30.1 Load Options

You use the following flags with the LoadModule function to specify how to load the module.

Flag

Value

Description

LO_NORMAL

0x00000000

Load the module normally without any special conditions. This is the default method.

LO_PROTECT

0x00000002

Load the module into a new protected address space.

LO_LOAD_LOW

0x00000020

Load as if the load -l <module_name> command was issued. The operating system attempts to load the specified module into low memory. Multiprocessor drivers use this flag.

LO_RETURN_HANDLE

0x00000040

Return the module handle to the caller on a successful load. The caller needs to leave 4 bytes available prior to the command line for the handle to be returned in.

LO_LOAD_SILENT

0x00000080

Load silently, without displaying any console messages.

LO_RESTART

0x00000200

Load the module into protected space with restart functionality. This means that if the protected space abends, the system closes the space, cleans up its resources, restarts the space, and reloads the modules into it.

LO_DONT_DISPLAY_ERROR

0x00002000

Display the load status messages to the console, but do not display any error messages.

LO_MEMORY_DEBUG

0x00010000

Load as if the load -m <module_name> command was issued. This flag should only be used during development and debugging. Do not allow this flag to be in effect for production (shipping binaries).

This flag is very useful in debugging the following types of problems:

  • Catches memory overruns. It causes every memory allocation to be justified to the end of the memory page with a guard page mapped in as the next page. If the end of the memory block is every overwritten, a page fault occurs and the server abends at the point memory corruption begins rather than long time afterwards.

  • Catches writes to already freed memory. Because each allocation has its own page and the page associated with each allocation is mapped out during the call to free the memory, any future writes to the page results in a page fault and a server abend at the point memory corruption begins.

LO_RELAXED_MEMORY_DEBUG

0x00020000

Load as if the load -r <module name> command was issued. This flag performs some more strict memory monitoring but not the strictest. This flag is only useful during development. Do not allow this flag to be in effect for production (shipping binaries).