_PELDR_LoadModule


#include <vxdldr.h>

LRESULT CDECL PELDR_LoadModule(PHPEMODULE  phModule, 
    PSTR pFileName, PHLIST phList);

Loads a portable executable, performs relocation fixups and resolves imports. Uses C calling conventions.

PELDR_ERR_FILE_UNABLETOOPEN

Unable to open the specified file.

PELDR_ERR_MEM_NOMEMORY

Insufficient memory to complete the request.

PELDR_ERR_IMAGE_INVALIDSIZE

Module image size is invalid.

PELDR_ERR_IMAGE_INVALIDFORMAT

The specified file is not a valid portable executable type binary.

PELDR_ERR_FILE_READERROR

A read error occurred while loading the file.


phModule

Address of the handle to receive the module handle on successful return.

pFileName

Address of a null terminated string containing the path and filename to the executable. If the path is not specified, the path of the VMM32 executable is used.

phList

Address of the list handle of export tables. This parameter is specified when a client restricts the export table list. If NULL, the global export table list is used. If the handle pointed to by phList is NULL, a new local export table list is created.

Note that this function does not load modules to resolve external dependencies, instead, this function assumes that the caller is loading modules in the appropriate order to resolve dynamic link dependencies. During system initialization (up to the Init_Complete notification), _PELDR_LoadModule will check the V86MMGR translation buffer state and automatically allocate a temporary global V86 data area for I/O buffering if the translation buffer does not exist.