mountmgr: Symlink WoW64 Wine ports key to regular Wine ports key.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2017-10-29 21:58:52 +01:00 committed by Alexandre Julliard
parent b3ee610173
commit c296e7de4d
2 changed files with 22 additions and 1 deletions

View File

@ -1136,7 +1136,8 @@ static void create_port_devices( DRIVER_OBJECT *driver )
}
p += 3;
RegOpenKeyExW( HKEY_LOCAL_MACHINE, ports_keyW, 0, KEY_QUERY_VALUE, &wine_ports_key );
RegCreateKeyExW( HKEY_LOCAL_MACHINE, ports_keyW, 0, NULL, 0,
KEY_QUERY_VALUE, NULL, &wine_ports_key, NULL );
RegCreateKeyExW( HKEY_LOCAL_MACHINE, windows_ports_key_name, 0, NULL, REG_OPTION_VOLATILE,
KEY_ALL_ACCESS, NULL, &windows_ports_key, NULL );

View File

@ -422,6 +422,17 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
static const WCHAR driver_serialW[] = {'\\','D','r','i','v','e','r','\\','S','e','r','i','a','l',0};
static const WCHAR driver_parallelW[] = {'\\','D','r','i','v','e','r','\\','P','a','r','a','l','l','e','l',0};
#ifdef _WIN64
static const WCHAR qualified_ports_keyW[] = {'\\','R','E','G','I','S','T','R','Y','\\',
'M','A','C','H','I','N','E','\\','S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','P','o','r','t','s'}; /* no null terminator */
static const WCHAR wow64_ports_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W','o','w','6','4','3','2','N','o','d','e','\\','W','i','n','e','\\',
'P','o','r','t','s',0};
static const WCHAR symbolic_link_valueW[] = {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e',0};
HKEY wow64_ports_key = NULL;
#endif
UNICODE_STRING nameW, linkW;
DEVICE_OBJECT *device;
NTSTATUS status;
@ -449,6 +460,15 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
initialize_dbus();
initialize_diskarbitration();
#ifdef _WIN64
/* create a symlink so that the Wine port overrides key can be edited with 32-bit reg or regedit */
RegCreateKeyExW( HKEY_LOCAL_MACHINE, wow64_ports_keyW, 0, NULL, REG_OPTION_CREATE_LINK,
KEY_SET_VALUE, NULL, &wow64_ports_key, NULL );
RegSetValueExW( wow64_ports_key, symbolic_link_valueW, 0, REG_LINK,
(BYTE *)qualified_ports_keyW, sizeof(qualified_ports_keyW) );
RegCloseKey( wow64_ports_key );
#endif
RtlInitUnicodeString( &nameW, driver_serialW );
IoCreateDriver( &nameW, serial_driver_entry );