EngLoadModuleForWrite

HANDLE EngLoadModuleForWrite(

    LPWSTR pwsz

    ULONG cjSizeOfModule

   );

EngLoadModuleForWrite loads the specified executable module into system memory for writing.

Parameters

pwsz
Pointer to a null-terminated string that contains the name of the file to be loaded.
cjSizeOfModule
Specifies the size, in bytes, of the module to be loaded.

Return Value

If EngLoadModuleForWrite succeeds, the return value is a handle to the module that was loaded. Otherwise, null is returned.

Comments

EngLoadModuleForWrite loads a data file into system memory with write permission. To access the loaded module, the driver should call EngMapModule with the handle returned by this function.

EndLoadModuleForWrite loads the file into memory that is the same size as the file when cjSizeOfModule is zero. If cjSizeOfModule is greater than zero, GDI extends or truncates the file to be exactly cjSizeOfModule bytes in size before loading it. No assumptions should be made about the contents of memory that extend beyond the file when cjSizeOfModule is greater than the file’s original size.

Drivers that need to load an image as executable code should call EngLoadImage instead of this function.

See Also

EngLoadModule