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

Function cmdFind

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

Source from the content-addressed store, hash-verified

376}
377
378int cmdFind(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
379/*++
380
381Routine Description:
382
383 FIND <id> ...
384 use EnumerateDevices to do hardwareID matching
385 for each match, dump to stdout
386 note that we only enumerate present devices
387
388Arguments:
389
390 BaseName - name of executable
391 Machine - if non-NULL, remote machine
392 argc/argv - remaining parameters - passed into EnumerateDevices
393
394Return Value:
395
396 EXIT_xxxx
397
398--*/
399{
400 GenericContext context;
401 int failcode;
402
403 UNREFERENCED_PARAMETER(Flags);
404
405 if(!argc) {
406 return EXIT_USAGE;
407 }
408
409 context.count = 0;
410 context.control = 0;
411 failcode = EnumerateDevices(BaseName,Machine,DIGCF_PRESENT,argc,argv,FindCallback,&context);
412
413 if(failcode == EXIT_OK) {
414
415 if(!context.count) {
416 FormatToStream(stdout,Machine?MSG_FIND_TAIL_NONE:MSG_FIND_TAIL_NONE_LOCAL,Machine);
417 } else {
418 FormatToStream(stdout,Machine?MSG_FIND_TAIL:MSG_FIND_TAIL_LOCAL,context.count,Machine);
419 }
420 }
421 return failcode;
422}
423
424int cmdFindAll(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[])
425/*++

Callers

nothing calls this directly

Calls 2

EnumerateDevicesFunction · 0.85
FormatToStreamFunction · 0.85

Tested by

no test coverage detected