MCPcopy Create free account
hub / github.com/NullArray/WinKernel-Resources / cmdRemoveAll

Function cmdRemoveAll

Drivers/Driver-SRC/setup/devcon/cmds.cpp:1554–1624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1552}
1553
1554int cmdRemoveAll(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
1555/*++
1556
1557Routine Description:
1558
1559REMOVEALL
1560remove devices
1561like remove, but also remove not-present devices
1562
1563Arguments:
1564
1565BaseName - name of executable
1566Machine - machine name, must be NULL
1567argc/argv - remaining parameters
1568
1569Return Value:
1570
1571EXIT_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

Callers

nothing calls this directly

Calls 2

EnumerateDevicesFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected