LoadModule

Loads an NLM or other module.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <netware.h> 
   
  int LoadModule (
     scr_t           scrID,
     const char     *path,
     unsigned long   options);
  

Parameters

scrID

(IN) Points to a screen handle.

path

(IN) Points to the file to load.

options

(IN) Specifies the options to use at load time. Make sure you do not set any undefined bits. For a list of supported options, see Section 30.1, Load Options.

Return Values

If success, returns 0. Otherwise, returns one of the following error codes:

Decimal

Constant

Description

1

ERR_LOADER_COULD_NOT_FIND_FILE

Load file not found.

2

ERR_LOADER_ERROR_READING_FILE

Error reading load file.

3

ERR_LOADER_NOT_NLM_FILE_FORMAT

Specified file is not in an NLM file format.

4

ERR_LOADER_WRONG_NLM_FILE_ VERSION

Specified file is the wrong version of the NLM.

5

ERR_LOADER_REENTRANT_INITIALIZE_ FAILURE

Reentrant load attempt failed in initialization.

6

ERR_LOADER_CAN_NOT_ERR_LOADER_ MULTIPLE_COPIES

Module already loaded and is not flagged to load multiple copies.

7

ERR_LOADER_ALREADY_IN_PROGRESS

Specified module is already being loaded by another process.

8

ERR_LOADER_NOT_ENOUGH_MEMORY

Insufficient server memory to complete the load operation.

9

ERR_LOADER_INITIALIZE_FAILURE

Module load request failed in initialization.

10

ERR_LOADER_INCONSISTENT_FILE_ FORMAT

Specified file has an inconsistent file format.

11

ERR_LOADER_CAN_NOT_ERR_LOADER_AT_STARTUP

Specified file cannot be loaded at startup.

12

ERR_LOADER_AUTO_LOAD_MODULES_ NOT_LOADED

Could not load module due to unresolved module dependencies.

13

ERR_LOADER_UNRESOLVED_EXTERNAL

Could not load module due to unresolved external symbols.

14

ERR_LOADER_PUBLIC_ALREADY_DEFINED

Module attempted to export Public symbols that are already defined.

15

ERR_LOADER_XDC_DATA_ERROR

The specified file has invalid or corrupt XDC-Data.

16

ERR_LOADER_NOT_KERNEL

The specified file must be loaded in the Kernel.

17

ERR_LOADER_NIOS_ONLY_NLM

The module is NIOS (Win Client) compatible only and cannot be loaded on NetWare.

18

ERR_LOADER_ADDRESS_SPACE_CREATION

Cannot create specified address space.

19

ERR_LOADER_INITIALIZE_FAULT

An error occurred while initializing the module.

Remarks

Normally, you should call NXVmSpawn or dlopen, rather than LoadModule. If the module to be loaded in one that provides interfaces to other modules, such as a library, call dlopen instead of LoadModule.

If you want a tighter relationship with the loaded NLM (including the ability to shut down the NLM you have loaded), call NXVmSpawn instead of LoadModule.

If you call LoadModule from ring 3, LoadModule works respective to that address space.

LoadModule is based on the semantics of the search path at the console. Even if the calling NLM exists in a subdirectory, there is no guarantee that NLM applications in the same directory can be loaded by calling LoadModule. You must supply a full path or work with a search path. If the search path does not work, you can change it by calling AddSearchPathAtEnd, DeleteSearchPathAtEnd, or InsertSearchPath, but changing the search path might affect the way other features behave on your server.