| 1552 | } |
| 1553 | |
| 1554 | int cmdRemoveAll(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 1555 | /*++ |
| 1556 | |
| 1557 | Routine Description: |
| 1558 | |
| 1559 | REMOVEALL |
| 1560 | remove devices |
| 1561 | like remove, but also remove not-present devices |
| 1562 | |
| 1563 | Arguments: |
| 1564 | |
| 1565 | BaseName - name of executable |
| 1566 | Machine - machine name, must be NULL |
| 1567 | argc/argv - remaining parameters |
| 1568 | |
| 1569 | Return Value: |
| 1570 | |
| 1571 | EXIT_xxxx |
| 1572 | |
| 1573 | --*/ |
| 1574 | { |
| 1575 | GenericContext context; |
| 1576 | TCHAR strRemove[80]; |
| 1577 | TCHAR strReboot[80]; |
| 1578 | TCHAR strFail[80]; |
| 1579 | int failcode = EXIT_FAIL; |
| 1580 | |
| 1581 | UNREFERENCED_PARAMETER(Flags); |
| 1582 | |
| 1583 | if (!argc) { |
| 1584 | // |
| 1585 | // arguments required |
| 1586 | // |
| 1587 | return EXIT_USAGE; |
| 1588 | } |
| 1589 | if (Machine) { |
| 1590 | // |
| 1591 | // must be local machine as we need to involve class/co installers |
| 1592 | // |
| 1593 | return EXIT_USAGE; |
| 1594 | } |
| 1595 | if (!LoadString(NULL, IDS_REMOVED, strRemove, ARRAYSIZE(strRemove))) { |
| 1596 | return EXIT_FAIL; |
| 1597 | } |
| 1598 | if (!LoadString(NULL, IDS_REMOVED_REBOOT, strReboot, ARRAYSIZE(strReboot))) { |
| 1599 | return EXIT_FAIL; |
| 1600 | } |
| 1601 | if (!LoadString(NULL, IDS_REMOVE_FAILED, strFail, ARRAYSIZE(strFail))) { |
| 1602 | return EXIT_FAIL; |
| 1603 | } |
| 1604 | |
| 1605 | context.reboot = FALSE; |
| 1606 | context.count = 0; |
| 1607 | context.strReboot = strReboot; |
| 1608 | context.strSuccess = strRemove; |
| 1609 | context.strFail = strFail; |
| 1610 | failcode = EnumerateDevices(BaseName, Machine, 0, argc, argv, RemoveCallback, &context); |
| 1611 |
nothing calls this directly
no test coverage detected