en:docs:fapi:dosloadmodule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosloadmodule [2021/08/20 08:50] – created prokusheven:docs:fapi:dosloadmodule [2021/09/18 15:07] (current) prokushev
Line 1: Line 1:
 {{page>en:templates:fapiint}} {{page>en:templates:fapiint}}
  
 +====== DosLoadModule ======
 + 
 This call loads a dynamic link module and returns a handle for the module. This call loads a dynamic link module and returns a handle for the module.
  
-==Syntax== +===== Syntax =====
- DosLoadModule (ObjNameBuf, ObjNameBufL, ModuleName, ModuleHandle)+
  
-==Parameters== +<code c> 
-;ObjNameBuf (PSZ) - output: Address of the name of an object that contributed to the failure of DosLoadModule+DosLoadModule (ObjNameBufObjNameBufL, ModuleName, ModuleHandle
-;ObjNameBufL (USHORT) - input: Lengthin bytesof the buffer described by ObjNameBuf. +</code>
-;ModuleName (PSZ) - input: Address of the ASCIIZ name string containing the dynamic link module name or the pathname string. The filename extension used for dynamic link libraries is .DLL. When a pathname is providedthe module name may have any extension. The internal module name (the name given in the LIBRARY statement in the .DEF filemust be the same as the filename without the extension. +
-;ModuleHandle (PHMODULE) - output: Address of the handle for the dynamic link module.+
  
-==Return Code== +===== Parameters =====
-;rc (USHORT) - return:Return code descriptions are: +
-* 0  NO_ERROR +
-* 2  ERROR_FILE_NOT_FOUND +
-* 3  ERROR_PATH_NOT_FOUND +
-* 4  ERROR_TOO_MANY_OPEN_FILES +
-* 5  ERROR_ACCESS_DENIED +
-* 8  ERROR_NOT_ENOUGH_MEMORY +
-* 11 ERROR_BAD_FORMAT +
-* 26 ERROR_NOT_DOS_DISK +
-* 32 ERROR_SHARING_VIOLATION +
-* 33 ERROR_LOCK_VIOLATION +
-* 36 ERROR_SHARING_BUFFER_EXCEEDED +
-* 95 ERROR_INTERRUPT +
-* 108 ERROR_DRIVE_LOCKED +
-* 123 ERROR_INVALID_NAME +
-* 127 ERROR_PROC_NOT_FOUND +
-* 180 ERROR_INVALID_SEGMENT_NUMBER +
-* 182 ERROR_INVALID_ORDINAL +
-* 190 ERROR_INVALID_MODULETYPE +
-* 191 ERROR_INVALID_EXE_SIGNATURE +
-* 192 ERROR_EXE_MARKED_INVALID +
-* 194 ERROR_ITERATED_DATA_EXCEEDS_64k +
-* 195 ERROR_INVALID_MINALLOCSIZE +
-* 196 ERROR_DYNLINK_FROM_INVALID_RING +
-* 198 ERROR_INVALID_SEGDPL +
-* 199 ERROR_AUTODATASEG_EXCEEDS_64k +
-* 201 ERROR_RELOC_CHAIN_XEEDS_SEGLIM +
-* 206 ERROR_FILENAME_EXCED_RANGE+
  
-==Remarks== +  *ObjNameBuf ([[PSZ]]) - output: Address of the name of an object that contributed to the failure of DosLoadModule. 
-If the file is an OS/2 dynamic link module, it is loaded, and a handle is returned. This handle is used for freeing the dynamic link module with a [[DosFreeModule (OS/2 1.x)|DosFreeModule]] request, getting procedure addresses with DosGetProcAddr requests, and getting the fully qualified file name with a DosGetModName request.+  *ObjNameBufL ([[USHORT]]) - input: Length, in bytes, of the buffer described by ObjNameBuf. 
 +  *ModuleName ([[PSZ]]) - input: Address of the ASCIIZ name string containing the dynamic link module name or the pathname string. The filename extension used for dynamic link libraries is .DLL. When a pathname is provided, the module name may have any extension. The internal module name (the name given in the LIBRARY statement in the .DEF file) must be the same as the filename without the extension. 
 +  *ModuleHandle ([[PHMODULE]]) - output: Address of the handle for the dynamic link module. 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHORT]]) - return:Return code descriptions are: 
 + 
 +  * 0  NO_ERROR 
 +  * 2  ERROR_FILE_NOT_FOUND 
 +  * 3  ERROR_PATH_NOT_FOUND 
 +  * 4  ERROR_TOO_MANY_OPEN_FILES 
 +  * 5  ERROR_ACCESS_DENIED 
 +  * 8  ERROR_NOT_ENOUGH_MEMORY 
 +  * 11 ERROR_BAD_FORMAT 
 +  * 26 ERROR_NOT_DOS_DISK 
 +  * 32 ERROR_SHARING_VIOLATION 
 +  * 33 ERROR_LOCK_VIOLATION 
 +  * 36 ERROR_SHARING_BUFFER_EXCEEDED 
 +  * 95 ERROR_INTERRUPT 
 +  * 108 ERROR_DRIVE_LOCKED 
 +  * 123 ERROR_INVALID_NAME 
 +  * 127 ERROR_PROC_NOT_FOUND 
 +  * 180 ERROR_INVALID_SEGMENT_NUMBER 
 +  * 182 ERROR_INVALID_ORDINAL 
 +  * 190 ERROR_INVALID_MODULETYPE 
 +  * 191 ERROR_INVALID_EXE_SIGNATURE 
 +  * 192 ERROR_EXE_MARKED_INVALID 
 +  * 194 ERROR_ITERATED_DATA_EXCEEDS_64k 
 +  * 195 ERROR_INVALID_MINALLOCSIZE 
 +  * 196 ERROR_DYNLINK_FROM_INVALID_RING 
 +  * 198 ERROR_INVALID_SEGDPL 
 +  * 199 ERROR_AUTODATASEG_EXCEEDS_64k 
 +  * 201 ERROR_RELOC_CHAIN_XEEDS_SEGLIM 
 +  * 206 ERROR_FILENAME_EXCED_RANGE 
 + 
 +===== Remarks ===== 
 + 
 + 
 +If the file is an OS/2 dynamic link module, it is loaded, and a handle is returned. This handle is used for freeing the dynamic link module with a [[DosFreeModule]] request, getting procedure addresses with [[DosGetProcAddr]] requests, and getting the fully qualified file name with a DosGetModName request.
  
 DosLoadModule may not be called from a dynamic library initialization routine if the module to be loaded or any module referenced by it contains a dynamic link library initialization routing. DosLoadModule may not be called from a dynamic library initialization routine if the module to be loaded or any module referenced by it contains a dynamic link library initialization routing.
  
-==Bindings== +===== Bindings ===== 
-===C=== + 
-<PRE>+==== C ===
 + 
 + 
 +<code c>
 #define INCL_DOSMODULEMGR #define INCL_DOSMODULEMGR
  
Line 60: Line 73:
  
 USHORT   rc;            /* return code */ USHORT   rc;            /* return code */
-</PRE>+</code>
  
-===MASM=== +==== MASM ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosLoadModule:FAR EXTRN  DosLoadModule:FAR
 INCL_DOSMODULEMGR   EQU 1 INCL_DOSMODULEMGR   EQU 1
Line 74: Line 88:
  
 Returns WORD Returns WORD
-</PRE>+</code> 
 + 
 +===== Example =====
  
-==Example== 
 This example loads a module. This example loads a module.
-<PRE>+<code c>
 #define INCL_DOSMODULEMGR #define INCL_DOSMODULEMGR
  
Line 92: Line 107:
                      MODULE_NAME,          /* Module name string */                      MODULE_NAME,          /* Module name string */
                      &ModuleHandle) == 2)  /* Module handle */                      &ModuleHandle) == 2)  /* Module handle */
-</PRE>+</code>