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 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
2 participants
892 discussions
Start a n
N
ew thread
Seth Shelnutt : wined3d: Nvidia Geforce 8400 and 8500 are now reported as 8400GS instead of 8300GS.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: b5a5db910f3db869a1d2587dd957a4215a3e057c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5a5db910f3db869a1d2587dd…
Author: Seth Shelnutt <Shelnutt2(a)gmail.com> Date: Mon Jul 12 22:56:37 2010 +0000 wined3d: Nvidia Geforce 8400 and 8500 are now reported as 8400GS instead of 8300GS. --- dlls/wined3d/directx.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 268fee1..0c4e994 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1009,6 +1009,7 @@ static const struct driver_version_information driver_version_table[] = {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7600, "NVIDIA GeForce 7600 GT", 15, 11, 9745 }, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7800GT, "NVIDIA GeForce 7800 GT", 15, 11, 9745 }, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8300GS, "NVIDIA GeForce 8300 GS", 15, 11, 9745 }, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8400GS, "NVIDIA GeForce 8400 GS", 15, 11, 9745 }, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600GT, "NVIDIA GeForce 8600 GT", 15, 11, 9745 }, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600MGT, "NVIDIA GeForce 8600M GT", 15, 11, 9745 }, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8800GTS, "NVIDIA GeForce 8800 GTS", 15, 11, 9745 }, @@ -1405,14 +1406,20 @@ static enum wined3d_pci_device select_card_nvidia_binary(const struct wined3d_gl return CARD_NVIDIA_GEFORCE_8600GT; } + /* Geforce8 - mid-lowend */ + if (strstr(gl_renderer, "8400") + || strstr(gl_renderer, "8500")) + { + *vidmem = 128; /* 128-256MB for a 8400, 256-512MB for a 8500 */ + return CARD_NVIDIA_GEFORCE_8400GS; + } + /* Geforce8 - lowend */ if (strstr(gl_renderer, "8100") || strstr(gl_renderer, "8200") - || strstr(gl_renderer, "8300") - || strstr(gl_renderer, "8400") - || strstr(gl_renderer, "8500")) + || strstr(gl_renderer, "8300")) { - *vidmem = 128; /* 128-256MB for a 8300, 256-512MB for a 8400 */ + *vidmem = 128; /* 128-256MB for a 8300 */ return CARD_NVIDIA_GEFORCE_8300GS; }
1
0
0
0
Piotr Caban : wininet: Cache non basic authorization data.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: c398e6fc7718030c82215bd1ab10518b1b4b672c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c398e6fc7718030c82215bd1a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:08:44 2010 +0200 wininet: Cache non basic authorization data. --- dlls/wininet/http.c | 127 ++++++++++++++++++++++++++++++++++++++++++++-- dlls/wininet/internet.h | 21 ++++++++ 2 files changed, 142 insertions(+), 6 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 57c4f75..c9bbde2 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -179,7 +179,7 @@ struct gzip_stream_t { BOOL end_of_data; }; -typedef struct _authorizationData +typedef struct _basicAuthorizationData { struct list entry; @@ -187,9 +187,24 @@ typedef struct _authorizationData LPWSTR lpszwRealm; LPSTR lpszAuthorization; UINT AuthorizationLen; +} basicAuthorizationData; + +typedef struct _authorizationData +{ + struct list entry; + + LPWSTR host; + LPWSTR scheme; + LPWSTR domain; + UINT domain_len; + LPWSTR user; + UINT user_len; + LPWSTR password; + UINT password_len; } authorizationData; static struct list basicAuthorizationCache = LIST_INIT(basicAuthorizationCache); +static struct list authorizationCache = LIST_INIT(authorizationCache); static CRITICAL_SECTION authcache_cs; static CRITICAL_SECTION_DEBUG critsect_debug = @@ -570,13 +585,13 @@ static void destroy_authinfo( struct HttpAuthInfo *authinfo ) static UINT retrieve_cached_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR *auth_data) { - authorizationData *ad; + basicAuthorizationData *ad; UINT rc = 0; TRACE("Looking for authorization for %s:%s\n",debugstr_w(host),debugstr_w(realm)); EnterCriticalSection(&authcache_cs); - LIST_FOR_EACH_ENTRY(ad, &basicAuthorizationCache, authorizationData, entry) + LIST_FOR_EACH_ENTRY(ad, &basicAuthorizationCache, basicAuthorizationData, entry) { if (!strcmpiW(host,ad->lpszwHost) && !strcmpW(realm,ad->lpszwRealm)) { @@ -594,14 +609,14 @@ static UINT retrieve_cached_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR static void cache_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR auth_data, UINT auth_data_len) { struct list *cursor; - authorizationData* ad = NULL; + basicAuthorizationData* ad = NULL; TRACE("caching authorization for %s:%s = %s\n",debugstr_w(host),debugstr_w(realm),debugstr_an(auth_data,auth_data_len)); EnterCriticalSection(&authcache_cs); LIST_FOR_EACH(cursor, &basicAuthorizationCache) { - authorizationData *check = LIST_ENTRY(cursor,authorizationData,entry); + basicAuthorizationData *check = LIST_ENTRY(cursor,basicAuthorizationData,entry); if (!strcmpiW(host,check->lpszwHost) && !strcmpW(realm,check->lpszwRealm)) { ad = check; @@ -619,7 +634,7 @@ static void cache_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR auth_data } else { - ad = HeapAlloc(GetProcessHeap(),0,sizeof(authorizationData)); + ad = HeapAlloc(GetProcessHeap(),0,sizeof(basicAuthorizationData)); ad->lpszwHost = heap_strdupW(host); ad->lpszwRealm = heap_strdupW(realm); ad->lpszAuthorization = HeapAlloc(GetProcessHeap(),0,auth_data_len); @@ -631,6 +646,95 @@ static void cache_basic_authorization(LPWSTR host, LPWSTR realm, LPSTR auth_data LeaveCriticalSection(&authcache_cs); } +static BOOL retrieve_cached_authorization(LPWSTR host, LPWSTR scheme, + SEC_WINNT_AUTH_IDENTITY_W *nt_auth_identity) +{ + authorizationData *ad; + + TRACE("Looking for authorization for %s:%s\n", debugstr_w(host), debugstr_w(scheme)); + + EnterCriticalSection(&authcache_cs); + LIST_FOR_EACH_ENTRY(ad, &authorizationCache, authorizationData, entry) { + if(!strcmpiW(host, ad->host) && !strcmpiW(scheme, ad->scheme)) { + TRACE("Authorization found in cache\n"); + + nt_auth_identity->User = heap_strdupW(ad->user); + nt_auth_identity->Password = heap_strdupW(ad->password); + nt_auth_identity->Domain = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*ad->domain_len); + if(!nt_auth_identity->User || !nt_auth_identity->Password || + (!nt_auth_identity->Domain && ad->domain_len)) { + HeapFree(GetProcessHeap(), 0, nt_auth_identity->User); + HeapFree(GetProcessHeap(), 0, nt_auth_identity->Password); + HeapFree(GetProcessHeap(), 0, nt_auth_identity->Domain); + break; + } + + nt_auth_identity->Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; + nt_auth_identity->UserLength = ad->user_len; + nt_auth_identity->PasswordLength = ad->password_len; + memcpy(nt_auth_identity->Domain, ad->domain, sizeof(WCHAR)*ad->domain_len); + nt_auth_identity->DomainLength = ad->domain_len; + LeaveCriticalSection(&authcache_cs); + return TRUE; + } + } + LeaveCriticalSection(&authcache_cs); + + return FALSE; +} + +static void cache_authorization(LPWSTR host, LPWSTR scheme, + SEC_WINNT_AUTH_IDENTITY_W *nt_auth_identity) +{ + authorizationData *ad; + BOOL found = FALSE; + + TRACE("Caching authorization for %s:%s\n", debugstr_w(host), debugstr_w(scheme)); + + EnterCriticalSection(&authcache_cs); + LIST_FOR_EACH_ENTRY(ad, &authorizationCache, authorizationData, entry) + if(!strcmpiW(host, ad->host) && !strcmpiW(scheme, ad->scheme)) { + found = TRUE; + break; + } + + if(found) { + HeapFree(GetProcessHeap(), 0, ad->user); + HeapFree(GetProcessHeap(), 0, ad->password); + HeapFree(GetProcessHeap(), 0, ad->domain); + } else { + ad = HeapAlloc(GetProcessHeap(), 0, sizeof(authorizationData)); + if(!ad) { + LeaveCriticalSection(&authcache_cs); + return; + } + + ad->host = heap_strdupW(host); + ad->scheme = heap_strdupW(scheme); + list_add_head(&authorizationCache, &ad->entry); + } + + ad->user = heap_strndupW(nt_auth_identity->User, nt_auth_identity->UserLength); + ad->password = heap_strndupW(nt_auth_identity->Password, nt_auth_identity->PasswordLength); + ad->domain = heap_strndupW(nt_auth_identity->Domain, nt_auth_identity->DomainLength); + ad->user_len = nt_auth_identity->UserLength; + ad->password_len = nt_auth_identity->PasswordLength; + ad->domain_len = nt_auth_identity->DomainLength; + + if(!ad->host || !ad->scheme || !ad->user || !ad->password + || (nt_auth_identity->Domain && !ad->domain)) { + HeapFree(GetProcessHeap(), 0, ad->host); + HeapFree(GetProcessHeap(), 0, ad->scheme); + HeapFree(GetProcessHeap(), 0, ad->user); + HeapFree(GetProcessHeap(), 0, ad->password); + HeapFree(GetProcessHeap(), 0, ad->domain); + list_remove(&ad->entry); + HeapFree(GetProcessHeap(), 0, ad); + } + + LeaveCriticalSection(&authcache_cs); +} + static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue, struct HttpAuthInfo **ppAuthInfo, LPWSTR domain_and_username, LPWSTR password, @@ -705,7 +809,11 @@ static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue, nt_auth_identity.DomainLength = domain ? user - domain - 1 : 0; nt_auth_identity.Password = password; nt_auth_identity.PasswordLength = strlenW(nt_auth_identity.Password); + + cache_authorization(host, pAuthInfo->scheme, &nt_auth_identity); } + else if(retrieve_cached_authorization(host, pAuthInfo->scheme, &nt_auth_identity)) + pAuthData = &nt_auth_identity; else /* use default credentials */ pAuthData = NULL; @@ -715,6 +823,13 @@ static BOOL HTTP_DoAuthorization( http_request_t *lpwhr, LPCWSTR pszAuthValue, pAuthData, NULL, NULL, &pAuthInfo->cred, &exp); + + if(pAuthData && !domain_and_username) { + HeapFree(GetProcessHeap(), 0, nt_auth_identity.User); + HeapFree(GetProcessHeap(), 0, nt_auth_identity.Domain); + HeapFree(GetProcessHeap(), 0, nt_auth_identity.Password); + } + if (sec_status == SEC_E_OK) { PSecPkgInfoW sec_pkg_info; diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 07b92d8..6e41f66 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -71,6 +71,27 @@ static inline LPWSTR heap_strdupW(LPCWSTR str) return ret; } +static inline LPWSTR heap_strndupW(LPCWSTR str, UINT max_len) +{ + LPWSTR ret; + UINT len; + + if(!str) + return NULL; + + for(len=0; len<max_len; len++) + if(str[len] == '\0') + break; + + ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1)); + if(ret) { + memcpy(ret, str, sizeof(WCHAR)*len); + ret[len] = '\0'; + } + + return ret; +} + static inline WCHAR *heap_strdupAtoW(const char *str) { LPWSTR ret = NULL;
1
0
0
0
Piotr Caban : wininet: Delete authorization data on unsucessful login.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: 98fb747aa9a2d04cbb676ef6ee4a4e91fbad1a68 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=98fb747aa9a2d04cbb676ef6e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:08:11 2010 +0200 wininet: Delete authorization data on unsucessful login. --- dlls/wininet/http.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index fc6e351..57c4f75 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3621,6 +3621,12 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, break; } } + + if(!loop_next) { + TRACE("Cleaning wrong authorization data\n"); + destroy_authinfo(lpwhr->pAuthInfo); + lpwhr->pAuthInfo = NULL; + } } if (dwStatusCode == HTTP_STATUS_PROXY_AUTH_REQ) { @@ -3637,6 +3643,12 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, break; } } + + if(!loop_next) { + TRACE("Cleaning wrong proxy authorization data\n"); + destroy_authinfo(lpwhr->pProxyAuthInfo); + lpwhr->pProxyAuthInfo = NULL; + } } } }
1
0
0
0
Piotr Caban : wininet: Fix reporting errors in callbacks.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: 3cfc7132be4709a199ed81bb883503a1715fea09 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3cfc7132be4709a199ed81bb8…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:07:43 2010 +0200 wininet: Fix reporting errors in callbacks. --- dlls/wininet/http.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 54895bb..fc6e351 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3685,7 +3685,7 @@ lend: HTTP_ReceiveRequestData(lpwhr, TRUE); else { - iar.dwResult = 0; + iar.dwResult = (res==ERROR_SUCCESS ? (DWORD_PTR)lpwhr->hdr.hInternet : 0); iar.dwError = res; INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, @@ -3769,7 +3769,7 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *lpwhr, DWORD dwFlags, DWORD_PT } } - iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet; + iar.dwResult = (res==ERROR_SUCCESS ? (DWORD_PTR)lpwhr->hdr.hInternet : 0); iar.dwError = res; INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
1
0
0
0
Piotr Caban : msxml3: Improve bstr_from_xmlCharN implementation.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: 7a22365674612122896ec5005406a45c25995de4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a22365674612122896ec5005…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:06:53 2010 +0200 msxml3: Improve bstr_from_xmlCharN implementation. --- dlls/msxml3/saxreader.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index a09f4ea..5381d95 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -158,7 +158,6 @@ static int namespacePop(saxlocator *locator) static BSTR bstr_from_xmlCharN(const xmlChar *buf, int len) { DWORD dLen; - LPWSTR str; BSTR bstr; if (!buf) @@ -166,13 +165,11 @@ static BSTR bstr_from_xmlCharN(const xmlChar *buf, int len) dLen = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, NULL, 0); if(len != -1) dLen++; - str = heap_alloc(dLen * sizeof (WCHAR)); - if (!str) + bstr = SysAllocStringLen(NULL, dLen-1); + if (!bstr) return NULL; - MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, str, dLen); - if(len != -1) str[dLen-1] = '\0'; - bstr = SysAllocString(str); - heap_free(str); + MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)buf, len, bstr, dLen); + if(len != -1) bstr[dLen-1] = '\0'; return bstr; }
1
0
0
0
Piotr Caban : msxml3: Improve QName_from_xmlChar implementation.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: bf263947e7eff1351e7b9bc6a43c7beb9b3746f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf263947e7eff1351e7b9bc6a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:06:27 2010 +0200 msxml3: Improve QName_from_xmlChar implementation. --- dlls/msxml3/saxreader.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index b81a47e..a09f4ea 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -180,7 +180,6 @@ static BSTR bstr_from_xmlCharN(const xmlChar *buf, int len) static BSTR QName_from_xmlChar(const xmlChar *prefix, const xmlChar *name) { DWORD dLen, dLast; - LPWSTR str; BSTR bstr; if(!name) return NULL; @@ -190,16 +189,13 @@ static BSTR QName_from_xmlChar(const xmlChar *prefix, const xmlChar *name) dLen = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)prefix, -1, NULL, 0) + MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)name, -1, NULL, 0); - str = heap_alloc(dLen * sizeof(WCHAR)); - if(!str) + bstr = SysAllocStringLen(NULL, dLen-1); + if(!bstr) return NULL; - dLast = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)prefix, -1, str, dLen); - str[dLast-1] = ':'; - MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)name, -1, &str[dLast], dLen-dLast); - bstr = SysAllocString(str); - - heap_free(str); + dLast = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)prefix, -1, bstr, dLen); + bstr[dLast-1] = ':'; + MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)name, -1, &bstr[dLast], dLen-dLast); return bstr; }
1
0
0
0
Piotr Caban : msxml3: Correctly allocate namespaces stack in saxreader.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: 3bf94bed3fe976ed7465552dfce790f0597d49a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bf94bed3fe976ed7465552df…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 17 14:05:56 2010 +0200 msxml3: Correctly allocate namespaces stack in saxreader. --- dlls/msxml3/saxreader.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index eca9f1d..b81a47e 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -139,7 +139,7 @@ static HRESULT namespacePush(saxlocator *locator, int ns) int *new_stack; new_stack = HeapReAlloc(GetProcessHeap(), 0, - locator->nsStack, locator->nsStackSize*2); + locator->nsStack, sizeof(int)*locator->nsStackSize*2); if(!new_stack) return E_OUTOFMEMORY; locator->nsStack = new_stack; locator->nsStackSize *= 2; @@ -1752,7 +1752,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B locator->ret = S_OK; locator->nsStackSize = 8; locator->nsStackLast = 0; - locator->nsStack = heap_alloc(locator->nsStackSize); + locator->nsStack = heap_alloc(sizeof(int)*locator->nsStackSize); if(!locator->nsStack) { ISAXXMLReader_Release((ISAXXMLReader*)&reader->lpSAXXMLReaderVtbl);
1
0
0
0
Jacek Caban : mshtml: Added IHTMLDocument3::detachEvent implementation.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: 4890eb5775b388d31ab00393f8707d98749a3144 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4890eb5775b388d31ab00393f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jul 17 13:31:43 2010 +0200 mshtml: Added IHTMLDocument3::detachEvent implementation. --- dlls/mshtml/htmldoc3.c | 6 +++- dlls/mshtml/tests/events.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmldoc3.c b/dlls/mshtml/htmldoc3.c index f4ea096..8d135ff 100644 --- a/dlls/mshtml/htmldoc3.c +++ b/dlls/mshtml/htmldoc3.c @@ -189,8 +189,10 @@ static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR even IDispatch *pDisp) { HTMLDocument *This = HTMLDOC3_THIS(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); - return E_NOTIMPL; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); + + return detach_event(This->doc_node->node.event_target, This, event, pDisp); } static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index deafd54..7d69dd5 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -59,6 +59,7 @@ DEFINE_EXPECT(document_onclick); DEFINE_EXPECT(body_onclick); +DEFINE_EXPECT(doc_onclick_attached); DEFINE_EXPECT(div_onclick); DEFINE_EXPECT(div_onclick_attached); DEFINE_EXPECT(timeout); @@ -662,6 +663,36 @@ static void _elem_detach_event(unsigned line, IUnknown *unk, const char *namea, ok_(__FILE__,line)(hres == S_OK, "detachEvent failed: %08x\n", hres); } +#define doc_attach_event(a,b,c) _doc_attach_event(__LINE__,a,b,c) +static void _doc_attach_event(unsigned line, IHTMLDocument2 *doc, const char *namea, IDispatch *disp) +{ + IHTMLDocument3 *doc3 = _get_doc3_iface(line, (IUnknown*)doc); + VARIANT_BOOL res; + BSTR name; + HRESULT hres; + + name = a2bstr(namea); + hres = IHTMLDocument3_attachEvent(doc3, name, disp, &res); + IHTMLDocument3_Release(doc3); + SysFreeString(name); + ok_(__FILE__,line)(hres == S_OK, "attachEvent failed: %08x\n", hres); + ok_(__FILE__,line)(res == VARIANT_TRUE, "attachEvent returned %x\n", res); +} + +#define doc_detach_event(a,b,c) _doc_detach_event(__LINE__,a,b,c) +static void _doc_detach_event(unsigned line, IHTMLDocument2 *doc, const char *namea, IDispatch *disp) +{ + IHTMLDocument3 *doc3 = _get_doc3_iface(line, (IUnknown*)doc); + BSTR name; + HRESULT hres; + + name = a2bstr(namea); + hres = IHTMLDocument3_detachEvent(doc3, name, disp); + IHTMLDocument3_Release(doc3); + SysFreeString(name); + ok_(__FILE__,line)(hres == S_OK, "detachEvent failed: %08x\n", hres); +} + static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) { *ppv = NULL; @@ -841,6 +872,18 @@ static HRESULT WINAPI div_onclick_attached(IDispatchEx *iface, DISPID id, LCID l EVENT_HANDLER_FUNC_OBJ(div_onclick_attached); +static HRESULT WINAPI doc_onclick_attached(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + CHECK_EXPECT(doc_onclick_attached); + + test_attached_event_args(id, wFlags, pdp, pvarRes, pei); + test_event_src("DIV"); + return S_OK; +} + +EVENT_HANDLER_FUNC_OBJ(doc_onclick_attached); + static HRESULT WINAPI body_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { @@ -1249,12 +1292,14 @@ static void test_onclick(IHTMLDocument2 *doc) cp_cookie = register_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, (IUnknown*)&doccp_obj); elem_attach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp); + doc_attach_event(doc, "onclick", (IDispatch*)&doc_onclick_attached_obj); SET_EXPECT(div_onclick); SET_EXPECT(div_onclick_disp); SET_EXPECT(div_onclick_attached); SET_EXPECT(body_onclick); SET_EXPECT(document_onclick); + SET_EXPECT(doc_onclick_attached); SET_EXPECT(doccp_onclick); hres = IHTMLElement_click(div); @@ -1265,6 +1310,7 @@ static void test_onclick(IHTMLDocument2 *doc) CHECK_CALLED(div_onclick_attached); CHECK_CALLED(body_onclick); CHECK_CALLED(document_onclick); + CHECK_CALLED(doc_onclick_attached); CHECK_CALLED(doccp_onclick); unregister_cp((IUnknown*)doc, &DIID_HTMLDocumentEvents, cp_cookie); @@ -1280,6 +1326,7 @@ static void test_onclick(IHTMLDocument2 *doc) elem_detach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp); elem_detach_event((IUnknown*)div, "onclick", (IDispatch*)&div_onclick_disp); elem_detach_event((IUnknown*)div, "test", (IDispatch*)&div_onclick_disp); + doc_detach_event(doc, "onclick", (IDispatch*)&doc_onclick_attached_obj); SET_EXPECT(div_onclick_attached); SET_EXPECT(body_onclick);
1
0
0
0
Jacek Caban : mshtml: Added implementation of remaining IHTMLRect getters.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: f2361112bad88e8807815c4755fffe35d3e8e71d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2361112bad88e8807815c475…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jul 17 13:31:15 2010 +0200 mshtml: Added implementation of remaining IHTMLRect getters. --- dlls/mshtml/htmlelem2.c | 45 +++++++++++++++++++++++++++++++++++++++------ dlls/mshtml/tests/dom.c | 15 +++++++++++++++ 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/htmlelem2.c b/dlls/mshtml/htmlelem2.c index 251763f..0c20723 100644 --- a/dlls/mshtml/htmlelem2.c +++ b/dlls/mshtml/htmlelem2.c @@ -138,8 +138,19 @@ static HRESULT WINAPI HTMLRect_put_left(IHTMLRect *iface, LONG v) static HRESULT WINAPI HTMLRect_get_left(IHTMLRect *iface, LONG *p) { HTMLRect *This = HTMLRECT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + float left; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMClientRect_GetLeft(This->nsrect, &left); + if(NS_FAILED(nsres)) { + ERR("GetLeft failed: %08x\n", nsres); + return E_FAIL; + } + + *p = floor(left+0.5); + return S_OK; } static HRESULT WINAPI HTMLRect_put_top(IHTMLRect *iface, LONG v) @@ -177,8 +188,19 @@ static HRESULT WINAPI HTMLRect_put_right(IHTMLRect *iface, LONG v) static HRESULT WINAPI HTMLRect_get_right(IHTMLRect *iface, LONG *p) { HTMLRect *This = HTMLRECT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + float right; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMClientRect_GetRight(This->nsrect, &right); + if(NS_FAILED(nsres)) { + ERR("GetRight failed: %08x\n", nsres); + return E_FAIL; + } + + *p = floor(right+0.5); + return S_OK; } static HRESULT WINAPI HTMLRect_put_bottom(IHTMLRect *iface, LONG v) @@ -191,8 +213,19 @@ static HRESULT WINAPI HTMLRect_put_bottom(IHTMLRect *iface, LONG v) static HRESULT WINAPI HTMLRect_get_bottom(IHTMLRect *iface, LONG *p) { HTMLRect *This = HTMLRECT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + float bottom; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMClientRect_GetBottom(This->nsrect, &bottom); + if(NS_FAILED(nsres)) { + ERR("GetBottom failed: %08x\n", nsres); + return E_FAIL; + } + + *p = floor(bottom+0.5); + return S_OK; } #undef HTMLRECT_THIS diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index fa3763c..b19822e 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2875,6 +2875,21 @@ static void test_elem_bounding_client_rect(IUnknown *unk) ok(hres == S_OK, "get_top failed: %08x\n", hres); ok(l != 0xdeadbeef, "l = 0xdeadbeef\n"); + l = 0xdeadbeef; + hres = IHTMLRect_get_left(rect, &l); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + ok(l != 0xdeadbeef, "l = 0xdeadbeef\n"); + + l = 0xdeadbeef; + hres = IHTMLRect_get_bottom(rect, &l); + ok(hres == S_OK, "get_bottom failed: %08x\n", hres); + ok(l != 0xdeadbeef, "l = 0xdeadbeef\n"); + + l = 0xdeadbeef; + hres = IHTMLRect_get_right(rect, &l); + ok(hres == S_OK, "get_right failed: %08x\n", hres); + ok(l != 0xdeadbeef, "l = 0xdeadbeef\n"); + IHTMLRect_Release(rect); }
1
0
0
0
Jacek Caban : mshtml: Added IHTMLRect::get_top implementation.
by Alexandre Julliard
19 Jul '10
19 Jul '10
Module: wine Branch: master Commit: bbaefeb3b5154d1646820527728169e8fd291cbf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bbaefeb3b5154d16468205277…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jul 17 13:30:43 2010 +0200 mshtml: Added IHTMLRect::get_top implementation. --- dlls/mshtml/htmlelem2.c | 52 ++++++++++++++++++++++++++++++++++++++++++---- dlls/mshtml/nsiface.idl | 17 ++++++++++++++- dlls/mshtml/tests/dom.c | 11 +++++++++- 3 files changed, 73 insertions(+), 7 deletions(-) diff --git a/dlls/mshtml/htmlelem2.c b/dlls/mshtml/htmlelem2.c index b6030b8..251763f 100644 --- a/dlls/mshtml/htmlelem2.c +++ b/dlls/mshtml/htmlelem2.c @@ -17,6 +17,7 @@ */ #include <stdarg.h> +#include <math.h> #define COBJMACROS @@ -36,7 +37,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); typedef struct { DispatchEx dispex; const IHTMLRectVtbl *lpIHTMLRectVtbl; + LONG ref; + + nsIDOMClientRect *nsrect; } HTMLRect; #define HTMLRECT(x) ((IHTMLRect*) &(x)->lpIHTMLRectVtbl) @@ -82,8 +86,11 @@ static ULONG WINAPI HTMLRect_Release(IHTMLRect *iface) TRACE("(%p) ref=%d\n", This, ref); - if(!ref) + if(!ref) { + if(This->nsrect) + nsIDOMClientRect_Release(This->nsrect); heap_free(This); + } return ref; } @@ -145,8 +152,19 @@ static HRESULT WINAPI HTMLRect_put_top(IHTMLRect *iface, LONG v) static HRESULT WINAPI HTMLRect_get_top(IHTMLRect *iface, LONG *p) { HTMLRect *This = HTMLRECT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + float top; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsres = nsIDOMClientRect_GetTop(This->nsrect, &top); + if(NS_FAILED(nsres)) { + ERR("GetTop failed: %08x\n", nsres); + return E_FAIL; + } + + *p = floor(top+0.5); + return S_OK; } static HRESULT WINAPI HTMLRect_put_right(IHTMLRect *iface, LONG v) @@ -208,7 +226,7 @@ static dispex_static_data_t HTMLRect_dispex = { HTMLRect_iface_tids }; -static HRESULT create_html_rect(IHTMLRect **ret) +static HRESULT create_html_rect(nsIDOMClientRect *nsrect, IHTMLRect **ret) { HTMLRect *rect; @@ -221,6 +239,9 @@ static HRESULT create_html_rect(IHTMLRect **ret) init_dispex(&rect->dispex, (IUnknown*)HTMLRECT(rect), &HTMLRect_dispex); + nsIDOMClientRect_AddRef(nsrect); + rect->nsrect = nsrect; + *ret = HTMLRECT(rect); return S_OK; } @@ -556,10 +577,31 @@ static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRec static HRESULT WINAPI HTMLElement2_getBoundingClientRect(IHTMLElement2 *iface, IHTMLRect **pRect) { HTMLElement *This = HTMLELEM2_THIS(iface); + nsIDOMNSElement *nselem; + nsIDOMClientRect *nsrect; + nsresult nsres; + HRESULT hres; TRACE("(%p)->(%p)\n", This, pRect); - return create_html_rect(pRect); + nsres = nsIDOMHTMLElement_QueryInterface(This->node.nsnode, &IID_nsIDOMNSElement, + (void**)&nselem); + if(NS_FAILED(nsres)) { + ERR("Could not get nsIDOMNSElement iface: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMNSElement_GetBoundingClientRect(nselem, &nsrect); + nsIDOMNSElement_Release(nselem); + if(NS_FAILED(nsres) || !nsrect) { + ERR("GetBoindingClientRect failed: %08x\n", nsres); + return E_FAIL; + } + + hres = create_html_rect(nsrect, pRect); + + nsIDOMClientRect_Release(nsrect); + return hres; } static HRESULT WINAPI HTMLElement2_setExpression(IHTMLElement2 *iface, BSTR propname, diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 4ccc64a..b62c7b2 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -131,7 +131,6 @@ typedef nsISupports nsIDOMMediaList; typedef nsISupports nsIDOMHTMLTableCaptionElement; typedef nsISupports nsIDOMHTMLTableSectionElement; typedef nsISupports nsIDOMClientRectList; -typedef nsISupports nsIDOMClientRect; typedef nsISupports nsIDOMLocation; typedef nsISupports nsIDocument; typedef nsISupports nsIContent; @@ -734,6 +733,22 @@ interface nsIDOMElementCSSInlineStyle : nsISupports [ object, + uuid(b2f824c4-d9d3-499b-8d3b-45c8245497c6), + local + /* NOT_FROZEN */ +] +interface nsIDOMClientRect : nsISupports +{ + nsresult GetLeft(float *aLeft); + nsresult GetTop(float *aTop); + nsresult GetRight(float *aRight); + nsresult GetBottom(float *aBottom); + nsresult GetWidth(float *aWidth); + nsresult GetHeight(float *aHeight); +} + +[ + object, uuid(f0aef489-18c5-4de6-99d5-58b3758b098c), local /* NOT_FROZEN */ diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index c877b96..fa3763c 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2854,18 +2854,27 @@ static void _test_style_set_csstext(unsigned line, IHTMLStyle *style, const char static void test_elem_bounding_client_rect(IUnknown *unk) { + IHTMLRect *rect, *rect2; IHTMLElement2 *elem2; - IHTMLRect *rect; + LONG l; HRESULT hres; elem2 = get_elem2_iface(unk); hres = IHTMLElement2_getBoundingClientRect(elem2, &rect); + hres = IHTMLElement2_getBoundingClientRect(elem2, &rect2); IHTMLElement2_Release(elem2); ok(hres == S_OK, "getBoundingClientRect failed: %08x\n", hres); ok(rect != NULL, "rect == NULL\n"); + ok(rect != rect2, "rect == rect2\n"); + IHTMLRect_Release(rect2); test_disp((IUnknown*)rect, &IID_IHTMLRect, "[object]"); + l = 0xdeadbeef; + hres = IHTMLRect_get_top(rect, &l); + ok(hres == S_OK, "get_top failed: %08x\n", hres); + ok(l != 0xdeadbeef, "l = 0xdeadbeef\n"); + IHTMLRect_Release(rect); }
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
90
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
Results per page:
10
25
50
100
200