| 1359 | } |
| 1360 | |
| 1361 | int cmdUpdateNI(_In_ LPCTSTR BaseName, _In_opt_ LPCTSTR Machine, _In_ DWORD Flags, _In_ int argc, _In_reads_(argc) PTSTR argv[]) |
| 1362 | /*++ |
| 1363 | |
| 1364 | Routine Description: |
| 1365 | UPDATE (non interactive version) |
| 1366 | update driver for existing device(s) |
| 1367 | |
| 1368 | Arguments: |
| 1369 | |
| 1370 | BaseName - name of executable |
| 1371 | Machine - machine name, must be NULL |
| 1372 | argc/argv - remaining parameters |
| 1373 | |
| 1374 | Return Value: |
| 1375 | |
| 1376 | EXIT_xxxx |
| 1377 | |
| 1378 | --*/ |
| 1379 | { |
| 1380 | // |
| 1381 | // turn off interactive mode while doing the update |
| 1382 | // |
| 1383 | HMODULE setupapiMod = NULL; |
| 1384 | SetupSetNonInteractiveModeProto SetNIFn; |
| 1385 | int res; |
| 1386 | BOOL prev; |
| 1387 | |
| 1388 | setupapiMod = LoadLibrary(TEXT("setupapi.dll")); |
| 1389 | if(!setupapiMod) { |
| 1390 | return cmdUpdate(BaseName,Machine,Flags,argc,argv); |
| 1391 | } |
| 1392 | SetNIFn = (SetupSetNonInteractiveModeProto)GetProcAddress(setupapiMod,SETUPSETNONINTERACTIVEMODE); |
| 1393 | if(!SetNIFn) |
| 1394 | { |
| 1395 | FreeLibrary(setupapiMod); |
| 1396 | return cmdUpdate(BaseName,Machine,Flags,argc,argv); |
| 1397 | } |
| 1398 | prev = SetNIFn(TRUE); |
| 1399 | res = cmdUpdate(BaseName,Machine,Flags,argc,argv); |
| 1400 | SetNIFn(prev); |
| 1401 | FreeLibrary(setupapiMod); |
| 1402 | return res; |
| 1403 | } |
| 1404 | |
| 1405 | int RemoveCallback(_In_ HDEVINFO Devs, _In_ PSP_DEVINFO_DATA DevInfo, _In_ DWORD Index, _In_ LPVOID Context) |
| 1406 | /*++ |
nothing calls this directly
no test coverage detected