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
July 2014
----- 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
2 participants
287 discussions
Start a n
N
ew thread
Piotr Caban : ole32: Don't do any message processing when we' re already done with dragdrop operation.
by Alexandre Julliard
03 Jul '14
03 Jul '14
Module: wine Branch: master Commit: cdf2c5f2cb3e5969bc83fdae0731a44a8941e68e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cdf2c5f2cb3e5969bc83fdae0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jul 3 16:28:20 2014 +0200 ole32: Don't do any message processing when we're already done with dragdrop operation. --- dlls/ole32/ole2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index a017c1b..786fdb4 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2205,7 +2205,9 @@ static LRESULT WINAPI OLEDD_DragTrackerWindowProc( case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: { - OLEDD_TrackStateChange((TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0)); + TrackerWindowInfo *trackerInfo = (TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0); + if (trackerInfo->trackingDone) break; + OLEDD_TrackStateChange(trackerInfo); break; } case WM_DESTROY:
1
0
0
0
Bruno Jesus : ws2_32: Improve WSAStartup/WSACleanup tracing.
by Alexandre Julliard
03 Jul '14
03 Jul '14
Module: wine Branch: master Commit: adde46f55255c4fb378ccbd75f9a8fad5d3f1c0c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adde46f55255c4fb378ccbd75…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Jul 3 11:18:28 2014 -0300 ws2_32: Improve WSAStartup/WSACleanup tracing. --- dlls/ws2_32/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 0e738f1..5900c8f 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1238,7 +1238,7 @@ int WINAPI WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) /* don't do anything with lpWSAData->lpVendorInfo */ /* (some apps don't allocate the space for this field) */ - TRACE("succeeded\n"); + TRACE("succeeded starts: %d\n", num_startup); return 0; } @@ -1250,6 +1250,7 @@ INT WINAPI WSACleanup(void) { if (num_startup) { num_startup--; + TRACE("pending cleanups: %d\n", num_startup); return 0; } SetLastError(WSANOTINITIALISED);
1
0
0
0
Frédéric Delanoy : ntdll: Avoid potential integer overflow when computing median position in bsearch.
by Alexandre Julliard
03 Jul '14
03 Jul '14
Module: wine Branch: master Commit: ec3a9a54f57646bf1b103a8c416306c44e4a412b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ec3a9a54f57646bf1b103a8c4…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Thu Jul 3 12:19:25 2014 +0200 ntdll: Avoid potential integer overflow when computing median position in bsearch. --- dlls/ntdll/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c index 659d504..ad1b43b 100644 --- a/dlls/ntdll/misc.c +++ b/dlls/ntdll/misc.c @@ -299,7 +299,7 @@ NTDLL_bsearch( const void *key, const void *base, size_t nmemb, while (min <= max) { - ssize_t cursor = (min + max) / 2; + ssize_t cursor = min + (max - min) / 2; int ret = compar(key,(const char *)base+(cursor*size)); if (!ret) return (char*)base+(cursor*size);
1
0
0
0
Bruno Jesus : ws2_32: Only declare IPX support if the required definitions are found.
by Alexandre Julliard
03 Jul '14
03 Jul '14
Module: wine Branch: master Commit: 543314d449ad0de1e5e3703f8091e5c594e922db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=543314d449ad0de1e5e3703f8…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Jul 3 01:01:53 2014 -0300 ws2_32: Only declare IPX support if the required definitions are found. --- dlls/ws2_32/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index e1d0ce5..0e738f1 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -100,7 +100,6 @@ #ifdef HAVE_NETIPX_IPX_H # include <netipx/ipx.h> -# define HAS_IPX #elif defined(HAVE_LINUX_IPX_H) # ifdef HAVE_ASM_TYPES_H # include <asm/types.h> @@ -109,6 +108,8 @@ # include <linux/types.h> # endif # include <linux/ipx.h> +#endif +#if defined(SOL_IPX) || defined(SO_DEFAULT_HEADERS) # define HAS_IPX #endif
1
0
0
0
Gediminas Jakutis : d3dx9: Add adjacency generation for D3DXCreateSphere() .
by Alexandre Julliard
03 Jul '14
03 Jul '14
Module: wine Branch: master Commit: dc115a2c917f9fa2b951292795e5717703755c93 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc115a2c917f9fa2b95129279…
Author: Gediminas Jakutis <gediminas(a)varciai.lt> Date: Thu Jul 3 01:42:11 2014 +0300 d3dx9: Add adjacency generation for D3DXCreateSphere(). --- dlls/d3dx9_36/mesh.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 1a2b020..3b3784b 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -4693,12 +4693,6 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U return D3DERR_INVALIDCALL; } - if (adjacency) - { - FIXME("Case of adjacency != NULL not implemented.\n"); - return E_NOTIMPL; - } - number_of_vertices = 2 + slices * (stacks-1); number_of_faces = 2 * slices + (stacks - 2) * (2 * slices); @@ -4836,6 +4830,24 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U free_sincos_table(&phi); sphere->lpVtbl->UnlockIndexBuffer(sphere); sphere->lpVtbl->UnlockVertexBuffer(sphere); + + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(number_of_faces * sizeof(DWORD) * 3, adjacency))) + { + sphere->lpVtbl->Release(sphere); + return hr; + } + + if (FAILED(hr = sphere->lpVtbl->GenerateAdjacency(sphere, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + sphere->lpVtbl->Release(sphere); + return hr; + } + } + *mesh = sphere; return D3D_OK;
1
0
0
0
Vincent Povirk : winebrowser: Don't use IUriBuilder with unix file: uri's.
by Alexandre Julliard
02 Jul '14
02 Jul '14
Module: wine Branch: master Commit: 5af3b8c97e8f537d8a4f01382acb7127bcfb8f3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5af3b8c97e8f537d8a4f01382…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Jul 1 14:09:39 2014 -0500 winebrowser: Don't use IUriBuilder with unix file: uri's. --- programs/winebrowser/main.c | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c index 6938e1e..cb9ea73 100644 --- a/programs/winebrowser/main.c +++ b/programs/winebrowser/main.c @@ -311,11 +311,12 @@ done: static WCHAR *encode_unix_path(const char *src) { - int len = 1; const char *tmp_src; WCHAR *dst, *tmp_dst; const char safe_chars[] = "/-_.~@&=+$,:"; const char hex_digits[] = "0123456789ABCDEF"; + const WCHAR schema[] = {'f','i','l','e',':','/','/',0}; + int len = sizeof(schema)/sizeof(schema[0]); tmp_src = src; @@ -336,8 +337,10 @@ static WCHAR *encode_unix_path(const char *src) if (!dst) return NULL; + strcpyW(dst, schema); + tmp_src = src; - tmp_dst = dst; + tmp_dst = dst + strlenW(dst); while (*tmp_src != 0) { @@ -362,15 +365,13 @@ static WCHAR *encode_unix_path(const char *src) return dst; } -static IUri *convert_file_uri(IUri *uri) +static WCHAR *convert_file_uri(IUri *uri) { wine_get_unix_file_name_t wine_get_unix_file_name_ptr; - IUriBuilder *uri_builder; struct stat dummy; WCHAR *new_path; char *unixpath; BSTR filename; - IUri *new_uri; HRESULT hres; /* check if the argument is a local file */ @@ -399,19 +400,7 @@ static IUri *convert_file_uri(IUri *uri) WINE_TRACE("New path: %s\n", wine_dbgstr_w(new_path)); - hres = CreateIUriBuilder(uri, 0, 0, &uri_builder); - if(SUCCEEDED(hres) && new_path) - hres = IUriBuilder_SetPath(uri_builder, new_path); - HeapFree(GetProcessHeap(), 0, new_path); - if(FAILED(hres)) - return NULL; - - hres = IUriBuilder_CreateUri(uri_builder, 0, 0, 0, &new_uri); - IUriBuilder_Release(uri_builder); - if(FAILED(hres)) - return NULL; - - return new_uri; + return new_path; } /***************************************************************************** @@ -423,7 +412,7 @@ int wmain(int argc, WCHAR *argv[]) static const WCHAR nohomeW[] = {'-','n','o','h','o','m','e',0}; WCHAR *url = argv[1]; - BSTR display_uri; + BSTR display_uri = NULL; DWORD scheme; IUri *uri; HRESULT hres; @@ -451,18 +440,14 @@ int wmain(int argc, WCHAR *argv[]) IUri_GetScheme(uri, &scheme); if(scheme == URL_SCHEME_FILE) { - IUri *file_uri; - - file_uri = convert_file_uri(uri); - if(file_uri) { - IUri_Release(uri); - uri = file_uri; - }else { + display_uri = convert_file_uri(uri); + if(!display_uri) { WINE_ERR("Failed to convert file URL to unix path\n"); } } - hres = IUri_GetDisplayUri(uri, &display_uri); + if (!display_uri) + hres = IUri_GetDisplayUri(uri, &display_uri); IUri_Release(uri); if(FAILED(hres)) return -1;
1
0
0
0
Vincent Povirk : winebrowser: Add traces for file uri conversion steps.
by Alexandre Julliard
02 Jul '14
02 Jul '14
Module: wine Branch: master Commit: c5f000632f75010739c0b7c21e85c368e8a1c9ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5f000632f75010739c0b7c21…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue Jul 1 11:37:39 2014 -0500 winebrowser: Add traces for file uri conversion steps. --- programs/winebrowser/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c index 6ce7707..6938e1e 100644 --- a/programs/winebrowser/main.c +++ b/programs/winebrowser/main.c @@ -383,9 +383,12 @@ static IUri *convert_file_uri(IUri *uri) if(FAILED(hres)) return NULL; + WINE_TRACE("Windows path: %s\n", wine_dbgstr_w(filename)); + unixpath = wine_get_unix_file_name_ptr(filename); SysFreeString(filename); if(unixpath && stat(unixpath, &dummy) >= 0) { + WINE_TRACE("Unix path: %s\n", wine_dbgstr_a(unixpath)); new_path = encode_unix_path(unixpath); HeapFree(GetProcessHeap(), 0, unixpath); }else { @@ -394,6 +397,8 @@ static IUri *convert_file_uri(IUri *uri) new_path = NULL; } + WINE_TRACE("New path: %s\n", wine_dbgstr_w(new_path)); + hres = CreateIUriBuilder(uri, 0, 0, &uri_builder); if(SUCCEEDED(hres) && new_path) hres = IUriBuilder_SetPath(uri_builder, new_path);
1
0
0
0
Vincent Povirk : winebrowser: Manually percent-encode file: paths for unix filenames.
by Alexandre Julliard
02 Jul '14
02 Jul '14
Module: wine Branch: master Commit: ee17213f37da3b869b79cab6cfa1e039d8db13da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee17213f37da3b869b79cab6c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Jun 27 15:44:32 2014 -0500 winebrowser: Manually percent-encode file: paths for unix filenames. --- programs/winebrowser/main.c | 60 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c index 22f3a93..6ce7707 100644 --- a/programs/winebrowser/main.c +++ b/programs/winebrowser/main.c @@ -309,6 +309,59 @@ done: return ret; } +static WCHAR *encode_unix_path(const char *src) +{ + int len = 1; + const char *tmp_src; + WCHAR *dst, *tmp_dst; + const char safe_chars[] = "/-_.~@&=+$,:"; + const char hex_digits[] = "0123456789ABCDEF"; + + tmp_src = src; + + while (*tmp_src != 0) + { + if ((*tmp_src >= 'a' && *tmp_src <= 'z') || + (*tmp_src >= 'A' && *tmp_src <= 'Z') || + (*tmp_src >= '0' && *tmp_src <= '9') || + strchr(safe_chars, *tmp_src)) + len += 1; + else + len += 3; + tmp_src++; + } + + dst = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + + if (!dst) + return NULL; + + tmp_src = src; + tmp_dst = dst; + + while (*tmp_src != 0) + { + if ((*tmp_src >= 'a' && *tmp_src <= 'z') || + (*tmp_src >= 'A' && *tmp_src <= 'Z') || + (*tmp_src >= '0' && *tmp_src <= '9') || + strchr(safe_chars, *tmp_src)) + { + *tmp_dst++ = *tmp_src; + } + else + { + *tmp_dst++ = '%'; + *tmp_dst++ = hex_digits[*(unsigned char*)(tmp_src) / 16]; + *tmp_dst++ = hex_digits[*tmp_src & 0xf]; + } + tmp_src++; + } + + *tmp_dst = 0; + + return dst; +} + static IUri *convert_file_uri(IUri *uri) { wine_get_unix_file_name_t wine_get_unix_file_name_ptr; @@ -333,12 +386,7 @@ static IUri *convert_file_uri(IUri *uri) unixpath = wine_get_unix_file_name_ptr(filename); SysFreeString(filename); if(unixpath && stat(unixpath, &dummy) >= 0) { - int len; - - len = MultiByteToWideChar(CP_UNIXCP, 0, unixpath, -1, NULL, 0); - new_path = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - if(new_path) - MultiByteToWideChar(CP_UNIXCP, 0, unixpath, -1, new_path, len); + new_path = encode_unix_path(unixpath); HeapFree(GetProcessHeap(), 0, unixpath); }else { WINE_WARN("File %s does not exist\n", wine_dbgstr_a(unixpath));
1
0
0
0
Nikolay Sivov : advapi32: Implement RegSetKeyValue().
by Alexandre Julliard
02 Jul '14
02 Jul '14
Module: wine Branch: master Commit: 7041b4db8539db28b06bb873c07f3a3006eca41a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7041b4db8539db28b06bb873c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jul 2 21:23:27 2014 +0400 advapi32: Implement RegSetKeyValue(). --- dlls/advapi32/advapi32.spec | 4 +-- dlls/advapi32/registry.c | 77 ++++++++++++++++++++++++++---------------- dlls/advapi32/tests/registry.c | 33 ++++++++++++++++++ include/winreg.h | 2 ++ 4 files changed, 85 insertions(+), 31 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 0efdc2c..b4bf440 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -645,8 +645,8 @@ # @ stub RegSaveKeyExW @ stdcall RegSaveKeyW(long ptr ptr) @ stdcall RegSetKeySecurity(long long ptr) -# @ stub RegSetKeyValueA -# @ stub RegSetKeyValueW +@ stdcall RegSetKeyValueA(long str str long ptr long) +@ stdcall RegSetKeyValueW(long wstr wstr long ptr long) @ stdcall RegSetValueA(long str long ptr long) @ stdcall RegSetValueExA(long str long long ptr long) @ stdcall RegSetValueExW(long wstr long long ptr long) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index c7ba3ef..d568ae0 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -1276,61 +1276,80 @@ LSTATUS WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD typ * Sets the data for the default or unnamed value of a reg key. * * PARAMS - * hKey [I] Handle to an open key. - * lpSubKey [I] Name of a subkey of hKey. - * dwType [I] Type of information to store. - * lpData [I] String that contains the data to set for the default value. - * cbData [I] Ignored. + * hkey [I] Handle to an open key. + * subkey [I] Name of a subkey of hKey. + * type [I] Type of information to store. + * data [I] String that contains the data to set for the default value. + * count [I] Ignored. * * RETURNS * Success: ERROR_SUCCESS * Failure: nonzero error code from Winerror.h */ -LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR name, DWORD type, LPCWSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR subkey, DWORD type, LPCWSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(name), type, debugstr_w(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(subkey), type, debugstr_w(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ - { - if ((ret = RegCreateKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; - } - - ret = RegSetValueExW( subkey, NULL, 0, REG_SZ, (const BYTE*)data, - (strlenW( data ) + 1) * sizeof(WCHAR) ); - if (subkey != hkey) RegCloseKey( subkey ); - return ret; + return RegSetKeyValueW( hkey, subkey, NULL, type, data, (strlenW(data) + 1)*sizeof(WCHAR) ); } - /****************************************************************************** * RegSetValueA [ADVAPI32.@] * * See RegSetValueW. */ -LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR subkey, DWORD type, LPCSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(name), type, debugstr_a(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(subkey), type, debugstr_a(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ + return RegSetKeyValueA( hkey, subkey, NULL, type, data, strlen(data) + 1 ); +} + +/****************************************************************************** + * RegSetKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ { - if ((ret = RegCreateKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; + if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; } - ret = RegSetValueExA( subkey, NULL, 0, REG_SZ, (const BYTE*)data, strlen(data)+1 ); - if (subkey != hkey) RegCloseKey( subkey ); + + ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); return ret; } +/****************************************************************************** + * RegSetKeyValueA [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_a(subkey), debugstr_a(name), type, data, len ); + if (subkey && subkey[0]) /* need to create the subkey */ + { + if ((ret = RegCreateKeyA( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; + } + + ret = RegSetValueExA( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} /****************************************************************************** * RegQueryValueExW [ADVAPI32.@] diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 7c4db40..0626aff 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -48,6 +48,7 @@ static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE); static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(UNICODE_STRING*); static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING); static LONG (WINAPI *pRegDeleteKeyValueA)(HKEY,LPCSTR,LPCSTR); +static LONG (WINAPI *pRegSetKeyValueW)(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); static BOOL limited_user; @@ -137,6 +138,7 @@ static void InitFunctionPtrs(void) ADVAPI32_GET_PROC(RegDeleteTreeA); ADVAPI32_GET_PROC(RegDeleteKeyExA); ADVAPI32_GET_PROC(RegDeleteKeyValueA); + ADVAPI32_GET_PROC(RegSetKeyValueW); pIsWow64Process = (void *)GetProcAddress( hkernel32, "IsWow64Process" ); pRtlFormatCurrentUserKeyPath = (void *)GetProcAddress( hntdll, "RtlFormatCurrentUserKeyPath" ); @@ -433,6 +435,37 @@ static void test_set_value(void) ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); ret = RegSetValueExW(hkey_main, name2W, 0, REG_DWORD, (const BYTE *)1, 1); ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); + + /* RegSetKeyValue */ + if (!pRegSetKeyValueW) + win_skip("RegSetKeyValue() is not supported.\n"); + else + { + static const WCHAR subkeyW[] = {'s','u','b','k','e','y',0}; + DWORD len, type; + HKEY subkey; + + ret = pRegSetKeyValueW(hkey_main, NULL, name1W, REG_SZ, (const BYTE*)string2W, sizeof(string2W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + test_hkey_main_Value_A(name1A, string2A, sizeof(string2A)); + test_hkey_main_Value_W(name1W, string2W, sizeof(string2W)); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, string1W, sizeof(string1W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegOpenKeyExW(hkey_main, subkeyW, 0, KEY_QUERY_VALUE, &subkey); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + type = len = 0; + ret = RegQueryValueExW(subkey, name1W, 0, &type, NULL, &len); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + ok(len == sizeof(string1W), "got %d\n", len); + ok(type == REG_SZ, "got type %d\n", type); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, NULL, 0); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + RegCloseKey(subkey); + } } static void create_test_entries(void) diff --git a/include/winreg.h b/include/winreg.h index 56d9650..cf6bd47 100644 --- a/include/winreg.h +++ b/include/winreg.h @@ -169,6 +169,8 @@ WINADVAPI LSTATUS WINAPI RegSaveKeyA(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES); WINADVAPI LSTATUS WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES); #define RegSaveKey WINELIB_NAME_AW(RegSaveKey) WINADVAPI LSTATUS WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); +WINADVAPI LSTATUS WINAPI RegSetKeyValueA(HKEY,LPCSTR,LPCSTR,DWORD,const void*,DWORD); +WINADVAPI LSTATUS WINAPI RegSetKeyValueW(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); WINADVAPI LSTATUS WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD); WINADVAPI LSTATUS WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD); #define RegSetValue WINELIB_NAME_AW(RegSetValue)
1
0
0
0
Zhenbo Li : shlwapi/tests: Add tests for PathIsRelativeA/W.
by Alexandre Julliard
02 Jul '14
02 Jul '14
Module: wine Branch: master Commit: 9d59d4e5502c15703d1c6813bdab09175356b965 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d59d4e5502c15703d1c6813b…
Author: Zhenbo Li <litimetal(a)gmail.com> Date: Wed Jul 2 23:55:02 2014 +0800 shlwapi/tests: Add tests for PathIsRelativeA/W. --- dlls/shlwapi/tests/path.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index a2e5594..9fe70cd 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -36,6 +36,8 @@ static HRESULT (WINAPI *pPathCreateFromUrlAlloc)(LPCWSTR, LPWSTR*, DWORD); static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR); static BOOL (WINAPI *pPathUnExpandEnvStringsA)(LPCSTR, LPSTR, UINT); static BOOL (WINAPI *pPathUnExpandEnvStringsW)(LPCWSTR, LPWSTR, UINT); +static BOOL (WINAPI *pPathIsRelativeA)(LPCSTR); +static BOOL (WINAPI *pPathIsRelativeW)(LPCWSTR); /* ################ */ @@ -1585,6 +1587,62 @@ static void test_PathUnExpandEnvStrings(void) ok(!lstrcmpW(buffW, pathW), "wrong unexpanded string %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(pathW)); } +static const struct { + const char *path; + BOOL expect; +} test_path_is_relative[] = { + {NULL, TRUE}, + {"\0", TRUE}, + {"test.txt", TRUE}, + {"\\\\folder\\test.txt", FALSE}, + {"file://folder/test.txt", TRUE}, + {"C:\\test.txt", FALSE}, + {"file:///C:/test.txt", TRUE} +}; + +void test_PathIsRelativeA(void) +{ + BOOL ret; + int i, num; + + if (!pPathIsRelativeA) { + win_skip("PathIsRelativeA not available\n"); + return; + } + + num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]); + for (i = 0; i < num; i++) { + ret = pPathIsRelativeA(test_path_is_relative[i].path); + ok(ret == test_path_is_relative[i].expect, + "PathIsRelativeA(\"%s\") expects %d, got %d.\n", + test_path_is_relative[i].path, test_path_is_relative[i].expect, ret); + } +} + +void test_PathIsRelativeW(void) +{ + BOOL ret; + int i, num; + LPWSTR path; + + if (!pPathIsRelativeW) { + win_skip("PathIsRelativeA not available\n"); + return; + } + + num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]); + for (i = 0; i < num; i++) { + path = GetWideString(test_path_is_relative[i].path); + + ret = pPathIsRelativeW(path); + ok(ret == test_path_is_relative[i].expect, + "PathIsRelativeW(\"%s\") expects %d, got %d.\n", + test_path_is_relative[i].path, test_path_is_relative[i].expect, ret); + + FreeWideString(path); + } +} + START_TEST(path) { HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll"); @@ -1604,6 +1662,8 @@ START_TEST(path) pPathAppendA = (void*)GetProcAddress(hShlwapi, "PathAppendA"); pPathUnExpandEnvStringsA = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsA"); pPathUnExpandEnvStringsW = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsW"); + pPathIsRelativeA = (void*)GetProcAddress(hShlwapi, "PathIsRelativeA"); + pPathIsRelativeW = (void*)GetProcAddress(hShlwapi, "PathIsRelativeW"); test_PathSearchAndQualify(); test_PathCreateFromUrl(); @@ -1626,4 +1686,6 @@ START_TEST(path) test_PathUnquoteSpaces(); test_PathGetDriveNumber(); test_PathUnExpandEnvStrings(); + test_PathIsRelativeA(); + test_PathIsRelativeW(); }
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
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
Results per page:
10
25
50
100
200