mirror of
https://github.com/reactos/reactos.git
synced 2024-06-15 17:11:52 +00:00
[NETSHELL] Return error if disconnection failed
CORE-12307
This commit is contained in:
parent
2469ce2c31
commit
5eeeb1c235
|
@ -135,9 +135,10 @@ CNetConnection::Disconnect()
|
||||||
PropChangeParams.Scope = DICS_FLAG_CONFIGSPECIFIC;
|
PropChangeParams.Scope = DICS_FLAG_CONFIGSPECIFIC;
|
||||||
PropChangeParams.HwProfile = 0;
|
PropChangeParams.HwProfile = 0;
|
||||||
|
|
||||||
if (SetupDiSetClassInstallParams(hInfo, &DevInfo, &PropChangeParams.ClassInstallHeader, sizeof(SP_PROPCHANGE_PARAMS)))
|
if (!SetupDiSetClassInstallParams(hInfo, &DevInfo, &PropChangeParams.ClassInstallHeader, sizeof(SP_PROPCHANGE_PARAMS)) ||
|
||||||
|
!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, hInfo, &DevInfo))
|
||||||
{
|
{
|
||||||
SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, hInfo, &DevInfo);
|
hr = HRESULT_FROM_WIN32(GetLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetupDiDestroyDeviceInfoList(hInfo);
|
SetupDiDestroyDeviceInfoList(hInfo);
|
||||||
|
@ -145,6 +146,9 @@ CNetConnection::Disconnect()
|
||||||
swprintf(szPath, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pDisplayName);
|
swprintf(szPath, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pDisplayName);
|
||||||
CoTaskMemFree(pDisplayName);
|
CoTaskMemFree(pDisplayName);
|
||||||
|
|
||||||
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue