ReactOS.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
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
List overview
Download
Ros-diffs
November 2016
----- 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
ros-diffs@reactos.org
15 participants
317 discussions
Start a n
N
ew thread
[akhaldi] 73360: [WININET] Sync with Wine Staging 1.9.23. CORE-12409 4695681 wininet: add ParseX509EncodedCertificateForListBoxEntry stub (try 2) e3e4fc6 wininet: Add support for INTERNET_OPTION_SE...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 18:09:57 2016 New Revision: 73360 URL:
http://svn.reactos.org/svn/reactos?rev=73360&view=rev
Log: [WININET] Sync with Wine Staging 1.9.23. CORE-12409 4695681 wininet: add ParseX509EncodedCertificateForListBoxEntry stub (try 2) e3e4fc6 wininet: Add support for INTERNET_OPTION_SETTINGS_CHANGED in InternetSetOption. 4a728d2 wininet: Allow INTERNET_OPTION_SETTINGS_CHANGED on connections. 8478c72 wininet: Resize buffer when call to InternetCanonicalizeUrlW fails in InternetCrackUrlW. 3d6da00 wininet: Handle INTERNET_INVALID_PORT_NUMBER in HttpOpenRequest. dee155f wininet: Replacing header fields should fail if they do not exist yet. efd7d44 wininet: Strip filename if no path is set in cookie. 65f5d89 wininet: Silence wininet no support on this platform message. 3cb027c wininet: Increase buffer in _test_status_code to avoid potential potential overflow. 7e84143 wininet: Don't crash by debug printing too long URLs. 7d9a439 wininet: Don't return available data sizes larger than the read buffer. Modified: trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/urlcache.c trunk/reactos/dll/win32/wininet/wininet_ros.diff trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Wed Nov 23 18:09:57 2016 @@ -2619,7 +2619,16 @@ /* return the size of data available to be read immediately (the read section must be held) */ static DWORD get_avail_data( http_request_t *req ) { - return req->read_size + req->data_stream->vtbl->get_avail_data(req->data_stream, req); + DWORD avail = req->read_size; + + /* + * Different Windows versions have different limits of returned data, but all + * of them return no more than centrain amount. We use READ_BUFFER_SIZE as a limit. + */ + if(avail < READ_BUFFER_SIZE) + avail += req->data_stream->vtbl->get_avail_data(req->data_stream, req); + + return min(avail, READ_BUFFER_SIZE); } static DWORD netconn_get_avail_data(data_stream_t *stream, http_request_t *req) Modified: trunk/reactos/dll/win32/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
============================================================================== --- trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] Wed Nov 23 18:09:57 2016 @@ -2566,7 +2566,7 @@ if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry)) { cache_container_unlock_index(pContainer, pHeader); - TRACE("entry %s not found!\n", lpszUrlName); + TRACE("entry %s not found!\n", debugstr_a(lpszUrlName)); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } @@ -3313,7 +3313,7 @@ if (!urlcache_find_hash_entry(pHeader, lpszUrlName, &pHashEntry)) { cache_container_unlock_index(pContainer, pHeader); - TRACE("entry %s not found!\n", lpszUrlName); + TRACE("entry %s not found!\n", debugstr_a(lpszUrlName)); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
============================================================================== --- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Wed Nov 23 18:09:57 2016 @@ -1,6 +1,6 @@ diff -pudN e:\wine\dlls\wininet/http.c e:\reactos\dll\win32\wininet/http.c ---- e:\wine\dlls\wininet/http.c 2016-05-31 18:02:43 +0100 -+++ e:\reactos\dll\win32\wininet/http.c 2016-07-02 16:18:16 +0100 +--- e:\wine\dlls\wininet/http.c 2016-11-16 17:36:38 +0100 ++++ e:\reactos\dll\win32\wininet/http.c 2016-11-17 00:15:58 +0100 @@ -118,6 +118,7 @@ static const WCHAR emptyW[] = {0}; #define COLLECT_TIME 60000 @@ -35,7 +35,7 @@ LIST_FOR_EACH_ENTRY_SAFE(server, server_safe, &connection_pool, server_t, entry) { LIST_FOR_EACH_ENTRY_SAFE(netconn, netconn_safe, &server->conn_pool, netconn_t, pool_entry) { -@@ -1923,13 +1934,14 @@ static void http_release_netconn(http_re +@@ -1933,13 +1944,14 @@ static void http_release_netconn(http_re if(!is_valid_netconn(req->netconn)) return; @@ -51,7 +51,7 @@ req->netconn = NULL; run_collector = !collector_running; -@@ -1957,6 +1969,10 @@ static void http_release_netconn(http_re +@@ -1967,6 +1979,10 @@ static void http_release_netconn(http_re } return; } @@ -63,8 +63,8 @@ INTERNET_SendCallback(&req->hdr, req->hdr.dwContext, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); diff -pudN e:\wine\dlls\wininet/internet.c e:\reactos\dll\win32\wininet/internet.c ---- e:\wine\dlls\wininet/internet.c 2016-05-31 18:05:36 +0100 -+++ e:\reactos\dll\win32\wininet/internet.c 2016-07-02 16:18:16 +0100 +--- e:\wine\dlls\wininet/internet.c 2016-11-16 17:36:38 +0100 ++++ e:\reactos\dll\win32\wininet/internet.c 2016-08-15 17:12:14 +0100 @@ -963,6 +963,9 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR l { appinfo_t *lpwai = NULL; @@ -76,9 +76,21 @@ #define FE(x) { x, #x } static const wininet_flag_info access_type[] = { +diff -pudN e:\wine\dlls\wininet/netconnection.c e:\reactos\dll\win32\wininet/netconnection.c +--- e:\wine\dlls\wininet/netconnection.c 2016-11-16 17:36:38 +0100 ++++ e:\reactos\dll\win32\wininet/netconnection.c 2016-10-13 11:15:37 +0100 +@@ -259,7 +259,7 @@ static BOOL WINAPI winsock_startup(INIT_ + WSADATA wsa_data; + DWORD res; + +- res = WSAStartup(MAKEWORD(1,1), &wsa_data); ++ res = WSAStartup(MAKEWORD(2,2), &wsa_data); + if(res == ERROR_SUCCESS) + winsock_loaded = TRUE; + else diff -pudN e:\wine\dlls\wininet/urlcache.c e:\reactos\dll\win32\wininet/urlcache.c ---- e:\wine\dlls\wininet/urlcache.c 2016-05-31 18:02:43 +0100 -+++ e:\reactos\dll\win32\wininet/urlcache.c 2016-07-02 16:18:16 +0100 +--- e:\wine\dlls\wininet/urlcache.c 2016-11-16 17:36:38 +0100 ++++ e:\reactos\dll\win32\wininet/urlcache.c 2016-11-17 00:16:23 +0100 @@ -179,6 +179,8 @@ typedef struct /* List of all containers available */ @@ -158,3 +170,16 @@ return TRUE; } +diff -pudN e:\wine\dlls\wininet/utility.c e:\reactos\dll\win32\wininet/utility.c +--- e:\wine\dlls\wininet/utility.c 2016-11-16 17:36:38 +0100 ++++ e:\reactos\dll\win32\wininet/utility.c 2016-08-15 17:12:40 +0100 +@@ -24,6 +24,9 @@ + + #include "internet.h" + ++// ReactOS ++#include "inet_ntop.c" ++ + #define TIME_STRING_LEN 30 + + time_t ConvertTimeString(LPCWSTR asctime) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Nov 23 18:09:57 2016 @@ -201,7 +201,7 @@ reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.9.23 reactos/dll/win32/wing32 # Synced to WineStaging-1.9.11 reactos/dll/win32/winhttp # Synced to WineStaging-1.9.23 -reactos/dll/win32/wininet # Synced to WineStaging-1.9.16 +reactos/dll/win32/wininet # Synced to WineStaging-1.9.23 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628 reactos/dll/win32/winmm/wavemap # Forked at Wine-20050628
8 years, 1 month
1
0
0
0
[jimtabor] 73359: [User32] - Fix dialog pop up flicker. Regression from 73333.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Nov 23 15:42:05 2016 New Revision: 73359 URL:
http://svn.reactos.org/svn/reactos?rev=73359&view=rev
Log: [User32] - Fix dialog pop up flicker. Regression from 73333. Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Wed Nov 23 15:42:05 2016 @@ -930,6 +930,8 @@ owner = parent; } ////// Wine'ie babies need to fix your code!!!! CORE-11633 + if (!parent) parent = GetAncestor( owner, GA_ROOT ); + if (parent) { owner = parent;
8 years, 1 month
1
0
0
0
[akhaldi] 73358: [WINHTTP_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 12:00:25 2016 New Revision: 73358 URL:
http://svn.reactos.org/svn/reactos?rev=73358&view=rev
Log: [WINHTTP_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/winhttp/url.c trunk/rostests/winetests/winhttp/winhttp.c Modified: trunk/rostests/winetests/winhttp/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/url.c?r…
============================================================================== --- trunk/rostests/winetests/winhttp/url.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/url.c [iso-8859-1] Wed Nov 23 12:00:25 2016 @@ -69,6 +69,9 @@ static const WCHAR url13[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o',' ','g','/','p','a','t','h',' ','w','i','t','h',' ','s','p','a','c','e','s',0}; static const WCHAR url14[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','t','e','s','t',0}; +static const WCHAR url15[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',':','6','5','5','3','6',0}; +static const WCHAR url16[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',':','0',0}; +static const WCHAR url17[] = {'h','t','t','p',':','/','/','w','i','n','e','h','q','.','o','r','g',':',0}; static const WCHAR url_k1[] = {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d', @@ -310,7 +313,7 @@ memset( uc, 0, sizeof(URL_COMPONENTS) ); uc->dwStructSize = sizeof(URL_COMPONENTS); uc->dwSchemeLength = ~0u; - uc->dwHostNameLength = ~0u; + uc->dwHostNameLength = 1; uc->nPort = 0; uc->dwUserNameLength = ~0u; uc->dwPasswordLength = ~0u; @@ -330,12 +333,7 @@ BOOL ret; /* buffers of sufficient length */ - scheme[0] = 0; - user[0] = 0; - pass[0] = 0; - host[0] = 0; - path[0] = 0; - extra[0] = 0; + scheme[0] = user[0] = pass[0] = host[0] = path[0] = extra[0] = 0; uc.dwStructSize = sizeof(URL_COMPONENTS); uc.nScheme = 0; @@ -370,23 +368,24 @@ ok( !memcmp( uc.lpszExtraInfo, query, sizeof(query) ), "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); ok( uc.dwExtraInfoLength == 6, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); - /* buffer of insufficient length */ - scheme[0] = 0; - uc.dwSchemeLength = 1; - + /* buffers of insufficient length */ + uc.dwSchemeLength = 1; + uc.dwHostNameLength = 1; + uc.dwUrlPathLength = 40; /* sufficient */ SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url1, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); ok( error == ERROR_INSUFFICIENT_BUFFER, "got %u, expected ERROR_INSUFFICIENT_BUFFER\n", error ); ok( uc.dwSchemeLength == 5, "unexpected scheme length: %u\n", uc.dwSchemeLength ); + ok( uc.dwHostNameLength == 15, "unexpected hostname length: %u\n", uc.dwHostNameLength ); + ok( uc.dwUrlPathLength == 11, "unexpected path length: %u\n", uc.dwUrlPathLength ); /* no buffers */ reset_url_components( &uc ); SetLastError( 0xdeadbeef ); - ret = WinHttpCrackUrl( url_k1, 0, 0,&uc); - error = GetLastError(); - + ret = WinHttpCrackUrl( url_k1, 0, 0, &uc); + error = GetLastError(); ok( ret, "WinHttpCrackUrl failed le=%u\n", error ); ok( error == ERROR_SUCCESS || broken(error == ERROR_INVALID_PARAMETER) /* < win7 */, "got %u, expected ERROR_SUCCESS\n", error ); @@ -406,8 +405,9 @@ ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); reset_url_components( &uc ); + uc.dwSchemeLength = uc.dwHostNameLength = uc.dwUserNameLength = 1; + uc.dwPasswordLength = uc.dwUrlPathLength = uc.dwExtraInfoLength = 1; ret = WinHttpCrackUrl( url_k2, 0, 0,&uc); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k2, "unexpected scheme\n" ); @@ -426,7 +426,6 @@ reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k3, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTPS, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k3, "unexpected scheme\n" ); @@ -445,24 +444,39 @@ /* bad parameters */ reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k4, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - - reset_url_components( &uc ); + error = GetLastError(); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k5, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - - reset_url_components( &uc ); + error = GetLastError(); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k6, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - - reset_url_components( &uc ); + error = GetLastError(); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k7, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - - reset_url_components( &uc ); + error = GetLastError(); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k8, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl succeeded\n" ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k9, 0, 0, &uc ); @@ -484,18 +498,30 @@ ok( uc.dwExtraInfoLength == 0, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url4, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl succeeded\n" ); - - reset_url_components( &uc ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( empty, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl succeeded\n" ); - + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url1, 0, 0, NULL ); - ok( !ret, "WinHttpCrackUrl succeeded\n" ); - + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + + SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( NULL, 0, 0, &uc ); - ok( !ret, "WinHttpCrackUrl succeeded\n" ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); /* decoding without buffers */ reset_url_components( &uc ); @@ -697,6 +723,25 @@ ok( uc.dwUrlPathLength == 0, "unexpected length %u\n", uc.dwUrlPathLength ); ok( !uc.lpszExtraInfo, "unexpected extra info %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); ok( uc.dwExtraInfoLength == 0, "unexpected length %u\n", uc.dwExtraInfoLength ); + + reset_url_components( &uc ); + SetLastError( 0xdeadbeef ); + ret = WinHttpCrackUrl( url15, 0, 0, &uc ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl succeeded\n" ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + + reset_url_components( &uc ); + uc.nPort = 1; + ret = WinHttpCrackUrl( url16, 0, 0, &uc ); + ok( ret, "got %u\n", GetLastError() ); + ok( !uc.nPort, "got %u\n", uc.nPort ); + + reset_url_components( &uc ); + uc.nPort = 1; + ret = WinHttpCrackUrl( url17, 0, 0, &uc ); + ok( ret, "got %u\n", GetLastError() ); + todo_wine ok( uc.nPort == 80, "got %u\n", uc.nPort ); } START_TEST(url) Modified: trunk/rostests/winetests/winhttp/winhttp.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/winhttp/winhttp…
============================================================================== --- trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] (original) +++ trunk/rostests/winetests/winhttp/winhttp.c [iso-8859-1] Wed Nov 23 12:00:25 2016 @@ -1001,6 +1001,9 @@ req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0); + ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "setting client cert context returned %x (%u)\n", ret, GetLastError()); + ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); err = GetLastError(); if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) @@ -1023,6 +1026,9 @@ req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, WINHTTP_FLAG_SECURE); ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0); + ok(ret, "failed to set client cert context %u\n", GetLastError()); WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, 0); @@ -3829,10 +3835,8 @@ ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#x\n", hr); VariantInit(&ret); -if (0) /* crashes */ -{ - hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, NULL, &ret, NULL, &err); -} + if (0) /* crashes */ + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, NULL, &ret, NULL, &err); params.cArgs = 1; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err);
8 years, 1 month
1
0
0
0
[akhaldi] 73357: [WINHTTP] Sync with Wine Staging 1.9.23. CORE-12409 e27ff36 winhttp: Added WINHTTP_OPTION_CLIENT_CERT_CONTEXT option stub. 9bc3e96 winhttp: Added WINHTTP_OPTION_MAX_CONNS_PER_SERVE...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 11:59:10 2016 New Revision: 73357 URL:
http://svn.reactos.org/svn/reactos?rev=73357&view=rev
Log: [WINHTTP] Sync with Wine Staging 1.9.23. CORE-12409 e27ff36 winhttp: Added WINHTTP_OPTION_CLIENT_CERT_CONTEXT option stub. 9bc3e96 winhttp: Added WINHTTP_OPTION_MAX_CONNS_PER_SERVER and WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER options stub. c8b166e winhttp: Also pass hostname to jsproxy. 668d429 winhttp: Indicate that WinHttpCrackUrl should return string pointers. 985443e winhttp: Don't perform buffer size tests for components that don't pass buffer in WinHttpCrackUrl. 17b4abf winhttp: Validate the port number in WinHttpCrackUrl. 1d07f89 winhttp: Set required buffer length for all components in WinHttpCrackUrl. 6c0fdc0 winhttp: Prevent console spamming in get_system_proxy_autoconfig_url. Modified: trunk/reactos/dll/win32/winhttp/session.c trunk/reactos/dll/win32/winhttp/url.c trunk/reactos/dll/win32/winhttp/winhttp_private.h trunk/reactos/dll/win32/winhttp/winhttp_ros.diff trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/winhttp/session.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/session.…
============================================================================== --- trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] Wed Nov 23 11:59:10 2016 @@ -176,6 +176,12 @@ case WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: TRACE("WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: %p\n", *(HANDLE *)buffer); session->unload_event = *(HANDLE *)buffer; + return TRUE; + case WINHTTP_OPTION_MAX_CONNS_PER_SERVER: + FIXME("WINHTTP_OPTION_MAX_CONNS_PER_SERVER: %d\n", *(DWORD *)buffer); + return TRUE; + case WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: + FIXME("WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: %d\n", *(DWORD *)buffer); return TRUE; default: FIXME("unimplemented option %u\n", option); @@ -971,6 +977,14 @@ if (!(session->proxy_password = buffer_to_str( buffer, buflen ))) return FALSE; return TRUE; } + case WINHTTP_OPTION_CLIENT_CERT_CONTEXT: + if (!(hdr->flags & WINHTTP_FLAG_SECURE)) + { + SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE ); + return FALSE; + } + FIXME("WINHTTP_OPTION_CLIENT_CERT_CONTEXT\n"); + return TRUE; default: FIXME("unimplemented option %u\n", option); set_last_error( ERROR_INVALID_PARAMETER ); @@ -1196,7 +1210,7 @@ { BOOL ret = TRUE; - if (!buffer) + if (!buffer && buflen) { set_last_error( ERROR_INVALID_PARAMETER ); return FALSE; @@ -1329,8 +1343,14 @@ CFRelease( settings ); return ret; #else - static int once; - if (!once++) FIXME( "no support on this platform\n" ); + static BOOL first = TRUE; + if (first) + { + FIXME( "no support on this platform\n" ); + first = FALSE; + } + else + TRACE( "no support on this platform\n" ); return FALSE; #endif } @@ -1722,6 +1742,8 @@ memset( &uc, 0, sizeof(uc) ); uc.dwStructSize = sizeof(uc); + uc.dwHostNameLength = -1; + uc.dwUrlPathLength = -1; if (!WinHttpCrackUrl( url, 0, 0, &uc )) return NULL; if (!(hostname = heap_alloc( (uc.dwHostNameLength + 1) * sizeof(WCHAR) ))) return NULL; memcpy( hostname, uc.lpszHostName, uc.dwHostNameLength * sizeof(WCHAR) ); @@ -1783,6 +1805,7 @@ char *result, *urlA; DWORD len_result; struct AUTO_PROXY_SCRIPT_BUFFER buffer; + URL_COMPONENTSW uc; buffer.dwStructSize = sizeof(buffer); buffer.lpszScriptBuffer = script; @@ -1794,10 +1817,23 @@ heap_free( urlA ); return FALSE; } - if ((ret = InternetGetProxyInfo( urlA, strlen(urlA), NULL, 0, &result, &len_result ))) - { - ret = parse_script_result( result, info ); - heap_free( result ); + + memset( &uc, 0, sizeof(uc) ); + uc.dwStructSize = sizeof(uc); + uc.dwHostNameLength = -1; + + if (WinHttpCrackUrl( url, 0, 0, &uc )) + { + char *hostnameA = strdupWA_sized( uc.lpszHostName, uc.dwHostNameLength ); + + if ((ret = InternetGetProxyInfo( urlA, strlen(urlA), + hostnameA, strlen(hostnameA), &result, &len_result ))) + { + ret = parse_script_result( result, info ); + heap_free( result ); + } + + heap_free( hostnameA ); } heap_free( urlA ); return InternetDeInitializeAutoProxyDll( NULL, 0 ); Modified: trunk/reactos/dll/win32/winhttp/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/winhttp/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/url.c [iso-8859-1] Wed Nov 23 11:59:10 2016 @@ -21,37 +21,29 @@ static const WCHAR scheme_http[] = {'h','t','t','p',0}; static const WCHAR scheme_https[] = {'h','t','t','p','s',0}; -static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, DWORD flags ) -{ - if (*str && !*str_len) - { - set_last_error( ERROR_INVALID_PARAMETER ); - return FALSE; - } - if (!*str_len) return TRUE; +static DWORD set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, DWORD flags, BOOL *overflow ) +{ + if (*str && !*str_len) return ERROR_INVALID_PARAMETER; + if (!*str_len) return ERROR_SUCCESS; if (!*str) { - if (len && *str_len && (flags & (ICU_DECODE|ICU_ESCAPE))) - { - set_last_error( ERROR_INVALID_PARAMETER ); - return FALSE; - } + if (len && *str_len && (flags & (ICU_DECODE|ICU_ESCAPE))) return ERROR_INVALID_PARAMETER; *str = value; *str_len = len; } else { - if (len > (*str_len) - 1) - { - *str_len = len + 1; - set_last_error( ERROR_INSUFFICIENT_BUFFER ); - return FALSE; + if (len >= *str_len) + { + *str_len = len+1; + *overflow = TRUE; + return ERROR_SUCCESS; } memcpy( *str, value, len * sizeof(WCHAR) ); (*str)[len] = 0; *str_len = len; } - return TRUE; + return ERROR_SUCCESS; } static WCHAR *decode_url( LPCWSTR url, DWORD *len ) @@ -159,16 +151,30 @@ return ret; } +static DWORD parse_port( const WCHAR *str, DWORD len, INTERNET_PORT *ret ) +{ + const WCHAR *p = str; + DWORD port = 0; + while (len && isdigitW( *p )) + { + if ((port = port * 10 + *p - '0') > 65535) return ERROR_WINHTTP_INVALID_URL; + p++; len--; + } + *ret = port; + return ERROR_SUCCESS; +} + /*********************************************************************** * WinHttpCrackUrl (winhttp.@) */ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc ) { - BOOL ret = FALSE; WCHAR *p, *q, *r, *url_decoded = NULL, *url_escaped = NULL; INTERNET_SCHEME scheme = 0; - - TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, uc); + BOOL overflow = FALSE; + DWORD err; + + TRACE("%s, %d, %x, %p\n", debugstr_wn(url, len), len, flags, uc); if (!url || !uc || uc->dwStructSize != sizeof(URL_COMPONENTS)) { @@ -204,95 +210,102 @@ else if (p - url == 5 && !strncmpiW( url, scheme_https, 5 )) scheme = INTERNET_SCHEME_HTTPS; else { - set_last_error( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ); + err = ERROR_WINHTTP_UNRECOGNIZED_SCHEME; goto exit; } - if (!(set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url, flags ))) goto exit; + + if ((err = set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url, flags, &overflow ))) goto exit; p++; /* skip ':' */ - if (!p[0] || p[0] != '/' || p[1] != '/') goto exit; + if (!p[0] || p[0] != '/' || p[1] != '/') + { + err = ERROR_WINHTTP_INVALID_URL; + goto exit; + } p += 2; - - if (!p[0]) goto exit; + if (!p[0]) + { + err = ERROR_WINHTTP_INVALID_URL; + goto exit; + } if ((q = memchrW( p, '@', len - (p - url) )) && !(memchrW( p, '/', q - p ))) { if ((r = memchrW( p, ':', q - p ))) { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p, flags ))) goto exit; + if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p, flags, &overflow ))) goto exit; r++; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r, flags ))) goto exit; - } - else - { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p, flags ))) goto exit; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit; + if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r, flags, &overflow ))) goto exit; + } + else + { + if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p, flags, &overflow ))) goto exit; + if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags, &overflow ))) goto exit; } p = q + 1; } else { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0, flags ))) goto exit; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit; + if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0, flags, &overflow ))) goto exit; + if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags, &overflow ))) goto exit; } if ((q = memchrW( p, '/', len - (p - url) ))) { if ((r = memchrW( p, ':', q - p ))) { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags ))) goto exit; + if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags, &overflow ))) goto exit; r++; - uc->nPort = atoiW( r ); - } - else - { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p, flags ))) goto exit; + if ((err = parse_port( r, q - r, &uc->nPort ))) goto exit; + } + else + { + if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p, flags, &overflow ))) goto exit; if (scheme == INTERNET_SCHEME_HTTP) uc->nPort = INTERNET_DEFAULT_HTTP_PORT; if (scheme == INTERNET_SCHEME_HTTPS) uc->nPort = INTERNET_DEFAULT_HTTPS_PORT; } if ((r = memchrW( q, '?', len - (q - url) ))) { - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q, flags ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url), flags ))) goto exit; - } - else - { - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url), flags ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit; + if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q, flags, &overflow ))) goto exit; + if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url), flags, &overflow ))) goto exit; + } + else + { + if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url), flags, &overflow ))) goto exit; + if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit; } } else { if ((r = memchrW( p, ':', len - (p - url) ))) { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags ))) goto exit; + if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags, &overflow ))) goto exit; r++; - uc->nPort = atoiW( r ); - } - else - { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url), flags ))) goto exit; + if ((err = parse_port( r, len - (r - url), &uc->nPort ))) goto exit; + } + else + { + if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url), flags, &overflow ))) goto exit; if (scheme == INTERNET_SCHEME_HTTP) uc->nPort = INTERNET_DEFAULT_HTTP_PORT; if (scheme == INTERNET_SCHEME_HTTPS) uc->nPort = INTERNET_DEFAULT_HTTPS_PORT; } - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0, flags ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit; - } - - ret = TRUE; - - TRACE("scheme(%s) host(%s) port(%d) path(%s) extra(%s)\n", - debugstr_wn( uc->lpszScheme, uc->dwSchemeLength ), - debugstr_wn( uc->lpszHostName, uc->dwHostNameLength ), - uc->nPort, - debugstr_wn( uc->lpszUrlPath, uc->dwUrlPathLength ), + if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit; + if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit; + } + + TRACE("scheme(%s) host(%s) port(%d) path(%s) extra(%s)\n", debugstr_wn( uc->lpszScheme, uc->dwSchemeLength ), + debugstr_wn( uc->lpszHostName, uc->dwHostNameLength ), uc->nPort, debugstr_wn( uc->lpszUrlPath, uc->dwUrlPathLength ), debugstr_wn( uc->lpszExtraInfo, uc->dwExtraInfoLength )); exit: - if (ret) uc->nScheme = scheme; + if (!err) + { + if (overflow) err = ERROR_INSUFFICIENT_BUFFER; + uc->nScheme = scheme; + } heap_free( url_decoded ); heap_free( url_escaped ); - if (ret) set_last_error( ERROR_SUCCESS ); - return ret; + set_last_error( err ); + return !err; } static INTERNET_SCHEME get_scheme( const WCHAR *scheme, DWORD len ) Modified: trunk/reactos/dll/win32/winhttp/winhttp_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_private.h [iso-8859-1] Wed Nov 23 11:59:10 2016 @@ -380,4 +380,19 @@ return dst; } +static inline char *strdupWA_sized( const WCHAR *src, DWORD size ) +{ + char *dst = NULL; + if (src) + { + int len = WideCharToMultiByte( CP_ACP, 0, src, size, NULL, 0, NULL, NULL ) + 1; + if ((dst = heap_alloc( len ))) + { + WideCharToMultiByte( CP_ACP, 0, src, len, dst, size, NULL, NULL ); + dst[len - 1] = 0; + } + } + return dst; +} + #endif /* _WINE_WINHTTP_PRIVATE_H_ */ Modified: trunk/reactos/dll/win32/winhttp/winhttp_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/winhttp_…
============================================================================== --- trunk/reactos/dll/win32/winhttp/winhttp_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/winhttp/winhttp_ros.diff [iso-8859-1] Wed Nov 23 11:59:10 2016 @@ -1,7 +1,7 @@ diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c ---- e:\wine\dlls\winhttp/net.c 2015-02-21 17:13:15.365542100 +0100 -+++ e:\reactos\dll\win32\winhttp/net.c 2015-07-20 14:25:14.321893000 +0100 -@@ -73,6 +50,7 @@ static CRITICAL_SECTION cs_gethostbyname +--- e:\wine\dlls\winhttp/net.c 2016-11-16 17:36:37 +0100 ++++ e:\reactos\dll\win32\winhttp/net.c 2016-10-13 11:15:39 +0100 +@@ -50,6 +50,7 @@ static CRITICAL_SECTION cs_gethostbyname #endif /* translate a unix error code into a winsock error code */ @@ -9,7 +9,7 @@ static int sock_get_error( int err ) { #if !defined(__MINGW32__) && !defined (_MSC_VER) -@@ -138,6 +116,15 @@ static int sock_get_error( int err ) +@@ -115,6 +116,15 @@ static int sock_get_error( int err ) #endif return err; } @@ -25,7 +25,47 @@ static int sock_send(int fd, const void *msg, size_t len, int flags) { -@@ -366,11 +353,25 @@ BOOL netconn_connect( netconn_t *conn, c +@@ -266,6 +276,28 @@ static BOOL ensure_cred_handle(void) + return ret; + } + ++#ifdef __REACTOS__ ++static BOOL winsock_initialized = FALSE; ++BOOL netconn_init_winsock() ++{ ++ WSADATA wsaData; ++ int error; ++ if (!winsock_initialized) ++ { ++ error = WSAStartup(MAKEWORD(1, 1), &wsaData); ++ if (error) ++ { ++ ERR("WSAStartup failed: %d\n", error); ++ return FALSE; ++ } ++ else ++ winsock_initialized = TRUE; ++ } ++ return winsock_initialized; ++} ++ ++#endif ++ + BOOL netconn_init( netconn_t *conn ) + { + memset(conn, 0, sizeof(*conn)); +@@ -281,6 +313,10 @@ void netconn_unload( void ) + #ifndef HAVE_GETADDRINFO + DeleteCriticalSection(&cs_gethostbyname); + #endif ++#ifdef __REACTOS__ ++ if(winsock_initialized) ++ WSACleanup(); ++#endif + } + + BOOL netconn_connected( netconn_t *conn ) +@@ -343,11 +379,25 @@ BOOL netconn_connect( netconn_t *conn, c res = sock_get_error( errno ); if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS) { @@ -52,9 +92,9 @@ else res = sock_get_error( errno ); diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c ---- e:\wine\dlls\winhttp/request.c 2015-07-14 15:44:36.027191600 +0100 -+++ e:\reactos\dll\win32\winhttp/request.c 2015-07-20 14:28:31.803188200 +0100 -@@ -1263,6 +1252,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNE +--- e:\wine\dlls\winhttp/request.c 2016-11-16 17:36:37 +0100 ++++ e:\reactos\dll\win32\winhttp/request.c 2016-02-27 16:08:59 +0100 +@@ -1258,6 +1258,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNE return ret; } @@ -62,7 +102,7 @@ #define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0])) static const WCHAR basicW[] = {'B','a','s','i','c',0}; -@@ -2754,8 +2744,8 @@ static void free_request( struct winhttp +@@ -2758,8 +2759,8 @@ static void free_request( struct winhttp CloseHandle( request->thread ); CloseHandle( request->wait ); CloseHandle( request->cancel ); @@ -73,7 +113,7 @@ heap_free( request->buffer ); heap_free( request->verb ); VariantClear( &request->data ); -@@ -2959,16 +2949,16 @@ static HRESULT WINAPI winhttp_request_Se +@@ -3005,16 +3006,16 @@ static HRESULT WINAPI winhttp_request_Se { case HTTPREQUEST_PROXYSETTING_DEFAULT: request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; @@ -94,7 +134,7 @@ request->proxy.lpszProxy = NULL; request->proxy.lpszProxyBypass = NULL; break; -@@ -2977,12 +2967,12 @@ static HRESULT WINAPI winhttp_request_Se +@@ -3023,12 +3024,12 @@ static HRESULT WINAPI winhttp_request_Se request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; if (V_VT( &proxy_server ) == VT_BSTR) { @@ -110,31 +150,29 @@ } break; diff -pudN e:\wine\dlls\winhttp/session.c e:\reactos\dll\win32\winhttp/session.c ---- e:\wine\dlls\winhttp/session.c 2015-07-14 15:44:36.029191700 +0100 -+++ e:\reactos\dll\win32\winhttp/session.c 2015-07-20 14:29:15.686698200 +0100 -@@ -109,6 +81,9 @@ static void session_destroy( object_head - heap_free( session->proxy_username ); - heap_free( session->proxy_password ); - heap_free( session ); -+#ifdef __REACTOS__ -+ WSACleanup(); -+#endif - } - - static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen ) -@@ -220,6 +195,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag +--- e:\wine\dlls\winhttp/session.c 2016-11-16 17:36:37 +0100 ++++ e:\reactos\dll\win32\winhttp/session.c 2016-11-17 00:14:49 +0100 +@@ -197,6 +197,9 @@ static const object_vtbl_t session_vtbl + session_set_option + }; + ++#ifdef __REACTOS__ ++BOOL netconn_init_winsock(); ++#endif /* __REACTOS__ */ + /*********************************************************************** + * WinHttpOpen (winhttp.@) + */ +@@ -204,6 +207,9 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag { session_t *session; HINTERNET handle = NULL; +#ifdef __REACTOS__ -+ WSADATA wsaData; -+ int error = WSAStartup(MAKEWORD(2, 2), &wsaData); -+ if (error) ERR("WSAStartup failed: %d\n", error); ++ if (!netconn_init_winsock()) return NULL; +#endif TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags); -@@ -246,14 +226,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag +@@ -230,14 +236,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag session->access = info.dwAccessType; if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy ))) { @@ -153,7 +191,7 @@ goto end; } } -@@ -624,7 +604,7 @@ static WCHAR *blob_to_str( DWORD encodin +@@ -610,7 +616,7 @@ static WCHAR *blob_to_str( DWORD encodin static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_storage ) { Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Nov 23 11:59:10 2016 @@ -200,7 +200,7 @@ reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.9.11 reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.9.23 reactos/dll/win32/wing32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/winhttp # Synced to WineStaging-1.9.16 +reactos/dll/win32/winhttp # Synced to WineStaging-1.9.23 reactos/dll/win32/wininet # Synced to WineStaging-1.9.16 reactos/dll/win32/winmm # Forked at Wine-20050628 reactos/dll/win32/winmm/midimap # Forked at Wine-20050628
8 years, 1 month
1
0
0
0
[tfaber] 73356: [ACPI] - Do not assert phys in AcpiOsMapMemory. Patch by Giovanni Mascellani (gio at debian dot org). CORE-12444 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Nov 23 11:57:52 2016 New Revision: 73356 URL:
http://svn.reactos.org/svn/reactos?rev=73356&view=rev
Log: [ACPI] - Do not assert phys in AcpiOsMapMemory. Patch by Giovanni Mascellani (gio at debian dot org). CORE-12444 #resolve Modified: trunk/reactos/drivers/bus/acpi/osl.c Modified: trunk/reactos/drivers/bus/acpi/osl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/osl.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/acpi/osl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/osl.c [iso-8859-1] Wed Nov 23 11:57:52 2016 @@ -113,8 +113,6 @@ PVOID Ptr; DPRINT("AcpiOsMapMemory(phys 0x%p size 0x%X)\n", phys, length); - - ASSERT(phys); Address.QuadPart = (ULONG)phys; Ptr = MmMapIoSpace(Address, length, MmNonCached);
8 years, 1 month
1
0
0
0
[akhaldi] 73355: [JSCRIPT_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 10:09:03 2016 New Revision: 73355 URL:
http://svn.reactos.org/svn/reactos?rev=73355&view=rev
Log: [JSCRIPT_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 Modified: trunk/rostests/winetests/jscript/api.js trunk/rostests/winetests/jscript/jscript.c Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
============================================================================== --- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Wed Nov 23 10:09:03 2016 @@ -629,6 +629,12 @@ ok(tmp == -1, "indexOf = " + tmp); tmp = "abcd".indexOf("b", bigInt); ok(tmp == -1, "indexOf = " + tmp); +tmp = "abcd".indexOf("abcd",0); +ok(tmp === 0, "indexOf = " + tmp); +tmp = "abcd".indexOf("abcd",1); +ok(tmp === -1, "indexOf = " + tmp); +tmp = ("ab" + String.fromCharCode(0) + "cd").indexOf(String.fromCharCode(0)); +ok(tmp === 2, "indexOf = " + tmp); tmp = "abcd".lastIndexOf("bc",1); ok(tmp === 1, "lastIndexOf = " + tmp); @@ -650,6 +656,12 @@ ok(tmp === 1, "lastIndexOf = " + tmp); tmp = "bbb".lastIndexOf("b", bigInt); ok(tmp === 2, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("abcd",4); +ok(tmp === 0, "lastIndexOf = " + tmp); +tmp = "abcd".lastIndexOf("abcd",0); +ok(tmp === 0, "lastIndexOf = " + tmp); +tmp = ("ab" + String.fromCharCode(0) + "cd").lastIndexOf(String.fromCharCode(0)); +ok(tmp === 2, "lastIndexOf = " + tmp); tmp = "".toLowerCase(); ok(tmp === "", "''.toLowerCase() = " + tmp); @@ -661,6 +673,8 @@ ok(tmp === "test", "''.toLowerCase() = " + tmp); tmp = "tEsT".toLowerCase(3); ok(tmp === "test", "''.toLowerCase(3) = " + tmp); +tmp = ("tE" + String.fromCharCode(0) + "sT").toLowerCase(); +ok(tmp === "te" + String.fromCharCode(0) + "st", "''.toLowerCase() = " + tmp); tmp = "".toUpperCase(); ok(tmp === "", "''.toUpperCase() = " + tmp); @@ -672,6 +686,8 @@ ok(tmp === "TEST", "''.toUpperCase() = " + tmp); tmp = "tEsT".toUpperCase(3); ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp); +tmp = ("tE" + String.fromCharCode(0) + "sT").toUpperCase(); +ok(tmp === "TE" + String.fromCharCode(0) + "ST", "''.toUpperCase() = " + tmp); tmp = "".anchor(); ok(tmp === "<A NAME=\"undefined\"></A>", "''.anchor() = " + tmp); @@ -916,6 +932,11 @@ ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); tmp = arr.toString("test"); ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp); + +arr = ["a", "b"]; + +tmp = arr.join(String.fromCharCode(0)); +ok(tmp === "a" + String.fromCharCode(0) + "b", "arr.join(String.fromCharCode(0)) = " + tmp); arr = new Object(); arr.length = 3; @@ -2129,6 +2150,23 @@ "Date.parse(\"Tue, 22 Mar 2016 09:57:55 -0300\") = " + Date.parse("Tue, 22 Mar 2016 09:57:55 -0300")); ok(Date.parse("Tue, 22 Mar 2016 09:57:55 +0400") === Date.parse("Tue, 22 Mar 2016 09:57:55 UTC+0400"), "Date.parse(\"Tue, 22 Mar 2016 09:57:55 +0400\") = " + Date.parse("Tue, 22 Mar 2016 09:57:55 +0400")); + +tmp = (new Date()).toGMTString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toLocaleDateString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date(1600, 1, 1, 0, 0, 0, 0)).toLocaleDateString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date(1600, 1, 1, 0, 0, 0, 0)).toLocaleString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toLocaleTimeString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toTimeString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); +tmp = (new Date()).toUTCString(); +ok(tmp.indexOf(String.fromCharCode(0)) == -1, "invalid null byte"); ok(typeof(Math.PI) === "number", "typeof(Math.PI) = " + typeof(Math.PI)); ok(Math.floor(Math.PI*100) === 314, "Math.PI = " + Math.PI); Modified: trunk/rostests/winetests/jscript/jscript.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/jscript…
============================================================================== --- trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/jscript.c [iso-8859-1] Wed Nov 23 10:09:03 2016 @@ -668,7 +668,7 @@ hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void**)&unk); - ok(hres == CLASS_E_NOAGGREGATION || broken(E_INVALIDARG) /* win2k */, + ok(hres == CLASS_E_NOAGGREGATION, "CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres); ok(!unk || broken(unk != NULL), "unk = %p\n", unk); }
8 years, 1 month
1
0
0
0
[akhaldi] 73354: [JSCRIPT] Sync with Wine Staging 1.9.23. Dedicated to Ged. CORE-12409 7af3f65 jscript: Add more jsdisp_t to Instance helpers. 55f6e3c jscript: Use the existing helpers to get from ...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 10:06:56 2016 New Revision: 73354 URL:
http://svn.reactos.org/svn/reactos?rev=73354&view=rev
Log: [JSCRIPT] Sync with Wine Staging 1.9.23. Dedicated to Ged. CORE-12409 7af3f65 jscript: Add more jsdisp_t to Instance helpers. 55f6e3c jscript: Use the existing helpers to get from a jsdisp_t to an Instance. 0f21353 jscript: Use wine_rb_tree to store local variables in compiler_ctx_t. fc1ae4f jscript: Use CONTAINING_RECORD() to get from a field to a struct. 57291c4 jscript: Simplify create_utc_string and add basic tests. 20d5bba jscript: Simplify date_to_string and add basic tests. 4d67ffd jscript: Allocate string of correct size in Date toLocaleDateString method. 79f18d0 jscript: Properly handle \0 characters in Array join method. fd07a15 jscript: Allocate string of correct size in Date toTimeString method. 1c3e0dd jscript: Properly handle \0 characters in String indexOf method. 54e6736 jscript: Properly handle \0 characters in String to{Lower,Upper}Case methods. 1842082 jscript: Do not include terminating \0 in result returned by Date_toLocale{Date,Time}String. 69437af jscript: Change prototype of jsstr_alloc_buf and fix some error handling issues. d36ae56 jscript: Fix definition of JSSTR_MAX_LENGTH. 7369836 jscript: Simplify jsstr_release implementation. Modified: trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/compile.c trunk/reactos/dll/win32/jscript/date.c trunk/reactos/dll/win32/jscript/error.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jsregexp.c trunk/reactos/dll/win32/jscript/jsstr.c trunk/reactos/dll/win32/jscript/jsstr.h trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/object.c trunk/reactos/dll/win32/jscript/string.c trunk/reactos/dll/win32/jscript/vbarray.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -93,7 +93,7 @@ static HRESULT set_length(jsdisp_t *obj, DWORD length) { if(is_class(obj, JSCLASS_ARRAY)) { - ((ArrayInstance*)obj)->length = length; + array_from_jsdisp(obj)->length = length; return S_OK; } @@ -181,7 +181,7 @@ jsobj = iface_to_jsdisp(obj); if(jsobj) { if(is_class(jsobj, JSCLASS_ARRAY)) { - hres = concat_array(array, (ArrayInstance*)jsobj, len); + hres = concat_array(array, array_from_jsdisp(jsobj), len); jsdisp_release(jsobj); return hres; } @@ -228,9 +228,10 @@ return S_OK; } -static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, jsval_t *r) -{ - jsstr_t **str_tab, *ret; +static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, + unsigned seplen, jsval_t *r) +{ + jsstr_t **str_tab, *ret = NULL; jsval_t val; DWORD i; HRESULT hres = E_FAIL; @@ -262,9 +263,7 @@ } if(SUCCEEDED(hres)) { - DWORD seplen = 0, len = 0; - - seplen = strlenW(sep); + DWORD len = 0; if(str_tab[0]) len = jsstr_length(str_tab[0]); @@ -281,8 +280,8 @@ if(SUCCEEDED(hres)) { WCHAR *ptr = NULL; - ptr = jsstr_alloc_buf(len, &ret); - if(ptr) { + ret = jsstr_alloc_buf(len, &ptr); + if(ret) { if(str_tab[0]) ptr += jsstr_flush(str_tab[0], ptr); @@ -340,11 +339,11 @@ if(FAILED(hres)) return hres; - hres = array_join(ctx, jsthis, length, sep, r); + hres = array_join(ctx, jsthis, length, sep, jsstr_length(sep_str), r); jsstr_release(sep_str); }else { - hres = array_join(ctx, jsthis, length, default_separatorW, r); + hres = array_join(ctx, jsthis, length, default_separatorW, strlenW(default_separatorW), r); } return hres; @@ -928,7 +927,8 @@ if(!array) return throw_type_error(ctx, JS_E_ARRAY_EXPECTED, NULL); - return array_join(ctx, &array->dispex, array->length, default_separatorW, r); + return array_join(ctx, &array->dispex, array->length, default_separatorW, + strlenW(default_separatorW), r); } static HRESULT Array_toLocaleString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, @@ -1004,7 +1004,8 @@ TRACE("\n"); - return array_join(ctx, &array->dispex, array->length, default_separatorW, r); + return array_join(ctx, &array->dispex, array->length, default_separatorW, + strlenW(default_separatorW), r); } static void Array_destructor(jsdisp_t *dispex) @@ -1014,7 +1015,7 @@ static void Array_on_put(jsdisp_t *dispex, const WCHAR *name) { - ArrayInstance *array = (ArrayInstance*)dispex; + ArrayInstance *array = array_from_jsdisp(dispex); const WCHAR *ptr = name; DWORD id = 0; Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -28,15 +28,25 @@ static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}; static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0}; +static inline BoolInstance *bool_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, BoolInstance, dispex); +} + +static inline BoolInstance *bool_from_vdisp(vdisp_t *vdisp) +{ + return bool_from_jsdisp(vdisp->u.jsdisp); +} + static inline BoolInstance *bool_this(vdisp_t *jsthis) { - return is_vclass(jsthis, JSCLASS_BOOLEAN) ? (BoolInstance*)jsthis->u.jsdisp : NULL; + return is_vclass(jsthis, JSCLASS_BOOLEAN) ? bool_from_vdisp(jsthis) : NULL; } BOOL bool_obj_value(jsdisp_t *obj) { assert(is_class(obj, JSCLASS_BOOLEAN)); - return ((BoolInstance*)obj)->val; + return bool_from_jsdisp(obj)->val; } /* ECMA-262 3rd Edition 15.6.4.2 */ Modified: trunk/reactos/dll/win32/jscript/compile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/compile.…
============================================================================== --- trunk/reactos/dll/win32/jscript/compile.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/compile.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -18,6 +18,8 @@ #include "jscript.h" +#include <wine/rbtree.h> + WINE_DECLARE_DEBUG_CHANNEL(jscript_disas); typedef struct _statement_ctx_t { @@ -34,6 +36,12 @@ } statement_ctx_t; typedef struct { + struct wine_rb_entry entry; + BSTR name; + int ref; +} function_local_t; + +typedef struct { parser_ctx_t *parser; bytecode_t *code; @@ -46,8 +54,7 @@ unsigned labels_size; unsigned labels_cnt; - local_ref_t *locals_buf; - unsigned locals_buf_size; + struct wine_rb_tree locals; unsigned locals_cnt; statement_ctx_t *stat_ctx; @@ -55,6 +62,8 @@ function_expression_t *func_head; function_expression_t *func_tail; + + heap_pool_t heap; } compiler_ctx_t; static const struct { @@ -1804,42 +1813,29 @@ return hres; } -static int local_cmp(const void *key, const void *ref) -{ - return strcmpW((const WCHAR*)key, ((const local_ref_t*)ref)->name); -} - -static inline local_ref_t *find_local(compiler_ctx_t *ctx, const WCHAR *name) -{ - return bsearch(name, ctx->locals_buf, ctx->locals_cnt, sizeof(*ctx->locals_buf), local_cmp); +static int function_local_cmp(const void *key, const struct wine_rb_entry *entry) +{ + function_local_t *local = WINE_RB_ENTRY_VALUE(entry, function_local_t, entry); + return strcmpW(key, local->name); +} + +static inline function_local_t *find_local(compiler_ctx_t *ctx, const WCHAR *name) +{ + struct wine_rb_entry *entry = wine_rb_get(&ctx->locals, name); + return entry ? WINE_RB_ENTRY_VALUE(entry, function_local_t, entry) : NULL; } static BOOL alloc_local(compiler_ctx_t *ctx, BSTR name, int ref) { - unsigned i; - - if(!ctx->locals_buf_size) { - ctx->locals_buf = heap_alloc(4 * sizeof(*ctx->locals_buf)); - if(!ctx->locals_buf) - return FALSE; - ctx->locals_buf_size = 4; - }else if(ctx->locals_buf_size == ctx->locals_cnt) { - local_ref_t *new_buf = heap_realloc(ctx->locals_buf, ctx->locals_buf_size * 2 * sizeof(*ctx->locals_buf)); - if(!new_buf) - return FALSE; - ctx->locals_buf = new_buf; - ctx->locals_buf_size *= 2; - } - - for(i = 0; i < ctx->locals_cnt; i++) { - if(strcmpW(ctx->locals_buf[i].name, name) > 0) { - memmove(ctx->locals_buf + i+1, ctx->locals_buf + i, (ctx->locals_cnt - i) * sizeof(*ctx->locals_buf)); - break; - } - } - - ctx->locals_buf[i].name = name; - ctx->locals_buf[i].ref = ref; + function_local_t *local; + + local = heap_pool_alloc(&ctx->heap, sizeof(*local)); + if(!local) + return FALSE; + + local->name = name; + local->ref = ref; + wine_rb_put(&ctx->locals, name, &local->entry); ctx->locals_cnt++; return TRUE; } @@ -2256,7 +2252,8 @@ BOOL from_eval, function_code_t *func) { function_expression_t *iter; - unsigned off, i, j; + function_local_t *local; + unsigned off, i; HRESULT hres; TRACE("\n"); @@ -2265,6 +2262,7 @@ ctx->from_eval = from_eval; ctx->func = func; ctx->locals_cnt = 0; + wine_rb_init(&ctx->locals, function_local_cmp); if(func_expr) { parameter_t *param_iter; @@ -2311,21 +2309,22 @@ if(!func->locals) return E_OUTOFMEMORY; func->locals_cnt = ctx->locals_cnt; - memcpy(func->locals, ctx->locals_buf, func->locals_cnt * sizeof(*func->locals)); func->variables = compiler_alloc(ctx->code, func->var_cnt * sizeof(*func->variables)); if(!func->variables) return E_OUTOFMEMORY; - for(i = 0, j = 0; i < func->locals_cnt; i++) { - if(func->locals[i].ref < 0) - continue; /* skip arguments */ - func->variables[func->locals[i].ref].name = func->locals[i].name; - func->variables[func->locals[i].ref].func_id = -1; - j++; - } - - assert(j == func->var_cnt); + i = 0; + WINE_RB_FOR_EACH_ENTRY(local, &ctx->locals, function_local_t, entry) { + func->locals[i].name = local->name; + func->locals[i].ref = local->ref; + if(local->ref >= 0) { + func->variables[local->ref].name = local->name; + func->variables[local->ref].func_id = -1; + } + i++; + } + assert(i == ctx->locals_cnt); func->funcs = compiler_alloc(ctx->code, func->func_cnt * sizeof(*func->funcs)); if(!func->funcs) @@ -2468,9 +2467,10 @@ return hres; } + heap_pool_init(&compiler.heap); hres = compile_function(&compiler, compiler.parser->source, NULL, from_eval, &compiler.code->global_code); + heap_pool_free(&compiler.heap); parser_release(compiler.parser); - heap_free(compiler.locals_buf); if(FAILED(hres)) { release_bytecode(compiler.code); return hres; Modified: trunk/reactos/dll/win32/jscript/date.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/date.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/date.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/date.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -483,8 +483,9 @@ BOOL formatAD = TRUE; WCHAR week[64], month[64]; + WCHAR buf[192]; jsstr_t *date_jsstr; - int len, size, year, day; + int year, day; DWORD lcid_en; WCHAR sign = '-'; @@ -495,65 +496,44 @@ } if(r) { - WCHAR *date_str; - - len = 21; - lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - size = GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week)); - assert(size); - len += size-1; - - size = GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month)); - len += size-1; - - year = year_from_time(time); - if(year<0) - year = -year+1; - do { - year /= 10; - len++; - } while(year); + week[0] = 0; + GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week)); + + month[0] = 0; + GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month)); year = year_from_time(time); if(year<0) { formatAD = FALSE; year = -year+1; - len += 5; } day = date_from_time(time); - do { - day /= 10; - len++; - } while(day); - day = date_from_time(time); - - if(!show_offset) len -= 9; - else if(offset == 0) len -= 5; - else if(offset < 0) { + + if(offset < 0) { sign = '+'; offset = -offset; } - date_str = jsstr_alloc_buf(len, &date_jsstr); - if(!date_str) - return E_OUTOFMEMORY; - if(!show_offset) - sprintfW(date_str, formatNoOffsetW, week, month, day, + sprintfW(buf, formatNoOffsetW, week, month, day, (int)hour_from_time(time), (int)min_from_time(time), (int)sec_from_time(time), year, formatAD?ADW:BCW); else if(offset) - sprintfW(date_str, formatW, week, month, day, + sprintfW(buf, formatW, week, month, day, (int)hour_from_time(time), (int)min_from_time(time), (int)sec_from_time(time), sign, offset/60, offset%60, year, formatAD?ADW:BCW); else - sprintfW(date_str, formatUTCW, week, month, day, + sprintfW(buf, formatUTCW, week, month, day, (int)hour_from_time(time), (int)min_from_time(time), (int)sec_from_time(time), year, formatAD?ADW:BCW); + + date_jsstr = jsstr_alloc(buf); + if(!date_jsstr) + return E_OUTOFMEMORY; *r = jsval_string(date_jsstr); } @@ -616,7 +596,7 @@ date_len = GetDateFormatW(ctx->lcid, DATE_LONGDATE, &st, NULL, NULL, 0); time_len = GetTimeFormatW(ctx->lcid, 0, &st, NULL, NULL, 0); - ptr = jsstr_alloc_buf(date_len+time_len-1, &date_str); + date_str = jsstr_alloc_buf(date_len+time_len-1, &ptr); if(!date_str) return E_OUTOFMEMORY; @@ -663,9 +643,10 @@ BOOL formatAD = TRUE; WCHAR week[64], month[64]; + WCHAR buf[192]; DateInstance *date; jsstr_t *date_str; - int len, size, year, day; + int year, day; DWORD lcid_en; if(!(date = date_this(jsthis))) @@ -678,47 +659,29 @@ } if(r) { - WCHAR *ptr; - - len = 17; - lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - size = GetLocaleInfoW(lcid_en, week_ids[(int)week_day(date->time)], week, sizeof(week)/sizeof(*week)); - len += size-1; - - size = GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(date->time)], month, sizeof(month)/sizeof(*month)); - len += size-1; - - year = year_from_time(date->time); - if(year<0) - year = -year+1; - do { - year /= 10; - len++; - } while(year); + week[0] = 0; + GetLocaleInfoW(lcid_en, week_ids[(int)week_day(date->time)], week, sizeof(week)/sizeof(*week)); + + month[0] = 0; + GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(date->time)], month, sizeof(month)/sizeof(*month)); year = year_from_time(date->time); if(year<0) { formatAD = FALSE; year = -year+1; - len += 5; } day = date_from_time(date->time); - do { - day /= 10; - len++; - } while(day); - day = date_from_time(date->time); - - ptr = jsstr_alloc_buf(len, &date_str); + + sprintfW(buf, formatAD ? formatADW : formatBCW, week, day, month, year, + (int)hour_from_time(date->time), (int)min_from_time(date->time), + (int)sec_from_time(date->time)); + + date_str = jsstr_alloc(buf); if(!date_str) return E_OUTOFMEMORY; - - sprintfW(ptr, formatAD?formatADW:formatBCW, week, day, month, year, - (int)hour_from_time(date->time), (int)min_from_time(date->time), - (int)sec_from_time(date->time)); *r = jsval_string(date_str); } @@ -758,9 +721,10 @@ BOOL formatAD = TRUE; WCHAR week[64], month[64]; + WCHAR buf[192]; jsstr_t *date_str; DOUBLE time; - int len, size, year, day; + int year, day; DWORD lcid_en; if(isnan(date->time)) { @@ -772,46 +736,27 @@ time = local_time(date->time, date); if(r) { - WCHAR *ptr; - - len = 5; - lcid_en = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); - size = GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week)); - assert(size); - len += size-1; - - size = GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month)); - assert(size); - len += size-1; - - year = year_from_time(time); - if(year<0) - year = -year+1; - do { - year /= 10; - len++; - } while(year); + week[0] = 0; + GetLocaleInfoW(lcid_en, week_ids[(int)week_day(time)], week, sizeof(week)/sizeof(*week)); + + month[0] = 0; + GetLocaleInfoW(lcid_en, month_ids[(int)month_from_time(time)], month, sizeof(month)/sizeof(*month)); year = year_from_time(time); if(year<0) { formatAD = FALSE; year = -year+1; - len += 5; } day = date_from_time(time); - do { - day /= 10; - len++; - } while(day); - day = date_from_time(time); - - ptr = jsstr_alloc_buf(len, &date_str); - if(!ptr) + + sprintfW(buf, formatAD ? formatADW : formatBCW, week, month, day, year); + + date_str = jsstr_alloc(buf); + if(!date_str) return E_OUTOFMEMORY; - sprintfW(ptr, formatAD?formatADW:formatBCW, week, month, day, year); *r = jsval_string(date_str); } @@ -839,6 +784,7 @@ ':','%','0','2','d',' ','U','T','C',0 }; DateInstance *date; jsstr_t *date_str; + WCHAR buf[32]; DOUBLE time; WCHAR sign; int offset; @@ -857,12 +803,6 @@ time = local_time(date->time, date); if(r) { - WCHAR *ptr; - - ptr = jsstr_alloc_buf(17, &date_str); - if(!date_str) - return E_OUTOFMEMORY; - offset = date->bias + daylight_saving_ta(time, date); @@ -873,12 +813,16 @@ else sign = '-'; if(offset) - sprintfW(ptr, formatW, (int)hour_from_time(time), + sprintfW(buf, formatW, (int)hour_from_time(time), (int)min_from_time(time), (int)sec_from_time(time), sign, offset/60, offset%60); else - sprintfW(ptr, formatUTCW, (int)hour_from_time(time), + sprintfW(buf, formatUTCW, (int)hour_from_time(time), (int)min_from_time(time), (int)sec_from_time(time)); + + date_str = jsstr_alloc(buf); + if(!date_str) + return E_OUTOFMEMORY; *r = jsval_string(date_str); } @@ -914,8 +858,8 @@ WCHAR *ptr; len = GetDateFormatW(ctx->lcid, DATE_LONGDATE, &st, NULL, NULL, 0); - ptr = jsstr_alloc_buf(len, &date_str); - if(!ptr) + date_str = jsstr_alloc_buf(len-1, &ptr); + if(!date_str) return E_OUTOFMEMORY; GetDateFormatW(ctx->lcid, DATE_LONGDATE, &st, NULL, ptr, len); @@ -953,8 +897,8 @@ WCHAR *ptr; len = GetTimeFormatW(ctx->lcid, 0, &st, NULL, NULL, 0); - ptr = jsstr_alloc_buf(len, &date_str); - if(!ptr) + date_str = jsstr_alloc_buf(len-1, &ptr); + if(!date_str) return E_OUTOFMEMORY; GetTimeFormatW(ctx->lcid, 0, &st, NULL, ptr, len); @@ -2469,7 +2413,7 @@ if(FAILED(hres)) return hres; - di = (DateInstance*)date; + di = date_from_jsdisp(date); di->time = utc(di->time, di); } } Modified: trunk/reactos/dll/win32/jscript/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/error.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/error.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/error.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -76,8 +76,8 @@ if(name_len && msg_len) { WCHAR *ptr; - ptr = jsstr_alloc_buf(name_len + msg_len + 2, &ret); - if(ptr) { + ret = jsstr_alloc_buf(name_len + msg_len + 2, &ptr); + if(ret) { jsstr_flush(name, ptr); ptr[name_len] = ':'; ptr[name_len+1] = ' '; Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
============================================================================== --- trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -74,7 +74,7 @@ static void Arguments_destructor(jsdisp_t *jsdisp) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); TRACE("(%p)\n", arguments); @@ -91,7 +91,7 @@ static unsigned Arguments_idx_length(jsdisp_t *jsdisp) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); return arguments->argc; } @@ -106,7 +106,7 @@ static HRESULT Arguments_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t *ref; TRACE("%p[%u]\n", arguments, idx); @@ -120,7 +120,7 @@ static HRESULT Arguments_idx_put(jsdisp_t *jsdisp, unsigned idx, jsval_t val) { - ArgumentsInstance *arguments = (ArgumentsInstance*)jsdisp; + ArgumentsInstance *arguments = arguments_from_jsdisp(jsdisp); jsval_t *ref; HRESULT hres; @@ -295,8 +295,8 @@ WCHAR *ptr; name_len = strlenW(function->name); - ptr = jsstr_alloc_buf((sizeof(native_prefixW)+sizeof(native_suffixW))/sizeof(WCHAR) + name_len, &str); - if(!ptr) + str = jsstr_alloc_buf((sizeof(native_prefixW)+sizeof(native_suffixW))/sizeof(WCHAR) + name_len, &ptr); + if(!str) return E_OUTOFMEMORY; memcpy(ptr, native_prefixW, sizeof(native_prefixW)); @@ -320,7 +320,7 @@ TRACE("func %p this %p\n", func_this, jsthis); assert(is_class(func_this, JSCLASS_FUNCTION)); - function = (FunctionInstance*)func_this; + function = function_from_jsdisp(func_this); flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(function->value_proc) @@ -523,7 +523,7 @@ return E_FAIL; } - function = (FunctionInstance*)jsthis->u.jsdisp; + function = function_from_jsdisp(jsthis->u.jsdisp); assert(function->value_proc != NULL); return invoke_value_proc(ctx, function, NULL, flags, argc, argv, r); @@ -570,7 +570,7 @@ static void Function_destructor(jsdisp_t *dispex) { - FunctionInstance *This = (FunctionInstance*)dispex; + FunctionInstance *This = function_from_jsdisp(dispex); if(This->code) release_bytecode(This->code); Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -140,8 +140,8 @@ len += 3; } - ret = jsstr_alloc_buf(len, &ret_str); - if(!ret) { + ret_str = jsstr_alloc_buf(len, &ret); + if(!ret_str) { jsstr_release(str); return E_OUTOFMEMORY; } @@ -500,8 +500,8 @@ len++; } - ret = jsstr_alloc_buf(len, &ret_str); - if(!ret) { + ret_str = jsstr_alloc_buf(len, &ret); + if(!ret_str) { jsstr_release(str); return E_OUTOFMEMORY; } @@ -639,8 +639,8 @@ } } - rptr = jsstr_alloc_buf(len, &ret); - if(!rptr) { + ret = jsstr_alloc_buf(len, &rptr); + if(!ret) { jsstr_release(str); return E_OUTOFMEMORY; } @@ -718,8 +718,8 @@ } } - ret = jsstr_alloc_buf(len, &ret_str); - if(!ret) { + ret_str = jsstr_alloc_buf(len, &ret); + if(!ret_str) { jsstr_release(str); return E_OUTOFMEMORY; } @@ -789,8 +789,8 @@ } } - ret = jsstr_alloc_buf(len, &ret_str); - if(!ret) { + ret_str = jsstr_alloc_buf(len, &ret); + if(!ret_str) { jsstr_release(str); return E_OUTOFMEMORY; } @@ -889,7 +889,7 @@ } } - out_ptr = jsstr_alloc_buf(len, &ret); + ret = jsstr_alloc_buf(len, &out_ptr); if(!ret) { jsstr_release(str); return E_OUTOFMEMORY; Modified: trunk/reactos/dll/win32/jscript/jsregexp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsregexp…
============================================================================== --- trunk/reactos/dll/win32/jscript/jsregexp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jsregexp.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -118,7 +118,7 @@ HRESULT regexp_match_next(script_ctx_t *ctx, jsdisp_t *dispex, DWORD rem_flags, jsstr_t *jsstr, match_state_t **ret) { - RegExpInstance *regexp = (RegExpInstance*)dispex; + RegExpInstance *regexp = regexp_from_jsdisp(dispex); match_state_t *match; heap_pool_t *mark; const WCHAR *str; @@ -175,7 +175,7 @@ static HRESULT regexp_match(script_ctx_t *ctx, jsdisp_t *dispex, jsstr_t *jsstr, BOOL gflag, match_result_t **match_result, DWORD *result_cnt) { - RegExpInstance *This = (RegExpInstance*)dispex; + RegExpInstance *This = regexp_from_jsdisp(dispex); match_result_t *ret = NULL; match_state_t *result; DWORD i=0, ret_size = 0; @@ -367,8 +367,8 @@ if(f & REG_MULTILINE) len++; - ptr = jsstr_alloc_buf(len, &ret); - if(!ptr) + ret = jsstr_alloc_buf(len, &ptr); + if(!ret) return E_OUTOFMEMORY; *ptr++ = '/'; @@ -589,7 +589,7 @@ static void RegExp_destructor(jsdisp_t *dispex) { - RegExpInstance *This = (RegExpInstance*)dispex; + RegExpInstance *This = regexp_from_jsdisp(dispex); if(This->jsregexp) regexp_destroy(This->jsregexp); @@ -701,7 +701,7 @@ obj = iface_to_jsdisp(get_object(src_arg)); if(obj) { if(is_class(obj, JSCLASS_REGEXP)) { - RegExpInstance *regexp = (RegExpInstance*)obj; + RegExpInstance *regexp = regexp_from_jsdisp(obj); hres = create_regexp(ctx, regexp->str, regexp->jsregexp->flags, ret); jsdisp_release(obj); @@ -747,7 +747,7 @@ static const WCHAR inputW[] = {'i','n','p','u','t',0}; static const WCHAR lastIndexW[] = {'l','a','s','t','I','n','d','e','x',0}; - RegExpInstance *regexp = (RegExpInstance*)re; + RegExpInstance *regexp = regexp_from_jsdisp(re); match_result_t *match_result; unsigned match_cnt, i; const WCHAR *str; Modified: trunk/reactos/dll/win32/jscript/jsstr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsstr.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/jsstr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jsstr.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -62,7 +62,7 @@ str->ref = 1; } -WCHAR *jsstr_alloc_buf(unsigned len, jsstr_t **r) +jsstr_t *jsstr_alloc_buf(unsigned len, WCHAR **buf) { jsstr_inline_t *ret; @@ -75,8 +75,8 @@ jsstr_init(&ret->str, len, JSSTR_INLINE); ret->buf[len] = 0; - *r = &ret->str; - return ret->buf; + *buf = ret->buf; + return &ret->str; } jsstr_t *jsstr_alloc_len(const WCHAR *buf, unsigned len) @@ -84,8 +84,8 @@ jsstr_t *ret; WCHAR *ptr; - ptr = jsstr_alloc_buf(len, &ret); - if(ptr) + ret = jsstr_alloc_buf(len, &ptr); + if(ret) memcpy(ptr, buf, len*sizeof(WCHAR)); return ret; @@ -243,7 +243,7 @@ } } - ptr = jsstr_alloc_buf(len1+len2, &ret); + ret = jsstr_alloc_buf(len1+len2, &ptr); if(!ret) return NULL; @@ -305,14 +305,15 @@ { static const WCHAR NaNW[] = { 'N','a','N',0 }; static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; - - if(!jsstr_alloc_buf(0, &empty_str)) + WCHAR *ptr; + + if(!(empty_str = jsstr_alloc_buf(0, &ptr))) return FALSE; if(!(nan_str = jsstr_alloc(NaNW))) return FALSE; if(!(undefined_str = jsstr_alloc(undefinedW))) return FALSE; - if(!jsstr_alloc_buf(0, &null_bstr_str)) + if(!(null_bstr_str = jsstr_alloc_buf(0, &ptr))) return FALSE; return TRUE; } Modified: trunk/reactos/dll/win32/jscript/jsstr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsstr.h?…
============================================================================== --- trunk/reactos/dll/win32/jscript/jsstr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jsstr.h [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -42,7 +42,7 @@ }; #define JSSTR_LENGTH_SHIFT 4 -#define JSSTR_MAX_LENGTH (1 << (32-JSSTR_LENGTH_SHIFT)) +#define JSSTR_MAX_LENGTH ((1 << (32-JSSTR_LENGTH_SHIFT))-1) #define JSSTR_FLAGS_MASK ((1 << JSSTR_LENGTH_SHIFT)-1) #define JSSTR_FLAG_LBIT 1 @@ -98,7 +98,7 @@ } jsstr_rope_t; jsstr_t *jsstr_alloc_len(const WCHAR*,unsigned) DECLSPEC_HIDDEN; -WCHAR *jsstr_alloc_buf(unsigned,jsstr_t**) DECLSPEC_HIDDEN; +jsstr_t *jsstr_alloc_buf(unsigned,WCHAR**) DECLSPEC_HIDDEN; static inline jsstr_t *jsstr_alloc(const WCHAR *str) { @@ -109,12 +109,8 @@ static inline void jsstr_release(jsstr_t *str) { - if(!--str->ref) { - if(jsstr_is_inline(str)) - heap_free(str); - else - jsstr_free(str); - } + if(!--str->ref) + jsstr_free(str); } static inline jsstr_t *jsstr_addref(jsstr_t *str) @@ -169,8 +165,8 @@ jsstr_t *ret; WCHAR *ptr; - ptr = jsstr_alloc_buf(len, &ret); - if(ptr) + ret = jsstr_alloc_buf(len, &ptr); + if(ret) jsstr_extract(str, off, len, ptr); return ret; } Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -120,7 +120,7 @@ if(prec) size += prec+1; - str = jsstr_alloc_buf(size, &ret); + ret = jsstr_alloc_buf(size, &str); if(!ret) return NULL; @@ -187,7 +187,7 @@ if(neg) size++; - str = jsstr_alloc_buf(size, &ret); + ret = jsstr_alloc_buf(size, &str); if(!ret) return NULL; Modified: trunk/reactos/dll/win32/jscript/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/object.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -67,8 +67,8 @@ jsstr_t *ret; WCHAR *ptr; - ptr = jsstr_alloc_buf(9+strlenW(str), &ret); - if(!ptr) + ret = jsstr_alloc_buf(9+strlenW(str), &ptr); + if(!ret) return E_OUTOFMEMORY; sprintfW(ptr, formatW, str); Modified: trunk/reactos/dll/win32/jscript/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/string.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/string.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -103,7 +103,7 @@ static HRESULT String_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - StringInstance *string = (StringInstance*)jsthis; + StringInstance *string = string_from_jsdisp(jsthis); TRACE("%p\n", jsthis); @@ -167,7 +167,7 @@ tagname_len = strlenW(tagname); - ptr = jsstr_alloc_buf(jsstr_length(str) + 2*tagname_len + 5, &ret); + ret = jsstr_alloc_buf(jsstr_length(str) + 2*tagname_len + 5, &ptr); if(!ret) { jsstr_release(str); return E_OUTOFMEMORY; @@ -217,8 +217,8 @@ jsstr_t *ret; WCHAR *ptr; - ptr = jsstr_alloc_buf(2*tagname_len + attrname_len + jsstr_length(attr_value) + jsstr_length(str) + 9, &ret); - if(ptr) { + ret = jsstr_alloc_buf(2*tagname_len + attrname_len + jsstr_length(attr_value) + jsstr_length(str) + 9, &ptr); + if(ret) { *ptr++ = '<'; memcpy(ptr, tagname, tagname_len*sizeof(WCHAR)); ptr += tagname_len; @@ -368,7 +368,7 @@ static HRESULT String_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { - jsstr_t *ret, *str; + jsstr_t *ret = NULL, *str; HRESULT hres; TRACE("\n"); @@ -425,8 +425,8 @@ } if(SUCCEEDED(hres)) { - ptr = jsstr_alloc_buf(len, &ret); - if(ptr) { + ret = jsstr_alloc_buf(len, &ptr); + if(ret) { for(i=0; i < str_cnt; i++) ptr += jsstr_flush(strs[i], ptr); }else { @@ -478,9 +478,9 @@ static HRESULT String_indexOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { + unsigned pos = 0, search_len, length; jsstr_t *search_jsstr, *jsstr; const WCHAR *search_str, *str; - int length, pos = 0; INT ret = -1; HRESULT hres; @@ -490,7 +490,6 @@ if(FAILED(hres)) return hres; - length = jsstr_length(jsstr); if(!argc) { if(r) *r = jsval_number(-1); @@ -504,6 +503,9 @@ return hres; } + search_len = jsstr_length(search_jsstr); + length = jsstr_length(jsstr); + if(argc >= 2) { double d; @@ -512,14 +514,16 @@ pos = is_int32(d) ? min(length, d) : length; } - if(SUCCEEDED(hres)) { + if(SUCCEEDED(hres) && length >= search_len) { + const WCHAR *end = str+length-search_len; const WCHAR *ptr; - ptr = strstrW(str+pos, search_str); - if(ptr) - ret = ptr - str; - else - ret = -1; + for(ptr = str+pos; ptr <= end; ptr++) { + if(!memcmp(ptr, search_str, search_len*sizeof(WCHAR))) { + ret = ptr-str; + break; + } + } } jsstr_release(search_jsstr); @@ -1394,17 +1398,19 @@ return hres; if(r) { + unsigned len = jsstr_length(str); jsstr_t *ret; WCHAR *buf; - buf = jsstr_alloc_buf(jsstr_length(str), &ret); - if(!buf) { + ret = jsstr_alloc_buf(len, &buf); + if(!ret) { jsstr_release(str); return E_OUTOFMEMORY; } jsstr_flush(str, buf); - strlwrW(buf); + for (; len--; buf++) *buf = tolowerW(*buf); + *r = jsval_string(ret); } jsstr_release(str); @@ -1424,17 +1430,19 @@ return hres; if(r) { + unsigned len = jsstr_length(str); jsstr_t *ret; WCHAR *buf; - buf = jsstr_alloc_buf(jsstr_length(str), &ret); - if(!buf) { + ret = jsstr_alloc_buf(len, &buf); + if(!ret) { jsstr_release(str); return E_OUTOFMEMORY; } jsstr_flush(str, buf); - struprW(buf); + for (; len--; buf++) *buf = toupperW(*buf); + *r = jsval_string(ret); } jsstr_release(str); @@ -1464,7 +1472,7 @@ static HRESULT String_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { - StringInstance *This = (StringInstance*)jsthis; + StringInstance *This = string_from_jsdisp(jsthis); TRACE("\n"); @@ -1474,7 +1482,7 @@ static void String_destructor(jsdisp_t *dispex) { - StringInstance *This = (StringInstance*)dispex; + StringInstance *This = string_from_jsdisp(dispex); jsstr_release(This->str); heap_free(This); @@ -1482,7 +1490,7 @@ static unsigned String_idx_length(jsdisp_t *jsdisp) { - StringInstance *string = (StringInstance*)jsdisp; + StringInstance *string = string_from_jsdisp(jsdisp); /* * NOTE: For invoke version < 2, indexed array is not implemented at all. @@ -1496,7 +1504,7 @@ static HRESULT String_idx_get(jsdisp_t *jsdisp, unsigned idx, jsval_t *r) { - StringInstance *string = (StringInstance*)jsdisp; + StringInstance *string = string_from_jsdisp(jsdisp); jsstr_t *ret; ret = jsstr_substr(string->str, idx, 1); @@ -1580,8 +1588,8 @@ TRACE("\n"); - ret_str = jsstr_alloc_buf(argc, &ret); - if(!ret_str) + ret = jsstr_alloc_buf(argc, &ret_str); + if(!ret) return E_OUTOFMEMORY; for(i=0; i<argc; i++) { Modified: trunk/reactos/dll/win32/jscript/vbarray.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/vbarray.…
============================================================================== --- trunk/reactos/dll/win32/jscript/vbarray.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/vbarray.c [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -30,9 +30,14 @@ static const WCHAR toArrayW[] = {'t','o','A','r','r','a','y',0}; static const WCHAR uboundW[] = {'u','b','o','u','n','d',0}; +static inline VBArrayInstance *vbarray_from_jsdisp(jsdisp_t *jsdisp) +{ + return CONTAINING_RECORD(jsdisp, VBArrayInstance, dispex); +} + static inline VBArrayInstance *vbarray_from_vdisp(vdisp_t *vdisp) { - return (VBArrayInstance*)vdisp->u.jsdisp; + return vbarray_from_jsdisp(vdisp->u.jsdisp); } static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis) @@ -232,7 +237,7 @@ static void VBArray_destructor(jsdisp_t *dispex) { - VBArrayInstance *vbarray = (VBArrayInstance*)dispex; + VBArrayInstance *vbarray = vbarray_from_jsdisp(dispex); SafeArrayDestroy(vbarray->safearray); heap_free(vbarray); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Wed Nov 23 10:06:56 2016 @@ -85,7 +85,7 @@ reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to WineStaging-1.9.11 reactos/dll/win32/itss # Synced to WineStaging-1.9.11 -reactos/dll/win32/jscript # Synced to WineStaging-1.9.16 +reactos/dll/win32/jscript # Synced to WineStaging-1.9.23 reactos/dll/win32/jsproxy # Synced to WineStaging-1.9.11 reactos/dll/win32/loadperf # Synced to WineStaging-1.9.11 reactos/dll/win32/lz32 # Synced to WineStaging-1.9.11
8 years, 1 month
1
0
0
0
[akhaldi] 73353: [CRYPT32] Bring back the code path that had r64026 and r66349 until we adapt our changes to the new code. CORE-12409 CORE-12446
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Nov 23 09:22:56 2016 New Revision: 73353 URL:
http://svn.reactos.org/svn/reactos?rev=73353&view=rev
Log: [CRYPT32] Bring back the code path that had r64026 and r66349 until we adapt our changes to the new code. CORE-12409 CORE-12446 Modified: trunk/reactos/dll/win32/crypt32/rootstore.c Modified: trunk/reactos/dll/win32/crypt32/rootstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/rootstor…
============================================================================== --- trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/crypt32/rootstore.c [iso-8859-1] Wed Nov 23 09:22:56 2016 @@ -427,6 +427,57 @@ } return ret; } + +#ifdef __REACTOS__ + +static BOOL WINAPI CRYPT_RootWriteCert(HCERTSTORE hCertStore, + PCCERT_CONTEXT cert, DWORD dwFlags) +{ + /* The root store can't have certs added */ + return FALSE; +} + +static BOOL WINAPI CRYPT_RootDeleteCert(HCERTSTORE hCertStore, + PCCERT_CONTEXT cert, DWORD dwFlags) +{ + /* The root store can't have certs deleted */ + return FALSE; +} + +static BOOL WINAPI CRYPT_RootWriteCRL(HCERTSTORE hCertStore, + PCCRL_CONTEXT crl, DWORD dwFlags) +{ + /* The root store can have CRLs added. At worst, a malicious application + * can DoS itself, as the changes aren't persisted in any way. + */ + return TRUE; +} + +static BOOL WINAPI CRYPT_RootDeleteCRL(HCERTSTORE hCertStore, + PCCRL_CONTEXT crl, DWORD dwFlags) +{ + /* The root store can't have CRLs deleted */ + return FALSE; +} + +static void *rootProvFuncs[] = { + NULL, /* CERT_STORE_PROV_CLOSE_FUNC */ + NULL, /* CERT_STORE_PROV_READ_CERT_FUNC */ + CRYPT_RootWriteCert, + CRYPT_RootDeleteCert, + NULL, /* CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_READ_CRL_FUNC */ + CRYPT_RootWriteCRL, + CRYPT_RootDeleteCRL, + NULL, /* CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_READ_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_WRITE_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_DELETE_CTL_FUNC */ + NULL, /* CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC */ + NULL, /* CERT_STORE_PROV_CONTROL_FUNC */ +}; + +#endif /* __REACTOS__ */ static const char * const CRYPT_knownLocations[] = { "/etc/ssl/certs/ca-certificates.crt", @@ -736,17 +787,48 @@ static HCERTSTORE create_root_store(void) { +#ifdef __REACTOS__ + HCERTSTORE root = NULL; +#endif HCERTSTORE memStore = CertOpenStore(CERT_STORE_PROV_MEMORY, X509_ASN_ENCODING, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); if (memStore) { +#ifdef __REACTOS__ + HCERTSTORE regStore; + CERT_STORE_PROV_INFO provInfo = { + sizeof(CERT_STORE_PROV_INFO), + sizeof(rootProvFuncs) / sizeof(rootProvFuncs[0]), + rootProvFuncs, + NULL, + 0, + NULL + }; +#endif + read_trusted_roots_from_known_locations(memStore); add_ms_root_certs(memStore); - } - +#ifdef __REACTOS__ + root = CRYPT_ProvCreateStore(0, memStore, &provInfo); + regStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, L"AuthRoot"); + if (regStore) + { + HCERTSTORE collStore = CertOpenStore(CERT_STORE_PROV_COLLECTION, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddStoreToCollection(collStore, regStore, 0, 0); + CertAddStoreToCollection(collStore, root, 0, 0); + root = collStore; + } +#endif + } +#ifdef __REACTOS__ + TRACE("returning %p\n", root); + return root; +#else TRACE("returning %p\n", memStore); return memStore; +#endif } static const WCHAR certs_root_pathW[] =
8 years, 1 month
1
0
0
0
[gedmurphy] 73352: [NTOS] - Fix an assert in MiFindExportedRoutineByName to be something more like what the original author probably wanted to do. - This allows FileSpy to run successfully with the...
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Tue Nov 22 22:30:55 2016 New Revision: 73352 URL:
http://svn.reactos.org/svn/reactos?rev=73352&view=rev
Log: [NTOS] - Fix an assert in MiFindExportedRoutineByName to be something more like what the original author probably wanted to do. - This allows FileSpy to run successfully with the legacy filter driver -
https://postimg.org/image/7z73xy4pd/
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Tue Nov 22 22:30:55 2016 @@ -554,8 +554,9 @@ Function = (PVOID)((ULONG_PTR)DllBase + ExportTable[Ordinal]); /* We found it! */ - ASSERT(!(Function > (PVOID)ExportDirectory) && - (Function < (PVOID)((ULONG_PTR)ExportDirectory + ExportSize))); + ASSERT((Function < (PVOID)ExportDirectory) || + (Function > (PVOID)((ULONG_PTR)ExportDirectory + ExportSize))); + return Function; }
8 years, 1 month
1
0
0
0
[akhaldi] 73351: [WINDOWSCODECS] Addendum to r73303. CORE-12409
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Nov 22 18:10:59 2016 New Revision: 73351 URL:
http://svn.reactos.org/svn/reactos?rev=73351&view=rev
Log: [WINDOWSCODECS] Addendum to r73303. CORE-12409 Modified: trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs Modified: trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/windowscodecs/wi…
============================================================================== --- trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs [iso-8859-1] (original) +++ trunk/reactos/dll/win32/windowscodecs/windowscodecs_wincodec.rgs [iso-8859-1] Tue Nov 22 18:10:59 2016 @@ -163,6 +163,10 @@ { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } } + '{114F5598-0B22-40A0-86A1-C83EA495ADBD}' = s 'WIC GIF Encoder' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } '{C61BFCDF-2E0F-4AAD-A8D7-E06BAFEBCDFE}' = s 'WIC ICO Decoder' { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
8 years, 1 month
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
32
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
Results per page:
10
25
50
100
200