Are there any Windows API calls that will accurately tell me whether a .dll contains a procedure?
I know about kernel32.dll's LoadLibraryA, which (if successful) returns a handle to a specified procedure [library], or (if unsuccessful) returns 0 and leaves a number on GetLastError. Unfortunately, when I ask LoadLibraryA to tell me the handle for a procedure (such as LoadLibraryA), it returns 0, and sets GetLastError to 126. Obviously, LoadLibraryA was in kernel32.dll, but it could not find itself!
[oops -- this was a bug. LoadLibraryA works fine when I ask for the handle for kernel32.dll, instead of LoadLibraryA. ]
I want my program to be able to detect whether a procedure is available at run-time. I do not want to include any other software, such as from nirsoft or Visual Studio. Can this be done using just the Windows API?
I am running Windows 10. The software I am writing uses the 32-bit Ascii versions of the Windows API calls. The software will do its best to run on any NT-style windows from Windows NT through Windows 10, including WINE. Some of these versions do not include particular procedures, and I want to be able to detect and work around such problems.