| 2382 | } |
| 2383 | |
| 2384 | int cmdDPEnumLegacy(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 2385 | /*++ |
| 2386 | |
| 2387 | Routine Description: |
| 2388 | dp_enumLegacy |
| 2389 | Enumerates installed Driver Packages on the machine pre Windows Longhorn |
| 2390 | |
| 2391 | Arguments: |
| 2392 | |
| 2393 | BaseName - name of executable |
| 2394 | Machine - machine name, must be NULL |
| 2395 | argc/argv - remaining parameters |
| 2396 | |
| 2397 | Return Value: |
| 2398 | |
| 2399 | EXIT_xxxx |
| 2400 | |
| 2401 | --*/ |
| 2402 | { |
| 2403 | int failcode = EXIT_FAIL; |
| 2404 | TCHAR FindName[MAX_PATH]; |
| 2405 | HANDLE hFind = INVALID_HANDLE_VALUE; |
| 2406 | WIN32_FIND_DATA wfd; |
| 2407 | |
| 2408 | UNREFERENCED_PARAMETER(BaseName); |
| 2409 | UNREFERENCED_PARAMETER(Machine); |
| 2410 | UNREFERENCED_PARAMETER(Flags); |
| 2411 | UNREFERENCED_PARAMETER(argv); |
| 2412 | |
| 2413 | if(argc) { |
| 2414 | return EXIT_USAGE; |
| 2415 | } |
| 2416 | |
| 2417 | if (!GetWindowsDirectory(FindName, ARRAYSIZE(FindName)) || |
| 2418 | FAILED(StringCchCat(FindName, ARRAYSIZE(FindName), TEXT("\\INF\\OEM*.INF")))) { |
| 2419 | goto final; |
| 2420 | } |
| 2421 | |
| 2422 | hFind = FindFirstFile(FindName, &wfd); |
| 2423 | if (hFind == INVALID_HANDLE_VALUE) { |
| 2424 | // |
| 2425 | // No OEM driver packages on this machine. |
| 2426 | // |
| 2427 | FormatToStream(stdout,MSG_DPENUM_NO_OEM_INF); |
| 2428 | failcode = EXIT_OK; |
| 2429 | goto final; |
| 2430 | } |
| 2431 | |
| 2432 | FormatToStream(stdout,MSG_DPENUM_LIST_HEADER); |
| 2433 | |
| 2434 | do { |
| 2435 | FormatToStream(stdout,MSG_DPENUM_LIST_ENTRY,wfd.cFileName); |
| 2436 | DumpDriverPackageData(wfd.cFileName); |
| 2437 | } while (FindNextFile(hFind, &wfd)); |
| 2438 | |
| 2439 | FindClose(hFind); |
| 2440 | |
| 2441 | failcode = EXIT_OK; |
nothing calls this directly
no test coverage detected