Author: akhaldi
Date: Sun Mar 19 17:05:35 2017
New Revision: 74198
URL:
http://svn.reactos.org/svn/reactos?rev=74198&view=rev
Log:
[WINHTTP_WINETEST] Sync with Wine Staging 2.2. CORE-12823
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] Sun Mar 19 17:05:35 2017
@@ -118,7 +118,7 @@
{
URL_COMPONENTS uc;
WCHAR *url;
- DWORD len;
+ DWORD len, err;
BOOL ret;
/* NULL components */
@@ -144,22 +144,33 @@
ok( !ret, "expected failure\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER
got %u\n", GetLastError() );
- /* valid components, NULL url */
+ /* valid components, NULL url, insufficient length */
+ len = 0;
SetLastError( 0xdeadbeef );
ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
ok( !ret, "expected failure\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
- GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER got
%u\n", GetLastError() );
+ ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected
ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() );
+ ok( len == 57, "expected len 57 got %u\n", len );
+
+ /* valid components, NULL url, sufficient length */
+ SetLastError( 0xdeadbeef );
+ len = 256;
+ ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
+ err = GetLastError();
+ ok( !ret, "expected failure\n" );
+ ok( err == ERROR_INVALID_PARAMETER || broken(err == ERROR_INSUFFICIENT_BUFFER) /*
< win7 */,
+ "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
+ ok( len == 256 || broken(len == 57) /* < win7 */, "expected len 256 got
%u\n", len );
/* correct size, NULL url */
fill_url_components( &uc );
SetLastError( 0xdeadbeef );
ret = WinHttpCreateUrl( &uc, 0, NULL, &len );
+ err = GetLastError();
ok( !ret, "expected failure\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
- GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER got
%u\n", GetLastError() );
+ ok( err == ERROR_INVALID_PARAMETER || broken(err == ERROR_INSUFFICIENT_BUFFER) /*
< win7 */,
+ "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() );
+ ok( len == 256 || broken(len == 57) /* < win7 */, "expected len 256 got
%u\n", len );
/* valid components, allocated url, short length */
SetLastError( 0xdeadbeef );
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] Sun Mar 19 17:05:35 2017
@@ -1002,7 +1002,10 @@
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());
+ err = GetLastError();
+ ok(!ret, "unexpected success\n");
+ ok(err == ERROR_WINHTTP_INCORRECT_HANDLE_STATE || broken(err ==
ERROR_INVALID_PARAMETER) /* winxp */,
+ "setting client cert context returned %u\n", err);
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0);
err = GetLastError();
@@ -1028,7 +1031,8 @@
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());
+ err = GetLastError();
+ ok(ret || broken(!ret && err == ERROR_INVALID_PARAMETER) /* winxp */,
"failed to set client cert context %u\n", err);
WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE,
0);
@@ -1220,21 +1224,28 @@
return ret;
}
+static void set_proxy( REGSAM access, BYTE *buf, DWORD len, DWORD type )
+{
+ HKEY hkey;
+ if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0, access, NULL,
&hkey, NULL ))
+ {
+ if (len) RegSetValueExW( hkey, WinHttpSettings, 0, type, buf, len );
+ else RegDeleteValueW( hkey, WinHttpSettings );
+ RegCloseKey( hkey );
+ }
+}
+
static void set_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD type )
{
- LONG l;
- HKEY key;
-
- l = RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0,
- KEY_WRITE, NULL, &key, NULL );
- if (!l)
+ BOOL wow64;
+ IsWow64Process( GetCurrentProcess(), &wow64 );
+ if (sizeof(void *) > sizeof(int) || wow64)
{
- if (len)
- RegSetValueExW( key, WinHttpSettings, 0, type, buf, len );
- else
- RegDeleteValueW( key, WinHttpSettings );
- RegCloseKey( key );
+ set_proxy( KEY_WRITE|KEY_WOW64_64KEY, buf, len, type );
+ set_proxy( KEY_WRITE|KEY_WOW64_32KEY, buf, len, type );
}
+ else
+ set_proxy( KEY_WRITE, buf, len, type );
}
static void test_set_default_proxy_config(void)