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

Function cmdRemove

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

Source from the content-addressed store, hash-verified

1481}
1482
1483int cmdRemove(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
1484/*++
1485
1486Routine Description:
1487
1488 REMOVE
1489 remove devices
1490
1491Arguments:
1492
1493 BaseName - name of executable
1494 Machine - machine name, must be NULL
1495 argc/argv - remaining parameters
1496
1497Return Value:
1498
1499 EXIT_xxxx
1500
1501--*/
1502{
1503 GenericContext context;
1504 TCHAR strRemove[80];
1505 TCHAR strReboot[80];
1506 TCHAR strFail[80];
1507 int failcode = EXIT_FAIL;
1508
1509 UNREFERENCED_PARAMETER(Flags);
1510
1511 if(!argc) {
1512 //
1513 // arguments required
1514 //
1515 return EXIT_USAGE;
1516 }
1517 if(Machine) {
1518 //
1519 // must be local machine as we need to involve class/co installers
1520 //
1521 return EXIT_USAGE;
1522 }
1523 if(!LoadString(NULL,IDS_REMOVED,strRemove,ARRAYSIZE(strRemove))) {
1524 return EXIT_FAIL;
1525 }
1526 if(!LoadString(NULL,IDS_REMOVED_REBOOT,strReboot,ARRAYSIZE(strReboot))) {
1527 return EXIT_FAIL;
1528 }
1529 if(!LoadString(NULL,IDS_REMOVE_FAILED,strFail,ARRAYSIZE(strFail))) {
1530 return EXIT_FAIL;
1531 }
1532
1533 context.reboot = FALSE;
1534 context.count = 0;
1535 context.strReboot = strReboot;
1536 context.strSuccess = strRemove;
1537 context.strFail = strFail;
1538 failcode = EnumerateDevices(BaseName,Machine,DIGCF_PRESENT,argc,argv,RemoveCallback,&context);
1539
1540 if(failcode == EXIT_OK) {

Callers

nothing calls this directly

Calls 2

EnumerateDevicesFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected