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
November 2009
----- 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
910 discussions
Start a n
N
ew thread
Vitaliy Margolen : dinput: Fix definitions to match PSDK.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: e1d6e3b258278b0aa456e9ea7a34dcf56598298d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1d6e3b258278b0aa456e9ea7…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Sun Nov 29 21:07:17 2009 -0700 dinput: Fix definitions to match PSDK. --- dlls/dinput/dinput_main.c | 2 +- include/dinput.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 78a5e26..5b16100 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -224,7 +224,7 @@ void _dump_diactionformatA(LPDIACTIONFORMATA lpdiActionFormat) { for (i=0;i<lpdiActionFormat->dwNumActions;i++) { FIXME("diaf.rgoAction[%u]:\n", i); FIXME("\tuAppData=%lx\n", lpdiActionFormat->rgoAction[i].uAppData); - FIXME("\tdwSemantics=%x\n", lpdiActionFormat->rgoAction[i].dwSemantics); + FIXME("\tdwSemantic=%x\n", lpdiActionFormat->rgoAction[i].dwSemantic); FIXME("\tdwFlags=%x\n", lpdiActionFormat->rgoAction[i].dwFlags); FIXME("\tszActionName=%s\n", debugstr_a(lpdiActionFormat->rgoAction[i].u.lptszActionName)); FIXME("\tguidInstance=%s\n", debugstr_guid(&lpdiActionFormat->rgoAction[i].guidInstance)); diff --git a/include/dinput.h b/include/dinput.h index 8c557eb..36b385f 100644 --- a/include/dinput.h +++ b/include/dinput.h @@ -1106,7 +1106,7 @@ typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID) /* DInput 8 structures and types */ typedef struct _DIACTIONA { UINT_PTR uAppData; - DWORD dwSemantics; + DWORD dwSemantic; DWORD dwFlags; union { LPCSTR lptszActionName; @@ -1120,7 +1120,7 @@ typedef const DIACTIONA *LPCDIACTIONA; typedef struct _DIACTIONW { UINT_PTR uAppData; - DWORD dwSemantics; + DWORD dwSemantic; DWORD dwFlags; union { LPCWSTR lptszActionName;
1
0
0
0
Jacek Caban : shdocvw: Use CoTaskMemFree to free url.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: 75c71b4b9c9db31f649d1534658773e2053518af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=75c71b4b9c9db31f649d15346…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:15:36 2009 +0100 shdocvw: Use CoTaskMemFree to free url. Pointed out by Dan Kegel. --- dlls/shdocvw/dochost.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c index f3035e1..5d661fd 100644 --- a/dlls/shdocvw/dochost.c +++ b/dlls/shdocvw/dochost.c @@ -753,5 +753,5 @@ void DocHost_Release(DocHost *This) ConnectionPointContainer_Destroy(&This->cps); - SysFreeString(This->url); + CoTaskMemFree(This->url); }
1
0
0
0
Jacek Caban : wininet: Don't use INTERNET_SetLastError in HttpSendRequestW.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: 4e3eabd6fa261976296e74d3cb0c3c09e87842e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e3eabd6fa261976296e74d3c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:14:41 2009 +0100 wininet: Don't use INTERNET_SetLastError in HttpSendRequestW. --- dlls/wininet/http.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index a250cbf..e4b6f1c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3405,7 +3405,7 @@ BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, http_request_t *lpwhr; http_session_t *lpwhs = NULL; appinfo_t *hIC = NULL; - BOOL r; + DWORD res = ERROR_SUCCESS; TRACE("%p, %s, %i, %p, %i)\n", hHttpRequest, debugstr_wn(lpszHeaders, dwHeaderLength), dwHeaderLength, lpOptional, dwOptionalLength); @@ -3413,24 +3413,21 @@ BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, lpwhr = (http_request_t*) WININET_GetObject( hHttpRequest ); if (NULL == lpwhr || lpwhr->hdr.htype != WH_HHTTPREQ) { - INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - r = FALSE; + res = ERROR_INTERNET_INCORRECT_HANDLE_TYPE; goto lend; } lpwhs = lpwhr->lpHttpSession; if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) { - INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - r = FALSE; + res = ERROR_INTERNET_INCORRECT_HANDLE_TYPE; goto lend; } hIC = lpwhs->lpAppInfo; if (NULL == hIC || hIC->hdr.htype != WH_HINIT) { - INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - r = FALSE; + res = ERROR_INTERNET_INCORRECT_HANDLE_TYPE; goto lend; } @@ -3464,19 +3461,23 @@ BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, /* * This is from windows. */ - INTERNET_SetLastError(ERROR_IO_PENDING); - r = FALSE; + res = ERROR_IO_PENDING; } else { - r = HTTP_HttpSendRequestW(lpwhr, lpszHeaders, + BOOL r = HTTP_HttpSendRequestW(lpwhr, lpszHeaders, dwHeaderLength, lpOptional, dwOptionalLength, dwOptionalLength, TRUE); + if(!r) + res = INTERNET_GetLastError(); } lend: if( lpwhr ) WININET_Release( &lpwhr->hdr ); - return r; + + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } /***********************************************************************
1
0
0
0
Jacek Caban : wininet: Directly return error status from NETCON_close.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: c55d0a8516f4faaa2b0e14d935e303e62b4ad7ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c55d0a8516f4faaa2b0e14d93…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:14:25 2009 +0100 wininet: Directly return error status from NETCON_close. --- dlls/wininet/internet.h | 2 +- dlls/wininet/netconnection.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index e1044e9..04a4a65 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -432,7 +432,7 @@ BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL); void NETCON_unload(void); DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, int type, int protocol); -BOOL NETCON_close(WININET_NETCONNECTION *connection); +DWORD NETCON_close(WININET_NETCONNECTION *connection); DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, unsigned int addrlen); DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname); diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 64513ac..36599e9 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -404,11 +404,11 @@ DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, * NETCON_close * Basically calls 'close()' unless we should use SSL */ -BOOL NETCON_close(WININET_NETCONNECTION *connection) +DWORD NETCON_close(WININET_NETCONNECTION *connection) { int result; - if (!NETCON_connected(connection)) return FALSE; + if (!NETCON_connected(connection)) return ERROR_SUCCESS; #ifdef SONAME_LIBSSL if (connection->useSSL) @@ -425,11 +425,8 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection) connection->socketFD = -1; if (result == -1) - { - INTERNET_SetLastError(sock_get_error(errno)); - return FALSE; - } - return TRUE; + return sock_get_error(errno); + return ERROR_SUCCESS; } #ifdef SONAME_LIBSSL static BOOL check_hostname(X509 *cert, char *hostname)
1
0
0
0
Jacek Caban : wininet: Directly return error status from HTTP_OpenConnection.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: 36cb1ef3d38835c110f5ea71057b3e1e2f7b6e4a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=36cb1ef3d38835c110f5ea710…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:14:02 2009 +0100 wininet: Directly return error status from HTTP_OpenConnection. --- dlls/wininet/http.c | 62 ++++++++++++++++++++++---------------------------- 1 files changed, 27 insertions(+), 35 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index f2d09c1..a250cbf 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -198,7 +198,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug = }; static CRITICAL_SECTION authcache_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; -static BOOL HTTP_OpenConnection(http_request_t *req); +static DWORD HTTP_OpenConnection(http_request_t *req); static BOOL HTTP_GetResponseHeaders(http_request_t *req, BOOL clear); static BOOL HTTP_ProcessHeader(http_request_t *req, LPCWSTR field, LPCWSTR value, DWORD dwModifier); static LPWSTR * HTTP_InterpretHttpHeader(LPCWSTR buffer); @@ -1610,7 +1610,7 @@ static BOOL HTTP_DealWithProxy(appinfo_t *hIC, http_session_t *lpwhs, http_reque #define INET6_ADDRSTRLEN 46 #endif -static BOOL HTTP_ResolveName(http_request_t *lpwhr) +static DWORD HTTP_ResolveName(http_request_t *lpwhr) { char szaddr[INET6_ADDRSTRLEN]; http_session_t *lpwhs = lpwhr->lpHttpSession; @@ -1624,10 +1624,7 @@ static BOOL HTTP_ResolveName(http_request_t *lpwhr) lpwhs->sa_len = sizeof(lpwhs->socketAddress); if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort, (struct sockaddr *)&lpwhs->socketAddress, &lpwhs->sa_len)) - { - INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED); - return FALSE; - } + return ERROR_INTERNET_NAME_NOT_RESOLVED; switch (lpwhs->socketAddress.ss_family) { @@ -1639,8 +1636,7 @@ static BOOL HTTP_ResolveName(http_request_t *lpwhr) break; default: WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family); - INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED); - return FALSE; + return ERROR_INTERNET_NAME_NOT_RESOLVED; } inet_ntop(lpwhs->socketAddress.ss_family, addr, szaddr, sizeof(szaddr)); INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, @@ -1648,7 +1644,7 @@ static BOOL HTTP_ResolveName(http_request_t *lpwhr) szaddr, strlen(szaddr)+1); TRACE("resolved %s to %s\n", debugstr_w(lpwhs->lpszServerName), szaddr); - return TRUE; + return ERROR_SUCCESS; } @@ -3680,12 +3676,17 @@ static BOOL HTTP_HandleRedirect(http_request_t *lpwhr, LPCWSTR lpszUrl) { if (strcmpiW(lpwhs->lpszServerName, hostName) || lpwhs->nServerPort != urlComponents.nPort) { + DWORD res; + HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); lpwhs->lpszServerName = heap_strdupW(hostName); lpwhs->nServerPort = urlComponents.nPort; NETCON_close(&lpwhr->netConnection); - if (!HTTP_ResolveName(lpwhr)) return FALSE; + if ((res = HTTP_ResolveName(lpwhr)) != ERROR_SUCCESS) { + INTERNET_SetLastError(res); + return FALSE; + } if (!NETCON_init(&lpwhr->netConnection, lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) return FALSE; lpwhr->read_pos = lpwhr->read_size = 0; lpwhr->read_chunked = FALSE; @@ -3749,7 +3750,7 @@ static LPWSTR HTTP_build_req( LPCWSTR *list, int len ) return str; } -static BOOL HTTP_SecureProxyConnect(http_request_t *lpwhr) +static DWORD HTTP_SecureProxyConnect(http_request_t *lpwhr) { LPWSTR lpszPath; LPWSTR requestString; @@ -3781,16 +3782,14 @@ static BOOL HTTP_SecureProxyConnect(http_request_t *lpwhr) res = NETCON_send( &lpwhr->netConnection, ascii_req, len, 0, &cnt ); HeapFree( GetProcessHeap(), 0, ascii_req ); - if (res != ERROR_SUCCESS || cnt < 0) { - INTERNET_SetLastError(res); - return FALSE; - } + if (res != ERROR_SUCCESS) + return res; responseLen = HTTP_GetResponseHeaders( lpwhr, TRUE ); if (!responseLen) - return FALSE; + return ERROR_HTTP_INVALID_HEADER; - return TRUE; + return ERROR_SUCCESS; } static void HTTP_InsertCookies(http_request_t *lpwhr) @@ -3847,6 +3846,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, static const WCHAR szContentLength[] = { 'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','l','i','\r','\n',0 }; WCHAR contentLengthStr[sizeof szContentLength/2 /* includes \r\n */ + 20 /* int */ ]; + DWORD res; TRACE("--> %p\n", lpwhr); @@ -3936,8 +3936,10 @@ BOOL WINAPI HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, TRACE("Request header -> %s\n", debugstr_w(requestString) ); /* Send the request and store the results */ - if (!HTTP_OpenConnection(lpwhr)) + if ((res = HTTP_OpenConnection(lpwhr)) != ERROR_SUCCESS) { + INTERNET_SetLastError(res); goto lend; + } /* send the request as ASCII, tack on the optional data */ if (!lpOptional || redirected) @@ -4310,9 +4312,8 @@ lerror: * TRUE on success * FALSE on failure */ -static BOOL HTTP_OpenConnection(http_request_t *lpwhr) +static DWORD HTTP_OpenConnection(http_request_t *lpwhr) { - BOOL bSuccess = FALSE; http_session_t *lpwhs; appinfo_t *hIC = NULL; char szaddr[INET6_ADDRSTRLEN]; @@ -4324,16 +4325,13 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) if (lpwhr->hdr.htype != WH_HHTTPREQ) { - INTERNET_SetLastError(ERROR_INVALID_PARAMETER); + res = ERROR_INVALID_PARAMETER; goto lend; } if (NETCON_connected(&lpwhr->netConnection)) - { - bSuccess = TRUE; goto lend; - } - if (!HTTP_ResolveName(lpwhr)) goto lend; + if ((res = HTTP_ResolveName(lpwhr)) != ERROR_SUCCESS) goto lend; lpwhs = lpwhr->lpHttpSession; @@ -4348,8 +4346,7 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) break; default: WARN("unsupported family %d\n", lpwhs->socketAddress.ss_family); - INTERNET_SetLastError(ERROR_INTERNET_NAME_NOT_RESOLVED); - return FALSE; + return ERROR_INTERNET_NAME_NOT_RESOLVED; } inet_ntop(lpwhs->socketAddress.ss_family, addr, szaddr, sizeof(szaddr)); INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, @@ -4377,7 +4374,7 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) * behaviour to be more correct and to not cause any incompatibilities * because using a secure connection through a proxy server is a rare * case that would be hard for anyone to depend on */ - if (hIC->lpszProxy && !HTTP_SecureProxyConnect(lpwhr)) + if (hIC->lpszProxy && (res = HTTP_SecureProxyConnect(lpwhr)) != ERROR_SUCCESS) goto lend; res = NETCON_secure_connect(&lpwhr->netConnection, lpwhs->lpszHostName); @@ -4392,17 +4389,12 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) INTERNET_STATUS_CONNECTED_TO_SERVER, szaddr, strlen(szaddr)+1); - bSuccess = TRUE; - lend: lpwhr->read_pos = lpwhr->read_size = 0; lpwhr->read_chunked = FALSE; - if(res != ERROR_SUCCESS) - INTERNET_SetLastError(res); - - TRACE("%d <--\n", bSuccess); - return bSuccess; + TRACE("%d <--\n", res); + return res; }
1
0
0
0
Jacek Caban : wininet: Directly return error status from WriteFile implementations.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: 1ee3ad476e3af49cdc747e146e0c820bb2b79caa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ee3ad476e3af49cdc747e146…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:13:39 2009 +0100 wininet: Directly return error status from WriteFile implementations. --- dlls/wininet/ftp.c | 4 ++-- dlls/wininet/http.c | 6 ++---- dlls/wininet/internet.c | 11 ++++++----- dlls/wininet/internet.h | 3 ++- dlls/wininet/netconnection.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index f0c3cbd..338f743 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -1156,7 +1156,7 @@ static DWORD FTPFILE_ReadFileExW(object_header_t *hdr, INTERNET_BUFFERSW *buffer return FTPFILE_ReadFile(hdr, buffers->lpvBuffer, buffers->dwBufferLength, &buffers->dwBufferLength); } -static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) +static DWORD FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) { ftp_file_t *lpwh = (ftp_file_t*) hdr; int res; @@ -1164,7 +1164,7 @@ static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD si res = send(lpwh->nDataSocket, buffer, size, 0); *written = res>0 ? res : 0; - return res >= 0; + return res >= 0 ? ERROR_SUCCESS : sock_get_error(errno); } static void FTP_ReceiveRequestData(ftp_file_t *file, BOOL first_notif) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index b23fc18..f2d09c1 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -2489,7 +2489,7 @@ done: return res; } -static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) +static DWORD HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) { DWORD res; http_request_t *lpwhr = (http_request_t*)hdr; @@ -2500,11 +2500,9 @@ static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD si res = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written); if (res == ERROR_SUCCESS) lpwhr->dwBytesWritten += *written; - else - SetLastError(res); INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_REQUEST_SENT, written, sizeof(DWORD)); - return res == ERROR_SUCCESS; + return res; } static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 65bb3d2..c13f44a 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1862,7 +1862,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten) { object_header_t *lpwh; - BOOL retval = FALSE; + BOOL res; TRACE("(%p %p %d %p)\n", hFile, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten); @@ -1874,16 +1874,17 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, } if(lpwh->vtbl->WriteFile) { - retval = lpwh->vtbl->WriteFile(lpwh, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten); + res = lpwh->vtbl->WriteFile(lpwh, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten); }else { WARN("No Writefile method.\n"); - SetLastError(ERROR_INVALID_HANDLE); - retval = FALSE; + res = ERROR_INVALID_HANDLE; } WININET_Release( lpwh ); - return retval; + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index f87e719..e1044e9 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -143,7 +143,7 @@ typedef struct { DWORD (*ReadFile)(object_header_t*,void*,DWORD,DWORD*); DWORD (*ReadFileExA)(object_header_t*,INTERNET_BUFFERSA*,DWORD,DWORD_PTR); DWORD (*ReadFileExW)(object_header_t*,INTERNET_BUFFERSW*,DWORD,DWORD_PTR); - BOOL (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*); + DWORD (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*); DWORD (*QueryDataAvailable)(object_header_t*,DWORD*,DWORD,DWORD_PTR); DWORD (*FindNextFileW)(object_header_t*,void*); } object_vtbl_t; @@ -443,6 +443,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available); LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection); DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value); +int sock_get_error(int); extern void URLCacheContainers_CreateDefaults(void); extern void URLCacheContainers_DeleteAll(void); diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index ca31d0e..64513ac 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -315,7 +315,7 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection) } /* translate a unix error code into a winsock one */ -static int sock_get_error( int err ) +int sock_get_error( int err ) { #if !defined(__MINGW32__) && !defined (_MSC_VER) switch (err)
1
0
0
0
Jacek Caban : wininet: Dorectly return error status from NETCON_secure_connect and NETCON_send.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: b77868cbfd9f2faeac7934a46919db5354dc8013 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b77868cbfd9f2faeac7934a46…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:13:21 2009 +0100 wininet: Dorectly return error status from NETCON_secure_connect and NETCON_send. --- dlls/wininet/http.c | 20 +++++++++++++------- dlls/wininet/internet.h | 4 ++-- dlls/wininet/netconnection.c | 38 ++++++++++++++++++-------------------- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 99abc3a..b23fc18 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -2491,17 +2491,20 @@ done: static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD size, DWORD *written) { - BOOL ret; + DWORD res; http_request_t *lpwhr = (http_request_t*)hdr; INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_SENDING_REQUEST, NULL, 0); *written = 0; - if ((ret = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written))) + res = NETCON_send(&lpwhr->netConnection, buffer, size, 0, (LPINT)written); + if (res == ERROR_SUCCESS) lpwhr->dwBytesWritten += *written; + else + SetLastError(res); INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_REQUEST_SENT, written, sizeof(DWORD)); - return ret; + return res == ERROR_SUCCESS; } static void HTTPREQ_AsyncQueryDataAvailableProc(WORKREQUEST *workRequest) @@ -3756,7 +3759,7 @@ static BOOL HTTP_SecureProxyConnect(http_request_t *lpwhr) INT cnt; INT responseLen; char *ascii_req; - BOOL ret; + DWORD res; static const WCHAR szConnect[] = {'C','O','N','N','E','C','T',0}; static const WCHAR szFormat[] = {'%','s',':','%','d',0}; http_session_t *lpwhs = lpwhr->lpHttpSession; @@ -3778,10 +3781,12 @@ static BOOL HTTP_SecureProxyConnect(http_request_t *lpwhr) TRACE("full request -> %s\n", debugstr_an( ascii_req, len ) ); - ret = NETCON_send( &lpwhr->netConnection, ascii_req, len, 0, &cnt ); + res = NETCON_send( &lpwhr->netConnection, ascii_req, len, 0, &cnt ); HeapFree( GetProcessHeap(), 0, ascii_req ); - if (!ret || cnt < 0) + if (res != ERROR_SUCCESS || cnt < 0) { + INTERNET_SetLastError(res); return FALSE; + } responseLen = HTTP_GetResponseHeaders( lpwhr, TRUE ); if (!responseLen) @@ -4377,7 +4382,8 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) if (hIC->lpszProxy && !HTTP_SecureProxyConnect(lpwhr)) goto lend; - if (!NETCON_secure_connect(&lpwhr->netConnection, lpwhs->lpszHostName)) + res = NETCON_secure_connect(&lpwhr->netConnection, lpwhs->lpszHostName); + if(res != ERROR_SUCCESS) { WARN("Couldn't connect securely to host\n"); goto lend; diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index b665874..f87e719 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -435,8 +435,8 @@ DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, BOOL NETCON_close(WININET_NETCONNECTION *connection); DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, unsigned int addrlen); -BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname); -BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, +DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname); +DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, int *sent /* out */); BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags, int *recvd /* out */); diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 1e4fc35..ca31d0e 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -442,8 +442,9 @@ static BOOL check_hostname(X509 *cert, char *hostname) * NETCON_secure_connect * Initiates a secure connection over an existing plaintext connection. */ -BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) +DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) { + DWORD res = ERROR_NOT_SUPPORTED; #ifdef SONAME_LIBSSL long verify_res; X509 *cert; @@ -454,7 +455,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) if (connection->useSSL) { ERR("already connected\n"); - return FALSE; + return ERROR_INTERNET_CANNOT_CONNECT; } connection->ssl_s = pSSL_new(ctx); @@ -462,7 +463,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) { ERR("SSL_new failed: %s\n", pERR_error_string(pERR_get_error(), 0)); - INTERNET_SetLastError(ERROR_OUTOFMEMORY); + res = ERROR_OUTOFMEMORY; goto fail; } @@ -470,7 +471,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) { ERR("SSL_set_fd failed: %s\n", pERR_error_string(pERR_get_error(), 0)); - INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); + res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR; goto fail; } @@ -478,7 +479,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) { ERR("SSL_connect failed: %s\n", pERR_error_string(pERR_get_error(), 0)); - INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); + res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR; goto fail; } cert = pSSL_get_peer_certificate(connection->ssl_s); @@ -486,7 +487,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) { ERR("no certificate for server %s\n", debugstr_w(hostname)); /* FIXME: is this the best error? */ - INTERNET_SetLastError(ERROR_INTERNET_INVALID_CA); + res = ERROR_INTERNET_INVALID_CA; goto fail; } verify_res = pSSL_get_verify_result(connection->ssl_s); @@ -501,7 +502,7 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) hostname_unix = HeapAlloc(GetProcessHeap(), 0, len); if (!hostname_unix) { - INTERNET_SetLastError(ERROR_OUTOFMEMORY); + res = ERROR_OUTOFMEMORY; goto fail; } WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, hostname_unix, len, NULL, NULL); @@ -509,13 +510,13 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) if (!check_hostname(cert, hostname_unix)) { HeapFree(GetProcessHeap(), 0, hostname_unix); - INTERNET_SetLastError(ERROR_INTERNET_SEC_CERT_CN_INVALID); + res = ERROR_INTERNET_SEC_CERT_CN_INVALID; goto fail; } HeapFree(GetProcessHeap(), 0, hostname_unix); connection->useSSL = TRUE; - return TRUE; + return ERROR_SUCCESS; fail: if (connection->ssl_s) @@ -525,7 +526,7 @@ fail: connection->ssl_s = NULL; } #endif - return FALSE; + return res; } /****************************************************************************** @@ -555,19 +556,16 @@ DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *s * Basically calls 'send()' unless we should use SSL * number of chars send is put in *sent */ -BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, +DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, int *sent /* out */) { - if (!NETCON_connected(connection)) return FALSE; + if (!NETCON_connected(connection)) return ERROR_INTERNET_CONNECTION_ABORTED; if (!connection->useSSL) { *sent = send(connection->socketFD, msg, len, flags); if (*sent == -1) - { - INTERNET_SetLastError(sock_get_error(errno)); - return FALSE; - } - return TRUE; + return sock_get_error(errno); + return ERROR_SUCCESS; } else { @@ -576,10 +574,10 @@ BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, FIXME("SSL_write doesn't support any flags (%08x)\n", flags); *sent = pSSL_write(connection->ssl_s, msg, len); if (*sent < 1 && len) - return FALSE; - return TRUE; + return ERROR_INTERNET_CONNECTION_ABORTED; + return ERROR_SUCCESS; #else - return FALSE; + return ERROR_NOT_SUPPORTED; #endif } }
1
0
0
0
Jacek Caban : wininet: Directly return error status from NETCON_connect.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: bf1da4c857d54cba305deb1c71c2b184e4bc06e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf1da4c857d54cba305deb1c7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:12:59 2009 +0100 wininet: Directly return error status from NETCON_connect. --- dlls/wininet/http.c | 5 +++-- dlls/wininet/internet.h | 2 +- dlls/wininet/netconnection.c | 9 +++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index c7e4d59..99abc3a 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4361,8 +4361,9 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) goto lend; } - if (!NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress, - lpwhs->sa_len)) + res = NETCON_connect(&lpwhr->netConnection, (struct sockaddr *)&lpwhs->socketAddress, + lpwhs->sa_len); + if(res != ERROR_SUCCESS) goto lend; if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index adebaf6..b665874 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -433,7 +433,7 @@ void NETCON_unload(void); DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, int type, int protocol); BOOL NETCON_close(WININET_NETCONNECTION *connection); -BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, +DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, unsigned int addrlen); BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname); BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 7ab33ae..1e4fc35 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -532,25 +532,22 @@ fail: * NETCON_connect * Connects to the specified address. */ -BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, +DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, unsigned int addrlen) { int result; - if (!NETCON_connected(connection)) return FALSE; - result = connect(connection->socketFD, serv_addr, addrlen); if (result == -1) { WARN("Unable to connect to host (%s)\n", strerror(errno)); - INTERNET_SetLastError(sock_get_error(errno)); closesocket(connection->socketFD); connection->socketFD = -1; - return FALSE; + return sock_get_error(errno); } - return TRUE; + return ERROR_SUCCESS; } /******************************************************************************
1
0
0
0
Jacek Caban : wininet: Directly return error status from NETCON_create.
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: cff77d602c40f377c36cfe06546810cebc10c37e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cff77d602c40f377c36cfe065…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Nov 30 00:12:42 2009 +0100 wininet: Directly return error status from NETCON_create. --- dlls/wininet/http.c | 10 +++++++--- dlls/wininet/internet.h | 2 +- dlls/wininet/netconnection.c | 12 +++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 3603761..c7e4d59 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4314,6 +4314,7 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) appinfo_t *hIC = NULL; char szaddr[INET6_ADDRSTRLEN]; const void *addr; + DWORD res = ERROR_SUCCESS; TRACE("-->\n"); @@ -4353,10 +4354,10 @@ static BOOL HTTP_OpenConnection(http_request_t *lpwhr) szaddr, strlen(szaddr)+1); - if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.ss_family, - SOCK_STREAM, 0)) + res = NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.ss_family, SOCK_STREAM, 0); + if (res != ERROR_SUCCESS) { - WARN("Socket creation failed: %u\n", INTERNET_GetLastError()); + WARN("Socket creation failed: %u\n", res); goto lend; } @@ -4392,6 +4393,9 @@ lend: lpwhr->read_pos = lpwhr->read_size = 0; lpwhr->read_chunked = FALSE; + if(res != ERROR_SUCCESS) + INTERNET_SetLastError(res); + TRACE("%d <--\n", bSuccess); return bSuccess; } diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 75568fa..adebaf6 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -430,7 +430,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, BOOL NETCON_connected(WININET_NETCONNECTION *connection); BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL); void NETCON_unload(void); -BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain, +DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, int type, int protocol); BOOL NETCON_close(WININET_NETCONNECTION *connection); BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 16cce40..7ab33ae 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -385,21 +385,19 @@ static int sock_get_error( int err ) * NETCON_create * Basically calls 'socket()' */ -BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain, +DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain, int type, int protocol) { #ifdef SONAME_LIBSSL if (connection->useSSL) - return FALSE; + return ERROR_NOT_SUPPORTED; #endif connection->socketFD = socket(domain, type, protocol); if (connection->socketFD == -1) - { - INTERNET_SetLastError(sock_get_error(errno)); - return FALSE; - } - return TRUE; + return sock_get_error(errno); + + return ERROR_SUCCESS; } /******************************************************************************
1
0
0
0
Rob Shearman : ole32: Cope with double quotes in paths for libraries to be loaded from the registry .
by Alexandre Julliard
30 Nov '09
30 Nov '09
Module: wine Branch: master Commit: 510ed24f9acfa28975d559f6b022721d44b7aea9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=510ed24f9acfa28975d559f6b…
Author: Rob Shearman <robertshearman(a)gmail.com> Date: Sun Nov 29 20:38:28 2009 +0000 ole32: Cope with double quotes in paths for libraries to be loaded from the registry. --- dlls/ole32/compobj.c | 10 ++++++++++ dlls/ole32/tests/marshal.c | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 321f2e9..58e8f0d 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -828,6 +828,16 @@ static DWORD COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *v if (keytype == REG_EXPAND_SZ) { if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA; } else { + const WCHAR *quote_start; + quote_start = strchrW(src, '\"'); + if (quote_start) { + const WCHAR *quote_end = strchrW(quote_start + 1, '\"'); + if (quote_end) { + memmove(src, quote_start + 1, + (quote_end - quote_start - 1) * sizeof(WCHAR)); + src[quote_end - quote_start - 1] = '\0'; + } + } lstrcpynW(dst, src, dstlen); } } diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index b4a2384..1ef9790 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -2293,7 +2293,7 @@ static void reg_unreg_wine_test_class(BOOL Register) { error = RegCreateKeyEx(HKEY_CLASSES_ROOT, buffer, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, &dwDisposition); ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %d\n", error); - error = RegSetValueEx(hkey, NULL, 0, REG_SZ, (const unsigned char *)"ole32.dll", strlen("ole32.dll") + 1); + error = RegSetValueEx(hkey, NULL, 0, REG_SZ, (const unsigned char *)"\"ole32.dll\" \"a\"", strlen("\"ole32.dll\" \"a\"") + 1); ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %d\n", error); RegCloseKey(hkey); }
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
91
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
Results per page:
10
25
50
100
200