api: do the set-quiet-install later
Rather than setting the "quiet" flag to each and every device in the process of iterating, set it when actually creating/deleting it. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
08e2993d23
commit
0adf0fab8d
@ -345,12 +345,6 @@ GetDevInfoData(_In_ const GUID *CfgInstanceID, _Out_ HDEVINFO *DevInfo, _Out_ SP
|
|||||||
if (Result != ERROR_SUCCESS || memcmp(CfgInstanceID, &CfgInstanceID2, sizeof(GUID)) != 0)
|
if (Result != ERROR_SUCCESS || memcmp(CfgInstanceID, &CfgInstanceID2, sizeof(GUID)) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Result = SetQuietInstall(*DevInfo, DevInfoData);
|
|
||||||
if (Result != ERROR_SUCCESS)
|
|
||||||
{
|
|
||||||
SetupDiDestroyDeviceInfoList(*DevInfo);
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
SetupDiDestroyDeviceInfoList(*DevInfo);
|
SetupDiDestroyDeviceInfoList(*DevInfo);
|
||||||
@ -1150,6 +1144,9 @@ WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequ
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
if (Result != ERROR_SUCCESS)
|
if (Result != ERROR_SUCCESS)
|
||||||
return Result;
|
return Result;
|
||||||
|
Result = SetQuietInstall(DevInfo, &DevInfoData);
|
||||||
|
if (Result != ERROR_SUCCESS)
|
||||||
|
goto cleanupDevInfo;
|
||||||
SP_REMOVEDEVICE_PARAMS RemoveDeviceParams = { .ClassInstallHeader = { .cbSize = sizeof(SP_CLASSINSTALL_HEADER),
|
SP_REMOVEDEVICE_PARAMS RemoveDeviceParams = { .ClassInstallHeader = { .cbSize = sizeof(SP_CLASSINSTALL_HEADER),
|
||||||
.InstallFunction = DIF_REMOVE },
|
.InstallFunction = DIF_REMOVE },
|
||||||
.Scope = DI_REMOVEDEVICE_GLOBAL };
|
.Scope = DI_REMOVEDEVICE_GLOBAL };
|
||||||
@ -1159,6 +1156,7 @@ WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequ
|
|||||||
*RebootRequired = *RebootRequired || CheckReboot(DevInfo, &DevInfoData);
|
*RebootRequired = *RebootRequired || CheckReboot(DevInfo, &DevInfoData);
|
||||||
else
|
else
|
||||||
Result = GetLastError();
|
Result = GetLastError();
|
||||||
|
cleanupDevInfo:
|
||||||
SetupDiDestroyDeviceInfoList(DevInfo);
|
SetupDiDestroyDeviceInfoList(DevInfo);
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@ -1229,8 +1227,6 @@ WintunEnumAdapters(_In_z_count_c_(MAX_POOL) const WCHAR *Pool, _In_ WINTUN_ENUMP
|
|||||||
if (!IsMember)
|
if (!IsMember)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SetQuietInstall(DevInfo, &DevInfoData); /* Ignore errors */
|
|
||||||
|
|
||||||
WINTUN_ADAPTER *Adapter;
|
WINTUN_ADAPTER *Adapter;
|
||||||
Result = CreateAdapterData(Pool, DevInfo, &DevInfoData, &Adapter);
|
Result = CreateAdapterData(Pool, DevInfo, &DevInfoData, &Adapter);
|
||||||
if (Result != ERROR_SUCCESS)
|
if (Result != ERROR_SUCCESS)
|
||||||
|
Loading…
Reference in New Issue
Block a user