winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2010
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
919 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Don' t try to create the owner window if it belongs to a different thread.
by Alexandre Julliard
02 Mar '10
02 Mar '10
Module: wine Branch: master Commit: 9cd1ce2510536e73cb94dc99ea29a9d189288f64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9cd1ce2510536e73cb94dc99e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 17:06:19 2010 +0100 winex11: Don't try to create the owner window if it belongs to a different thread. --- dlls/winex11.drv/window.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 1847527..47f7245 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1005,7 +1005,8 @@ static Window get_owner_whole_window( HWND owner ) if (!(data = X11DRV_get_win_data( owner ))) { - if (!(data = X11DRV_create_win_data( owner ))) + if (GetWindowThreadProcessId( owner, NULL ) != GetCurrentThreadId() || + !(data = X11DRV_create_win_data( owner ))) return (Window)GetPropA( owner, whole_window_prop ); } else if (!data->managed) /* make it managed */
1
0
0
0
Reece Dunn : msxml3/tests: Improve the IObjectSecurity tests to cover msxml3 SP8+ behaviour.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 47016df9b719a57477156794b97c2860ed63957d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47016df9b719a57477156794b…
Author: Reece Dunn <msclrhd(a)gmail.com> Date: Sun Feb 28 21:24:47 2010 +0000 msxml3/tests: Improve the IObjectSecurity tests to cover msxml3 SP8+ behaviour. --- dlls/msxml3/domdoc.c | 5 ++- dlls/msxml3/tests/domdoc.c | 119 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 103 insertions(+), 21 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 41c1f41..a29e9b2 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -2214,7 +2214,7 @@ static ULONG WINAPI xmldoc_Safety_Release(IObjectSafety *iface) return IXMLDocument_Release((IXMLDocument *)This); } -#define SAFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA) +#define SAFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER) static HRESULT WINAPI xmldoc_Safety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) @@ -2238,6 +2238,9 @@ static HRESULT WINAPI xmldoc_Safety_SetInterfaceSafetyOptions(IObjectSafety *ifa domdoc *This = impl_from_IObjectSafety(iface); TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions); + if ((dwOptionSetMask & ~SAFETY_SUPPORTED_OPTIONS) != 0) + return E_FAIL; + This->safeopt = dwEnabledOptions & dwOptionSetMask & SAFETY_SUPPORTED_OPTIONS; return S_OK; } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 929a35f..5f06d93 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -5292,6 +5292,41 @@ static void test_put_nodeValue(void) IXMLDOMDocument_Release(doc); } +static void test_IObjectSafety_set(IObjectSafety *safety, HRESULT result, HRESULT result2, DWORD set, DWORD mask, DWORD expected, DWORD expected2) +{ + HRESULT hr; + DWORD enabled, supported; + + trace("testing IObjectSafety: enable=%08x, mask=%08x\n", set, mask); + + hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, set, mask); + if (result == result2) + ok(hr == result, "SetInterfaceSafetyOptions: expected %08x, returned %08x\n", result, hr ); + else + ok(broken(hr == result) || hr == result2, + "SetInterfaceSafetyOptions: expected %08x, got %08x\n", result2, hr ); + + supported = enabled = 0xCAFECAFE; + hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); + ok(hr == S_OK, "ret %08x\n", hr ); + if (expected == expected2) + ok(enabled == expected, "Expected %08x, got %08x\n", expected, enabled); + else + ok(broken(enabled == expected) || enabled == expected2, + "Expected %08x, got %08x\n", expected2, enabled); + + /* reset the safety options */ + + hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, + INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER, + 0); + ok(hr == S_OK, "ret %08x\n", hr ); + + hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); + ok(hr == S_OK, "ret %08x\n", hr ); + ok(enabled == 0, "Expected 0, got %08x\n", enabled); +} + static void test_document_IObjectSafety(void) { IXMLDOMDocument *doc; @@ -5314,41 +5349,85 @@ static void test_document_IObjectSafety(void) hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); ok(hr == S_OK, "ret %08x\n", hr ); - ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA), - "Expected (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA)," + ok(broken(supported == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA)) || + supported == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER) /* msxml3 SP8+ */, + "Expected (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER), " "got %08x\n", supported); ok(enabled == 0, "Expected 0, got %08x\n", enabled); - /* set */ + + /* set -- individual flags */ + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_CALLER, + INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_CALLER); + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACESAFE_FOR_UNTRUSTED_DATA, INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACESAFE_FOR_UNTRUSTED_DATA, INTERFACESAFE_FOR_UNTRUSTED_DATA); + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACE_USES_SECURITY_MANAGER, INTERFACE_USES_SECURITY_MANAGER, + 0, INTERFACE_USES_SECURITY_MANAGER /* msxml3 SP8+ */); + + /* set INTERFACE_USES_DISPEX */ + + test_IObjectSafety_set(safety, S_OK, E_FAIL /* msxml3 SP8+ */, + INTERFACE_USES_DISPEX, INTERFACE_USES_DISPEX, + 0, 0); + + test_IObjectSafety_set(safety, S_OK, E_FAIL /* msxml3 SP8+ */, + INTERFACE_USES_DISPEX, 0, + 0, 0); + + test_IObjectSafety_set(safety, S_OK, S_OK /* msxml3 SP8+ */, + 0, INTERFACE_USES_DISPEX, + 0, 0); + + /* set option masking */ + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACESAFE_FOR_UNTRUSTED_CALLER, + INTERFACESAFE_FOR_UNTRUSTED_CALLER, + INTERFACESAFE_FOR_UNTRUSTED_CALLER); + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACESAFE_FOR_UNTRUSTED_DATA); + + test_IObjectSafety_set(safety, S_OK, S_OK, + INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA, + INTERFACE_USES_SECURITY_MANAGER, + 0, + 0); + + /* set -- inheriting previous settings */ + hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, INTERFACESAFE_FOR_UNTRUSTED_CALLER, INTERFACESAFE_FOR_UNTRUSTED_CALLER); ok(hr == S_OK, "ret %08x\n", hr ); hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); ok(hr == S_OK, "ret %08x\n", hr ); - ok(enabled == INTERFACESAFE_FOR_UNTRUSTED_CALLER, - "Expected INTERFACESAFE_FOR_UNTRUSTED_CALLER, got %08x\n", enabled); - /* set unsupported */ - hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, - INTERFACE_USES_SECURITY_MANAGER | - INTERFACESAFE_FOR_UNTRUSTED_CALLER, - INTERFACE_USES_SECURITY_MANAGER); - ok(hr == S_OK, "ret %08x\n", hr ); - hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); - ok(hr == S_OK, "ret %08x\n", hr ); - ok(enabled == 0, "Expected 0, got %08x\n", enabled); + todo_wine + ok(broken(enabled == INTERFACESAFE_FOR_UNTRUSTED_CALLER) || + enabled == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACE_USES_SECURITY_MANAGER) /* msxml3 SP8+ */, + "Expected (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACE_USES_SECURITY_MANAGER), " + "got %08x\n", enabled); hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, - INTERFACESAFE_FOR_UNTRUSTED_CALLER, - INTERFACESAFE_FOR_UNTRUSTED_CALLER); - ok(hr == S_OK, "ret %08x\n", hr ); - hr = IObjectSafety_SetInterfaceSafetyOptions(safety, NULL, INTERFACESAFE_FOR_UNTRUSTED_DATA, INTERFACESAFE_FOR_UNTRUSTED_DATA); ok(hr == S_OK, "ret %08x\n", hr ); hr = IObjectSafety_GetInterfaceSafetyOptions(safety, NULL, &supported, &enabled); ok(hr == S_OK, "ret %08x\n", hr ); - ok(enabled == INTERFACESAFE_FOR_UNTRUSTED_DATA, - "Expected INTERFACESAFE_FOR_UNTRUSTED_DATA, got %08x\n", enabled); + todo_wine + ok(broken(enabled == INTERFACESAFE_FOR_UNTRUSTED_DATA) || + enabled == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA) /* msxml3 SP8+ */, + "Expected (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA), " + "got %08x\n", enabled); IObjectSafety_Release(safety);
1
0
0
0
Gerald Pfeifer : widl: Avoid two warnings.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 844e22093ecdd11fa2231ab3d4ef8850d20b4798 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=844e22093ecdd11fa2231ab3d…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Sun Feb 28 13:13:59 2010 +0100 widl: Avoid two warnings. --- tools/widl/parser.y | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 2af7742..71b7ed6 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2348,6 +2348,7 @@ static void check_field_common(const type_t *container_type, default: /* should be no other container types */ assert(0); + return; } if (is_attr(arg->attrs, ATTR_LENGTHIS) &&
1
0
0
0
Andrew Eikum : shlwapi: Ignore the hash of HTML URLs in UrlCombine.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 386cb659df0f7e7616d62332f6a116b8a0c74a8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=386cb659df0f7e7616d62332f…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Fri Feb 26 19:20:42 2010 -0600 shlwapi: Ignore the hash of HTML URLs in UrlCombine. --- dlls/shlwapi/tests/url.c | 5 ++++ dlls/shlwapi/url.c | 48 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 3d86ae7..31df64e 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -278,6 +278,11 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { {"
http://www.winehq.org/tests/../tests/
", "/tests10/..", URL_DONT_SIMPLIFY, S_OK, "
http://www.winehq.org/tests10/
.."}, {"
http://www.winehq.org/tests/../
", "tests11", URL_DONT_SIMPLIFY, S_OK, "
http://www.winehq.org/tests/../tests11
"}, {"file:///C:\\dir\\file.txt", "test.txt", 0, S_OK, "file:///C:/dir/test.txt"}, + {"file:///C:\\dir\\file.txt#hash\\hash", "test.txt", 0, S_OK, "file:///C:/dir/file.txt#hash/test.txt"}, + {"file:///C:\\dir\\file.html#hash\\hash", "test.html", 0, S_OK, "file:///C:/dir/test.html"}, + {"file:///C:\\dir\\file.htm#hash\\hash", "test.htm", 0, S_OK, "file:///C:/dir/test.htm"}, + {"file:///C:\\dir\\file.hTmL#hash\\hash", "test.hTmL", 0, S_OK, "file:///C:/dir/test.hTmL"}, + {"file:///C:\\dir.html\\file.txt#hash\\hash", "test.txt", 0, S_OK, "file:///C:/dir.html/file.txt#hash/test.txt"}, {"C:\\winehq\\winehq.txt", "C:\\Test\\test.txt", 0, S_OK, "file:///C:/Test/test.txt"}, {"
http://www.winehq.org/test/
", "test%20file.txt", 0, S_OK, "
http://www.winehq.org/test/test%20file.txt
"}, {"
http://www.winehq.org/test/
", "test%20file.txt", URL_FILE_USE_PATHURL, S_OK, "
http://www.winehq.org/test/test%20file.txt
"}, diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 4a93b23..2fdae3d 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -630,6 +630,8 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, process_case = 1; } else do { + BOOL manual_search = FALSE; + /* mk is a special case */ if(base.nScheme == URL_SCHEME_MK) { static const WCHAR wsz[] = {':',':',0}; @@ -659,13 +661,45 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, } } - /* Change .sizep2 to not have the last leaf in it, - * Note: we need to start after the location (if it exists) - */ - work = strrchrW((base.pszSuffix+sizeloc), '/'); - if (work) { - len = (DWORD)(work - base.pszSuffix + 1); - base.cchSuffix = len; + /* If there is a '#' and the characters immediately preceeding it are + * ".htm[l]", then begin looking for the last leaf starting from + * the '#'. Otherwise the '#' is not meaningful and just start + * looking from the end. */ + if ((work = strchrW(base.pszSuffix + sizeloc, '#'))) { + const WCHAR htmlW[] = {'.','h','t','m','l',0}; + const int len_htmlW = 5; + const WCHAR htmW[] = {'.','h','t','m',0}; + const int len_htmW = 4; + + if (work - base.pszSuffix > len_htmW * sizeof(WCHAR)) { + work -= len_htmW; + if (strncmpiW(work, htmW, len_htmW) == 0) + manual_search = TRUE; + work += len_htmW; + } + + if (!manual_search && + work - base.pszSuffix > len_htmlW * sizeof(WCHAR)) { + work -= len_htmlW; + if (strncmpiW(work, htmlW, len_htmlW) == 0) + manual_search = TRUE; + work += len_htmlW; + } + } + + if (manual_search) { + /* search backwards starting from the current position */ + while (*work != '/' && work > base.pszSuffix + sizeloc) + --work; + if (work > base.pszSuffix + sizeloc) + base.cchSuffix = work - base.pszSuffix + 1; + }else { + /* search backwards starting from the end of the string */ + work = strrchrW((base.pszSuffix+sizeloc), '/'); + if (work) { + len = (DWORD)(work - base.pszSuffix + 1); + base.cchSuffix = len; + } } /*
1
0
0
0
Alexandre Julliard : ntdll/tests: Add tests showing that NtCreateKey is not recursive.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: ef4a9cadf58c868671d2daf9c18602ad2673d790 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ef4a9cadf58c868671d2daf9c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:24:05 2010 +0100 ntdll/tests: Add tests showing that NtCreateKey is not recursive. --- dlls/ntdll/tests/reg.c | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 42 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 79e5ece..d534240 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -367,9 +367,10 @@ static void test_NtCreateKey(void) { /*Create WineTest*/ OBJECT_ATTRIBUTES attr; - HANDLE key; + HANDLE key, subkey; ACCESS_MASK am = GENERIC_ALL; NTSTATUS status; + UNICODE_STRING str; /* All NULL */ status = pNtCreateKey(NULL, 0, NULL, 0, 0, 0, 0); @@ -397,14 +398,51 @@ static void test_NtCreateKey(void) status = pNtCreateKey(NULL, 0, &attr, 0, 0, 0, 0); ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08x\n", status); - status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0); - ok(status == STATUS_SUCCESS, "NtCreateKey Failed: 0x%08x\n", status); - /* Length > sizeof(OBJECT_ATTRIBUTES) */ attr.Length *= 2; status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0); ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08x\n", status); + attr.Length = sizeof(attr); + status = pNtCreateKey(&key, am, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey Failed: 0x%08x\n", status); + + attr.RootDirectory = key; + attr.ObjectName = &str; + + pRtlCreateUnicodeStringFromAsciiz( &str, "test\\sub\\key" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "test\\subkey" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "test\\subkey\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_OBJECT_NAME_NOT_FOUND, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey\\" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS || broken(status == STATUS_OBJECT_NAME_NOT_FOUND), /* nt4 */ + "NtCreateKey failed: 0x%08x\n", status ); + if (status == STATUS_SUCCESS) + { + pNtDeleteKey( subkey ); + pNtClose( subkey ); + } + pRtlFreeUnicodeString( &str ); + + pRtlCreateUnicodeStringFromAsciiz( &str, "test_subkey" ); + status = pNtCreateKey( &subkey, am, &attr, 0, 0, 0, 0 ); + ok( status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status ); + pRtlFreeUnicodeString( &str ); + pNtDeleteKey( subkey ); + pNtClose( subkey ); + pNtClose(key); }
1
0
0
0
Alexandre Julliard : server: Make the standard registry key creation non-recursive.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 8eca1da43c25d6bd3fa82d853e58933021f82d95 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8eca1da43c25d6bd3fa82d853…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:14:50 2010 +0100 server: Make the standard registry key creation non-recursive. --- server/registry.c | 41 +++++++++++++++++++---------------------- 1 files changed, 19 insertions(+), 22 deletions(-) diff --git a/server/registry.c b/server/registry.c index 52b65a7..ea7ea20 100644 --- a/server/registry.c +++ b/server/registry.c @@ -656,9 +656,8 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, const struct unicode_str *class, unsigned int options, unsigned int attributes, int *created ) { - struct key *base; int index; - struct unicode_str token; + struct unicode_str token, next; if (key->flags & KEY_DELETED) /* we cannot create a subkey under a deleted key */ { @@ -676,16 +675,14 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, key = subkey; get_path_token( name, &token ); if (!token.len) break; - if (!(subkey = follow_symlink( subkey, 0 ))) + if (!(key = follow_symlink( key, 0 ))) { set_error( STATUS_OBJECT_NAME_NOT_FOUND ); return NULL; } } - /* create the remaining part */ - - if (!token.len) + if (!token.len) /* the key already exists */ { if (options & REG_OPTION_CREATE_LINK) { @@ -697,8 +694,20 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, set_error( STATUS_OBJECT_NAME_NOT_FOUND ); return NULL; } - goto done; + if (debug_level > 1) dump_operation( key, NULL, "Open" ); + grab_object( key ); + return key; } + + /* token must be the last path component at this point */ + next = token; + get_path_token( name, &next ); + if (next.len) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + if ((key->flags & KEY_VOLATILE) && !(options & REG_OPTION_VOLATILE)) { set_error( STATUS_CHILD_MUST_BE_VOLATILE ); @@ -707,23 +716,11 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, *created = 1; make_dirty( key ); if (!(key = alloc_subkey( key, &token, index, current_time ))) return NULL; - base = key; - for (;;) - { - if (options & REG_OPTION_VOLATILE) key->flags |= KEY_VOLATILE; - else key->flags |= KEY_DIRTY; - get_path_token( name, &token ); - if (!token.len) break; - /* we know the index is always 0 in a new key */ - if (!(key = alloc_subkey( key, &token, 0, current_time ))) - { - free_subkey( base, index ); - return NULL; - } - } + if (options & REG_OPTION_CREATE_LINK) key->flags |= KEY_SYMLINK; + if (options & REG_OPTION_VOLATILE) key->flags |= KEY_VOLATILE; + else key->flags |= KEY_DIRTY; - done: if (debug_level > 1) dump_operation( key, NULL, "Create" ); if (class && class->len) {
1
0
0
0
Alexandre Julliard : server: Add a separate function for internal registry key creation.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 22de1f43d9c2840814cfb8e7445684499e9ee749 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22de1f43d9c2840814cfb8e74…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:13:46 2010 +0100 server: Add a separate function for internal registry key creation. --- server/registry.c | 81 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 59 insertions(+), 22 deletions(-) diff --git a/server/registry.c b/server/registry.c index ef38c8e..52b65a7 100644 --- a/server/registry.c +++ b/server/registry.c @@ -653,8 +653,8 @@ static struct key *open_key( struct key *key, const struct unicode_str *name, un /* create a subkey */ static struct key *create_key( struct key *key, const struct unicode_str *name, - const struct unicode_str *class, int flags, unsigned int options, - unsigned int attributes, timeout_t modif, int *created ) + const struct unicode_str *class, unsigned int options, + unsigned int attributes, int *created ) { struct key *base; int index; @@ -699,26 +699,23 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, } goto done; } - if (options & REG_OPTION_VOLATILE) - { - flags = (flags & ~KEY_DIRTY) | KEY_VOLATILE; - } - else if (key->flags & KEY_VOLATILE) + if ((key->flags & KEY_VOLATILE) && !(options & REG_OPTION_VOLATILE)) { set_error( STATUS_CHILD_MUST_BE_VOLATILE ); return NULL; } *created = 1; - if (flags & KEY_DIRTY) make_dirty( key ); - if (!(key = alloc_subkey( key, &token, index, modif ))) return NULL; + make_dirty( key ); + if (!(key = alloc_subkey( key, &token, index, current_time ))) return NULL; base = key; for (;;) { - key->flags |= flags; + if (options & REG_OPTION_VOLATILE) key->flags |= KEY_VOLATILE; + else key->flags |= KEY_DIRTY; get_path_token( name, &token ); if (!token.len) break; /* we know the index is always 0 in a new key */ - if (!(key = alloc_subkey( key, &token, 0, modif ))) + if (!(key = alloc_subkey( key, &token, 0, current_time ))) { free_subkey( base, index ); return NULL; @@ -738,6 +735,49 @@ static struct key *create_key( struct key *key, const struct unicode_str *name, return key; } +/* recursively create a subkey (for internal use only) */ +static struct key *create_key_recursive( struct key *key, const struct unicode_str *name, timeout_t modif ) +{ + struct key *base; + int index; + struct unicode_str token; + + token.str = NULL; + if (!get_path_token( name, &token )) return NULL; + while (token.len) + { + struct key *subkey; + if (!(subkey = find_subkey( key, &token, &index ))) break; + key = subkey; + if (!(key = follow_symlink( key, 0 ))) + { + set_error( STATUS_OBJECT_NAME_NOT_FOUND ); + return NULL; + } + get_path_token( name, &token ); + } + + if (token.len) + { + if (!(key = alloc_subkey( key, &token, index, modif ))) return NULL; + base = key; + for (;;) + { + get_path_token( name, &token ); + if (!token.len) break; + /* we know the index is always 0 in a new key */ + if (!(key = alloc_subkey( key, &token, 0, modif ))) + { + free_subkey( base, index ); + return NULL; + } + } + } + + grab_object( key ); + return key; +} + /* query information about a key or a subkey */ static void enum_key( const struct key *key, int index, int info_class, struct enum_key_reply *reply ) @@ -1191,7 +1231,7 @@ static int get_data_type( const char *buffer, int *type, int *parse_type ) } /* load and create a key from the input file */ -static struct key *load_key( struct key *base, const char *buffer, int flags, +static struct key *load_key( struct key *base, const char *buffer, int prefix_len, struct file_load_info *info ) { WCHAR *p; @@ -1227,7 +1267,7 @@ static struct key *load_key( struct key *base, const char *buffer, int flags, } name.str = p; name.len = len - (p - info->tmp + 1) * sizeof(WCHAR); - return create_key( base, &name, NULL, flags, 0, 0, modif, &res ); + return create_key_recursive( base, &name, modif ); } /* load a key option from the input file */ @@ -1440,7 +1480,7 @@ static void load_keys( struct key *key, const char *filename, FILE *f, int prefi case '[': /* new key */ if (subkey) release_object( subkey ); if (prefix_len == -1) prefix_len = get_prefix_len( key, p + 1, &info ); - if (!(subkey = load_key( key, p + 1, key->flags, prefix_len, &info ))) + if (!(subkey = load_key( key, p + 1, prefix_len, &info ))) file_read_error( "Error creating key", &info ); break; case '@': /* default value */ @@ -1544,9 +1584,7 @@ void init_registry(void) WCHAR *current_user_path; struct unicode_str current_user_str; - struct key *key; - int dummy; /* switch to the config dir */ @@ -1559,7 +1597,7 @@ void init_registry(void) /* load system.reg into Registry\Machine */ - if (!(key = create_key( root_key, &HKLM_name, NULL, 0, 0, 0, current_time, &dummy ))) + if (!(key = create_key_recursive( root_key, &HKLM_name, current_time ))) fatal_error( "could not create Machine registry key\n" ); load_init_registry_from_file( "system.reg", key ); @@ -1567,7 +1605,7 @@ void init_registry(void) /* load userdef.reg into Registry\User\.Default */ - if (!(key = create_key( root_key, &HKU_name, NULL, 0, 0, 0, current_time, &dummy ))) + if (!(key = create_key_recursive( root_key, &HKU_name, current_time ))) fatal_error( "could not create User\\.Default registry key\n" ); load_init_registry_from_file( "userdef.reg", key ); @@ -1578,7 +1616,7 @@ void init_registry(void) /* FIXME: match default user in token.c. should get from process token instead */ current_user_path = format_user_registry_path( security_interactive_sid, ¤t_user_str ); if (!current_user_path || - !(key = create_key( root_key, ¤t_user_str, NULL, 0, 0, 0, current_time, &dummy ))) + !(key = create_key_recursive( root_key, ¤t_user_str, current_time ))) fatal_error( "could not create HKEY_CURRENT_USER registry key\n" ); free( current_user_path ); load_init_registry_from_file( "user.reg", key ); @@ -1771,8 +1809,7 @@ DECL_HANDLER(create_key) /* NOTE: no access rights are required from the parent handle to create a key */ if ((parent = get_parent_hkey_obj( req->parent ))) { - if ((key = create_key( parent, &name, &class, KEY_DIRTY, req->options, - req->attributes, current_time, &reply->created ))) + if ((key = create_key( parent, &name, &class, req->options, req->attributes, &reply->created ))) { reply->hkey = alloc_handle( current->process, key, access, req->attributes ); release_object( key ); @@ -1927,7 +1964,7 @@ DECL_HANDLER(load_registry) { int dummy; get_req_path( &name, !req->hkey ); - if ((key = create_key( parent, &name, NULL, KEY_DIRTY, 0, 0, current_time, &dummy ))) + if ((key = create_key( parent, &name, NULL, 0, 0, &dummy ))) { load_registry( key, req->file ); release_object( key );
1
0
0
0
Alexandre Julliard : advapi32: Create keys recursively if necessary.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: 972f96d6c4c743659f3d6337241cacb4ce7e1d56 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=972f96d6c4c743659f3d63372…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:12:12 2010 +0100 advapi32: Create keys recursively if necessary. --- dlls/advapi32/registry.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 37 insertions(+), 6 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index faae2b1..dd3f516 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -91,15 +91,47 @@ static inline int is_version_nt(void) return !(GetVersion() & 0x80000000); } +/* wrapper for NtCreateKey that creates the key recursively if necessary */ +static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr, + const UNICODE_STRING *class, ULONG options, PULONG dispos ) +{ + NTSTATUS status = NtCreateKey( (HANDLE *)retkey, access, attr, 0, class, options, dispos ); + + if (status == STATUS_OBJECT_NAME_NOT_FOUND) + { + DWORD attrs, i = 0, len = attr->ObjectName->Length / sizeof(WCHAR); + + while (i < len && attr->ObjectName->Buffer[i] != '\\') i++; + if (i == len) return status; + attrs = attr->Attributes; + attr->Attributes &= ~OBJ_OPENLINK; + + while (i < len) + { + attr->ObjectName->Length = i * sizeof(WCHAR); + status = NtCreateKey( (HANDLE *)retkey, access, attr, 0, class, + options & ~REG_OPTION_CREATE_LINK, dispos ); + if (status) return status; + NtClose( *retkey ); + while (i < len && attr->ObjectName->Buffer[i] == '\\') i++; + while (i < len && attr->ObjectName->Buffer[i] != '\\') i++; + } + attr->Attributes = attrs; + attr->ObjectName->Length = len * sizeof(WCHAR); + status = NtCreateKey( (PHANDLE)retkey, access, attr, 0, class, options, dispos ); + } + return status; +} + /* create one of the HKEY_* special root keys */ -static HKEY create_special_root_hkey( HANDLE hkey, DWORD access ) +static HKEY create_special_root_hkey( HKEY hkey, DWORD access ) { HKEY ret = 0; int idx = (UINT_PTR)hkey - (UINT_PTR)HKEY_SPECIAL_ROOT_FIRST; if (hkey == HKEY_CURRENT_USER) { - if (RtlOpenCurrentUser( access, &hkey )) return 0; + if (RtlOpenCurrentUser( access, (HANDLE *)&hkey )) return 0; TRACE( "HKEY_CURRENT_USER -> %p\n", hkey ); /* don't cache the key in the table if caching is disabled */ @@ -118,7 +150,7 @@ static HKEY create_special_root_hkey( HANDLE hkey, DWORD access ) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; RtlInitUnicodeString( &name, root_key_names[idx] ); - if (NtCreateKey( &hkey, access, &attr, 0, NULL, 0, NULL )) return 0; + if (create_key( &hkey, access, &attr, NULL, 0, NULL )) return 0; TRACE( "%s -> %p\n", debugstr_w(attr.ObjectName->Buffer), hkey ); } @@ -194,8 +226,7 @@ LSTATUS WINAPI RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD reserved, LPWSTR RtlInitUnicodeString( &nameW, name ); RtlInitUnicodeString( &classW, class ); - return RtlNtStatusToDosError( NtCreateKey( (PHANDLE)retkey, access, &attr, 0, - &classW, options, dispos ) ); + return RtlNtStatusToDosError( create_key( retkey, access, &attr, &classW, options, dispos ) ); } @@ -254,7 +285,7 @@ LSTATUS WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR cl { if (!(status = RtlAnsiStringToUnicodeString( &classW, &classA, TRUE ))) { - status = NtCreateKey( (PHANDLE)retkey, access, &attr, 0, &classW, options, dispos ); + status = create_key( retkey, access, &attr, &classW, options, dispos ); RtlFreeUnicodeString( &classW ); } }
1
0
0
0
Alexandre Julliard : kernel32: Create the Nls\CodePage key one element at a time.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: ea3f48ff112175ae2a9e2367098ee2d182a9eb2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea3f48ff112175ae2a9e23670…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:06:08 2010 +0100 kernel32: Create the Nls\CodePage key one element at a time. --- dlls/kernel32/locale.c | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 277f55c..7a141b2 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -74,12 +74,6 @@ static const WCHAR szLocaleKeyName[] = { 'C','o','n','t','r','o','l','\\','N','l','s','\\','L','o','c','a','l','e',0 }; -static const WCHAR szCodepageKeyName[] = { - 'M','a','c','h','i','n','e','\\','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','\\','N','l','s','\\','C','o','d','e','p','a','g','e',0 -}; - static const WCHAR szLangGroupsKeyName[] = { 'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', @@ -774,11 +768,26 @@ void LOCALE_InitRegistry(void) if (locale_update_registry( hkey, lc_ctypeW, lcid_LC_CTYPE, NULL, 0 )) { + static const WCHAR codepageW[] = + {'M','a','c','h','i','n','e','\\','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','\\','N','l','s','\\','C','o','d','e','p','a','g','e',0}; + OBJECT_ATTRIBUTES attr; HANDLE nls_key; + DWORD len = 14; - RtlInitUnicodeString( &nameW, szCodepageKeyName ); + RtlInitUnicodeString( &nameW, codepageW ); InitializeObjectAttributes( &attr, &nameW, 0, 0, NULL ); + while (codepageW[len]) + { + nameW.Length = len * sizeof(WCHAR); + if (NtCreateKey( &nls_key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) break; + NtClose( nls_key ); + len++; + while (codepageW[len] && codepageW[len] != '\\') len++; + } + nameW.Length = len * sizeof(WCHAR); if (!NtCreateKey( &nls_key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) { for (i = 0; i < sizeof(update_cp_values)/sizeof(update_cp_values[0]); i++)
1
0
0
0
Alexandre Julliard : kernel32: Create the Control Panel\International key one element at a time.
by Alexandre Julliard
01 Mar '10
01 Mar '10
Module: wine Branch: master Commit: f5248ef7c8f709db88a52490fb344dc669193142 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f5248ef7c8f709db88a52490f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 1 14:04:33 2010 +0100 kernel32: Create the Control Panel\International key one element at a time. --- dlls/kernel32/locale.c | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 6f965e3..277f55c 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -614,11 +614,11 @@ static BOOL is_genitive_name_supported( LCTYPE lctype ) */ static inline HANDLE create_registry_key(void) { - static const WCHAR intlW[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\', - 'I','n','t','e','r','n','a','t','i','o','n','a','l',0}; + static const WCHAR cplW[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l',0}; + static const WCHAR intlW[] = {'I','n','t','e','r','n','a','t','i','o','n','a','l',0}; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; - HANDLE hkey; + HANDLE cpl_key, hkey = 0; if (RtlOpenCurrentUser( KEY_ALL_ACCESS, &hkey ) != STATUS_SUCCESS) return 0; @@ -628,9 +628,15 @@ static inline HANDLE create_registry_key(void) attr.Attributes = 0; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - RtlInitUnicodeString( &nameW, intlW ); + RtlInitUnicodeString( &nameW, cplW ); - if (NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ) != STATUS_SUCCESS) hkey = 0; + if (!NtCreateKey( &cpl_key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) + { + NtClose( attr.RootDirectory ); + attr.RootDirectory = cpl_key; + RtlInitUnicodeString( &nameW, intlW ); + if (NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) hkey = 0; + } NtClose( attr.RootDirectory ); return hkey; }
1
0
0
0
← Newer
1
...
85
86
87
88
89
90
91
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200