LoadDriver (Windows CE 5.0)

Send Feedback

This function maps the specified executable module into the address space of the calling process. This function also prevents the code and data from being paged out.

HINSTANCE LoadDriver(LPCWSTRlpszFileName );

Parameters

  • lpszFileName
    [out] Pointer to a null-terminated string that names the executable module.

Return Values

A handle to the module indicates success; NULL indicates failure. To get extended error information, call GetLastError.

Remarks

This function is different from the LoadLibrary function because the entire executable module is locked into memory and never pages out. Because the LoadDriver function has the same specification as LoadLibrary, it calls LoadLibrary to fulfill the request. To free the executable module and release the memory back to the system, use the FreeLibrary function.

You can use the LockPages function instead of LoadDriver to lock specific sections of your code into memory. This alternative can reduce memory usage, but it requires additional code to determine where the code pages are loaded.

Any code that needs to guarantee real-time performance should load the code with LoadDriver. All drivers loaded by the system load using LoadLibrary.

Requirements

OS Versions: Windows CE 2.10 and later.
Header: Pkfuncs.h.
Link Library: Coredll.lib.

See Also

FreeLibrary | LoadLibrary | LockPages | Trusted APIs

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.