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

Function cmdDriverNodes

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

Source from the content-addressed store, hash-verified

614}
615
616int cmdDriverNodes(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
617/*++
618
619Routine Description:
620
621 STATUS <id> ...
622 use EnumerateDevices to do hardwareID matching
623 for each match, dump drivernodes to stdout
624 note that we only enumerate present devices
625
626Arguments:
627
628 BaseName - name of executable
629 Machine - if non-NULL, remote machine
630 argc/argv - remaining parameters - passed into EnumerateDevices
631
632Return Value:
633
634 EXIT_xxxx
635
636--*/
637{
638 GenericContext context;
639 int failcode;
640
641 UNREFERENCED_PARAMETER(Flags);
642
643 if(!argc) {
644 return EXIT_USAGE;
645 }
646 if(Machine) {
647 //
648 // must be local machine as we need to involve class/co installers (FIND_DRIVERNODES)
649 //
650 return EXIT_USAGE;
651 }
652
653 context.count = 0;
654 context.control = FIND_DEVICE | FIND_DRIVERNODES;
655 failcode = EnumerateDevices(BaseName,Machine,DIGCF_PRESENT,argc,argv,FindCallback,&context);
656
657 if(failcode == EXIT_OK) {
658
659 if(!context.count) {
660 FormatToStream(stdout,Machine?MSG_FIND_TAIL_NONE:MSG_FIND_TAIL_NONE_LOCAL,Machine);
661 } else {
662 FormatToStream(stdout,Machine?MSG_FIND_TAIL:MSG_FIND_TAIL_LOCAL,context.count,Machine);
663 }
664 }
665 return failcode;
666}
667
668int cmdHwIds(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
669/*++

Callers

nothing calls this directly

Calls 2

EnumerateDevicesFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected