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

Function cmdDriverFiles

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

Source from the content-addressed store, hash-verified

562
563
564int cmdDriverFiles(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
565/*++
566
567Routine Description:
568
569 STATUS <id> ...
570 use EnumerateDevices to do hardwareID matching
571 for each match, dump driver files to stdout
572 note that we only enumerate present devices
573
574Arguments:
575
576 BaseName - name of executable
577 Machine - if non-NULL, remote machine
578 argc/argv - remaining parameters - passed into EnumerateDevices
579
580Return Value:
581
582 EXIT_xxxx
583
584--*/
585{
586 GenericContext context;
587 int failcode;
588
589 UNREFERENCED_PARAMETER(Flags);
590
591 if(!argc) {
592 return EXIT_USAGE;
593 }
594 if(Machine) {
595 //
596 // must be local machine as we need to involve class/co installers (FIND_DRIVERFILES)
597 //
598 return EXIT_USAGE;
599 }
600
601 context.count = 0;
602 context.control = FIND_DEVICE | FIND_DRIVERFILES;
603 failcode = EnumerateDevices(BaseName,Machine,DIGCF_PRESENT,argc,argv,FindCallback,&context);
604
605 if(failcode == EXIT_OK) {
606
607 if(!context.count) {
608 FormatToStream(stdout,Machine?MSG_FIND_TAIL_NONE:MSG_FIND_TAIL_NONE_LOCAL,Machine);
609 } else {
610 FormatToStream(stdout,Machine?MSG_FIND_TAIL:MSG_FIND_TAIL_LOCAL,context.count,Machine);
611 }
612 }
613 return failcode;
614}
615
616int cmdDriverNodes(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
617/*++

Callers

nothing calls this directly

Calls 2

EnumerateDevicesFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected