mirror of
https://github.com/reactos/reactos.git
synced 2024-12-12 04:43:48 +08:00
[MSPORTS] Notify the installer of changes to the configuration of serial or parallel ports
This commit is contained in:
parent
ebfe9853aa
commit
85a854f6b5
@ -248,12 +248,14 @@ WritePortSettings(
|
||||
HWND hwnd,
|
||||
PPORT_DATA pPortData)
|
||||
{
|
||||
SP_PROPCHANGE_PARAMS PropChangeParams;
|
||||
DWORD dwDisposition;
|
||||
DWORD dwFilterResourceMethod;
|
||||
DWORD dwLegacy;
|
||||
DWORD dwPortNumber;
|
||||
DWORD dwPortMap;
|
||||
HKEY hKey;
|
||||
BOOL bChanged = FALSE;
|
||||
DWORD dwError;
|
||||
|
||||
TRACE("WritePortSettings(%p)\n", pPortData);
|
||||
@ -282,13 +284,12 @@ WritePortSettings(
|
||||
REG_DWORD,
|
||||
(PBYTE)&dwFilterResourceMethod,
|
||||
sizeof(dwFilterResourceMethod));
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
ERR("RegSetValueExW failed (Error %lu)\n", dwError);
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
if (dwError == ERROR_SUCCESS)
|
||||
{
|
||||
pPortData->dwFilterResourceMethod = dwFilterResourceMethod;
|
||||
bChanged = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -319,9 +320,8 @@ WritePortSettings(
|
||||
|
||||
if (dwError == ERROR_SUCCESS)
|
||||
{
|
||||
FIXME("Notify the driver!\n");
|
||||
|
||||
pPortData->dwLegacy = dwLegacy;
|
||||
bChanged = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -337,15 +337,41 @@ WritePortSettings(
|
||||
if (dwPortMap & 1 << dwPortNumber)
|
||||
{
|
||||
ERR("Port LPT%lu is already in use!\n", dwPortNumber);
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ChangePortNumber(pPortData,
|
||||
dwPortNumber);
|
||||
bChanged = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bChanged)
|
||||
{
|
||||
/* Notify the system */
|
||||
PostMessageW(HWND_BROADCAST,
|
||||
WM_WININICHANGE,
|
||||
0,
|
||||
(LPARAM)pPortData->szPortName);
|
||||
|
||||
/* Notify the installer (and device) */
|
||||
PropChangeParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
|
||||
PropChangeParams.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
|
||||
PropChangeParams.Scope = DICS_FLAG_GLOBAL;
|
||||
PropChangeParams.StateChange = DICS_PROPCHANGE;
|
||||
|
||||
SetupDiSetClassInstallParams(pPortData->DeviceInfoSet,
|
||||
pPortData->DeviceInfoData,
|
||||
(PSP_CLASSINSTALL_HEADER)&PropChangeParams,
|
||||
sizeof(SP_PROPCHANGE_PARAMS));
|
||||
|
||||
SetupDiCallClassInstaller(DIF_PROPERTYCHANGE,
|
||||
pPortData->DeviceInfoSet,
|
||||
pPortData->DeviceInfoData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
BOOL
|
||||
|
@ -229,6 +229,7 @@ WritePortSettings(
|
||||
HWND hwnd,
|
||||
PPORT_DATA pPortData)
|
||||
{
|
||||
SP_PROPCHANGE_PARAMS PropChangeParams;
|
||||
WCHAR szPortData[32];
|
||||
HWND hwndControl;
|
||||
INT nBaudRateIndex;
|
||||
@ -329,6 +330,21 @@ WritePortSettings(
|
||||
0,
|
||||
(LPARAM)pPortData->szPortName);
|
||||
|
||||
/* Notify the installer (and device) */
|
||||
PropChangeParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
|
||||
PropChangeParams.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
|
||||
PropChangeParams.Scope = DICS_FLAG_GLOBAL;
|
||||
PropChangeParams.StateChange = DICS_PROPCHANGE;
|
||||
|
||||
SetupDiSetClassInstallParams(pPortData->DeviceInfoSet,
|
||||
pPortData->DeviceInfoData,
|
||||
(PSP_CLASSINSTALL_HEADER)&PropChangeParams,
|
||||
sizeof(SP_PROPCHANGE_PARAMS));
|
||||
|
||||
SetupDiCallClassInstaller(DIF_PROPERTYCHANGE,
|
||||
pPortData->DeviceInfoSet,
|
||||
pPortData->DeviceInfoData);
|
||||
|
||||
TRACE("Done!\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user