diff options
-rw-r--r-- | lib/win32-cfgmgr32.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/win32-cfgmgr32.c b/lib/win32-cfgmgr32.c index 37cf2f7..dbddc54 100644 --- a/lib/win32-cfgmgr32.c +++ b/lib/win32-cfgmgr32.c @@ -88,8 +88,11 @@ /* * Unfortunately MinGW32 toolchain does not provide import library for these * cfgmgr32.dll functions. So resolve pointers to these functions at runtime. + * MinGW-w64 toolchain provides them also in 32-bit mode. */ +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) + #ifdef CM_Get_DevNode_Registry_PropertyA #undef CM_Get_DevNode_Registry_PropertyA #endif @@ -129,6 +132,8 @@ resolve_cfgmgr32_functions(void) return TRUE; } +#endif + /* * cfgmgr32.dll uses custom non-Win32 error numbers which are unsupported by * Win32 APIs like GetLastError() and FormatMessage() functions. @@ -1535,11 +1540,13 @@ win32_cfgmgr32_scan(struct pci_access *a) struct pci_dev *d; CONFIGRET cr; +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) if (!resolve_cfgmgr32_functions()) { a->warning("Required cfgmgr32.dll functions are unavailable."); return; } +#endif /* * Explicitly initialize size to zero as wine cfgmgr32 implementation does not @@ -1609,11 +1616,13 @@ win32_cfgmgr32_detect(struct pci_access *a) ULONG devinst_id_list_size; CONFIGRET cr; +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) if (!resolve_cfgmgr32_functions()) { a->debug("Required cfgmgr32.dll functions are unavailable."); return 0; } +#endif /* * Explicitly initialize size to zero as wine cfgmgr32 implementation does not |