CeCallUserProc (Windows Embedded CE 6.0)
1/6/2010
This function loads the user interface (UI) proxy device driver.
Syntax
BOOL CeCallUserProc(
LPCWSTR pszDllName,
LPCWSTR pszFuncName,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesReturned
);
Parameters
- pszDllName
[in] UI proxy device driver to load.
- pszFuncName
[in] UI proxy device driver entry point. For information about this entry point, see PFN_UIENTRYPOINT.
- lpInBuffer
[in] Data to pass to the UI proxy device driver.
- nInBufferSize
[in] Size of the data passed to the UI proxy device driver.
- lpOutBuffer
[out] Data returned by the UI proxy device driver.
- nOutBufferSize
[out] Size of the data returned by the UI proxy device driver.
- lpBytesReturned
[out] Size in bytes of the data returned by the UI proxy device driver.
Return Value
TRUE indicates success. The lpOutBuffer parameter contains the data returned by the UI proxy device driver, and lpBytesReturned contains the amount of data returned by the UI proxy device driver.
FALSE indicates failure. Call GetLastError on the thread that made the function call to obtain error information. In this case, lpOutBuffer and lpBytesReturned remain unchanged.
Remarks
Include the UI proxy device driver in your run-time image by setting SYSGEN_UIPROXY. By setting this Sysgen variable, the UI proxy device driver is automatically included in the run-time image and loaded the first time it is used.
If this function is called from user mode, the implementation is in Coredll, so it can run in the same process as the caller. If the function is called from a kernel-mode driver, the implementation is delegated to a UI proxy device driver loaded in udevice.exe.
The purpose of this function is for a kernel mode driver to call an API in a DLL that must be loaded outside the kernel.
One example of this is when a kernel mode driver wants to display UI to the user. Since displaying UI in the kernel is discouraged, the UI portion of the kernel mode driver can be written as a normal DLL. Then the kernel mode driver can call this function with the UI DLL name and the function name to laod the UI DLL outside the kernel. The kernel makes sure that the UI DLL is loaded outside the kernel, calls the function in the DLL, passing the input parameters from the kernel mode driver, and returns the output parameter from the UI DLL to the kernel-mode driver once the UI operation is complete.
There is one limitation to the UI DLL design. Since the call to the UI DLL function comes in as a Program Static Library (PSL) call, none of the Transport Level Security (TLS) functions can be called in that UI DLL function implementation. If the UI DLL needs to use TLS functions, it should spawn a thread and do all the TLS operations on that thread.
Requirements
Header | pkfuncs.h |
Library | coredll.lib |
Windows Embedded CE | Windows Embedded CE 6.0 and later |
See Also
Reference
Kernel Functions
PFN_UIENTRYPOINT
Concepts
New Kernel APIs
Displaying a User Interface from a Kernel-Mode Device Driver