EngLoadImage function

The EngLoadImage function loads the specified executable image into kernel-mode memory.

Syntax


HANDLE EngLoadImage(
  _In_ LPWSTR pwszDriver
);

Parameters

pwszDriver [in]

Pointer to a null-terminated string that names the file containing the executable image to be loaded.

Return value

If EngLoadImage succeeds, the return value is a handle to the image that was loaded. Otherwise, this function returns NULL.

Remarks

A driver can use EngLoadImage to map an executable image into kernel-mode memory. For example, a printer driver can call EngLoadImage to load a minidriver.

EngLoadImage requires that the image file to be loaded have a .dll suffix. The driver must include this suffix in the pwszDriver string.

To execute a section of code within the loaded image, the driver should obtain the function address from EngFindImageProcAddress.

The file identified by pwszDriver must be located in the %SystemRoot%\System32 directory or within a directory found in the directory hierarchy under %SystemRoot%\System32.

Drivers that need to load a module as data only should call EngLoadModule or EngLoadModuleForWrite instead of this function.

Requirements

Target platform

Universal

Version

Available in Windows 2000 and later versions of the Windows operating systems.

Header

Winddi.h (include Winddi.h)

Library

Win32k.lib

DLL

Win32k.sys

See also

EngLoadModule
EngLoadModuleForWrite
EngUnloadImage

 

 

Send comments about this topic to Microsoft

Show: