[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosFreeModule

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = DosFreeModule( hMod );

Parameters

HMODULE hMod (input)
Handle for the module to be freed (from DosLoadModule).

Returns

APIRET rc
Indicates if any error occured.
0NO_ERROR
6ERROR_INVALID_HANDLE
12ERROR_INVALID_ACCESS
95ERROR_INTERRUPT

Include Info

#define INCL_DOSMODULEMGR
#include <os2.h>

Usage Explanation

DosFreeModule frees the reference to the dynamic link module for this process and if the dynamic link module is not used by any other process the memory occupied by the module is freed. This means that no functions in the dynamic link module can be used any longer.

Relevant Structures

Gotchas

Sample Code

HMODULE hmod; APIRET rc=0; /* Load DLL with DosLoadModule */ /* Free DLL */ rc = DosFreeModule(hmod); if(rc) { /* Not success? */ printf("Error. Cannot free the DLL. DosFreeModule returned %d.\n",rc); return(-1); }

See Also

DosLoadModule, DosQueryProcAddr

Author

Oscar Gustafsson - oscar@lysator.liu.se

Additions

Last modified March 7/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosFreeModule