[PATCH] explorer: Create CurrentControlSet\Control\Video registry key as non-volatile.
From: Michael Müller <michael(a)fds-team.de> From: Michael Müller <michael(a)fds-team.de> Signed-off-by: Michael Müller <michael(a)fds-team.de> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> --- dlls/advapi32/tests/registry.c | 7 +++++++ programs/explorer/desktop.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index d1fe3f05fe5..011c2fcea1c 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -1345,6 +1345,13 @@ static void test_reg_create_key(void) RegDeleteKeyA(hkey1, ""); RegCloseKey(hkey1); + /* System\CurrentControlSet\Control\Video should be non-volatile */ + ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Video\\Wine", + 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL); + ok(ret == ERROR_SUCCESS, "RegCreateKeyExA failed with error %d\n", ret); + RegDeleteKeyA(hkey1, ""); + RegCloseKey(hkey1); + /* WOW64 flags - open an existing key */ hkey1 = NULL; ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, NULL, 0, KEY_READ|KEY_WOW64_32KEY, NULL, &hkey1, NULL); diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 27b9b249012..5424a194029 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -775,6 +775,11 @@ static BOOL get_default_enable_shell( const WCHAR *name ) static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid ) { + static const WCHAR video_keyW[] = { + 'S','y','s','t','e','m','\\', + 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', + 'C','o','n','t','r','o','l','\\', + 'V','i','d','e','o',0}; static const WCHAR device_keyW[] = { 'S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', @@ -838,6 +843,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid ) TRACE( "display %s driver %s\n", debugstr_guid(guid), debugstr_w(buffer) ); } + /* create video key first without REG_OPTION_VOLATILE attribute */ + if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, video_keyW, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, NULL )) + RegCloseKey( hkey ); + sprintfW( key, device_keyW, guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); -- 2.17.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=51034 Your paranoid android. === w8adm (32 bit report) === advapi32: registry.c:1351: Test failed: RegCreateKeyExA failed with error 5
I think it's better to add this key in wine.inf On 4/17/19 4:58 PM, Vijay Kiran Kamuju wrote:
From: Michael Müller <michael(a)fds-team.de>
From: Michael Müller <michael(a)fds-team.de> Signed-off-by: Michael Müller <michael(a)fds-team.de> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> --- dlls/advapi32/tests/registry.c | 7 +++++++ programs/explorer/desktop.c | 9 +++++++++ 2 files changed, 16 insertions(+)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index d1fe3f05fe5..011c2fcea1c 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -1345,6 +1345,13 @@ static void test_reg_create_key(void) RegDeleteKeyA(hkey1, ""); RegCloseKey(hkey1);
+ /* System\CurrentControlSet\Control\Video should be non-volatile */ + ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Video\\Wine", + 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL); + ok(ret == ERROR_SUCCESS, "RegCreateKeyExA failed with error %d\n", ret); + RegDeleteKeyA(hkey1, ""); + RegCloseKey(hkey1); + /* WOW64 flags - open an existing key */ hkey1 = NULL; ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, NULL, 0, KEY_READ|KEY_WOW64_32KEY, NULL, &hkey1, NULL); diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 27b9b249012..5424a194029 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -775,6 +775,11 @@ static BOOL get_default_enable_shell( const WCHAR *name )
static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid ) { + static const WCHAR video_keyW[] = { + 'S','y','s','t','e','m','\\', + 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', + 'C','o','n','t','r','o','l','\\', + 'V','i','d','e','o',0}; static const WCHAR device_keyW[] = { 'S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', @@ -838,6 +843,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid ) TRACE( "display %s driver %s\n", debugstr_guid(guid), debugstr_w(buffer) ); }
+ /* create video key first without REG_OPTION_VOLATILE attribute */ + if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, video_keyW, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, NULL )) + RegCloseKey( hkey ); + sprintfW( key, device_keyW, guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
Zhiyi Zhang <zzhang(a)codeweavers.com> writes:
I think it's better to add this key in wine.inf
No, if there's existing code to create the subkey, it should create the top-level key too. That's better than relying on wine.inf. -- Alexandre Julliard julliard(a)winehq.org
On Mon, Apr 22, 2019 at 7:20 PM Alexandre Julliard <julliard(a)winehq.org> wrote:
Zhiyi Zhang <zzhang(a)codeweavers.com> writes:
I think it's better to add this key in wine.inf
No, if there's existing code to create the subkey, it should create the top-level key too. That's better than relying on wine.inf.
-- Alexandre Julliard julliard(a)winehq.org
But the subkey is created as volatitle, the parent key is also created as volatile. But in windows, the parent key is not volatile. Hence I think if the parent key is created via the wine.inf file, its better. --- Vijay
Vijay Kiran Kamuju <infyquest(a)gmail.com> writes:
On Mon, Apr 22, 2019 at 7:20 PM Alexandre Julliard <julliard(a)winehq.org> wrote:
Zhiyi Zhang <zzhang(a)codeweavers.com> writes:
I think it's better to add this key in wine.inf
No, if there's existing code to create the subkey, it should create the top-level key too. That's better than relying on wine.inf.
-- Alexandre Julliard julliard(a)winehq.org
But the subkey is created as volatitle, the parent key is also created as volatile. But in windows, the parent key is not volatile. Hence I think if the parent key is created via the wine.inf file, its better.
No, it should be created as non-volatile in the code that uses it. There's no reason to split the creation of that key in two different places. -- Alexandre Julliard julliard(a)winehq.org
participants (4)
-
Alexandre Julliard -
Marvin -
Vijay Kiran Kamuju -
Zhiyi Zhang