none
SetupDiEnumDeviceInfo error at Intel Galileo Board RRS feed

  • Question

  • Hi Guys

    I’m using an Intel Galileo board and try to enumerate all installed devices.

    I successfully got a handle with the ‘SetupDiGetClassDevs’ function.

    But when I add the function ‘SetupDiEnumDeviceInfo’ to my code and start the program via Remote-Windows-Debugger I got the following error immediately after the program starts:

    First-chance exception at 0x77BE342A (ntdll.dll) in HelloBlinky.exe: 0xC0000139: Entry Point Not Found.
    Das Programm "[0x16C] HelloBlinky.exe" wurde mit Code -1073741511 (0xc0000139) 'Entry Point Not Found' beendet.

    May my project properties wrong or isn't it possible to call ‘SetupDiEnumDeviceInfo’ at this windows version?

    Thanks for your proposals.

    Saturday, August 23, 2014 2:44 PM

Answers

  • FIXED IT!!!

    The problem was, that the setupapi.dll at the windows version for the galileo board has other entry point addresses than the setupapi.lib assumes.

    With the help of the Dependency Walker I discovered, that the setupapi.dll at the galileo board published only four functions:

    So I removed the setupapi.lib and the setupapi.h from my project and redefined these functions at my code and load the library manually.

    typedef PVOID HDEVINFO;
    
    typedef HDEVINFO(CALLBACK* SetupDiGetClassDevsW_PROC)(
        _In_opt_ CONST GUID *ClassGuid,
        _In_opt_ PCWSTR Enumerator,
        _In_opt_ HWND hwndParent,
        _In_ DWORD Flags
        );
    
    HINSTANCE hDLL = LoadLibrary(L"setupapi.dll");
    
    SetupDiGetClassDevsW_PROC SetupDiGetClassDevsW_ENTRY = 
    (SetupDiGetClassDevsW_PROC)GetProcAddress(hDLL, "SetupDiGetClassDevsW");
    
    HDEVINFO hDevInfo = SetupDiGetClassDevsW_ENTRY(
    ClassGuid, Enumerator, hwndParent, Flags);
    
    I do so also for the other function and was so able to enumerate all devices.

    • Marked as answer by Habaniel Wednesday, October 8, 2014 6:28 PM
    Wednesday, October 8, 2014 6:26 PM