| 417 | #endif |
| 418 | |
| 419 | BOOL loadSETUAPI() |
| 420 | { |
| 421 | #ifdef SETUPAPI_DYN |
| 422 | /* shut up this cast warning */ |
| 423 | # if __GNUC__ > 4 |
| 424 | # pragma GCC diagnostic ignored "-Wcast-function-type" |
| 425 | # endif |
| 426 | |
| 427 | if(version_compare(&sysver, &WINVER98) >= 0) |
| 428 | { |
| 429 | hSETUPAPI = LoadLibraryA("SETUPAPI.dll"); |
| 430 | } |
| 431 | |
| 432 | if(hSETUPAPI == NULL) |
| 433 | { |
| 434 | hSETUPAPI = LoadLibraryA("redist\\SETUPAPI.dll"); |
| 435 | } |
| 436 | |
| 437 | if(hSETUPAPI != NULL) |
| 438 | { |
| 439 | #define SETUPAPI_FUNC(_t, _n, _a) \ |
| 440 | h##_n = (f##_n)GetProcAddress(hSETUPAPI, #_n); \ |
| 441 | if(h##_n == NULL){REPORT("GetProcAddress(SETUPAPI.dll, %s) = %ld", #_n, GetLastError()); return FALSE;} |
| 442 | |
| 443 | #include "setupapi_list.h" |
| 444 | |
| 445 | #undef SETUPAPI_FUNC |
| 446 | return TRUE; |
| 447 | } |
| 448 | else |
| 449 | { |
| 450 | REPORT("LoadLibraryA(SETUPAPI.dll): %ld", GetLastError()); |
| 451 | } |
| 452 | |
| 453 | return FALSE; |
| 454 | #else |
| 455 | return TRUE; |
| 456 | #endif |
| 457 | } |
| 458 | |
| 459 | void freeSETUAPI() |
| 460 | { |
no test coverage detected