Profiler Won't Profile DLLs That Are Freed and Then Reloaded

ID Number: Q72884

1.00 | 1.00

WINDOWS | OS/2

Summary:

The Microsoft Source Profiler version 1.0 can profile the first

instance of any and all DLLs (dynamic-link libraries) in a Windows or

OS/2 application, but it cannot continue to collect statistics for a

dynamically loaded DLL that is freed and then reloaded.

More Information:

DLLs that are dynamically loaded with LoadLibrary() under Windows, or

DosLoadModule() under OS/2, and that are freed and then reloaded,

should not be profiled because the results will not be correct.

Under Windows, this behavior can be observed by attempting to profile

code that performs the following actions:

1. Dynamically loads a DLL with LoadLibrary().

2. Frees the DLL with FreeLibrary().

3. Reloads the DLL again with LoadLibrary().

Similarly, under OS/2, this behavior can be observed by attempting to

profile code that performs these actions:

1. Dynamically loads a DLL with DosLoadModule().

2. Frees the DLL with DosFreeModule().

3. Reloads the DLL again with DosLoadModule().

There are currently no workarounds for this limitation. The ability to

handle dynamically reloaded DLLs under Windows is being considered for

a future version of the Profiler. There are no current plans for an

OS/2 version that can handle dynamically reloaded DLLs due to the lack

of a message from the operating system when a DLL has been freed.