Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
Ferenc Wagner wferi@afavant.elte.hu writes:
Hi, please somebody enlighten me! How does this test work once psapi_test.exe is linked with -lpsapi? How can a program start at all without one of its hard dependencies?
START_TEST(module) { dll = LoadLibrary("psapi.dll"); if (!dll) { trace("LoadLibraryA(psapi.dll) failed: skipping tests with target module\n"); return; }
The above seems to be a common idiom which I don't understand as opposed to using GetProcAddress and invoking functions through pointers. What am I missing here?
If the library is already loaded, LoadLibrary returns the HModule of the already loaded module, to my knowledge...
Fine, but what for? Once this code is given control we can be sure that run-time linking is done, ie. psapi.dll was found and loaded. What do we test then?