| 376 | } |
| 377 | |
| 378 | int cmdFind(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 379 | /*++ |
| 380 | |
| 381 | Routine 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 | |
| 388 | Arguments: |
| 389 | |
| 390 | BaseName - name of executable |
| 391 | Machine - if non-NULL, remote machine |
| 392 | argc/argv - remaining parameters - passed into EnumerateDevices |
| 393 | |
| 394 | Return 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 | |
| 424 | int cmdFindAll(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 425 | /*++ |
nothing calls this directly
no test coverage detected