Method GetProcAddress
GetProcAddress(nint, string)
Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).
public static extern nint GetProcAddress(nint hModule, string procName)
Parameters
hModulenintA handle to the DLL module that contains the function or variable. This handle must be obtained by calling LoadLibrary(string) or a similar method.
procNamestringThe name of the function or variable whose address is to be retrieved. Alternatively, this can be the ordinal value of the function, specified as a string.
Returns
Remarks
This method is used to dynamically retrieve the address
of a function or
variable exported by a DLL. Ensure that the module handle passed
to hModule is valid
and that the function or variable name specified in procName
exists in the module.