mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NETSHELL] Return error if disconnection failed
CORE-12307
This commit is contained in:
parent
2469ce2c31
commit
5eeeb1c235
1 changed files with 6 additions and 2 deletions
|
@ -135,9 +135,10 @@ CNetConnection::Disconnect()
|
|||
PropChangeParams.Scope = DICS_FLAG_CONFIGSPECIFIC;
|
||||
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);
|
||||
|
@ -145,6 +146,9 @@ CNetConnection::Disconnect()
|
|||
swprintf(szPath, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pDisplayName);
|
||||
CoTaskMemFree(pDisplayName);
|
||||
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
return hr;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||
return E_FAIL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue