The GetProcAddress function retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).
If the function succeeds, the return value is the address of the exported function or variable.
If the function fails, the return value is NULL (IntPtr.Zero). To get extended error information, call GetLastWin32Error.
The spelling and case of a function name pointed to by processName must be identical to that in the EXPORTS statement of the source DLL's module-definition (.def) file. The exported names of functions may differ from the names you use when calling these functions in your code. This difference is hidden by macros used in the SDK header files.
The processName parameter can identify the DLL function by specifying an ordinal value associated with the function in the EXPORTS statement. GetProcAddress verifies that the specified ordinal is in the range 1 through the highest ordinal value exported in the .def file. The function then uses the ordinal as an index to read the function's address from a function table. If the .def file does not number the functions consecutively from 1 to N (where N is the number of exported functions), an error can occur where GetProcAddress returns an invalid, non-NULL address, even though there is no function with the specified ordinal.
In cases where the function may not exist, the function should be specified by name rather than by ordinal value.
Kernel Class | Tao.Platform.Windows Namespace | FreeLibrary | GetModuleHandle | LoadLibrary