From: Janne Kekkonen janne.kekkonen@gmail.com
Prevent creating empty registry node. User definitions for serial and parallel ports are taken into count. Removed double variables.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58598 --- dlls/mountmgr.sys/device.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 664a44079a7..a9d9dcf38f6 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -1987,8 +1987,6 @@ static void create_port_devices( DRIVER_OBJECT *driver, const char *devices ) int i, n; HKEY hKey; BOOL user_defined_ports; - WCHAR port_name[256]; - DWORD port_name_len;
if (driver == serial_driver) { @@ -2008,15 +2006,15 @@ static void create_port_devices( DRIVER_OBJECT *driver, const char *devices ) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\Wine\Ports" , 0, KEY_READ , &hKey)==ERROR_SUCCESS) { i=0; - port_name_len = 255; + port_len = ARRAY_SIZE(port); user_defined_ports=FALSE; - while ((RegEnumValueW(hKey, i, port_name, &port_name_len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)) { - if (wcsnicmp( port_name, port_prefix, 3)==0){ + 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_name_len = 255; + port_len = 255; } RegCloseKey(hKey); }