Empty registry node for parallel devices will cause Realterm to crash.
Wine-bug:https://bugs.winehq.org/show_bug.cgi?id=58598
-- v5: mountmgr.sys: Do not create empty registry nodes for serial or parallel ports.
From: Janne Kekkonen janne.kekkonen@gmail.com
fix port_len setting
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58598 --- dlls/mountmgr.sys/device.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index ba019cdb13d..468ff3bb155 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -1985,6 +1985,8 @@ static void create_port_devices( DRIVER_OBJECT *driver, const char *devices ) WCHAR port[7]; DWORD port_len, type, size; int i, n; + HKEY hKey; + BOOL user_defined_ports;
if (driver == serial_driver) { @@ -1999,6 +2001,26 @@ static void create_port_devices( DRIVER_OBJECT *driver, const char *devices ) port_prefix = L"LPT"; }
+ /* Check for user defined ports*/ + user_defined_ports=TRUE; + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\Wine\Ports" , 0, KEY_READ , &hKey)==ERROR_SUCCESS) + { + i=0; + port_len = ARRAY_SIZE(port); + user_defined_ports=FALSE; + while ((RegEnumValueW(hKey, i, port, &port_len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)) { + if (wcsnicmp( port, port_prefix, 3)==0){ + user_defined_ports=TRUE; + break; + } + i++; + port_len = ARRAY_SIZE(port); + } + RegCloseKey(hKey); + } + /*If no user defined ports and no devices do not create registry entry*/ + if(!user_defined_ports && strlen(devices)==0) return; + /* @@ Wine registry key: HKLM\Software\Wine\Ports */
RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"Software\Wine\Ports", 0, NULL, 0,
Now all commits are squashed into one.
I am new to git so hopefully latest version is decent.
This merge request was closed by Alexandre Julliard.
Superseded by bc5f39ebf5fa3e936ad8fea726441b88716724c4.