Jump to content

DosReplaceModule

From EDM2
Revision as of 00:22, 28 June 2012 by Martini (talk | contribs) (Created page with "==DosReplaceModule== ==Syntax== rc = DosReplaceModule( pszModName, pszReplaceWith, pszBackupName ); ==Parameters== ;PSZ pszModName (input) : Name of module to replace ;PSZ p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DosReplaceModule

Syntax

rc = DosReplaceModule( pszModName, pszReplaceWith, pszBackupName );

Parameters

PSZ pszModName (input)
Name of module to replace
PSZ pszReplaceWith (input)
Name of module to replace the above with
PSZ pszBackupName (input)
Name to back up the old module with (if specified)

Returns

APIRET rc

Usage Explanation

This API is undocumented, but the entry point is located in the OS2386.LIB file.

This API allows you to replace a DLL that is in use. Apparently, this API checks to see whether the DLL named in pszModName is currently being used. If it is not, the API returns with an error. If it is, the O/S loads the entire module into memory, and releases the filesystem's hold on the file. It will then copy the pszReplaceWith file over the pszModName file, and optionally back up pszModName to pszBackupName.

No guarantees...

The prototype is APIRET APIENTRY DosReplaceModule(PSZ pszModName, PSZ pszReplaceWith, PSZ pszBackupName);