LoadLibrary("pdh.dll") in WinXP causes segmentation fault

Nousiainen am.nousiainen@pp.inet.fi
Thu Jun 6 07:13:00 GMT 2002


So, my problem is that when I try to load pdh.dll using LoadLibrary function
(using the newest 1.3.10 cygwin) it causes a segmentation fault
(not when running the function, but a bit later, which is also weird).
When debugging the program, which loads the dll, with gdb, gdb
crashes with an error message when executing LoadLibrary.
(exact error message: Lowest section in /cygdrive/c/WINDOWS/
System32/odbcint.dll is .rsrc at 1f851000)

I've been able to produce this error only by loading pdh.dll (loading any other
dll has succeeded so far).

For those who don't know, pdh.dll provides some nice monitoring
(cpu usage, disk access, network, etc.) functions.

What am I doing wrong, or is there a bug in cygwin dlls?
Has that odbcint.dll something to do with this?

The code, that produces the fault:

...

int main(int iArgCount, char *lpszArgument[])
{
    HINSTANCE hpdhLib;

    hpdhLib = LoadLibrary("pdh.dll"); // gdb stops and crashes here... every single time
    if (hpdhLib == NULL)
        return 0;
    printf("Err: %d\n", GetLastError());

...






--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list