Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/winhttp/tests/Makefile.in | 1 - dlls/winhttp/tests/notification.c | 422 +++---- dlls/winhttp/tests/url.c | 190 +-- dlls/winhttp/tests/winhttp.c | 1902 ++++++++++++++--------------- 4 files changed, 1246 insertions(+), 1269 deletions(-)
diff --git a/dlls/winhttp/tests/Makefile.in b/dlls/winhttp/tests/Makefile.in index 73dce0b7dc9..77ebefae170 100644 --- a/dlls/winhttp/tests/Makefile.in +++ b/dlls/winhttp/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = winhttp.dll IMPORTS = winhttp oleaut32 ole32 crypt32 advapi32 ws2_32
diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 121190ba9d2..ffde61b3bf5 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -104,16 +104,16 @@ static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DW info->index++; while (info->index < info->count && (info->test[info->index].flags & NF_WINE_ALLOW)) { - todo_wine ok(info->test[info->index].status != status, "unexpected %x notification\n", status); + todo_wine ok( info->test[info->index].status != status, "unexpected %#lx notification\n", status ); if (info->test[info->index].status == status) break; info->index++; } - ok(info->index < info->count, "%u: unexpected notification 0x%08x\n", info->line, status); + ok( info->index < info->count, "%u: unexpected notification %#lx\n", info->line, status ); if (info->index >= info->count) return;
status_ok = (info->test[info->index].status == status); function_ok = (info->test[info->index].function == info->function); - ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[info->index].status, status); + ok( status_ok, "%u: expected status %#x got %#lx\n", info->line, info->test[info->index].status, status ); ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[info->index].function, info->function);
if (info->test[info->index].flags & NF_MAIN_THREAD) @@ -222,7 +222,7 @@ static void test_connection_cache( void ) info.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); @@ -235,15 +235,15 @@ static void test_connection_cache( void ) WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -253,16 +253,16 @@ static void test_connection_cache( void ) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == 200, "request failed unexpectedly %u\n", status); + ok( ret, "failed unexpectedly %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %lu\n", status );
ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); @@ -271,10 +271,10 @@ static void test_connection_cache( void )
setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -284,16 +284,16 @@ static void test_connection_cache( void ) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == 200, "request failed unexpectedly %u\n", status); + ok( ret, "failed unexpectedly %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %lu\n", status );
ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); @@ -305,7 +305,7 @@ static void test_connection_cache( void ) if (unload) { status = WaitForSingleObject( event, 0 ); - ok(status == WAIT_TIMEOUT, "got %08x\n", status); + ok( status == WAIT_TIMEOUT, "got %#lx\n", status ); }
setup_test( &info, winhttp_close_handle, __LINE__ ); @@ -315,12 +315,11 @@ static void test_connection_cache( void ) if (unload) { status = WaitForSingleObject( event, 100 ); - ok(status == WAIT_OBJECT_0, "got %08x\n", status); + ok( status == WAIT_OBJECT_0, "got %#lx\n", status ); }
- ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
if (unload) { @@ -331,18 +330,18 @@ static void test_connection_cache( void ) WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -352,16 +351,16 @@ static void test_connection_cache( void ) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == 200, "request failed unexpectedly %u\n", status); + ok( ret, "failed unexpectedly %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %lu\n", status );
ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); @@ -370,10 +369,10 @@ static void test_connection_cache( void )
setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -383,16 +382,16 @@ static void test_connection_cache( void ) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == 200, "request failed unexpectedly %u\n", status); + ok( ret, "failed unexpectedly %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %lu\n", status );
setup_test( &info, winhttp_close_handle, __LINE__ ); done: @@ -403,7 +402,7 @@ done: if (unload) { status = WaitForSingleObject( event, 0 ); - ok(status == WAIT_TIMEOUT, "got %08x\n", status); + ok( status == WAIT_TIMEOUT, "got %#lx\n", status ); }
setup_test( &info, winhttp_close_handle, __LINE__ ); @@ -415,7 +414,7 @@ done: if (unload) { status = WaitForSingleObject( event, 100 ); - ok(status == WAIT_OBJECT_0, "got %08x\n", status); + ok( status == WAIT_OBJECT_0, "got %#lx\n", status ); }
CloseHandle( event ); @@ -462,20 +461,20 @@ static void test_redirect( void ) info.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); - ok(ret, "failed to set context value %u\n", GetLastError()); + ok( ret, "failed to set context value %lu\n", GetLastError() );
setup_test( &info, winhttp_connect, __LINE__ ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
setup_test( &info, winhttp_open_request, __LINE__ ); req = WinHttpOpenRequest( con, NULL, L"/tests/redirect", NULL, NULL, NULL, 0 ); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -485,16 +484,16 @@ static void test_redirect( void ) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( req, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == 200, "request failed unexpectedly %u\n", status); + ok( ret, "failed unexpectedly %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly %lu\n", status );
setup_test( &info, winhttp_close_handle, __LINE__ ); done: @@ -543,7 +542,7 @@ static void test_async( void ) info.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
ses = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); @@ -556,27 +555,27 @@ static void test_async( void ) SetLastError( 0xdeadbeef ); WinHttpSetStatusCallback( ses, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); err = GetLastError(); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
SetLastError( 0xdeadbeef ); ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); err = GetLastError(); - ok(ret, "failed to set context value %u\n", err); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok( ret, "failed to set context value %lu\n", err ); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_connect, __LINE__ ); SetLastError( 0xdeadbeef ); con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); err = GetLastError(); - ok(con != NULL, "failed to open a connection %u\n", err); - ok(err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %u\n", err); + ok( con != NULL, "failed to open a connection %lu\n", err ); + ok( err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_open_request, __LINE__ ); SetLastError( 0xdeadbeef ); req = WinHttpOpenRequest( con, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); err = GetLastError(); - ok(req != NULL, "failed to open a request %u\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok( req != NULL, "failed to open a request %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
setup_test( &info, winhttp_send_request, __LINE__ ); SetLastError( 0xdeadbeef ); @@ -591,8 +590,8 @@ static void test_async( void ) CloseHandle( info.wait ); return; } - ok(ret, "failed to send request %u\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok( ret, "failed to send request %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
WaitForSingleObject( info.wait, INFINITE );
@@ -600,8 +599,8 @@ static void test_async( void ) SetLastError( 0xdeadbeef ); ret = WinHttpReceiveResponse( req, NULL ); err = GetLastError(); - ok(ret, "failed to receive response %u\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok( ret, "failed to receive response %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
WaitForSingleObject( info.wait, INFINITE );
@@ -609,33 +608,33 @@ static void test_async( void ) SetLastError( 0xdeadbeef ); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); err = GetLastError(); - ok(ret, "failed unexpectedly %u\n", err); - ok(status == 200, "request failed unexpectedly %u\n", status); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok( ret, "failed unexpectedly %lu\n", err ); + ok( status == 200, "request failed unexpectedly %lu\n", status ); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_query_data, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpQueryDataAvailable( req, NULL ); err = GetLastError(); - ok(ret, "failed to query data available %u\n", err); - ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok( ret, "failed to query data available %lu\n", err ); + ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
WaitForSingleObject( info.wait, INFINITE ); - ok(info.last_status == WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, "got status %#x.\n", status); - ok((err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) - || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), - "Got unexpected thread %#x, err %#x.\n", info.last_thread_id, err); + ok( info.last_status == WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, "got status %#lx\n", status ); + ok(( err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) + || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), + "got unexpected thread %#lx, err %#lx\n", info.last_thread_id, err );
setup_test( &info, winhttp_read_data, __LINE__ ); ret = WinHttpReadData( req, buffer, sizeof(buffer), NULL ); - ok(ret, "failed to read data %u\n", err); + ok( ret, "failed to read data %lu\n", err );
WaitForSingleObject( info.wait, INFINITE );
- ok(info.last_status == WINHTTP_CALLBACK_STATUS_READ_COMPLETE, "got status %#x.\n", status); - ok((err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) - || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), - "Got unexpected thread %#x, err %#x.\n", info.last_thread_id, err); + ok( info.last_status == WINHTTP_CALLBACK_STATUS_READ_COMPLETE, "got status %#lx\n", status ); + ok( (err == ERROR_SUCCESS && info.last_thread_id == GetCurrentThreadId()) + || (err == ERROR_IO_PENDING && info.last_thread_id != GetCurrentThreadId()), + "got unexpected thread %#lx, err %#lx\n", info.last_thread_id, err );
setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); @@ -644,7 +643,7 @@ static void test_async( void ) if (unload) { status = WaitForSingleObject( event, 0 ); - ok(status == WAIT_TIMEOUT, "got %08x\n", status); + ok( status == WAIT_TIMEOUT, "got %#lx\n", status ); } WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); @@ -653,7 +652,7 @@ static void test_async( void ) if (unload) { status = WaitForSingleObject( event, 2000 ); - ok(status == WAIT_OBJECT_0, "got %08x\n", status); + ok( status == WAIT_OBJECT_0, "got %#lx\n", status ); } CloseHandle( event ); CloseHandle( info.wait ); @@ -767,7 +766,7 @@ static void test_websocket(BOOL secure) info.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); - ok( session != NULL, "got %u\n", GetLastError() ); + ok( session != NULL, "got %lu\n", GetLastError() );
event = CreateEventW( NULL, FALSE, FALSE, NULL ); ret = WinHttpSetOption( session, WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT, &event, sizeof(event) ); @@ -781,44 +780,44 @@ static void test_websocket(BOOL secure) { protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; ret = WinHttpSetOption(session, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols)); - ok(ret, "failed to set protocols %u\n", GetLastError()); + ok( ret, "failed to set protocols %lu\n", GetLastError() ); }
SetLastError( 0xdeadbeef ); WinHttpSetStatusCallback( session, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 ); err = GetLastError(); - ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err ); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
SetLastError( 0xdeadbeef ); ret = WinHttpSetOption( session, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context) ); err = GetLastError(); - ok( ret, "got %u\n", err ); - ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok( ret, "got %lu\n", err ); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_connect, __LINE__ ); SetLastError( 0xdeadbeef ); connection = WinHttpConnect( session, L"ws.ifelse.io", 0, 0 ); err = GetLastError(); - ok( connection != NULL, "got %u\n", err); - ok( err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %u\n", err ); + ok( connection != NULL, "got %lu\n", err ); + ok( err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_open_request, __LINE__ ); SetLastError( 0xdeadbeef ); request = WinHttpOpenRequest( connection, NULL, L"/", NULL, NULL, NULL, secure ? WINHTTP_FLAG_SECURE : 0); err = GetLastError(); - ok( request != NULL, "got %u\n", err ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( request != NULL, "got %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
if (secure) { flags = SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_CERT_CN_INVALID; ret = WinHttpSetOption(request, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok( ret, "failed to set security flags %lu\n", GetLastError() ); }
ret = WinHttpSetOption( request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); SetLastError( 0xdeadbeef ); @@ -833,81 +832,76 @@ static void test_websocket(BOOL secure) CloseHandle( info.wait ); return; } - ok( ret, "got %u\n", err ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( ret, "got %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_receive_response, __LINE__ ); SetLastError( 0xdeadbeef ); ret = WinHttpReceiveResponse( request, NULL ); err = GetLastError(); - ok( ret, "got %u\n", err ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( ret, "got %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
size = sizeof(status); SetLastError( 0xdeadbeef ); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); err = GetLastError(); - ok( ret, "failed unexpectedly %u\n", err ); - ok( status == 101, "got %u\n", status ); - ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err ); + ok( ret, "failed unexpectedly %lu\n", err ); + ok( status == 101, "got %lu\n", status ); + ok( err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err );
setup_test( &info, winhttp_websocket_complete_upgrade, __LINE__ ); SetLastError( 0xdeadbeef ); socket = pWinHttpWebSocketCompleteUpgrade( request, (DWORD_PTR)context ); err = GetLastError(); - ok( socket != NULL, "got %u\n", err ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( socket != NULL, "got %lu\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
/* The send is executed synchronously (even if sending a reasonably big buffer exceeding SSL buffer size). * It is possible to trigger queueing the send into another thread but that involves sending a considerable * amount of big enough buffers. */ big_buffer = malloc( BIG_BUFFER_SIZE ); - for (i = 0; i < BIG_BUFFER_SIZE; ++i) - big_buffer[i] = (i & 0xff) ^ 0xcc; + for (i = 0; i < BIG_BUFFER_SIZE; ++i) big_buffer[i] = (i & 0xff) ^ 0xcc;
setup_test( &info, winhttp_websocket_send, __LINE__ ); - err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, - big_buffer, BIG_BUFFER_SIZE ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, big_buffer, BIG_BUFFER_SIZE ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_websocket_send, __LINE__ ); - err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, - (void*)"hello", sizeof("hello") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, (void *)"hello", sizeof("hello") ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_websocket_shutdown, __LINE__ ); err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
- err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, - (void*)"hello", sizeof("hello") ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, (void *)"hello", sizeof("hello") ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err );
WaitForSingleObject( info.wait, INFINITE );
err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); - err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, - (void*)"hello", sizeof("hello") ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err ); + err = pWinHttpWebSocketSend( socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, (void *)"hello", sizeof("hello") ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err );
setup_test( &info, winhttp_websocket_receive, __LINE__ ); buffer[0] = 0; size = 0xdeadbeef; type = 0xdeadbeef; err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE ); - ok( info.buflen == sizeof(*ws_status), "got unexpected buflen %u.\n", info.buflen ); + ok( info.buflen == sizeof(*ws_status), "got %u\n", info.buflen ); ws_status = (WINHTTP_WEB_SOCKET_STATUS *)info.buffer; ok( ws_status->eBufferType == WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE, - "Got unexpected eBufferType %u.\n", ws_status->eBufferType ); - ok( size == 0xdeadbeef, "got %u\n", size ); + "got unexpected eBufferType %u\n", ws_status->eBufferType ); + ok( size == 0xdeadbeef, "got %lu\n", size ); ok( type == 0xdeadbeef, "got %u\n", type ); ok( buffer[0] == 'R', "unexpected data\n" );
@@ -923,21 +917,19 @@ static void test_websocket(BOOL secure) ws_status = (WINHTTP_WEB_SOCKET_STATUS *)info.buffer; ws_status->eBufferType = ~0u; err = pWinHttpWebSocketReceive( socket, big_buffer + offset, BIG_BUFFER_SIZE - offset, &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE ); - ok( info.buflen == sizeof(*ws_status), "got unexpected buflen %u.\n", info.buflen ); + ok( info.buflen == sizeof(*ws_status), "got %u\n", info.buflen ); ok( ws_status->eBufferType == WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE - || ws_status->eBufferType == WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE, - "Got unexpected eBufferType %u.\n", ws_status->eBufferType ); + || ws_status->eBufferType == WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE, "got %u\n", ws_status->eBufferType ); offset += ws_status->dwBytesTransferred; - ok( offset <= BIG_BUFFER_SIZE, "Got unexpected dwBytesTransferred %u.\n", - ws_status->dwBytesTransferred ); - ok( size == 0xdeadbeef, "got %u\n", size ); + ok( offset <= BIG_BUFFER_SIZE, "got %lu\n", ws_status->dwBytesTransferred ); + ok( size == 0xdeadbeef, "got %lu\n", size ); ok( type == 0xdeadbeef, "got %u\n", type ); } while (ws_status->eBufferType == WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE);
- ok( offset == BIG_BUFFER_SIZE, "Got unexpected offset %u.\n", offset ); + ok( offset == BIG_BUFFER_SIZE, "got %u\n", offset );
for (i = 0; i < BIG_BUFFER_SIZE; ++i) if (big_buffer[i] != ((i & 0xff) ^ 0xcc)) break; @@ -948,21 +940,21 @@ static void test_websocket(BOOL secure) close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err ); ok( close_status == 0xdead, "got %u\n", close_status ); - ok( size == sizeof(buffer) + 1, "got %u\n", size ); + ok( size == sizeof(buffer) + 1, "got %lu\n", size );
setup_test( &info, winhttp_websocket_close, __LINE__ ); err = pWinHttpWebSocketClose( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); ok( close_status == 1000, "got %u\n", close_status ); - ok( size <= sizeof(buffer), "got %u\n", size ); + ok( size <= sizeof(buffer), "got %lu\n", size );
setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( socket ); @@ -978,75 +970,73 @@ static void test_websocket(BOOL secure)
setup_test( &info, winhttp_open_request, __LINE__ ); request = WinHttpOpenRequest( connection, NULL, L"/", NULL, NULL, NULL, secure ? WINHTTP_FLAG_SECURE : 0); - ok( request != NULL, "got %u\n", err ); + ok( request != NULL, "got %lu\n", err );
if (secure) { flags = SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_CERT_CN_INVALID; ret = WinHttpSetOption(request, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok( ret, "failed to set security flags %lu\n", GetLastError() ); }
ret = WinHttpSetOption( request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( request, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( request, NULL ); - ok( ret, "got %u\n", err ); + ok( ret, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
size = sizeof(status); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed unexpectedly %u\n", err ); - ok( status == 101, "got %u\n", status ); + ok( ret, "failed unexpectedly %lu\n", err ); + ok( status == 101, "got %lu\n", status );
setup_test( &info, winhttp_websocket_complete_upgrade, __LINE__ ); socket = pWinHttpWebSocketCompleteUpgrade( request, (DWORD_PTR)context ); - ok( socket != NULL, "got %u\n", err ); + ok( socket != NULL, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_websocket_receive, __LINE__ ); buffer[0] = 0; err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE ); ok( buffer[0] == 'R', "unexpected data\n" );
err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
setup_test( &info, winhttp_websocket_close, __LINE__ ); err = pWinHttpWebSocketClose( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); - ok( info.buflen == sizeof(*result), "got unexpected buflen %u.\n", info.buflen ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); + ok( info.buflen == sizeof(*result), "got %u\n", info.buflen ); result = (WINHTTP_WEB_SOCKET_ASYNC_RESULT *)info.buffer; - ok( result->Operation == WINHTTP_WEB_SOCKET_RECEIVE_OPERATION, "got unexpected operation %u.\n", - result->Operation ); - ok( !result->AsyncResult.dwResult, "got unexpected result %lu.\n", result->AsyncResult.dwResult ); - ok( result->AsyncResult.dwError == ERROR_WINHTTP_OPERATION_CANCELLED, "got unexpected error %u.\n", - result->AsyncResult.dwError ); + ok( result->Operation == WINHTTP_WEB_SOCKET_RECEIVE_OPERATION, "got %u\n", result->Operation ); + ok( !result->AsyncResult.dwResult, "got %Iu\n", result->AsyncResult.dwResult ); + ok( result->AsyncResult.dwError == ERROR_WINHTTP_OPERATION_CANCELLED, "got %lu\n", result->AsyncResult.dwError );
close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err ); ok( close_status == 0xdead, "got %u\n", close_status ); - ok( size == sizeof(buffer) + 1, "got %u\n", size ); + ok( size == sizeof(buffer) + 1, "got %lu\n", size );
WaitForSingleObject( info.wait, INFINITE );
close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); ok( close_status == 1000, "got %u\n", close_status ); - ok( size <= sizeof(buffer), "got %u\n", size ); + ok( size <= sizeof(buffer), "got %lu\n", size );
setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( socket ); @@ -1062,88 +1052,87 @@ static void test_websocket(BOOL secure)
setup_test( &info, winhttp_open_request, __LINE__ ); request = WinHttpOpenRequest( connection, NULL, L"/", NULL, NULL, NULL, secure ? WINHTTP_FLAG_SECURE : 0); - ok( request != NULL, "got %u\n", err ); + ok( request != NULL, "got %lu\n", err );
if (secure) { flags = SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_CERT_CN_INVALID; ret = WinHttpSetOption(request, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok( ret, "failed to set security flags %lu\n", GetLastError() ); }
ret = WinHttpSetOption( request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( request, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_receive_response, __LINE__ ); ret = WinHttpReceiveResponse( request, NULL ); - ok( ret, "got %u\n", err ); + ok( ret, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
size = sizeof(status); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed unexpectedly %u\n", err ); - ok( status == 101, "got %u\n", status ); + ok( ret, "failed unexpectedly %lu\n", err ); + ok( status == 101, "got %lu\n", status );
setup_test( &info, winhttp_websocket_complete_upgrade, __LINE__ ); socket = pWinHttpWebSocketCompleteUpgrade( request, (DWORD_PTR)context ); - ok( socket != NULL, "got %u\n", err ); + ok( socket != NULL, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE );
setup_test( &info, winhttp_websocket_receive, __LINE__ ); buffer[0] = 0; err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); WaitForSingleObject( info.wait, INFINITE ); ok( buffer[0] == 'R', "unexpected data\n" );
err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err );
setup_test( &info, winhttp_websocket_shutdown, __LINE__ ); ws_status = (WINHTTP_WEB_SOCKET_STATUS *)info.buffer; ws_status->eBufferType = ~0u; err = pWinHttpWebSocketShutdown( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err ); ok( close_status == 0xdead, "got %u\n", close_status ); - ok( size == sizeof(buffer) + 1, "got %u\n", size ); + ok( size == sizeof(buffer) + 1, "got %lu\n", size );
WaitForSingleObject( info.wait, INFINITE );
- ok( info.buflen == sizeof(*ws_status), "got unexpected buflen %u.\n", info.buflen ); - ok( ws_status->eBufferType == WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE, "Got unexpected eBufferType %u.\n", - ws_status->eBufferType ); - ok( !ws_status->dwBytesTransferred, "got unexpected dwBytesTransferred %u.\n", ws_status->dwBytesTransferred ); + ok( info.buflen == sizeof(*ws_status), "got %u\n", info.buflen ); + ok( ws_status->eBufferType == WINHTTP_WEB_SOCKET_CLOSE_BUFFER_TYPE, "got %u\n", ws_status->eBufferType ); + ok( !ws_status->dwBytesTransferred, "got %lu\n", ws_status->dwBytesTransferred );
close_status = 0xdead; size = sizeof(buffer) + 1; err = pWinHttpWebSocketQueryCloseStatus( socket, &close_status, buffer, sizeof(buffer), &size ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err ); ok( close_status == 1000, "got %u\n", close_status ); - ok( size <= sizeof(buffer), "got %u\n", size ); + ok( size <= sizeof(buffer), "got %lu\n", size );
err = pWinHttpWebSocketReceive( socket, buffer, sizeof(buffer), &size, &type ); - ok( err == ERROR_INVALID_OPERATION, "got %u\n", err ); + ok( err == ERROR_INVALID_OPERATION, "got %lu\n", err );
info.buflen = 0xdeadbeef; setup_test( &info, winhttp_websocket_close, __LINE__ ); err = pWinHttpWebSocketClose( socket, 1000, (void *)"success", sizeof("success") ); - ok( err == ERROR_SUCCESS, "got %u\n", err ); + ok( err == ERROR_SUCCESS, "got %lu\n", err );
WaitForSingleObject( info.wait, INFINITE ); - ok( !info.buflen, "Got unexpected buflen %u.\n", info.buflen ); + ok( !info.buflen, "got %u\n", info.buflen );
setup_test( &info, winhttp_close_handle, __LINE__ );
@@ -1154,7 +1143,7 @@ static void test_websocket(BOOL secure) if (unload) { status = WaitForSingleObject( event, 0 ); - ok( status == WAIT_TIMEOUT, "got %08x\n", status ); + ok( status == WAIT_TIMEOUT, "got %#lx\n", status ); } WinHttpCloseHandle( session ); WaitForSingleObject( info.wait, INFINITE ); @@ -1163,7 +1152,7 @@ static void test_websocket(BOOL secure) if (unload) { status = WaitForSingleObject( event, 2000 ); - ok( status == WAIT_OBJECT_0, "got %08x\n", status ); + ok( status == WAIT_OBJECT_0, "got %#lx\n", status ); } CloseHandle( event ); CloseHandle( info.wait ); @@ -1265,30 +1254,30 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) BOOL ret;
ses = WinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest(con, verb, path, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok( ret, "failed to query status code %lu\n", GetLastError()); + ok( status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status );
count = 0; memset(buffer, 0, sizeof(buffer)); ret = WinHttpReadData(req, buffer, sizeof buffer, &count); - ok(ret, "failed to read data %u\n", GetLastError()); + ok( ret, "failed to read data %lu\n", GetLastError() ); ok(count == sizeof page1 - 1, "count was wrong\n"); ok(!memcmp(buffer, page1, sizeof page1), "http data wrong\n");
@@ -1337,22 +1326,22 @@ static void open_async_request(int port, struct test_request *req, struct info * }
req->session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); - ok(req->session != NULL, "failed to open session %u\n", GetLastError()); + ok( req->session != NULL, "failed to open session %lu\n", GetLastError() );
WinHttpSetOption( req->session, WINHTTP_OPTION_CONTEXT_VALUE, &info, sizeof(struct info *) ); WinHttpSetStatusCallback( req->session, check_notification, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
setup_test( info, winhttp_connect, __LINE__ ); req->connection = WinHttpConnect( req->session, L"localhost", port, 0 ); - ok(req->connection != NULL, "failed to open a connection %u\n", GetLastError()); + ok( req->connection != NULL, "failed to open a connection %lu\n", GetLastError() );
setup_test( info, winhttp_open_request, __LINE__ ); req->request = WinHttpOpenRequest( req->connection, NULL, path, NULL, NULL, NULL, 0 ); - ok(req->request != NULL, "failed to open a request %u\n", GetLastError()); + ok( req->request != NULL, "failed to open a request %lu\n", GetLastError() );
setup_test( info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req->request, NULL, 0, NULL, 0, 0, 0 ); - ok(ret, "failed to send request %u\n", GetLastError()); + ok( ret, "failed to send request %lu\n", GetLastError() ); }
static void open_socket_request(int port, struct test_request *req, struct info *info) @@ -1381,7 +1370,7 @@ static void server_send_reply(struct test_request *req, struct info *info, const info->index = 0; setup_test( info, winhttp_send_request, __LINE__ ); ret = WinHttpReceiveResponse( req->request, NULL ); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok( ret, "failed to receive response %lu\n", GetLastError() );
WaitForSingleObject( info->wait, INFINITE ); end_test( info, __LINE__ ); @@ -1437,11 +1426,11 @@ static void close_request(struct test_request *req, struct info *info, BOOL allo setup_test( info, winhttp_close_handle, __LINE__ );
ret = WinHttpCloseHandle( req->request ); - ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); + ok( ret, "WinHttpCloseHandle failed: %lu\n", GetLastError() ); ret = WinHttpCloseHandle( req->connection ); - ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); + ok( ret, "WinHttpCloseHandle failed: %lu\n", GetLastError() ); ret = WinHttpCloseHandle( req->session ); - ok(ret, "WinHttpCloseHandle failed: %u\n", GetLastError()); + ok( ret, "WinHttpCloseHandle failed: %lu\n", GetLastError() );
WaitForSingleObject( info->wait, INFINITE ); end_test( info, __LINE__ ); @@ -1468,7 +1457,7 @@ static void _read_request_data(struct test_request *req, struct info *info, cons setup_test( info, winhttp_read_data, line ); memset(buffer, '?', sizeof(buffer)); ret = WinHttpReadData( req->request, buffer, sizeof(buffer), NULL ); - ok(ret, "failed to read data %u\n", GetLastError()); + ok( ret, "failed to read data %lu\n", GetLastError() );
WaitForSingleObject( info->wait, INFINITE );
@@ -1578,17 +1567,15 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex break; }
- ok(context->recursion_count < TEST_RECURSION_LIMIT, - "Got unexpected context->recursion_count %u, thread %#x.\n", - context->recursion_count, GetCurrentThreadId()); + ok( context->recursion_count < TEST_RECURSION_LIMIT, + "got %lu, thread %#lx\n", context->recursion_count, GetCurrentThreadId() ); context->max_recursion_query = max( context->max_recursion_query, context->recursion_count ); InterlockedIncrement( &context->recursion_count ); ret = WinHttpReadData( context->request, &b, 1, NULL ); err = GetLastError(); - ok(ret, "Failed to read data, GetLastError() %u.\n", err); - ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "Got unexpected err %u.\n", err); - if (err == ERROR_SUCCESS) - context->have_sync_callback = TRUE; + ok( ret, "failed to read data, GetLastError() %lu\n", err ); + ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "got %lu\n", err ); + if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break;
@@ -1598,18 +1585,16 @@ static void CALLBACK test_recursion_callback( HINTERNET handle, DWORD_PTR contex SetEvent( context->wait ); break; } - ok(context->recursion_count < TEST_RECURSION_LIMIT, - "Got unexpected context->recursion_count %u, thread %#x.\n", - context->recursion_count, GetCurrentThreadId()); + ok( context->recursion_count < TEST_RECURSION_LIMIT, + "got %lu, thread %#lx\n", context->recursion_count, GetCurrentThreadId() ); context->max_recursion_read = max( context->max_recursion_read, context->recursion_count ); context->read_from_callback = TRUE; InterlockedIncrement( &context->recursion_count ); ret = WinHttpQueryDataAvailable( context->request, NULL ); err = GetLastError(); - ok(ret, "Failed to query data available, GetLastError() %u.\n", err); - ok(err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "Got unexpected err %u.\n", err); - if (err == ERROR_SUCCESS) - context->have_sync_callback = TRUE; + ok( ret, "failed to query data available, GetLastError() %lu\n", err ); + ok( err == ERROR_SUCCESS || err == ERROR_IO_PENDING, "got %lu\n", err ); + if (err == ERROR_SUCCESS) context->have_sync_callback = TRUE; InterlockedDecrement( &context->recursion_count ); break; } @@ -1628,15 +1613,15 @@ static void test_recursion(void) context.wait = CreateEventW( NULL, FALSE, FALSE, NULL );
session = WinHttpOpen( L"winetest", 0, NULL, NULL, WINHTTP_FLAG_ASYNC ); - ok(!!session, "Failed to open session, GetLastError() %u.\n", GetLastError()); + ok( !!session, "failed to open session, GetLastError() %lu\n", GetLastError() );
WinHttpSetStatusCallback( session, test_recursion_callback, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
connection = WinHttpConnect( session, L"test.winehq.org", 0, 0 ); - ok(!!connection, "Failed to open a connection, GetLastError() %u.\n", GetLastError()); + ok( !!connection, "failed to open a connection, GetLastError() %lu\n", GetLastError() );
request = WinHttpOpenRequest( connection, NULL, L"/tests/hello.html", NULL, NULL, NULL, 0 ); - ok(!!request, "Failed to open a request, GetLastError() %u.\n", GetLastError()); + ok( !!request, "failed to open a request, GetLastError() %lu\n", GetLastError() );
context.request = request; ret = WinHttpSendRequest( request, NULL, 0, NULL, 0, 0, (DWORD_PTR)&context ); @@ -1651,39 +1636,36 @@ static void test_recursion(void) CloseHandle( context.wait ); return; } - ok(ret, "Failed to send request, GetLastError() %u.\n", GetLastError()); + ok( ret, "failed to send request, GetLastError() %lu\n", GetLastError() );
WaitForSingleObject( context.wait, INFINITE );
ret = WinHttpReceiveResponse( request, NULL ); - ok(ret, "Failed to receive response, GetLastError() %u.\n", GetLastError()); + ok( ret, "failed to receive response, GetLastError() %lu\n", GetLastError() );
WaitForSingleObject( context.wait, INFINITE );
size = sizeof(status); ret = WinHttpQueryHeaders( request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok(ret, "Request failed, GetLastError() %u.\n", GetLastError()); - ok(status == 200, "Request failed unexpectedly, status %u.\n", status); + ok( ret, "request failed, GetLastError() %lu\n", GetLastError() ); + ok( status == 200, "request failed unexpectedly, status %lu\n", status );
ret = WinHttpQueryDataAvailable( request, NULL ); - ok(ret, "Failed to query data available, GetLastError() %u.\n", GetLastError()); + ok( ret, "failed to query data available, GetLastError() %lu\n", GetLastError() );
WaitForSingleObject( context.wait, INFINITE );
ret = WinHttpReadData( request, &b, 1, NULL ); - ok(ret, "Failed to read data, GetLastError() %u.\n", GetLastError()); + ok( ret, "failed to read data, GetLastError() %lu\n", GetLastError() );
WaitForSingleObject( context.wait, INFINITE ); if (context.have_sync_callback) { - ok(context.max_recursion_query >= 2, "Got unexpected max_recursion_query %u.\n", context.max_recursion_query); - ok(context.max_recursion_read >= 2, "Got unexpected max_recursion_read %u.\n", context.max_recursion_read); - } - else - { - skip("No sync callbacks.\n"); + ok( context.max_recursion_query >= 2, "got %lu\n", context.max_recursion_query ); + ok( context.max_recursion_read >= 2, "got %lu\n", context.max_recursion_read ); } + else skip( "no sync callbacks\n");
WinHttpSetStatusCallback( session, NULL, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, 0 );
@@ -1720,13 +1702,13 @@ START_TEST (notification) si.port = 7533;
thread = CreateThread( NULL, 0, server_thread, &si, 0, NULL ); - ok(thread != NULL, "failed to create thread %u\n", GetLastError()); + ok( thread != NULL, "failed to create thread %lu\n", GetLastError() );
server_socket_available = CreateEventW( NULL, 0, 0, NULL ); server_socket_done = CreateEventW( NULL, 0, 0, NULL );
ret = WaitForSingleObject( si.event, 10000 ); - ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %u\n", GetLastError()); + ok( ret == WAIT_OBJECT_0, "failed to start winhttp test server %lu\n", GetLastError() ); if (ret != WAIT_OBJECT_0) { CloseHandle(thread); diff --git a/dlls/winhttp/tests/url.c b/dlls/winhttp/tests/url.c index 35d23c5b083..5f137dc6365 100644 --- a/dlls/winhttp/tests/url.c +++ b/dlls/winhttp/tests/url.c @@ -104,31 +104,31 @@ static void WinHttpCreateUrl_test( void ) SetLastError( 0xdeadbeef ); ret = WinHttpCreateUrl( NULL, 0, NULL, &len ); ok( !ret, "expected failure\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() ); - ok( len == ~0u, "expected len ~0u got %u\n", len ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() ); + ok( len == ~0u, "expected len ~0u got %lu\n", len );
/* zero'ed components */ memset( &uc, 0, sizeof(URL_COMPONENTS) ); SetLastError( 0xdeadbeef ); ret = WinHttpCreateUrl( &uc, 0, NULL, &len ); ok( !ret, "expected failure\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() ); - ok( len == ~0u, "expected len ~0u got %u\n", len ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() ); + ok( len == ~0u, "expected len ~0u got %lu\n", len );
/* valid components, NULL url, NULL length */ fill_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCreateUrl( &uc, 0, NULL, NULL ); ok( !ret, "expected failure\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() );
/* 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, "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() ); - ok( len == 57, "expected len 57 got %u\n", len ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %lu\n", GetLastError() ); + ok( len == 57, "expected len 57 got %lu\n", len );
/* valid components, NULL url, sufficient length */ SetLastError( 0xdeadbeef ); @@ -137,8 +137,8 @@ static void WinHttpCreateUrl_test( void ) 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 ); + "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() ); + ok( len == 256 || broken(len == 57) /* < win7 */, "expected len 256 got %lu\n", len );
/* correct size, NULL url */ fill_url_components( &uc ); @@ -147,8 +147,8 @@ static void WinHttpCreateUrl_test( void ) 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 ); + "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() ); + ok( len == 256 || broken(len == 57) /* < win7 */, "expected len 256 got %lu\n", len );
/* valid components, allocated url, short length */ SetLastError( 0xdeadbeef ); @@ -157,8 +157,8 @@ static void WinHttpCreateUrl_test( void ) len = 2; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( !ret, "expected failure\n" ); - ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %u\n", GetLastError() ); - ok( len == 57, "expected len 57 got %u\n", len ); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %lu\n", GetLastError() ); + ok( len == 57, "expected len 57 got %lu\n", len );
/* allocated url, NULL scheme */ SetLastError( 0xdeadbeef ); @@ -168,8 +168,8 @@ static void WinHttpCreateUrl_test( void ) ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); ok( GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "expected ERROR_SUCCESS got %u\n", GetLastError() ); - ok( len == 56, "expected len 56 got %u\n", len ); + "expected ERROR_SUCCESS got %lu\n", GetLastError() ); + ok( len == 56, "expected len 56 got %lu\n", len ); ok( !lstrcmpW( url, url1 ), "url doesn't match\n" );
/* allocated url, 0 scheme */ @@ -179,7 +179,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 56, "expected len 56 got %u\n", len ); + ok( len == 56, "expected len 56 got %lu\n", len );
/* valid components, allocated url */ fill_url_components( &uc ); @@ -187,7 +187,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 56, "expected len 56 got %d\n", len ); + ok( len == 56, "expected len 56 got %lu\n", len ); ok( !lstrcmpW( url, url1 ), "url doesn't match\n" );
/* valid username, NULL password */ @@ -205,7 +205,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 56, "expected len 56 got %u\n", len ); + ok( len == 56, "expected len 56 got %lu\n", len ); ok( !lstrcmpW( url, url2 ), "url doesn't match\n" );
/* valid password, NULL username */ @@ -216,7 +216,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( !ret, "expected failure\n" ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError() );
/* valid password, empty username */ fill_url_components( &uc ); @@ -234,7 +234,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 38, "expected len 38 got %u\n", len ); + ok( len == 38, "expected len 38 got %lu\n", len ); ok( !lstrcmpW( url, url3 ), "url doesn't match\n" );
/* empty username, empty password */ @@ -245,7 +245,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 56, "expected len 56 got %u\n", len ); + ok( len == 56, "expected len 56 got %lu\n", len ); ok( !lstrcmpW( url, url4 ), "url doesn't match\n" );
/* nScheme has lower precedence than lpszScheme */ @@ -256,7 +256,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == lstrlenW( url5 ), "expected len %d got %u\n", lstrlenW( url5 ) + 1, len ); + ok( len == lstrlenW( url5 ), "expected len %d got %lu\n", lstrlenW( url5 ) + 1, len ); ok( !lstrcmpW( url, url5 ), "url doesn't match\n" );
/* non-standard port */ @@ -267,7 +267,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 59, "expected len 59 got %u\n", len ); + ok( len == 59, "expected len 59 got %lu\n", len ); ok( !lstrcmpW( url, url6 ), "url doesn't match\n" );
/* escape extra info */ @@ -278,7 +278,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len ); ok( ret, "expected success\n" ); - ok( len == 113, "expected len 113 got %u\n", len ); + ok( len == 113, "expected len 113 got %lu\n", len ); ok( !lstrcmpW( url, url7 ), "url doesn't match %s\n", wine_dbgstr_w(url) );
/* escape extra info */ @@ -290,7 +290,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len ); ok( ret, "expected success\n" ); - ok( len == lstrlenW(url18), "expected len %u got %u\n", lstrlenW(url18), len ); + ok( len == lstrlenW(url18), "expected len %u got %lu\n", lstrlenW(url18), len ); ok( !lstrcmpW( url, url18 ), "url doesn't match\n" );
/* extra info with Unicode characters */ @@ -304,7 +304,7 @@ static void WinHttpCreateUrl_test( void ) ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len ); err = GetLastError(); ok( !ret, "expected failure\n" ); - ok( err == ERROR_INVALID_PARAMETER, "got %u\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %lu\n", err );
/* extra info with Unicode characters, no ICU_ESCAPE */ memset( &uc, 0, sizeof(uc) ); @@ -317,7 +317,7 @@ static void WinHttpCreateUrl_test( void ) ok( ret || broken(!ret) /* < win7 */, "expected success\n" ); if (ret) { - ok( len == lstrlenW(url19), "expected len %u got %u\n", lstrlenW(url19), len ); + ok( len == lstrlenW(url19), "expected len %u got %lu\n", lstrlenW(url19), len ); ok( !lstrcmpW( url, url19 ), "url doesn't match %s\n", wine_dbgstr_w(url) ); }
@@ -330,7 +330,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len ); ok( ret, "expected success\n" ); - ok( len == lstrlenW(url18), "expected len %u got %u\n", lstrlenW(url18), len ); + ok( len == lstrlenW(url18), "expected len %u got %lu\n", lstrlenW(url18), len ); ok( !lstrcmpW( url, url18 ), "url doesn't match\n" );
/* path with Unicode characters */ @@ -344,7 +344,7 @@ static void WinHttpCreateUrl_test( void ) ret = WinHttpCreateUrl( &uc, ICU_ESCAPE, url, &len ); err = GetLastError(); ok( !ret, "expected failure\n" ); - ok( err == ERROR_INVALID_PARAMETER, "got %u\n", err ); + ok( err == ERROR_INVALID_PARAMETER, "got %lu\n", err );
/* path with Unicode characters, no ICU_ESCAPE */ memset( &uc, 0, sizeof(uc) ); @@ -357,7 +357,7 @@ static void WinHttpCreateUrl_test( void ) ok( ret || broken(!ret) /* < win7 */, "expected success\n" ); if (ret) { - ok( len == lstrlenW(url20), "expected len %u got %u\n", lstrlenW(url20), len ); + ok( len == lstrlenW(url20), "expected len %u got %lu\n", lstrlenW(url20), len ); ok( !lstrcmpW( url, url20 ), "url doesn't match %s\n", wine_dbgstr_w(url) ); }
@@ -371,7 +371,7 @@ static void WinHttpCreateUrl_test( void ) len = 256; ret = WinHttpCreateUrl( &uc, 0, url, &len ); ok( ret, "expected success\n" ); - ok( len == 58, "expected len 58 got %u\n", len ); + ok( len == 58, "expected len 58 got %lu\n", len ); ok( !lstrcmpW( url, url8 ), "url doesn't match\n" );
HeapFree( GetProcessHeap(), 0, url ); @@ -417,21 +417,21 @@ static void WinHttpCrackUrl_test( void ) uc.dwExtraInfoLength = 20;
ret = WinHttpCrackUrl( url1, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme: %u\n", uc.nScheme ); ok( !memcmp( uc.lpszScheme, http, sizeof(http) ), "unexpected scheme: %s\n", wine_dbgstr_w(uc.lpszScheme) ); - ok( uc.dwSchemeLength == 4, "unexpected scheme length: %u\n", uc.dwSchemeLength ); + ok( uc.dwSchemeLength == 4, "unexpected scheme length: %lu\n", uc.dwSchemeLength ); ok( !memcmp( uc.lpszUserName, username, sizeof(username) ), "unexpected username: %s\n", wine_dbgstr_w(uc.lpszUserName) ); - ok( uc.dwUserNameLength == 8, "unexpected username length: %u\n", uc.dwUserNameLength ); + ok( uc.dwUserNameLength == 8, "unexpected username length: %lu\n", uc.dwUserNameLength ); ok( !memcmp( uc.lpszPassword, password, sizeof(password) ), "unexpected password: %s\n", wine_dbgstr_w(uc.lpszPassword) ); - ok( uc.dwPasswordLength == 8, "unexpected password length: %u\n", uc.dwPasswordLength ); + ok( uc.dwPasswordLength == 8, "unexpected password length: %lu\n", uc.dwPasswordLength ); ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected hostname: %s\n", wine_dbgstr_w(uc.lpszHostName) ); - ok( uc.dwHostNameLength == 14, "unexpected hostname length: %u\n", uc.dwHostNameLength ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length: %lu\n", uc.dwHostNameLength ); ok( uc.nPort == 80, "unexpected port: %u\n", uc.nPort ); ok( !memcmp( uc.lpszUrlPath, about, sizeof(about) ), "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 11, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 11, "unexpected path length: %lu\n", uc.dwUrlPathLength ); 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 ); + ok( uc.dwExtraInfoLength == 6, "unexpected extra info length: %lu\n", uc.dwExtraInfoLength );
/* buffers of insufficient length */ uc.dwSchemeLength = 1; @@ -441,19 +441,19 @@ static void WinHttpCrackUrl_test( void ) 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 ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %lu, expected ERROR_INSUFFICIENT_BUFFER\n", error ); + ok( uc.dwSchemeLength == 5, "unexpected scheme length: %lu\n", uc.dwSchemeLength ); + ok( uc.dwHostNameLength == 15, "unexpected hostname length: %lu\n", uc.dwHostNameLength ); + ok( uc.dwUrlPathLength == 11, "unexpected path length: %lu\n", uc.dwUrlPathLength );
/* no buffers */ reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k1, 0, 0, &uc); error = GetLastError(); - ok( ret, "WinHttpCrackUrl failed le=%u\n", error ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", error ); ok( error == ERROR_SUCCESS || broken(error == ERROR_INVALID_PARAMETER) /* < win7 */, - "got %u, expected ERROR_SUCCESS\n", error ); + "got %lu, expected ERROR_SUCCESS\n", error ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k1,"unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -473,7 +473,7 @@ static void WinHttpCrackUrl_test( void ) 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( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k2, "unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -491,7 +491,7 @@ static void WinHttpCrackUrl_test( void )
reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k3, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTPS, "unexpected scheme\n" ); ok( uc.lpszScheme == url_k3, "unexpected scheme\n" ); ok( uc.dwSchemeLength == 5, "unexpected scheme length\n" ); @@ -513,80 +513,80 @@ static void WinHttpCrackUrl_test( void ) ret = WinHttpCrackUrl( url_k4, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); error = GetLastError(); - ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %lu\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k5, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); error = GetLastError(); - ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %lu\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k6, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); error = GetLastError(); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k7, 0, 0, &uc ); ok( !ret, "WinHttpCrackUrl succeeded\n" ); error = GetLastError(); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url_k8, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu\n", error );
reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k9, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.lpszUrlPath == url_k9 + 14 || broken(uc.lpszUrlPath == url_k9 + 13) /* win8 */, "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 0, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 0, "unexpected path length: %lu\n", uc.dwUrlPathLength ); ok( uc.lpszExtraInfo == url_k9 + 14 || broken(uc.lpszExtraInfo == url_k9 + 13) /* win8 */, "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); ok( uc.dwExtraInfoLength == 0 || broken(uc.dwExtraInfoLength == 1) /* win8 */, - "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); + "unexpected extra info length: %lu\n", uc.dwExtraInfoLength );
reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k10, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.lpszUrlPath == url_k10 + 13, "unexpected path: %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 7, "unexpected path length: %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 7, "unexpected path length: %lu\n", uc.dwUrlPathLength ); ok( uc.lpszExtraInfo == url_k10 + 20, "unexpected extra info: %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); - ok( uc.dwExtraInfoLength == 0, "unexpected extra info length: %u\n", uc.dwExtraInfoLength ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length: %lu\n", uc.dwExtraInfoLength );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url4, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_WINHTTP_INVALID_URL, "got %u\n", error ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %lu\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( empty, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( url1, 0, 0, NULL ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( NULL, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
/* decoding without buffers */ reset_url_components( &uc ); @@ -594,7 +594,7 @@ static void WinHttpCrackUrl_test( void ) ret = WinHttpCrackUrl( url7, 0, ICU_DECODE, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u, expected ERROR_INVALID_PARAMETER\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu, expected ERROR_INVALID_PARAMETER\n", error );
/* decoding with buffers */ uc.lpszScheme = scheme; @@ -613,11 +613,11 @@ static void WinHttpCrackUrl_test( void ) path[0] = 0;
ret = WinHttpCrackUrl( url7, 0, ICU_DECODE, &uc ); - ok( ret, "WinHttpCrackUrl failed %u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed %lu\n", GetLastError() ); ok( !memcmp( uc.lpszUrlPath + 11, escape, 21 * sizeof(WCHAR) ), "unexpected path\n" ); - ok( uc.dwUrlPathLength == 32, "unexpected path length %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 32, "unexpected path length %lu\n", uc.dwUrlPathLength ); ok( !memcmp( uc.lpszExtraInfo, escape + 21, 12 * sizeof(WCHAR) ), "unexpected extra info\n" ); - ok( uc.dwExtraInfoLength == 12, "unexpected extra info length %u\n", uc.dwExtraInfoLength ); + ok( uc.dwExtraInfoLength == 12, "unexpected extra info length %lu\n", uc.dwExtraInfoLength );
/* Urls with specified port numbers */ /* decoding with buffers */ @@ -637,25 +637,25 @@ static void WinHttpCrackUrl_test( void ) path[0] = 0;
ret = WinHttpCrackUrl( url6, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected host name: %s\n", wine_dbgstr_w(uc.lpszHostName) ); - ok( uc.dwHostNameLength == 14, "unexpected host name length: %d\n", uc.dwHostNameLength ); + ok( uc.dwHostNameLength == 14, "unexpected host name length: %lu\n", uc.dwHostNameLength ); ok( uc.nPort == 42, "unexpected port: %u\n", uc.nPort );
/* decoding without buffers */ reset_url_components( &uc ); ret = WinHttpCrackUrl( url8, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nPort == 0, "unexpected port: %u\n", uc.nPort );
reset_url_components( &uc ); ret = WinHttpCrackUrl( url9, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nPort == 80, "unexpected port: %u\n", uc.nPort );
reset_url_components( &uc ); ret = WinHttpCrackUrl( url10, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nPort == 443, "unexpected port: %u\n", uc.nPort );
reset_url_components( &uc ); @@ -663,18 +663,18 @@ static void WinHttpCrackUrl_test( void ) ret = WinHttpCrackUrl( empty, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u, expected ERROR_WINHTTP_UNRECOGNIZED_SCHEME\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu, expected ERROR_WINHTTP_UNRECOGNIZED_SCHEME\n", error );
reset_url_components( &uc ); SetLastError( 0xdeadbeef ); ret = WinHttpCrackUrl( http, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %u, expected ERROR_WINHTTP_UNRECOGNIZED_SCHEME\n", error ); + ok( error == ERROR_WINHTTP_UNRECOGNIZED_SCHEME, "got %lu, expected ERROR_WINHTTP_UNRECOGNIZED_SCHEME\n", error );
reset_url_components( &uc ); ret = WinHttpCrackUrl( url11, 0, 0, &uc); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); ok( uc.lpszScheme == url11,"unexpected scheme\n" ); ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); @@ -702,7 +702,7 @@ static void WinHttpCrackUrl_test( void ) uc.dwExtraInfoLength = 0; uc.nPort = 0; ret = WinHttpCrackUrl( url12, 0, ICU_DECODE, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() );
uc.lpszScheme = scheme; uc.dwSchemeLength = 20; @@ -718,10 +718,10 @@ static void WinHttpCrackUrl_test( void ) uc.dwExtraInfoLength = 0; uc.nPort = 0; ret = WinHttpCrackUrl( url13, 0, ICU_ESCAPE|ICU_DECODE, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( !lstrcmpW( uc.lpszHostName, L"winehq.o g" ), "unexpected host name\n" ); ok( !lstrcmpW( uc.lpszUrlPath, L"/path%20with%20spaces" ), "unexpected path\n" ); - ok( uc.dwUrlPathLength == lstrlenW(L"/path%20with%20spaces"), "got %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == lstrlenW(L"/path%20with%20spaces"), "got %lu\n", uc.dwUrlPathLength );
uc.dwStructSize = sizeof(uc); uc.lpszScheme = NULL; @@ -739,21 +739,21 @@ static void WinHttpCrackUrl_test( void ) uc.lpszExtraInfo = NULL; uc.dwExtraInfoLength = ~0u; ret = WinHttpCrackUrl( url14, 0, 0, &uc ); - ok( ret, "WinHttpCrackUrl failed le=%u\n", GetLastError() ); + ok( ret, "WinHttpCrackUrl failed le = %lu\n", GetLastError() ); ok( !uc.lpszScheme, "unexpected scheme %s\n", wine_dbgstr_w(uc.lpszScheme) ); - ok( !uc.dwSchemeLength, "unexpected length %u\n", uc.dwSchemeLength ); + ok( !uc.dwSchemeLength, "unexpected length %lu\n", uc.dwSchemeLength ); ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme %u\n", uc.nScheme ); ok( !lstrcmpW( uc.lpszHostName, url14 + 7 ), "unexpected hostname %s\n", wine_dbgstr_w(uc.lpszHostName) ); - ok( uc.dwHostNameLength == 14, "unexpected length %u\n", uc.dwHostNameLength ); + ok( uc.dwHostNameLength == 14, "unexpected length %lu\n", uc.dwHostNameLength ); ok( uc.nPort == 80, "unexpected port %u\n", uc.nPort ); ok( !uc.lpszUserName, "unexpected username\n" ); - ok( !uc.dwUserNameLength, "unexpected length %u\n", uc.dwUserNameLength ); + ok( !uc.dwUserNameLength, "unexpected length %lu\n", uc.dwUserNameLength ); ok( !uc.lpszPassword, "unexpected password\n" ); - ok( !uc.dwPasswordLength, "unexpected length %u\n", uc.dwPasswordLength ); + ok( !uc.dwPasswordLength, "unexpected length %lu\n", uc.dwPasswordLength ); ok( !lstrcmpW( uc.lpszUrlPath, url14 + 21 ), "unexpected path %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 5, "unexpected length %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 5, "unexpected length %lu\n", uc.dwUrlPathLength ); ok( !uc.lpszExtraInfo[0], "unexpected extra info %s\n", wine_dbgstr_w(uc.lpszExtraInfo) ); - ok( uc.dwExtraInfoLength == 0, "unexpected length %u\n", uc.dwExtraInfoLength ); + ok( uc.dwExtraInfoLength == 0, "unexpected length %lu\n", uc.dwExtraInfoLength );
uc.dwStructSize = sizeof(uc); uc.lpszScheme = scheme; @@ -774,39 +774,39 @@ static void WinHttpCrackUrl_test( void ) ret = WinHttpCrackUrl( url14, 0, 0, &uc ); error = GetLastError(); ok( !ret, "WinHttpCrackUrl succeeded\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error ); ok( !lstrcmpW( uc.lpszScheme, http ), "unexpected scheme %s\n", wine_dbgstr_w(uc.lpszScheme) ); - ok( !uc.dwSchemeLength, "unexpected length %u\n", uc.dwSchemeLength ); + ok( !uc.dwSchemeLength, "unexpected length %lu\n", uc.dwSchemeLength ); ok( uc.nScheme == 0, "unexpected scheme %u\n", uc.nScheme ); ok( !uc.lpszHostName, "unexpected hostname %s\n", wine_dbgstr_w(uc.lpszHostName) ); - ok( uc.dwHostNameLength == 0, "unexpected length %u\n", uc.dwHostNameLength ); + ok( uc.dwHostNameLength == 0, "unexpected length %lu\n", uc.dwHostNameLength ); ok( uc.nPort == 0, "unexpected port %u\n", uc.nPort ); ok( !uc.lpszUserName, "unexpected username\n" ); - ok( uc.dwUserNameLength == ~0u, "unexpected length %u\n", uc.dwUserNameLength ); + ok( uc.dwUserNameLength == ~0u, "unexpected length %lu\n", uc.dwUserNameLength ); ok( !uc.lpszPassword, "unexpected password\n" ); - ok( uc.dwPasswordLength == ~0u, "unexpected length %u\n", uc.dwPasswordLength ); + ok( uc.dwPasswordLength == ~0u, "unexpected length %lu\n", uc.dwPasswordLength ); ok( !uc.lpszUrlPath, "unexpected path %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 0, "unexpected length %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 0, "unexpected length %lu\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 ); + ok( uc.dwExtraInfoLength == 0, "unexpected length %lu\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 ); + ok( error == ERROR_WINHTTP_INVALID_URL, "got %lu\n", error );
reset_url_components( &uc ); uc.nPort = 1; ret = WinHttpCrackUrl( url16, 0, 0, &uc ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\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() ); + ok( ret, "got %lu\n", GetLastError() ); todo_wine ok( uc.nPort == 80, "got %u\n", uc.nPort );
memset( &uc, 0, sizeof(uc) ); @@ -818,9 +818,9 @@ static void WinHttpCrackUrl_test( void ) uc.lpszUrlPath = path; uc.dwUrlPathLength = ARRAY_SIZE(path); ret = WinHttpCrackUrl( url21, 0, 0, &uc ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !lstrcmpW( uc.lpszUrlPath, url21 + 37 ), "unexpected path %s\n", wine_dbgstr_w(uc.lpszUrlPath) ); - ok( uc.dwUrlPathLength == 50, "unexpected length %u\n", uc.dwUrlPathLength ); + ok( uc.dwUrlPathLength == 50, "unexpected length %lu\n", uc.dwUrlPathLength ); }
START_TEST(url) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 21af2761323..354c85c6d28 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -50,8 +50,8 @@ static BOOL proxy_active(void) SetLastError(0xdeadbeef); if (WinHttpGetDefaultProxyConfiguration(&proxy_info)) { - ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "got %u\n", GetLastError()); + ok( GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, + "got %lu\n", GetLastError() ); active = (proxy_info.lpszProxy != NULL); if (active) GlobalFree(proxy_info.lpszProxy); @@ -72,92 +72,89 @@ static void test_WinHttpQueryOption(void)
SetLastError(0xdeadbeef); session = WinHttpOpen(L"winetest", 0, 0, 0, 0); - ok(session != NULL, "WinHttpOpen failed to open session, error %u\n", GetLastError()); + ok( session != NULL, "WinHttpOpen failed to open session, error %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, NULL, NULL); - ok(!ret, "should fail to set redirect policy %u\n", GetLastError()); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok( !ret, "should fail to set redirect policy %lu\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError() );
size = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, NULL, &size); ok(!ret, "should fail to query option\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(size == 4, "expected 4, got %u\n", size); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError() ); + ok( size == 4, "expected 4, got %lu\n", size );
feature = 0xdeadbeef; size = sizeof(feature) - 1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, &size); ok(!ret, "should fail to query option\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(size == 4, "expected 4, got %u\n", size); + ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError() ); + ok( size == 4, "expected 4, got %lu\n", size );
feature = 0xdeadbeef; size = sizeof(feature) + 1; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, &size); - ok(ret, "failed to query option %u\n", GetLastError()); + ok(ret, "failed to query option %lu\n", GetLastError()); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "got %u\n", GetLastError()); - ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %u\n", size); + "got %lu\n", GetLastError()); + ok(size == sizeof(feature), "WinHttpQueryOption should set the size: %lu\n", size); ok(feature == WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP, - "expected WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP, got %#x\n", feature); + "expected WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP, got %#lx\n", feature);
SetLastError(0xdeadbeef); ret = WinHttpSetOption(session, WINHTTP_OPTION_REDIRECT_POLICY, NULL, sizeof(feature)); - ok(!ret, "should fail to set redirect policy %u\n", GetLastError()); + ok(!ret, "should fail to set redirect policy %lu\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
feature = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS; SetLastError(0xdeadbeef); ret = WinHttpSetOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, sizeof(feature) - 1); - ok(!ret, "should fail to set redirect policy %u\n", GetLastError()); + ok(!ret, "should fail to set redirect policy %lu\n", GetLastError()); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
feature = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS; SetLastError(0xdeadbeef); ret = WinHttpSetOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, sizeof(feature) + 1); - ok(!ret, "should fail to set redirect policy %u\n", GetLastError()); + ok(!ret, "should fail to set redirect policy %lu\n", GetLastError()); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError());
feature = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS; SetLastError(0xdeadbeef); ret = WinHttpSetOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, sizeof(feature)); - ok(ret, "failed to set redirect policy %u\n", GetLastError()); + ok(ret, "failed to set redirect policy %lu\n", GetLastError());
feature = 0xdeadbeef; size = sizeof(feature); SetLastError(0xdeadbeef); ret = WinHttpQueryOption(session, WINHTTP_OPTION_REDIRECT_POLICY, &feature, &size); - ok(ret, "failed to query option %u\n", GetLastError()); + ok(ret, "failed to query option %lu\n", GetLastError()); ok(feature == WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS, - "expected WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS, got %#x\n", feature); + "expected WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS, got %#lx\n", feature);
feature = WINHTTP_DISABLE_COOKIES; SetLastError(0xdeadbeef); ret = WinHttpSetOption(session, WINHTTP_OPTION_DISABLE_FEATURE, &feature, sizeof(feature)); ok(!ret, "should fail to set disable feature for a session\n"); ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); connection = WinHttpConnect(session, L"test.winehq.org", INTERNET_DEFAULT_HTTP_PORT, 0); - ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %lu\n", GetLastError());
feature = WINHTTP_DISABLE_COOKIES; SetLastError(0xdeadbeef); ret = WinHttpSetOption(connection, WINHTTP_OPTION_DISABLE_FEATURE, &feature, sizeof(feature)); ok(!ret, "should fail to set disable feature for a connection\n"); ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, @@ -174,80 +171,80 @@ static void test_WinHttpQueryOption(void) ret = WinHttpQueryOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &feature, &size); ok(!ret, "should fail to query disable feature for a request\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
feature = 0; size = sizeof(feature); SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &feature, sizeof(feature)); - ok(ret, "failed to set feature %u\n", GetLastError()); + ok(ret, "failed to set feature %lu\n", GetLastError());
feature = 0xffffffff; size = sizeof(feature); SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &feature, sizeof(feature)); - ok(ret, "failed to set feature %u\n", GetLastError()); + ok(ret, "failed to set feature %lu\n", GetLastError());
feature = WINHTTP_DISABLE_COOKIES; size = sizeof(feature); SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &feature, sizeof(feature)); - ok(ret, "failed to set feature %u\n", GetLastError()); + ok(ret, "failed to set feature %lu\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = WinHttpQueryOption(request, WINHTTP_OPTION_DISABLE_FEATURE, NULL, &size); ok(!ret, "should fail to query disable feature for a request\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
feature = 0xdeadbeef; size = sizeof(feature); SetLastError(0xdeadbeef); ret = WinHttpQueryOption(request, WINHTTP_OPTION_ENABLE_FEATURE, &feature, &size); ok(!ret, "should fail to query enabled features for a request\n"); - ok(feature == 0xdeadbeef, "expect feature 0xdeadbeef, got %u\n", feature); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok(feature == 0xdeadbeef, "expect feature 0xdeadbeef, got %#lx\n", feature); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
feature = WINHTTP_ENABLE_SSL_REVOCATION; SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_ENABLE_FEATURE, 0, sizeof(feature)); ok(!ret, "should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_ENABLE_FEATURE, &feature, 0); ok(!ret, "should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_ENABLE_FEATURE, &feature, sizeof(feature)); ok(ret, "failed to set feature\n"); ok(GetLastError() == NO_ERROR || broken(GetLastError() == 0xdeadbeef), /* Doesn't set error code on Vista or older */ - "expected NO_ERROR, got %u\n", GetLastError()); + "expected NO_ERROR, got %lu\n", GetLastError());
feature = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpSetOption(request, WINHTTP_OPTION_ENABLE_FEATURE, &feature, sizeof(feature)); ok(!ret, "should fail to enable WINHTTP_ENABLE_SSL_REVOCATION with invalid parameters\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
feature = 6; size = sizeof(feature); ret = WinHttpSetOption(request, WINHTTP_OPTION_CONNECT_RETRIES, &feature, sizeof(feature)); - ok(ret, "failed to set WINHTTP_OPTION_CONNECT_RETRIES %u\n", GetLastError()); + ok(ret, "failed to set WINHTTP_OPTION_CONNECT_RETRIES %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpCloseHandle(request); - ok(ret, "WinHttpCloseHandle failed on closing request: %u\n", GetLastError()); + ok(ret, "WinHttpCloseHandle failed on closing request: %lu\n", GetLastError());
done: SetLastError(0xdeadbeef); ret = WinHttpCloseHandle(connection); - ok(ret, "WinHttpCloseHandle failed on closing connection: %u\n", GetLastError()); + ok(ret, "WinHttpCloseHandle failed on closing connection: %lu\n", GetLastError()); SetLastError(0xdeadbeef); ret = WinHttpCloseHandle(session); - ok(ret, "WinHttpCloseHandle failed on closing session: %u\n", GetLastError()); + ok(ret, "WinHttpCloseHandle failed on closing session: %lu\n", GetLastError()); }
static void test_WinHttpOpenRequest (void) @@ -261,21 +258,21 @@ static void test_WinHttpOpenRequest (void) WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); err = GetLastError(); ok(session != NULL, "WinHttpOpen failed to open session.\n"); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok(err == ERROR_SUCCESS, "got %lu\n", err);
/* Test with a bad server name */ SetLastError(0xdeadbeef); connection = WinHttpConnect(session, NULL, INTERNET_DEFAULT_HTTP_PORT, 0); err = GetLastError(); ok (connection == NULL, "WinHttpConnect succeeded in opening connection to NULL server argument.\n"); - ok(err == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u.\n", err); + ok(err == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %lu.\n", err);
/* Test with a valid server name */ SetLastError(0xdeadbeef); connection = WinHttpConnect (session, L"test.winehq.org", INTERNET_DEFAULT_HTTP_PORT, 0); err = GetLastError(); - ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", err); - ok(err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %u\n", err); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %lu.\n", err); + ok(err == ERROR_SUCCESS || broken(err == WSAEINVAL) /* < win7 */, "got %lu\n", err);
SetLastError(0xdeadbeef); request = WinHttpOpenRequest(connection, NULL, NULL, NULL, WINHTTP_NO_REFERER, @@ -286,8 +283,8 @@ static void test_WinHttpOpenRequest (void) skip("Network unreachable, skipping.\n"); goto done; } - ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %lu.\n", err); + ok(err == ERROR_SUCCESS, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0); @@ -297,14 +294,14 @@ static void test_WinHttpOpenRequest (void) skip("Connection failed, skipping.\n"); goto done; } - ok(ret, "WinHttpSendRequest failed: %u\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok(ret, "WinHttpSendRequest failed: %lu\n", err); + ok(err == ERROR_SUCCESS, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpCloseHandle(request); err = GetLastError(); - ok(ret, "WinHttpCloseHandle failed on closing request, got %u.\n", err); - ok(err == ERROR_SUCCESS, "got %u\n", err); + ok(ret, "WinHttpCloseHandle failed on closing request, got %lu.\n", err); + ok(err == ERROR_SUCCESS, "got %lu\n", err);
done: ret = WinHttpCloseHandle(connection); @@ -321,13 +318,13 @@ static void test_empty_headers_param(void) BOOL ret;
ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"test.winehq.org", 80, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, L"", 0, NULL, 0, 0, 0); err = GetLastError(); @@ -336,7 +333,7 @@ static void test_empty_headers_param(void) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
done: WinHttpCloseHandle(req); @@ -366,7 +363,7 @@ static void test_WinHttpSendRequest (void) ok(session != NULL, "WinHttpOpen failed to open session.\n");
connection = WinHttpConnect (session, L"test.winehq.org", INTERNET_DEFAULT_HTTP_PORT, 0); - ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %lu\n", GetLastError());
request = WinHttpOpenRequest(connection, L"POST", L"tests/post.php", NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); @@ -375,25 +372,25 @@ static void test_WinHttpSendRequest (void) skip("Network unreachable, skipping.\n"); goto done; } - ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenrequest failed to open a request, error: %lu\n", GetLastError()); if (!request) goto done;
method[0] = 0; len = sizeof(method); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_REQUEST_METHOD, NULL, method, &len, NULL); - ok(ret, "got %u\n", GetLastError()); - ok(len == lstrlenW(L"POST") * sizeof(WCHAR), "got %u\n", len); + ok(ret, "got %lu\n", GetLastError()); + ok(len == lstrlenW(L"POST") * sizeof(WCHAR), "got %lu\n", len); ok(!lstrcmpW(method, L"POST"), "got %s\n", wine_dbgstr_w(method));
context = 0xdeadbeef; ret = WinHttpSetOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(context)); - ok(ret, "WinHttpSetOption failed: %u\n", GetLastError()); + ok(ret, "WinHttpSetOption failed: %lu\n", GetLastError());
/* writing more data than promised by the content-length header causes an error when the connection is reused, so disable keep-alive */ disable = WINHTTP_DISABLE_KEEP_ALIVE; ret = WinHttpSetOption(request, WINHTTP_OPTION_DISABLE_FEATURE, &disable, sizeof(disable)); - ok(ret, "WinHttpSetOption failed: %u\n", GetLastError()); + ok(ret, "WinHttpSetOption failed: %lu\n", GetLastError());
context++; ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, context); @@ -403,13 +400,13 @@ static void test_WinHttpSendRequest (void) skip("connection failed, skipping\n"); goto done; } - ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpSendRequest failed: %lu\n", GetLastError());
context = 0; size = sizeof(context); ret = WinHttpQueryOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &context, &size); - ok(ret, "WinHttpQueryOption failed: %u\n", GetLastError()); - ok(context == 0xdeadbef0, "expected 0xdeadbef0, got %lx\n", context); + ok(ret, "WinHttpQueryOption failed: %lu\n", GetLastError()); + ok(context == 0xdeadbef0, "expected 0xdeadbef0, got %#Ix\n", context);
for (i = 3; post_data[i]; i++) { @@ -418,12 +415,12 @@ static void test_WinHttpSendRequest (void) ret = WinHttpWriteData(request, &post_data[i], 1, &bytes_rw); if (ret) { - ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %u.\n", GetLastError()); - ok(bytes_rw == 1, "WinHttpWriteData failed, wrote %u bytes instead of 1 byte.\n", bytes_rw); + ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %lu\n", GetLastError()); + ok(bytes_rw == 1, "WinHttpWriteData failed, wrote %lu bytes instead of 1 byte\n", bytes_rw); } else /* Since we already passed all optional data in WinHttpSendRequest Win7 fails our WinHttpWriteData call */ { - ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER got %u.\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER got %lu\n", GetLastError()); ok(bytes_rw == -1, "Expected bytes_rw to remain unchanged.\n"); } } @@ -431,22 +428,22 @@ static void test_WinHttpSendRequest (void) SetLastError(0xdeadbeef); ret = WinHttpReceiveResponse(request, NULL); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == ERROR_NO_TOKEN) /* < win7 */, - "Expected ERROR_SUCCESS got %u.\n", GetLastError()); - ok(ret == TRUE, "WinHttpReceiveResponse failed: %u.\n", GetLastError()); + "Expected ERROR_SUCCESS got %lu\n", GetLastError()); + ok(ret == TRUE, "WinHttpReceiveResponse failed: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_ORIG_URI, NULL, NULL, &len, NULL); - ok(!ret && GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_MAX + 1, NULL, NULL, &len, NULL); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError());
bytes_rw = -1; ret = WinHttpReadData(request, buffer, sizeof(buffer) - 1, &bytes_rw); - ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError()); + ok(ret == TRUE, "WinHttpReadData failed: %lu\n", GetLastError());
- ok(bytes_rw == sizeof(test_post) - 1, "Read %u bytes\n", bytes_rw); + ok(bytes_rw == sizeof(test_post) - 1, "Read %lu bytes\n", bytes_rw); ok(!memcmp(buffer, test_post, sizeof(test_post) - 1), "Data read did not match.\n");
done: @@ -469,19 +466,19 @@ static void test_WinHttpTimeFromSystemTime(void) ret = WinHttpTimeFromSystemTime(&time, NULL); err = GetLastError(); ok(!ret, "WinHttpTimeFromSystemTime succeeded\n"); - ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpTimeFromSystemTime(NULL, time_string); err = GetLastError(); ok(!ret, "WinHttpTimeFromSystemTime succeeded\n"); - ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpTimeFromSystemTime(&time, time_string); err = GetLastError(); - ok(ret, "WinHttpTimeFromSystemTime failed: %u\n", err); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok(ret, "WinHttpTimeFromSystemTime failed: %lu\n", err); + ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err); ok(!memcmp(time_string, L"Mon, 28 Jul 2008 10:05:52 GMT", sizeof(L"Mon, 28 Jul 2008 10:05:52 GMT")), "Time string returned did not match expected time string.\n"); } @@ -497,27 +494,27 @@ static void test_WinHttpTimeToSystemTime(void) ret = WinHttpTimeToSystemTime(L"Mon, 28 Jul 2008 10:05:52 GMT\n", NULL); err = GetLastError(); ok(!ret, "WinHttpTimeToSystemTime succeeded\n"); - ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpTimeToSystemTime(NULL, &time); err = GetLastError(); ok(!ret, "WinHttpTimeToSystemTime succeeded\n"); - ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
SetLastError(0xdeadbeef); ret = WinHttpTimeToSystemTime(L"Mon, 28 Jul 2008 10:05:52 GMT\n", &time); err = GetLastError(); - ok(ret, "WinHttpTimeToSystemTime failed: %u\n", err); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok(ret, "WinHttpTimeToSystemTime failed: %lu\n", err); + ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err); ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n");
SetLastError(0xdeadbeef); ret = WinHttpTimeToSystemTime(L" mon 28 jul 2008 10 05 52\n", &time); err = GetLastError(); - ok(ret, "WinHttpTimeToSystemTime failed: %u\n", err); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok(ret, "WinHttpTimeToSystemTime failed: %lu\n", err); + ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err); ok(memcmp(&time, &expected_time, sizeof(SYSTEMTIME)) == 0, "Returned SYSTEMTIME structure did not match expected SYSTEMTIME structure.\n"); } @@ -564,7 +561,7 @@ static void test_WinHttpAddHeaders(void) ok(session != NULL, "WinHttpOpen failed to open session.\n");
connection = WinHttpConnect (session, L"test.winehq.org", INTERNET_DEFAULT_HTTP_PORT, 0); - ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %lu\n", GetLastError());
request = WinHttpOpenRequest(connection, L"POST", L"/posttest.php", NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0); @@ -573,7 +570,7 @@ static void test_WinHttpAddHeaders(void) skip("Network unreachable, skipping.\n"); goto done; } - ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %lu\n", GetLastError());
index = 0; len = sizeof(buffer); @@ -583,18 +580,18 @@ static void test_WinHttpAddHeaders(void) SetLastError(0xdeadbeef); ret = WinHttpAddRequestHeaders(request, test_headers[0], -1L, WINHTTP_ADDREQ_FLAG_ADD); err = GetLastError(); - ok(ret, "WinHttpAddRequestHeaders failed to add new header, got %d with error %u.\n", ret, err); - ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %u\n", err); + ok(ret, "WinHttpAddRequestHeaders failed to add new header, got %d with error %lu\n", ret, err); + ok(err == ERROR_SUCCESS || broken(err == 0xdeadbeef) /* < win7 */, "got %lu\n", err);
index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed: header index not incremented\n"); ok(!memcmp(buffer, test_indices[0], sizeof(test_indices[0])), "WinHttpQueryHeaders failed: incorrect string returned\n"); - ok(len == 5*sizeof(WCHAR), "WinHttpQueryHeaders failed: invalid length returned, expected 5, got %d\n", len); + ok(len == 5 * sizeof(WCHAR), "WinHttpQueryHeaders failed: invalid length returned, expected 5, got %lu\n", len);
ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); @@ -612,7 +609,7 @@ static void test_WinHttpAddHeaders(void) ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded with a buffer that's too small.\n"); ok(memcmp(buffer, check_buffer, sizeof(buffer)) == 0, "WinHttpQueryHeaders failed, modified the buffer when it should not have.\n"); - ok(len == 6*sizeof(WCHAR), "WinHttpQueryHeaders returned invalid length, expected 12, got %d\n", len); + ok(len == 6 * sizeof(WCHAR), "WinHttpQueryHeaders returned invalid length, expected 12, got %lu\n", len);
/* Try with a NULL buffer */ index = 0; @@ -621,8 +618,8 @@ static void test_WinHttpAddHeaders(void) ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS_CRLF | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", NULL, &len, &index); ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %lu\n", len); ok(index == 0, "WinHttpQueryHeaders incorrectly incremented header index.\n");
/* Try with a NULL buffer and a length that's too small */ @@ -633,8 +630,8 @@ static void test_WinHttpAddHeaders(void) L"Warning", NULL, &len, &index); ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %lu\n", len); ok(index == 0, "WinHttpQueryHeaders incorrectly incremented header index.\n");
index = 0; @@ -644,8 +641,8 @@ static void test_WinHttpAddHeaders(void) L"Warning", NULL, &len, &index); ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %lu\n", len); ok(index == 0, "WinHttpQueryHeaders failed: index was incremented.\n");
/* valid query */ @@ -672,8 +669,8 @@ static void test_WinHttpAddHeaders(void) L"Warning", NULL, &len, &index); ok(ret == FALSE, "WinHttpQueryHeaders unexpectedly succeeded.\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %d\n", len); + "WinHttpQueryHeaders set incorrect error: expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", GetLastError()); + ok(len > 40, "WinHttpQueryHeaders returned invalid length: expected greater than 40, got %lu\n", len); ok(index == 0, "WinHttpQueryHeaders failed: index was incremented.\n");
oldlen = len; @@ -682,7 +679,7 @@ static void test_WinHttpAddHeaders(void) memset(buffer, 0xff, sizeof(buffer)); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_RAW_HEADERS | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed %lu\n", GetLastError()); ok(len + sizeof(WCHAR) <= oldlen, "resulting length longer than advertized\n"); ok((len < sizeof(buffer) - sizeof(WCHAR)) && !buffer[len / sizeof(WCHAR)] && !buffer[len / sizeof(WCHAR) - 1], "no double NULL terminator\n"); @@ -697,14 +694,14 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); ok(memcmp(buffer, test_indices[0], sizeof(test_indices[0])) == 0, "WinHttpQueryHeaders returned incorrect string.\n");
len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(memcmp(buffer, test_indices[1], sizeof(test_indices[1])) == 0, "WinHttpQueryHeaders returned incorrect string.\n");
@@ -715,7 +712,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); reverse = (memcmp(buffer, test_indices[1], sizeof(test_indices[1])) != 0); /* Win7 returns values in reverse order of adding */ ok(!memcmp(buffer, test_indices[reverse ? 2 : 1], sizeof(test_indices[reverse ? 2 : 1])), @@ -724,7 +721,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 2], sizeof(test_indices[reverse ? 1 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -737,7 +734,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 2 : 1], sizeof(test_indices[reverse ? 2 : 1])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -745,7 +742,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 2], sizeof(test_indices[reverse ? 1 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -763,7 +760,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, reverse ? L"test3, test4" : L"test2, test4", reverse ? sizeof(L"test3, test4") : sizeof(L"test2, test4")), @@ -772,7 +769,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 2], sizeof(test_indices[reverse ? 1 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -790,7 +787,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n");
ok(!memcmp(buffer, reverse ? L"test3, test4, test5" : L"test2, test4, test5", @@ -800,7 +797,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 2], sizeof(test_indices[reverse ? 1 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -819,7 +816,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n");
ok(!memcmp(buffer, reverse ? L"test3, test4, test5; test6" : L"test2, test4, test5; test6", @@ -829,7 +826,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 2], sizeof(test_indices[reverse ? 1 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -847,7 +844,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 1, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 3 : 2], sizeof(test_indices[reverse ? 3 : 2])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -855,7 +852,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Warning", buffer, &len, &index); - ok(ret == TRUE, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(index == 2, "WinHttpQueryHeaders failed to increment index.\n"); ok(!memcmp(buffer, test_indices[reverse ? 1 : 3], sizeof(test_indices[reverse ? 1 : 3])), "WinHttpQueryHeaders returned incorrect string.\n"); @@ -876,7 +873,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"a", buffer, &len, &index); - ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(!memcmp(buffer, L"", sizeof(L"")), "unexpected result\n");
ret = WinHttpAddRequestHeaders(request, test_headers[10], ~0u, WINHTTP_ADDREQ_FLAG_ADD); @@ -896,7 +893,7 @@ static void test_WinHttpAddHeaders(void) len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"field", buffer, &len, &index); - ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); + ok(ret, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); ok(!memcmp(buffer, L"value ", sizeof(L"value ")) || !memcmp(buffer, L"value", sizeof(L"value")), "unexpected result\n");
@@ -905,20 +902,20 @@ static void test_WinHttpAddHeaders(void) WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE); err = GetLastError(); ok(!ret, "unexpected success\n"); - ok(err == ERROR_INVALID_PARAMETER, "got %u\n", err); + ok(err == ERROR_INVALID_PARAMETER, "got %lu\n", err);
ret = WinHttpAddRequestHeaders(request, L"Range: bytes=0-773\r\n", ~0u, WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE); - ok(ret, "failed to add header: %u\n", GetLastError()); + ok(ret, "failed to add header: %lu\n", GetLastError());
index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Range", buffer, &len, &index); - ok(ret, "failed to get range header %u\n", GetLastError()); + ok(ret, "failed to get range header %lu\n", GetLastError()); ok(!memcmp(buffer, L"bytes=0-773", sizeof(L"bytes=0-773")), "incorrect string returned\n"); - ok(len == lstrlenW(L"bytes=0-773") * sizeof(WCHAR), "wrong length %u\n", len); - ok(index == 1, "wrong index %u\n", index); + ok(len == lstrlenW(L"bytes=0-773") * sizeof(WCHAR), "wrong length %lu\n", len); + ok(index == 1, "wrong index %lu\n", index); index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, @@ -929,21 +926,21 @@ static void test_WinHttpAddHeaders(void) ret = WinHttpAddRequestHeaders(request, test_headers[14], ~0u, WINHTTP_ADDREQ_FLAG_REPLACE); err = GetLastError(); ok(!ret, "unexpected success\n"); - ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", err); + ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %lu\n", err);
ret = WinHttpAddRequestHeaders(request, test_headers[14], ~0u, WINHTTP_ADDREQ_FLAG_ADD); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"name", buffer, &len, &index); - ok(ret, "got %u\n", GetLastError()); - ok(index == 1, "wrong index %u\n", index); + ok(ret, "got %lu\n", GetLastError()); + ok(index == 1, "wrong index %lu\n", index); ok(!memcmp(buffer, L"value", sizeof(L"value")), "incorrect string\n");
ret = WinHttpAddRequestHeaders(request, test_headers[15], ~0u, WINHTTP_ADDREQ_FLAG_REPLACE); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
index = 0; len = sizeof(buffer); @@ -952,17 +949,17 @@ static void test_WinHttpAddHeaders(void) L"name", buffer, &len, &index); err = GetLastError(); ok(!ret, "unexpected success\n"); - ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", err); + ok(err == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %lu\n", err);
ret = WinHttpAddRequestHeaders(request, test_headers[14], -1L, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"name", buffer, &len, &index); - ok(ret, "got %u\n", GetLastError()); - ok(index == 1, "wrong index %u\n", index); + ok(ret, "got %lu\n", GetLastError()); + ok(index == 1, "wrong index %lu\n", index); ok(!memcmp(buffer, L"value", sizeof(L"value")), "incorrect string\n");
ret = WinHttpCloseHandle(request); @@ -1006,36 +1003,36 @@ static void test_secure_connection(void) char buffer[32];
ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
policy = WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS; ret = WinHttpSetOption(ses, WINHTTP_OPTION_REDIRECT_POLICY, &policy, sizeof(policy)); - ok(ret, "failed to set redirect policy %u\n", GetLastError()); + ok(ret, "failed to set redirect policy %lu\n", GetLastError());
protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; ret = WinHttpSetOption(ses, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols)); err = GetLastError(); - ok(ret || err == ERROR_INVALID_PARAMETER /* < win7 */, "failed to set protocols %u\n", err); + ok(ret || err == ERROR_INVALID_PARAMETER /* < win7 */, "failed to set protocols %lu\n", err);
con = WinHttpConnect(ses, L"test.winehq.org", 443, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
SetLastError( 0xdeadbeef ); protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; ret = WinHttpSetOption(con, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols)); err = GetLastError(); ok(!ret, "unexpected success\n"); - ok(err == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %u\n", err); + ok(err == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", err);
/* try without setting WINHTTP_FLAG_SECURE */ req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0); 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); + "setting client cert context returned %lu\n", err);
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); err = GetLastError(); @@ -1044,31 +1041,31 @@ static void test_secure_connection(void) skip("Connection failed, skipping.\n"); goto cleanup; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "header query failed %u\n", GetLastError()); - ok(status == HTTP_STATUS_BAD_REQUEST, "got %u\n", status); + ok(ret, "header query failed %lu\n", GetLastError()); + ok(status == HTTP_STATUS_BAD_REQUEST, "got %lu\n", status);
WinHttpCloseHandle(req);
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, WINHTTP_FLAG_SECURE); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
flags = 0xdeadbeef; size = sizeof(flags); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_FLAGS, &flags, &size); - ok(ret, "failed to query security flags %u\n", GetLastError()); - ok(!flags, "got %08x\n", flags); + ok(ret, "failed to query security flags %lu\n", GetLastError()); + ok(!flags, "got %#lx\n", flags);
flags = SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE; ret = WinHttpSetOption(req, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok(ret, "failed to set security flags %lu\n", GetLastError());
flags = SECURITY_FLAG_SECURE; ret = WinHttpSetOption(req, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); @@ -1081,15 +1078,15 @@ static void test_secure_connection(void) flags = SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_CERT_CN_INVALID; ret = WinHttpSetOption(req, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok(ret, "failed to set security flags %lu\n", GetLastError());
flags = 0; ret = WinHttpSetOption(req, WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags)); - ok(ret, "failed to set security flags %u\n", GetLastError()); + ok(ret, "failed to set security flags %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0); err = GetLastError(); - ok(ret || broken(!ret && err == ERROR_INVALID_PARAMETER) /* winxp */, "failed to set client cert context %u\n", err); + ok(ret || broken(!ret && err == ERROR_INVALID_PARAMETER) /* winxp */, "failed to set client cert context %lu\n", err);
WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, 0);
@@ -1101,20 +1098,20 @@ static void test_secure_connection(void) skip("secure connection failed, skipping remaining secure tests\n"); goto cleanup; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
size = sizeof(cert); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert, &size ); - ok(ret, "failed to retrieve certificate context %u\n", GetLastError()); + ok(ret, "failed to retrieve certificate context %lu\n", GetLastError()); if (ret) CertFreeCertificateContext(cert);
size = sizeof(bitness); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_KEY_BITNESS, &bitness, &size ); - ok(ret, "failed to retrieve key bitness %u\n", GetLastError()); + ok(ret, "failed to retrieve key bitness %lu\n", GetLastError());
size = sizeof(info); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT, &info, &size ); - ok(ret, "failed to retrieve certificate info %u\n", GetLastError()); + ok(ret, "failed to retrieve certificate info %lu\n", GetLastError());
if (ret) { @@ -1123,7 +1120,7 @@ static void test_secure_connection(void) trace("lpszProtocolName %s\n", wine_dbgstr_w(info.lpszProtocolName)); trace("lpszSignatureAlgName %s\n", wine_dbgstr_w(info.lpszSignatureAlgName)); trace("lpszEncryptionAlgName %s\n", wine_dbgstr_w(info.lpszEncryptionAlgName)); - trace("dwKeySize %u\n", info.dwKeySize); + trace("dwKeySize %lu\n", info.dwKeySize); LocalFree( info.lpszSubjectInfo ); LocalFree( info.lpszIssuerInfo ); } @@ -1134,18 +1131,18 @@ static void test_secure_connection(void) skip("connection error, skipping remaining secure tests\n"); goto cleanup; } - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
available_size = 0; ret = WinHttpQueryDataAvailable(req, &available_size); - ok(ret, "failed to query available data %u\n", GetLastError()); - ok(available_size > 2014, "available_size = %u\n", available_size); + ok(ret, "failed to query available data %lu\n", GetLastError()); + ok(available_size > 2014, "available_size = %lu\n", available_size);
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed unexpectedly %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
size = 0; ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL); @@ -1156,18 +1153,18 @@ static void test_secure_connection(void) { size = 0; ret = WinHttpReadData(req, buffer, sizeof(buffer), &size); - ok(ret == TRUE, "WinHttpReadData failed: %u.\n", GetLastError()); + ok(ret == TRUE, "WinHttpReadData failed: %lu\n", GetLastError()); if (!size) break; read_size += size;
if (read_size <= 32) ok(!memcmp(buffer, data_start, sizeof(data_start)-1), "not expected: %.32s\n", buffer); } - ok(read_size >= available_size, "read_size = %u, available_size = %u\n", read_size, available_size); + ok(read_size >= available_size, "read_size = %lu, available_size = %lu\n", read_size, available_size);
size = sizeof(cert); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert, &size); - ok(ret, "failed to retrieve certificate context %u\n", GetLastError()); + ok(ret, "failed to retrieve certificate context %lu\n", GetLastError()); if (ret) CertFreeCertificateContext(cert);
cleanup: @@ -1184,13 +1181,13 @@ static void test_request_parameter_defaults(void) BOOL ret;
ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"test.winehq.org", 0, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); error = GetLastError(); @@ -1199,21 +1196,21 @@ static void test_request_parameter_defaults(void) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed unexpectedly %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
WinHttpCloseHandle(req);
req = WinHttpOpenRequest(con, L"", L"", L"", NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); error = GetLastError(); @@ -1222,29 +1219,29 @@ static void test_request_parameter_defaults(void) skip("connection failed, skipping\n"); goto done; } - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
size = 0; SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_VERSION, NULL, NULL, &size, NULL); error = GetLastError(); ok(!ret, "succeeded unexpectedly\n"); - ok(error == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %u\n", error); + ok(error == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %lu\n", error);
version = HeapAlloc(GetProcessHeap(), 0, size); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_VERSION, NULL, version, &size, NULL); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(lstrlenW(version) == size / sizeof(WCHAR), "unexpected size %u\n", size); + ok(ret, "failed unexpectedly %lu\n", GetLastError()); + ok(lstrlenW(version) == size / sizeof(WCHAR), "unexpected size %lu\n", size); HeapFree(GetProcessHeap(), 0, version);
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed unexpectedly %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed unexpectedly %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
done: WinHttpCloseHandle(req); @@ -1350,7 +1347,7 @@ static void test_set_default_proxy_config(void) SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(NULL); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); }
/* test with invalid access type */ @@ -1359,7 +1356,7 @@ static void test_set_default_proxy_config(void) SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
/* at a minimum, the proxy server must be set */ info.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; @@ -1367,12 +1364,12 @@ static void test_set_default_proxy_config(void) SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError()); info.lpszProxyBypass = normalString; SetLastError(0xdeadbeef); ret = WinHttpSetDefaultProxyConfiguration(&info); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
/* the proxy server can't have wide characters */ info.lpszProxy = wideString; @@ -1383,7 +1380,7 @@ static void test_set_default_proxy_config(void) else ok((!ret && GetLastError() == ERROR_INVALID_PARAMETER) || broken(ret), /* Earlier winhttp versions on W2K/XP */ - "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
info.lpszProxy = normalString; SetLastError(0xdeadbeef); @@ -1392,9 +1389,9 @@ static void test_set_default_proxy_config(void) skip("couldn't set default proxy configuration: access denied\n"); else { - ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %u\n", GetLastError()); - ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "got %u\n", GetLastError()); + ok(ret, "WinHttpSetDefaultProxyConfiguration failed: %lu\n", GetLastError()); + ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, + "got %lu\n", GetLastError()); } set_default_proxy_reg_value( saved_proxy_settings, len, type ); } @@ -1406,488 +1403,488 @@ static void test_timeouts(void) HINTERNET ses, req, con;
ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, -2, 0, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, 0, -2, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, 0, 0, -2, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, 0, 0, 0, -2); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, -1, -1, -1, -1); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError()); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "expected ERROR_SUCCESS, got %u\n", GetLastError()); + "expected ERROR_SUCCESS, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, 0, 0, 0, 0); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(ses, 0x0123, 0x4567, 0x89ab, 0xcdef); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x0123, "Expected 0x0123, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x0123, "Expected 0x0123, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x4567, "Expected 0x4567, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x4567, "Expected 0x4567, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x89ab, "Expected 0x89ab, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x89ab, "Expected 0x89ab, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xcdef, "Expected 0xcdef, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xcdef, "Expected 0xcdef, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
con = WinHttpConnect(ses, L"test.winehq.org", 0, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
/* Timeout values should match the last one set for session */ SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, -2, 0, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, 0, -2, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, 0, 0, -2, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, 0, 0, 0, -2); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, -1, -1, -1, -1); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(con, 0, 0, 0, 0); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(con, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(con, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(con, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(con, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, - "expected ERROR_WINHTTP_INVALID_TYPE, got %u\n", GetLastError()); + "expected ERROR_WINHTTP_INVALID_TYPE, got %lu\n", GetLastError());
/* Changing timeout values for session should affect the values for connection */ SetLastError(0xdeadbeef); value = 0xdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdead; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(con, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
/* Timeout values should match the last one set for session */ SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, -2, 0, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, 0, -2, 0, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, 0, 0, -2, 0); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, 0, 0, 0, -2); ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + "expected ERROR_INVALID_PARAMETER, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, -1, -1, -1, -1); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, 0, 0, 0, 0); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetTimeouts(req, 0xcdef, 0x89ab, 0x4567, 0x0123); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xcdef, "Expected 0xcdef, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xcdef, "Expected 0xcdef, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x89ab, "Expected 0x89ab, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x89ab, "Expected 0x89ab, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x4567, "Expected 0x4567, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x4567, "Expected 0x4567, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0x0123, "Expected 0x0123, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0x0123, "Expected 0x0123, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0; ret = WinHttpSetOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0, "Expected 0, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0, "Expected 0, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
/* Changing timeout values for session should not affect the values for a request, * neither should the other way around. @@ -1895,162 +1892,162 @@ static void test_timeouts(void) SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeefdead; ret = WinHttpSetOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xdead, "Expected 0xdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xdead, "Expected 0xdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeef; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RESOLVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeef; ret = WinHttpSetOption(ses, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_CONNECT_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeef; ret = WinHttpSetOption(ses, WINHTTP_OPTION_SEND_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_SEND_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xbeef; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(DWORD); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 0xbeefdead, "Expected 0xbeefdead, got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 0xbeefdead, "Expected 0xbeefdead, got %lu\n", value);
/* response timeout */ SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == ~0u, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == ~0u, "got %lu\n", value);
SetLastError(0xdeadbeef); value = 30000; ret = WinHttpSetOption(req, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(req, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - todo_wine ok(value == 0xbeefdead, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + todo_wine ok(value == 0xbeefdead, "got %lu\n", value);
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(con, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == ~0u, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == ~0u, "got %lu\n", value);
SetLastError(0xdeadbeef); value = 30000; ret = WinHttpSetOption(con, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, sizeof(value)); ok(!ret, "expected failure\n"); - ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %u\n", GetLastError()); + ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == ~0u, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == ~0u, "got %lu\n", value);
SetLastError(0xdeadbeef); value = 48878; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - todo_wine ok(value == 48879, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + todo_wine ok(value == 48879, "got %lu\n", value);
SetLastError(0xdeadbeef); value = 48880; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, sizeof(value)); - ok(ret, "%u\n", GetLastError()); + ok(ret, "%lu\n", GetLastError());
SetLastError(0xdeadbeef); value = 0xdeadbeef; size = sizeof(value); ret = WinHttpQueryOption(ses, WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT, &value, &size); - ok(ret, "%u\n", GetLastError()); - ok(value == 48880, "got %u\n", value); + ok(ret, "%lu\n", GetLastError()); + ok(value == 48880, "got %lu\n", value);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2066,17 +2063,17 @@ static void test_resolve_timeout(void) if (! proxy_active()) { ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
timeout = 10000; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &timeout, sizeof(timeout)); - ok(ret, "failed to set resolve timeout %u\n", GetLastError()); + ok(ret, "failed to set resolve timeout %lu\n", GetLastError());
con = WinHttpConnect(ses, L"nxdomain.winehq.org", 0, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); @@ -2086,12 +2083,12 @@ static void test_resolve_timeout(void) goto done; } ok(GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED, - "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u\n", GetLastError()); + "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %lu\n", GetLastError());
ret = WinHttpReceiveResponse( req, NULL ); ok( !ret && (GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_STATE || GetLastError() == ERROR_WINHTTP_OPERATION_CANCELLED /* < win7 */), - "got %u\n", GetLastError() ); + "got %lu\n", GetLastError() );
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2101,17 +2098,17 @@ static void test_resolve_timeout(void) skip("Skipping host resolution tests, host resolution performed by proxy\n");
ses = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
timeout = 10000; ret = WinHttpSetOption(ses, WINHTTP_OPTION_RESOLVE_TIMEOUT, &timeout, sizeof(timeout)); - ok(ret, "failed to set resolve timeout %u\n", GetLastError()); + ok(ret, "failed to set resolve timeout %lu\n", GetLastError());
con = WinHttpConnect(ses, L"test.winehq.org", 0, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) @@ -2489,71 +2486,71 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetOption(ses, 0, buffer, sizeof(buffer)); - ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryOption(ses, 0, buffer, &size); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetOption(con, 0, buffer, sizeof(buffer)); - todo_wine ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + todo_wine ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryOption(con, 0, buffer, &size); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError());
req = WinHttpOpenRequest(con, verb, path, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetOption(req, 0, buffer, sizeof(buffer)); - ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_WINHTTP_INVALID_OPTION, "got %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryOption(req, 0, buffer, &size); - ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %u\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
supported = first = target = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); error = GetLastError(); ok(!ret, "unexpected success\n"); - ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); - ok(supported == 0xdeadbeef, "got %x\n", supported); - ok(first == 0xdeadbeef, "got %x\n", first); - ok(target == 0xdeadbeef, "got %x\n", target); + ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %lu\n", error); + ok(supported == 0xdeadbeef, "got %lu\n", supported); + ok(first == 0xdeadbeef, "got %lu\n", first); + ok(target == 0xdeadbeef, "got %lu\n", target);
size = sizeof(buffer2); memset(buffer2, 0, sizeof(buffer2)); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, buffer2, &size, NULL); - ok(ret, "failed to query for raw headers: %u\n", GetLastError()); + ok(ret, "failed to query for raw headers: %lu\n", GetLastError()); ok(!memcmp(buffer2 + lstrlenW(buffer2) - 4, L"\r\n\r\n", sizeof(L"\r\n\r\n")), "WinHttpQueryHeaders returned invalid end of header string\n");
size = sizeof(buffer2); memset(buffer2, 0, sizeof(buffer2)); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_RAW_HEADERS, NULL, buffer2, &size, NULL); - ok(ret, "failed to query for raw headers: %u\n", GetLastError()); + ok(ret, "failed to query for raw headers: %lu\n", GetLastError()); ok(!memcmp(buffer2 + (size / sizeof(WCHAR)) - 1, L"", sizeof(L"")), "WinHttpQueryHeaders returned invalid end of header string\n"); ok(buffer2[(size / sizeof(WCHAR)) - 2] != 0, "returned string has too many NULL characters\n"); @@ -2561,7 +2558,7 @@ static void test_basic_request(int port, const WCHAR *verb, const WCHAR *path) count = 0; memset(buffer, 0, sizeof(buffer)); ret = WinHttpReadData(req, buffer, sizeof buffer, &count); - ok(ret, "failed to read data %u\n", GetLastError()); + ok(ret, "failed to read data %lu\n", GetLastError()); ok(count == sizeof page1 - 1, "count was wrong\n"); ok(!memcmp(buffer, page1, sizeof page1), "http data wrong\n");
@@ -2578,82 +2575,82 @@ static void test_basic_authentication(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/auth", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(NULL, NULL, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", error); + ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %lu\n", error);
SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, NULL, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %lu\n", error);
supported = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, &supported, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %u\n", error); - ok(supported == 0xdeadbeef, "got %x\n", supported); + ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %lu\n", error); + ok(supported == 0xdeadbeef, "got %lu\n", supported);
supported = first = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, &supported, &first, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %u\n", error); - ok(supported == 0xdeadbeef, "got %x\n", supported); - ok(first == 0xdeadbeef, "got %x\n", first); + ok(error == ERROR_INVALID_PARAMETER || error == ERROR_INVALID_OPERATION, "got %lu\n", error); + ok(supported == 0xdeadbeef, "got %lu\n", supported); + ok(first == 0xdeadbeef, "got %lu\n", first);
supported = first = target = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %u\n", error); - ok(supported == 0xdeadbeef, "got %x\n", supported); - ok(first == 0xdeadbeef, "got %x\n", first); - ok(target == 0xdeadbeef, "got %x\n", target); + ok(error == ERROR_INVALID_OPERATION, "expected ERROR_INVALID_OPERATION, got %lu\n", error); + ok(supported == 0xdeadbeef, "got %lu\n", supported); + ok(first == 0xdeadbeef, "got %lu\n", first); + ok(target == 0xdeadbeef, "got %lu\n", target);
supported = first = target = 0xdeadbeef; SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(NULL, &supported, &first, &target); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", error); - ok(supported == 0xdeadbeef, "got %x\n", supported); - ok(first == 0xdeadbeef, "got %x\n", first); - ok(target == 0xdeadbeef, "got %x\n", target); + ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %lu\n", error); + ok(supported == 0xdeadbeef, "got %lu\n", supported); + ok(first == 0xdeadbeef, "got %lu\n", first); + ok(target == 0xdeadbeef, "got %lu\n", target);
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_DENIED, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_DENIED, "request failed unexpectedly %lu\n", status);
size = 0; ret = WinHttpReadData(req, buffer, sizeof(buffer), &size); error = GetLastError(); - ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %u\n", GetLastError()); + ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %lu\n", GetLastError()); if (ret) { - ok(size == 12, "expected 12, got %u\n", size); + ok(size == 12, "expected 12, got %lu\n", size); ok(!memcmp(buffer, unauthorized, 12), "got %s\n", buffer); }
@@ -2661,70 +2658,70 @@ static void test_basic_authentication(int port) SetLastError(0xdeadbeef); ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); error = GetLastError(); - ok(ret, "failed to query authentication schemes %u\n", error); - ok(error == ERROR_SUCCESS || broken(error == 0xdeadbeef) /* < win7 */, "expected ERROR_SUCCESS, got %u\n", error); - ok(supported == WINHTTP_AUTH_SCHEME_BASIC, "got %x\n", supported); - ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %x\n", first); - ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target); + ok(ret, "failed to query authentication schemes %lu\n", error); + ok(error == ERROR_SUCCESS || broken(error == 0xdeadbeef) /* < win7 */, "expected ERROR_SUCCESS, got %lu\n", error); + ok(supported == WINHTTP_AUTH_SCHEME_BASIC, "got %lu\n", supported); + ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %lu\n", first); + ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %lu\n", target);
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_NTLM, NULL, NULL, NULL); error = GetLastError(); - ok(ret, "failed to set credentials %u\n", error); - ok(error == ERROR_SUCCESS || broken(error == 0xdeadbeef) /* < win7 */, "expected ERROR_SUCCESS, got %u\n", error); + ok(ret, "failed to set credentials %lu\n", error); + ok(error == ERROR_SUCCESS || broken(error == 0xdeadbeef) /* < win7 */, "expected ERROR_SUCCESS, got %lu\n", error);
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_PASSPORT, NULL, NULL, NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_NEGOTIATE, NULL, NULL, NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_DIGEST, NULL, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, NULL, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, L"user", NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, NULL, L"pwd", NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, L"user", L"pwd", NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
size = 0; ret = WinHttpReadData(req, buffer, sizeof(buffer), &size); error = GetLastError(); - ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %u\n", GetLastError()); + ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %lu\n", GetLastError()); if (ret) { - ok(size == 11, "expected 11, got %u\n", size); + ok(size == 11, "expected 11, got %lu\n", size); ok(!memcmp(buffer, hello_world, 11), "got %s\n", buffer); }
@@ -2734,36 +2731,36 @@ static void test_basic_authentication(int port)
/* now set the credentials first to show that they get sent with the first request */ ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/auth_with_creds", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, L"user", L"pwd", NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
size = 0; ret = WinHttpReadData(req, buffer, sizeof(buffer), &size); error = GetLastError(); - ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %u\n", GetLastError()); + ok(ret || broken(error == ERROR_WINHTTP_SHUTDOWN || error == ERROR_WINHTTP_TIMEOUT) /* XP */, "failed to read data %lu\n", GetLastError()); if (ret) { - ok(size == 11, "expected 11, got %u\n", size); + ok(size == 11, "expected 11, got %lu\n", size); ok(!memcmp(buffer, hello_world, 11), "got %s\n", buffer); }
@@ -2774,68 +2771,68 @@ static void test_basic_authentication(int port) /* credentials set with WinHttpSetCredentials take precedence over those set through options */
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/auth", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, L"user", L"pwd", NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_USERNAME, (void *)L"user", lstrlenW(L"user")); - ok(ret, "failed to set username %u\n", GetLastError()); + ok(ret, "failed to set username %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_PASSWORD, (void *)L"pwd2", lstrlenW(L"pwd2")); - ok(ret, "failed to set password %u\n", GetLastError()); + ok(ret, "failed to set password %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); WinHttpCloseHandle(ses);
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/auth", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_USERNAME, (void *)L"user", lstrlenW(L"user")); - ok(ret, "failed to set username %u\n", GetLastError()); + ok(ret, "failed to set username %lu\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_PASSWORD, (void *)L"pwd", lstrlenW(L"pwd")); - ok(ret, "failed to set password %u\n", GetLastError()); + ok(ret, "failed to set password %lu\n", GetLastError());
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, L"user", L"pwd2", NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to query status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_DENIED, "request failed unexpectedly %u\n", status); + ok(ret, "failed to query status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_DENIED, "request failed unexpectedly %lu\n", status);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2850,13 +2847,13 @@ static void test_multi_authentication(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, L"GET", L"/multiauth", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA,0, 0, 0 ); @@ -2868,25 +2865,25 @@ static void test_multi_authentication(int port) supported = first = target = 0xdeadbeef; ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target); ok(ret, "expected success\n"); - ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %x\n", supported); - ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target); - ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %x\n", first); + ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %#lx\n", supported); + ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %#lx\n", target); + ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %#lx\n", first);
index = 0; size = sizeof(buf); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_CUSTOM, L"WWW-Authenticate", buf, &size, &index); ok(ret, "expected success\n"); ok(!lstrcmpW(buf, L"Bearer"), "buf = %s\n", wine_dbgstr_w(buf)); - ok(size == lstrlenW(buf) * sizeof(WCHAR), "size = %u\n", size); - ok(index == 1, "index = %u\n", index); + ok(size == lstrlenW(buf) * sizeof(WCHAR), "size = %lu\n", size); + ok(index == 1, "index = %lu\n", index);
index = 0; size = 0xdeadbeef; ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_CUSTOM, L"WWW-Authenticate", NULL, &size, &index); ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, - "WinHttpQueryHeaders returned %x(%u)\n", ret, GetLastError()); - ok(size == (lstrlenW(buf) + 1) * sizeof(WCHAR), "size = %u\n", size); - ok(index == 0, "index = %u\n", index); + "WinHttpQueryHeaders returned %d(%lu)\n", ret, GetLastError()); + ok(size == (lstrlenW(buf) + 1) * sizeof(WCHAR), "size = %lu\n", size); + ok(index == 0, "index = %lu\n", index);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2900,13 +2897,13 @@ static void test_large_data_authentication(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, L"GET", L"/largeauth", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0); ok(ret, "expected success\n"); @@ -2918,13 +2915,13 @@ static void test_large_data_authentication(int port) ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); ok(ret, "expected success\n"); - ok(status == HTTP_STATUS_DENIED, "got %d\n", status); + ok(status == HTTP_STATUS_DENIED, "got %lu\n", status);
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_NTLM, L"user", L"pwd", NULL); ok(ret, "expected success\n");
ret = WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0); - ok(ret, "expected success %d\n", GetLastError()); + ok(ret, "expected success %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); ok(ret, "expected success\n"); @@ -2933,7 +2930,7 @@ static void test_large_data_authentication(int port) ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); ok(ret, "expected success\n"); - ok(status == HTTP_STATUS_OK, "got %d\n", status); + ok(status == HTTP_STATUS_OK, "got %lu\n", status);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -2947,19 +2944,19 @@ static void test_no_headers(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/no_headers", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); if (!ret) { error = GetLastError(); - ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %u\n", error); + ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %lu\n", error); } else { @@ -2967,7 +2964,7 @@ static void test_no_headers(int port) ret = WinHttpReceiveResponse(req, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %u\n", error); + ok(error == ERROR_WINHTTP_INVALID_SERVER_RESPONSE, "got %lu\n", error); }
WinHttpCloseHandle(req); @@ -2983,13 +2980,13 @@ static void test_no_content(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"/no_content", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
size = 12345; SetLastError(0xdeadbeef); @@ -2997,9 +2994,9 @@ static void test_no_content(int port) todo_wine { ok(!ret, "expected error\n"); ok(GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, - "expected ERROR_WINHTTP_INCORRECT_HANDLE_STATE, got 0x%08x\n", GetLastError()); + "expected ERROR_WINHTTP_INCORRECT_HANDLE_STATE, got %lu\n", GetLastError()); ok(size == 12345 || broken(size == 0) /* Win <= 2003 */, - "expected 12345, got %u\n", size); + "expected 12345, got %lu\n", size); }
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); @@ -3013,7 +3010,7 @@ static void test_no_content(int port) ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); ok(ret, "expected success\n"); - ok(status == HTTP_STATUS_NO_CONTENT, "expected status 204, got %d\n", status); + ok(status == HTTP_STATUS_NO_CONTENT, "expected status 204, got %lu\n", status);
SetLastError(0xdeadbeef); size = sizeof(status); @@ -3021,28 +3018,28 @@ static void test_no_content(int port) ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_CONTENT_LENGTH | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, 0); ok(!ret, "expected no content-length header\n"); - ok(GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "wrong error %u\n", GetLastError()); - ok(status == 12345, "expected 0, got %d\n", status); + ok(GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "wrong error %lu\n", GetLastError()); + ok(status == 12345, "expected 0, got %lu\n", status);
SetLastError(0xdeadbeef); size = 12345; ret = WinHttpQueryDataAvailable(req, &size); ok(ret, "expected success\n"); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "wrong error %u\n", GetLastError()); - ok(!size, "expected 0, got %u\n", size); + "wrong error %lu\n", GetLastError()); + ok(!size, "expected 0, got %lu\n", size);
SetLastError(0xdeadbeef); ret = WinHttpReadData(req, buf, len, &bytes_read); ok(ret, "expected success\n"); ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == 0xdeadbeef) /* < win7 */, - "wrong error %u\n", GetLastError()); - ok(!bytes_read, "expected 0, got %u\n", bytes_read); + "wrong error %lu\n", GetLastError()); + ok(!bytes_read, "expected 0, got %lu\n", bytes_read);
size = 12345; ret = WinHttpQueryDataAvailable(req, &size); ok(ret, "expected success\n"); - ok(size == 0, "expected 0, got %d\n", size); + ok(size == 0, "expected 0, got %lu\n", size);
WinHttpCloseHandle(req);
@@ -3050,9 +3047,8 @@ static void test_no_content(int port) SetLastError(0xdeadbeef); ret = WinHttpQueryDataAvailable(req, &size); ok(!ret, "expected error\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, - "expected ERROR_INVALID_HANDLE, got 0x%08x\n", GetLastError()); - ok(size == 12345, "expected 12345, got %u\n", size); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %#lx\n", GetLastError()); + ok(size == 12345, "expected 12345, got %lu\n", size);
WinHttpCloseHandle(con); WinHttpCloseHandle(ses); @@ -3066,49 +3062,49 @@ static void test_head_request(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, L"HEAD", L"/head", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to get status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "got %u\n", status); + ok(ret, "failed to get status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "got %lu\n", status);
len = 0xdeadbeef; size = sizeof(len); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_CONTENT_LENGTH | WINHTTP_QUERY_FLAG_NUMBER, NULL, &len, &size, 0); - ok(ret, "failed to get content-length header %u\n", GetLastError()); - ok(len == HTTP_STATUS_CONTINUE, "got %u\n", len); + ok(ret, "failed to get content-length header %lu\n", GetLastError()); + ok(len == HTTP_STATUS_CONTINUE, "got %lu\n", len);
count = 0xdeadbeef; ret = WinHttpQueryDataAvailable(req, &count); - ok(ret, "failed to query data available %u\n", GetLastError()); - ok(!count, "got %u\n", count); + ok(ret, "failed to query data available %lu\n", GetLastError()); + ok(!count, "got %lu\n", count);
len = sizeof(buf); count = 0xdeadbeef; ret = WinHttpReadData(req, buf, len, &count); - ok(ret, "failed to read data %u\n", GetLastError()); - ok(!count, "got %u\n", count); + ok(ret, "failed to read data %lu\n", GetLastError()); + ok(!count, "got %lu\n", count);
count = 0xdeadbeef; ret = WinHttpQueryDataAvailable(req, &count); - ok(ret, "failed to query data available %u\n", GetLastError()); - ok(!count, "got %u\n", count); + ok(ret, "failed to query data available %lu\n", GetLastError()); + ok(!count, "got %lu\n", count);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -3123,37 +3119,37 @@ static void test_redirect(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, L"POST", L"/redirect", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, (void *)"data", sizeof("data"), sizeof("data"), 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); - ok(ret, "failed to receive response %u\n", GetLastError()); + ok(ret, "failed to receive response %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "failed to get status code %u\n", GetLastError()); - ok(status == HTTP_STATUS_OK, "got %u\n", status); + ok(ret, "failed to get status code %lu\n", GetLastError()); + ok(status == HTTP_STATUS_OK, "got %lu\n", status);
count = 0; ret = WinHttpQueryDataAvailable(req, &count); - ok(ret, "failed to query data available %u\n", GetLastError()); - ok(count == 128, "got %u\n", count); + ok(ret, "failed to query data available %lu\n", GetLastError()); + ok(count == 128, "got %lu\n", count);
len = sizeof(buf); count = 0; ret = WinHttpReadData(req, buf, len, &count); - ok(ret, "failed to read data %u\n", GetLastError()); - ok(count == 128, "got %u\n", count); + ok(ret, "failed to read data %lu\n", GetLastError()); + ok(count == 128, "got %lu\n", count);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -3178,30 +3174,30 @@ static void test_websocket(int port) }
session = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(session != NULL, "got %u\n", GetLastError()); + ok(session != NULL, "got %lu\n", GetLastError());
connection = WinHttpConnect(session, L"localhost", port, 0); - ok(connection != NULL, "got %u\n", GetLastError()); + ok(connection != NULL, "got %lu\n", GetLastError());
request = WinHttpOpenRequest(connection, L"GET", L"/websocket", NULL, NULL, NULL, 0); - ok(request != NULL, "got %u\n", GetLastError()); + ok(request != NULL, "got %lu\n", GetLastError());
ret = WinHttpSetOption(request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
size = sizeof(header); SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); error = GetLastError(); ok(!ret, "success\n"); - todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error); + todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %lu\n", error);
size = sizeof(header); SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CONNECTION, NULL, &header, &size, NULL); error = GetLastError(); ok(!ret, "success\n"); - todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error); + todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %lu\n", error);
index = 0; size = sizeof(buf); @@ -3210,7 +3206,7 @@ static void test_websocket(int port) L"Sec-WebSocket-Key", buf, &size, &index); error = GetLastError(); ok(!ret, "success\n"); - ok(error == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", error); + ok(error == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %lu\n", error);
index = 0; size = sizeof(buf); @@ -3219,65 +3215,65 @@ static void test_websocket(int port) L"Sec-WebSocket-Version", buf, &size, &index); error = GetLastError(); ok(!ret, "success\n"); - ok(error == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %u\n", error); + ok(error == ERROR_WINHTTP_HEADER_NOT_FOUND, "got %lu\n", error);
ret = WinHttpSendRequest(request, NULL, 0, NULL, 0, 0, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
size = sizeof(header); SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); error = GetLastError(); ok(!ret, "success\n"); - todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error); + todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %lu\n", error);
size = sizeof(header); SetLastError(0xdeadbeef); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CONNECTION, NULL, &header, &size, NULL); error = GetLastError(); ok(!ret, "success\n"); - todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error); + todo_wine ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %lu\n", error);
index = 0; buf[0] = 0; size = sizeof(buf); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Sec-WebSocket-Key", buf, &size, &index); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
index = 0; buf[0] = 0; size = sizeof(buf); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Sec-WebSocket-Version", buf, &size, &index); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpReceiveResponse(request, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
count = 0xdeadbeef; ret = WinHttpQueryDataAvailable(request, &count); - ok(ret, "got %u\n", GetLastError()); - ok(!count, "got %u\n", count); + ok(ret, "got %lu\n", GetLastError()); + ok(!count, "got %lu\n", count);
header[0] = 0; size = sizeof(header); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(!wcscmp( header, L"websocket" ), "got %s\n", wine_dbgstr_w(header));
header[0] = 0; size = sizeof(header); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CONNECTION, NULL, &header, &size, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(!wcscmp( header, L"Upgrade" ), "got %s\n", wine_dbgstr_w(header));
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "got %u\n", GetLastError()); - ok(status == HTTP_STATUS_SWITCH_PROTOCOLS, "got %u\n", status); + ok(ret, "got %lu\n", GetLastError()); + ok(status == HTTP_STATUS_SWITCH_PROTOCOLS, "got %lu\n", status);
len = 0xdeadbeef; size = sizeof(len); @@ -3288,191 +3284,191 @@ static void test_websocket(int port) index = 0; size = sizeof(buf); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM, L"Sec-WebSocket-Accept", buf, &size, &index); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
socket = pWinHttpWebSocketCompleteUpgrade(request, 0); - ok(socket != NULL, "got %u\n", GetLastError()); + ok(socket != NULL, "got %lu\n", GetLastError());
size = sizeof(header); ret = WinHttpQueryHeaders(socket, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); error = GetLastError(); ok(!ret, "success\n"); - ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %u\n", error); + ok(error == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %lu\n", error);
header[0] = 0; size = sizeof(header); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_UPGRADE, NULL, &header, &size, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(!wcscmp( header, L"websocket" ), "got %s\n", wine_dbgstr_w(header));
header[0] = 0; size = sizeof(header); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CONNECTION, NULL, &header, &size, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError()); ok(!wcscmp( header, L"Upgrade" ), "got %s\n", wine_dbgstr_w(header));
index = 0; size = sizeof(buf); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM, L"Sec-WebSocket-Accept", buf, &size, &index); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
/* sending request again generates new key */ ret = WinHttpSendRequest(request, NULL, 0, NULL, 0, 0, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
/* and creates a new websocket */ socket2 = pWinHttpWebSocketCompleteUpgrade(request, 0); - ok(socket2 != NULL, "got %u\n", GetLastError()); + ok(socket2 != NULL, "got %lu\n", GetLastError()); ok(socket2 != socket, "got same socket\n");
WinHttpCloseHandle(connection); /* request handle is still valid */ size = sizeof(ctx); ret = WinHttpQueryOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &ctx, &size); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpCloseHandle(socket2); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpCloseHandle(socket); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpQueryOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &ctx, &size); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpCloseHandle(session); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpQueryOption(request, WINHTTP_OPTION_CONTEXT_VALUE, &ctx, &size); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpCloseHandle(request); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
session = WinHttpOpen(L"winetest", 0, NULL, NULL, 0); - ok(session != NULL, "got %u\n", GetLastError()); + ok(session != NULL, "got %lu\n", GetLastError());
connection = WinHttpConnect(session, L"ws.ifelse.io", 0, 0); - ok(connection != NULL, "got %u\n", GetLastError()); + ok(connection != NULL, "got %lu\n", GetLastError());
request = WinHttpOpenRequest(connection, L"GET", L"/", NULL, NULL, NULL, 0); - ok(request != NULL, "got %u\n", GetLastError()); + ok(request != NULL, "got %lu\n", GetLastError());
ret = WinHttpSetOption(request, WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET, NULL, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpSendRequest(request, NULL, 0, NULL, 0, 0, 0); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
ret = WinHttpReceiveResponse(request, NULL); - ok(ret, "got %u\n", GetLastError()); + ok(ret, "got %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "got %u\n", GetLastError()); - ok(status == HTTP_STATUS_SWITCH_PROTOCOLS, "got %u\n", status); + ok(ret, "got %lu\n", GetLastError()); + ok(status == HTTP_STATUS_SWITCH_PROTOCOLS, "got %lu\n", status);
socket = pWinHttpWebSocketCompleteUpgrade(request, 0); - ok(socket != NULL, "got %u\n", GetLastError()); + ok(socket != NULL, "got %lu\n", GetLastError());
buf[0] = 0; count = 0; type = 0xdeadbeef; error = pWinHttpWebSocketReceive(socket, buf, sizeof(buf), &count, &type); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error); ok(buf[0] == 'R', "got %c\n", buf[0]); - ok(count == 26, "got %u\n", count); + ok(count == 26, "got %lu\n", count); ok(type == WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE, "got %u\n", type);
error = pWinHttpWebSocketSend(socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, NULL, 1); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
large_buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(buf) * 2); memcpy(large_buf, "hello", sizeof("hello")); memcpy(large_buf + sizeof(buf), "world", sizeof("world")); error = pWinHttpWebSocketSend(socket, WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, large_buf, sizeof(buf) * 2); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error); HeapFree(GetProcessHeap(), 0, large_buf);
error = pWinHttpWebSocketReceive(socket, NULL, 0, NULL, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketReceive(socket, buf, 0, NULL, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketReceive(socket, NULL, 1, NULL, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
buf[0] = 0; count = 0; type = 0xdeadbeef; error = pWinHttpWebSocketReceive(socket, buf, sizeof(buf), &count, &type); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error); ok(buf[0] == 'h', "got %c\n", buf[0]); - ok(count == sizeof(buf), "got %u\n", count); + ok(count == sizeof(buf), "got %lu\n", count); ok(type == WINHTTP_WEB_SOCKET_BINARY_FRAGMENT_BUFFER_TYPE, "got %u\n", type);
buf[0] = 0; count = 0; type = 0xdeadbeef; error = pWinHttpWebSocketReceive(socket, buf, sizeof(buf), &count, &type); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error); ok(buf[0] == 'w', "got %c\n", buf[0]); - ok(count == sizeof(buf), "got %u\n", count); + ok(count == sizeof(buf), "got %lu\n", count); ok(type == WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE, "got %u\n", type);
error = pWinHttpWebSocketShutdown(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, NULL, 1); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketShutdown(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, buf, sizeof(buf)); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketShutdown(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, (void *)"success", sizeof("success")); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error);
error = pWinHttpWebSocketClose(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, NULL, 1); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketClose(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, buf, sizeof(buf)); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketClose(socket, WINHTTP_WEB_SOCKET_SUCCESS_CLOSE_STATUS, (void *)"success2", sizeof("success2")); - ok(!error, "got %u\n", error); + ok(!error, "got %lu\n", error);
error = pWinHttpWebSocketQueryCloseStatus(socket, NULL, NULL, 0, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 0, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, 0, NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, sizeof(buf), NULL); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
error = pWinHttpWebSocketQueryCloseStatus(socket, NULL, NULL, 0, &len); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
len = 0xdeadbeef; error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 0, &len); - ok(!error, "got %u\n", error); - ok(!len, "got %u\n", len); + ok(!error, "got %lu\n", error); + ok(!len, "got %lu\n", len);
error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, NULL, 1, &len); - ok(error == ERROR_INVALID_PARAMETER, "got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "got %lu\n", error);
close_status = 0xdead; len = 0xdeadbeef; memset(buf, 0, sizeof(buf)); error = pWinHttpWebSocketQueryCloseStatus(socket, &close_status, buf, sizeof(buf), &len); - ok(!error, "got %u\n", error); - ok(close_status == 1000, "got %08x\n", close_status); - ok(!len, "got %u\n", len); + ok(!error, "got %lu\n", error); + ok(close_status == 1000, "got %d\n", close_status); + ok(!len, "got %lu\n", len);
WinHttpCloseHandle(socket); WinHttpCloseHandle(request); @@ -3494,44 +3490,44 @@ static void test_not_modified(int port)
session = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); - ok(session != NULL, "WinHttpOpen failed: %u\n", GetLastError()); + ok(session != NULL, "WinHttpOpen failed: %lu\n", GetLastError());
connection = WinHttpConnect(session, L"localhost", port, 0); - ok(connection != NULL, "WinHttpConnect failed: %u\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed: %lu\n", GetLastError());
request = WinHttpOpenRequest(connection, NULL, L"/not_modified", NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_BYPASS_PROXY_CACHE); - ok(request != NULL, "WinHttpOpenrequest failed: %u\n", GetLastError()); + ok(request != NULL, "WinHttpOpenrequest failed: %lu\n", GetLastError());
ret = WinHttpSendRequest(request, today, 0, NULL, 0, 0, 0); - ok(ret, "WinHttpSendRequest failed: %u\n", GetLastError()); + ok(ret, "WinHttpSendRequest failed: %lu\n", GetLastError());
ret = WinHttpReceiveResponse(request, NULL); - ok(ret, "WinHttpReceiveResponse failed: %u\n", GetLastError()); + ok(ret, "WinHttpReceiveResponse failed: %lu\n", GetLastError());
index = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_CUSTOM | WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"If-Modified-Since", buffer, &len, &index); - ok(ret, "failed to get header %u\n", GetLastError()); + ok(ret, "failed to get header %lu\n", GetLastError());
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders(request, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL); - ok(ret, "WinHttpQueryHeaders failed: %u\n", GetLastError()); - ok(status == HTTP_STATUS_NOT_MODIFIED, "got %u\n", status); + ok(ret, "WinHttpQueryHeaders failed: %lu\n", GetLastError()); + ok(status == HTTP_STATUS_NOT_MODIFIED, "got %lu\n", status);
size = 0xdeadbeef; ret = WinHttpQueryDataAvailable(request, &size); - ok(ret, "WinHttpQueryDataAvailable failed: %u\n", GetLastError()); - ok(!size, "got %u\n", size); + ok(ret, "WinHttpQueryDataAvailable failed: %lu\n", GetLastError()); + ok(!size, "got %lu\n", size);
WinHttpCloseHandle(request); WinHttpCloseHandle(connection); WinHttpCloseHandle(session); start = GetTickCount() - start; - ok(start <= 2000, "Expected less than 2 seconds for the test, got %u ms\n", start); + ok(start <= 2000, "Expected less than 2 seconds for the test, got %lu ms\n", start); }
static void test_bad_header( int port ) @@ -3542,34 +3538,34 @@ static void test_bad_header( int port ) BOOL ret;
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpAddRequestHeaders( req, L"Content-Type: text/html\n\rContent-Length:6\rCookie:111", ~0u, WINHTTP_ADDREQ_FLAG_ADD ); - ok( ret, "failed to add header %u\n", GetLastError() ); + ok( ret, "failed to add header %lu\n", GetLastError() );
index = 0; buffer[0] = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_CUSTOM|WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Content-Type", buffer, &len, &index ); - ok( ret, "failed to query headers %u\n", GetLastError() ); + ok( ret, "failed to query headers %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, L"text/html" ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( index == 1, "index = %u\n", index ); + ok( index == 1, "index = %lu\n", index );
index = 0; buffer[0] = 0; len = sizeof(buffer); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_CUSTOM|WINHTTP_QUERY_FLAG_REQUEST_HEADERS, L"Cookie", buffer, &len, &index ); - ok( ret, "failed to query headers %u\n", GetLastError() ); + ok( ret, "failed to query headers %lu\n", GetLastError() ); ok( !lstrcmpW( buffer, L"111" ), "got %s\n", wine_dbgstr_w(buffer) ); - ok( index == 1, "index = %u\n", index ); + ok( index == 1, "index = %lu\n", index );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); @@ -3583,16 +3579,16 @@ static void test_multiple_reads(int port) BOOL ret;
ses = WinHttpOpen(L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", port, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, L"big", NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - ok(ret, "failed to send request %u\n", GetLastError()); + ok(ret, "failed to send request %lu\n", GetLastError());
ret = WinHttpReceiveResponse(req, NULL); ok(ret == TRUE, "expected success\n"); @@ -3601,7 +3597,7 @@ static void test_multiple_reads(int port) { DWORD len = 0xdeadbeef; ret = WinHttpQueryDataAvailable( req, &len ); - ok( ret, "WinHttpQueryDataAvailable failed with error %u\n", GetLastError() ); + ok( ret, "WinHttpQueryDataAvailable failed with error %lu\n", GetLastError() ); if (ret) ok( len != 0xdeadbeef, "WinHttpQueryDataAvailable return wrong length\n" ); if (len) { @@ -3609,8 +3605,8 @@ static void test_multiple_reads(int port) char *buf = HeapAlloc( GetProcessHeap(), 0, len + 1 );
ret = WinHttpReadData( req, buf, len, &bytes_read ); - ok(ret, "WinHttpReadData failed: %u.\n", GetLastError()); - ok( len == bytes_read, "only got %u of %u available\n", bytes_read, len ); + ok(ret, "WinHttpReadData failed: %lu\n", GetLastError()); + ok( len == bytes_read, "only got %lu of %lu available\n", bytes_read, len );
HeapFree( GetProcessHeap(), 0, buf ); if (!bytes_read) break; @@ -3618,7 +3614,7 @@ static void test_multiple_reads(int port) } if (!len) break; } - ok(total_len == BIG_BUFFER_LEN, "got wrong length: 0x%x\n", total_len); + ok(total_len == BIG_BUFFER_LEN, "got wrong length: %lu\n", total_len);
WinHttpCloseHandle(req); WinHttpCloseHandle(con); @@ -3632,146 +3628,146 @@ static void test_cookies( int port ) BOOL ret;
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/cookie", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req );
req = WinHttpOpenRequest( con, NULL, L"/cookie2", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/cookie2", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req );
req = WinHttpOpenRequest( con, NULL, L"/cookie3", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() ); ret = WinHttpSendRequest( req, L"Cookie: name=value2\r\n", ~0u, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_OK || broken(status == HTTP_STATUS_BAD_REQUEST), "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_OK || broken(status == HTTP_STATUS_BAD_REQUEST), "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses );
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/cookie2", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_BAD_REQUEST, "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_BAD_REQUEST, "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses );
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/cookie4", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); - ok( status == HTTP_STATUS_OK, "request failed unexpectedly %u\n", status ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_OK, "request failed unexpectedly %lu\n", status ); WinHttpCloseHandle( req );
req = WinHttpOpenRequest( con, NULL, L"/cookie5", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); ok( status == HTTP_STATUS_OK || broken(status == HTTP_STATUS_BAD_REQUEST) /* < win7 */, - "request failed unexpectedly %u\n", status ); + "request failed unexpectedly %lu\n", status );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); @@ -3785,20 +3781,20 @@ static void do_request( HINTERNET con, const WCHAR *obj, DWORD flags ) BOOL ret;
req = WinHttpOpenRequest( con, NULL, obj, NULL, NULL, NULL, flags ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "failed to query status code %u\n", GetLastError() ); + ok( ret, "failed to query status code %lu\n", GetLastError() ); ok( status == HTTP_STATUS_OK || broken(status == HTTP_STATUS_BAD_REQUEST) /* < win7 */, - "request %s with flags %08x failed %u\n", wine_dbgstr_w(obj), flags, status ); + "request %s with flags %#lx failed %lu\n", wine_dbgstr_w(obj), flags, status ); WinHttpCloseHandle( req ); }
@@ -3829,10 +3825,10 @@ static void test_request_path_escapes( int port ) HINTERNET ses, con;
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
do_request( con, objW, 0 ); do_request( con, obj2W, WINHTTP_FLAG_ESCAPE_PERCENT ); @@ -3854,13 +3850,13 @@ static void test_connection_info( int port ) BOOL ret;
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/basic", NULL, NULL, NULL, 0 ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
size = sizeof(info); SetLastError( 0xdeadbeef ); @@ -3872,32 +3868,32 @@ static void test_connection_info( int port ) return; } ok( !ret, "unexpected success\n" ); - ok( error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %u\n", error ); + ok( error == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "got %lu\n", error );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
size = 0; SetLastError( 0xdeadbeef ); ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); error = GetLastError(); ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INSUFFICIENT_BUFFER, "got %u\n", error ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %lu\n", error );
size = sizeof(info); memset( &info, 0, sizeof(info) ); ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); - ok( ret, "failed to retrieve connection info %u\n", GetLastError() ); - ok( info.cbSize == sizeof(info) || info.cbSize == sizeof(info) - sizeof(info.cbSize) /* Win7 */, "wrong size %u\n", info.cbSize ); + ok( ret, "failed to retrieve connection info %lu\n", GetLastError() ); + ok( info.cbSize == sizeof(info) || info.cbSize == sizeof(info) - sizeof(info.cbSize) /* Win7 */, "wrong size %lu\n", info.cbSize );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
size = sizeof(info); memset( &info, 0, sizeof(info) ); ret = WinHttpQueryOption( req, WINHTTP_OPTION_CONNECTION_INFO, &info, &size ); - ok( ret, "failed to retrieve connection info %u\n", GetLastError() ); - ok( info.cbSize == sizeof(info) || info.cbSize == sizeof(info) - sizeof(info.cbSize) /* Win7 */, "wrong size %u\n", info.cbSize ); + ok( ret, "failed to retrieve connection info %lu\n", GetLastError() ); + ok( info.cbSize == sizeof(info) || info.cbSize == sizeof(info) - sizeof(info.cbSize) /* Win7 */, "wrong size %lu\n", info.cbSize );
WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); @@ -3914,25 +3910,25 @@ static void test_passport_auth( int port ) BOOL ret;
ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok( ses != NULL, "got %u\n", GetLastError() ); + ok( ses != NULL, "got %lu\n", GetLastError() );
option = WINHTTP_ENABLE_PASSPORT_AUTH; ret = WinHttpSetOption( ses, WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH, &option, sizeof(option) ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"localhost", port, 0 ); - ok( con != NULL, "got %u\n", GetLastError() ); + ok( con != NULL, "got %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/passport", NULL, NULL, NULL, 0 ); - ok( req != NULL, "got %u\n", GetLastError() ); + ok( req != NULL, "got %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); err = GetLastError(); ok( ret || broken(!ret && err == ERROR_WINHTTP_LOGIN_FAILURE) /* winxp */ - || broken(!ret && err == ERROR_WINHTTP_INVALID_SERVER_RESPONSE ), "got %u\n", err ); + || broken(!ret && err == ERROR_WINHTTP_INVALID_SERVER_RESPONSE ), "got %lu\n", err ); if (!ret) { win_skip("no support for Passport redirects\n"); @@ -3942,23 +3938,23 @@ static void test_passport_auth( int port ) status = 0xdeadbeef; size = sizeof(status); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE|WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); - ok( ret, "got %u\n", GetLastError() ); - ok( status == HTTP_STATUS_DENIED, "got %u\n", status ); + ok( ret, "got %lu\n", GetLastError() ); + ok( status == HTTP_STATUS_DENIED, "got %lu\n", status );
buf[0] = 0; size = sizeof(buf); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_TEXT, NULL, buf, &size, NULL ); - ok( ret, "got %u\n", GetLastError() ); + ok( ret, "got %lu\n", GetLastError() ); ok( !lstrcmpW(L"Found", buf) || broken(!lstrcmpW(L"Unauthorized", buf)) /* < win7 */, "got %s\n", wine_dbgstr_w(buf) );
buf[0] = 0; size = sizeof(buf); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, buf, &size, NULL ); - ok( ret || broken(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) /* < win7 */, "got %u\n", GetLastError() ); + ok( ret || broken(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER) /* < win7 */, "got %lu\n", GetLastError() ); if (ret) { - ok( size == lstrlenW(headersW) * sizeof(WCHAR), "got %u\n", size ); + ok( size == lstrlenW(headersW) * sizeof(WCHAR), "got %lu\n", size ); ok( !lstrcmpW(headersW, buf), "got %s\n", wine_dbgstr_w(buf) ); }
@@ -3980,108 +3976,108 @@ static void test_credentials(void) BOOL ret;
ses = WinHttpOpen(L"winetest", 0, proxy_userW, proxy_passW, 0); - ok(ses != NULL, "failed to open session %u\n", GetLastError()); + ok(ses != NULL, "failed to open session %lu\n", GetLastError());
con = WinHttpConnect(ses, L"localhost", 0, 0); - ok(con != NULL, "failed to open a connection %u\n", GetLastError()); + ok(con != NULL, "failed to open a connection %lu\n", GetLastError());
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_USERNAME, &buffer, &size); - ok(ret, "failed to query proxy username %u\n", GetLastError()); + ok(ret, "failed to query proxy username %lu\n", GetLastError()); ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size);
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_PASSWORD, &buffer, &size); - ok(ret, "failed to query proxy password %u\n", GetLastError()); + ok(ret, "failed to query proxy password %lu\n", GetLastError()); ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size);
ret = WinHttpSetOption(req, WINHTTP_OPTION_PROXY_USERNAME, proxy_userW, lstrlenW(proxy_userW)); - ok(ret, "failed to set username %u\n", GetLastError()); + ok(ret, "failed to set username %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_USERNAME, &buffer, &size); - ok(ret, "failed to query proxy username %u\n", GetLastError()); + ok(ret, "failed to query proxy username %lu\n", GetLastError()); ok(!wcscmp(buffer, proxy_userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(size == lstrlenW(proxy_userW) * sizeof(WCHAR), "unexpected result %u\n", size); + ok(size == lstrlenW(proxy_userW) * sizeof(WCHAR), "unexpected result %lu\n", size);
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_USERNAME, &buffer, &size); - ok(ret, "failed to query username %u\n", GetLastError()); + ok(ret, "failed to query username %lu\n", GetLastError()); ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size);
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PASSWORD, &buffer, &size); - ok(ret, "failed to query password %u\n", GetLastError()); + ok(ret, "failed to query password %lu\n", GetLastError()); ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size);
ret = WinHttpSetOption(req, WINHTTP_OPTION_PROXY_PASSWORD, proxy_passW, lstrlenW(proxy_passW)); - ok(ret, "failed to set proxy password %u\n", GetLastError()); + ok(ret, "failed to set proxy password %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PROXY_PASSWORD, &buffer, &size); - ok(ret, "failed to query proxy password %u\n", GetLastError()); + ok(ret, "failed to query proxy password %lu\n", GetLastError()); ok(!wcscmp(buffer, proxy_passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(size == lstrlenW(proxy_passW) * sizeof(WCHAR), "unexpected result %u\n", size); + ok(size == lstrlenW(proxy_passW) * sizeof(WCHAR), "unexpected result %lu\n", size);
ret = WinHttpSetOption(req, WINHTTP_OPTION_USERNAME, userW, lstrlenW(userW)); - ok(ret, "failed to set username %u\n", GetLastError()); + ok(ret, "failed to set username %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_USERNAME, &buffer, &size); - ok(ret, "failed to query username %u\n", GetLastError()); + ok(ret, "failed to query username %lu\n", GetLastError()); ok(!wcscmp(buffer, userW), "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(size == lstrlenW(userW) * sizeof(WCHAR), "unexpected result %u\n", size); + ok(size == lstrlenW(userW) * sizeof(WCHAR), "unexpected result %lu\n", size);
ret = WinHttpSetOption(req, WINHTTP_OPTION_PASSWORD, passW, lstrlenW(passW)); - ok(ret, "failed to set password %u\n", GetLastError()); + ok(ret, "failed to set password %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PASSWORD, &buffer, &size); - ok(ret, "failed to query password %u\n", GetLastError()); + ok(ret, "failed to query password %lu\n", GetLastError()); ok(!wcscmp(buffer, passW), "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(size == lstrlenW(passW) * sizeof(WCHAR), "unexpected result %u\n", size); + ok(size == lstrlenW(passW) * sizeof(WCHAR), "unexpected result %lu\n", size);
WinHttpCloseHandle(req);
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); - ok(req != NULL, "failed to open a request %u\n", GetLastError()); + ok(req != NULL, "failed to open a request %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, userW, NULL, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
SetLastError(0xdeadbeef); ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, NULL, passW, NULL); error = GetLastError(); ok(!ret, "expected failure\n"); - ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error); + ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %lu\n", error);
ret = WinHttpSetCredentials(req, WINHTTP_AUTH_TARGET_SERVER, WINHTTP_AUTH_SCHEME_BASIC, userW, passW, NULL); - ok(ret, "failed to set credentials %u\n", GetLastError()); + ok(ret, "failed to set credentials %lu\n", GetLastError());
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_USERNAME, &buffer, &size); - ok(ret, "failed to query username %u\n", GetLastError()); + ok(ret, "failed to query username %lu\n", GetLastError()); todo_wine { ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size); }
size = ARRAY_SIZE(buffer); ret = WinHttpQueryOption(req, WINHTTP_OPTION_PASSWORD, &buffer, &size); - ok(ret, "failed to query password %u\n", GetLastError()); + ok(ret, "failed to query password %lu\n", GetLastError()); todo_wine { ok(!buffer[0], "unexpected result %s\n", wine_dbgstr_w(buffer)); - ok(!size, "expected 0, got %u\n", size); + ok(!size, "expected 0, got %lu\n", size); }
WinHttpCloseHandle(req); @@ -4112,7 +4108,7 @@ static void test_IWinHttpRequest(int port)
CoInitialize( NULL ); hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
V_VT( &empty ) = VT_ERROR; V_ERROR( &empty ) = 0xdeadbeef; @@ -4123,54 +4119,54 @@ static void test_IWinHttpRequest(int port) method = SysAllocString( L"POST" ); url = SysAllocString( L"http://test.winehq.org/tests/post.php" ); hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( method ); SysFreeString( url );
V_VT( &data ) = VT_BSTR; V_BSTR( &data ) = SysAllocString( L"testdata\x80" ); hr = IWinHttpRequest_Send( req, data ); - ok( hr == S_OK || hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_INVALID_SERVER_RESPONSE ), "got %08x\n", hr ); + ok( hr == S_OK || hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_INVALID_SERVER_RESPONSE ), "got %#lx\n", hr ); SysFreeString( V_BSTR( &data ) ); if (hr != S_OK) goto done;
hr = IWinHttpRequest_Open( req, NULL, NULL, empty ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
method = SysAllocString( L"GET" ); hr = IWinHttpRequest_Open( req, method, NULL, empty ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_Open( req, method, NULL, async ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
url = SysAllocString( L"http://test.winehq.org" ); hr = IWinHttpRequest_Open( req, NULL, url, empty ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Open( req, method, url, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
IWinHttpRequest_Release( req );
hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
SysFreeString( url ); url = SysAllocString( L"test.winehq.org" ); hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ), "got %#lx\n", hr );
SysFreeString( method ); method = SysAllocString( L"INVALID" ); hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ), "got %#lx\n", hr );
SysFreeString( method ); method = SysAllocString( L"GET" ); @@ -4179,401 +4175,401 @@ static void test_IWinHttpRequest(int port) V_VT( &async ) = VT_ERROR; V_ERROR( &async ) = DISP_E_PARAMNOTFOUND; hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
V_VT( &cp ) = VT_ERROR; V_ERROR( &cp ) = 0xdeadbeef; hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); - ok( V_I4( &cp ) == CP_UTF8, "got %u\n", V_I4( &cp ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %#x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_UTF8, "got %ld\n", V_I4( &cp ) );
V_VT( &cp ) = VT_UI4; V_UI4( &cp ) = CP_ACP; hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage, cp ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
V_VT( &cp ) = VT_ERROR; V_ERROR( &cp ) = 0xdeadbeef; hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); - ok( V_I4( &cp ) == CP_ACP, "got %u\n", V_I4( &cp ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %#x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_ACP, "got %ld\n", V_I4( &cp ) );
value = SysAllocString( L"utf-8" ); V_VT( &cp ) = VT_BSTR; V_BSTR( &cp ) = value; hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage, cp ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( value );
V_VT( &cp ) = VT_ERROR; V_ERROR( &cp ) = 0xdeadbeef; hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); - ok( V_I4( &cp ) == CP_UTF8, "got %u\n", V_I4( &cp ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %#x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_UTF8, "got %ld\n", V_I4( &cp ) );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %#lx\n", hr );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
IWinHttpRequest_Release( req );
hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_Status( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_StatusText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_StatusText( req, &status_text ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseBody( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetTimeouts( req, 10000, 10000, 10000, 10000 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, NULL, NULL, 0xdeadbeef ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %#lx\n", hr );
VariantInit( &proxy_server ); V_VT( &proxy_server ) = VT_ERROR; VariantInit( &bypass_list ); V_VT( &bypass_list ) = VT_ERROR; hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, &headers ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_GetResponseHeader( req, NULL, NULL ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
connection = SysAllocString( L"Connection" ); hr = IWinHttpRequest_GetResponseHeader( req, connection, NULL ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_GetResponseHeader( req, connection, &value ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_SetRequestHeader( req, NULL, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
date = SysAllocString( L"Date" ); hr = IWinHttpRequest_SetRequestHeader( req, date, NULL ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %#lx\n", hr );
today = SysAllocString( todayW ); hr = IWinHttpRequest_SetRequestHeader( req, date, today ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN ), "got %#lx\n", hr );
hr = IWinHttpRequest_SetAutoLogonPolicy( req, 0xdeadbeef ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
SysFreeString( method ); method = SysAllocString( L"GET" ); SysFreeString( url ); url = SysAllocString( L"http://test.winehq.org" ); hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_StatusText( req, &status_text ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseBody( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetTimeouts( req, 10000, 10000, 10000, 10000 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, NULL, NULL, 0xdeadbeef ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
username = SysAllocString( L"username" ); hr = IWinHttpRequest_SetCredentials( req, username, NULL, 0xdeadbeef ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
password = SysAllocString( L"password" ); hr = IWinHttpRequest_SetCredentials( req, NULL, password, 0xdeadbeef ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, username, password, 0xdeadbeef ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, NULL, password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, username, password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
V_VT( &proxy_server ) = VT_BSTR; V_BSTR( &proxy_server ) = SysAllocString( L"proxyserver" ); V_VT( &bypass_list ) = VT_BSTR; V_BSTR( &bypass_list ) = SysAllocString( L"bypasslist" ); hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, 0xdeadbeef, proxy_server, bypass_list ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, &headers ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_GetResponseHeader( req, connection, &value ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_SetRequestHeader( req, date, today ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetRequestHeader( req, date, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( !memcmp(response, data_start, sizeof(data_start)), "got %s\n", wine_dbgstr_wn(response, 32) ); SysFreeString( response );
hr = IWinHttpRequest_get_Status( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
status = 0; hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == S_OK, "got %08x\n", hr ); - trace("Status=%d\n", status); + ok( hr == S_OK, "got %#lx\n", hr ); + trace("Status = %lu\n", status);
hr = IWinHttpRequest_get_StatusText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_StatusText( req, &status_text ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); trace("StatusText=%s\n", wine_dbgstr_w(status_text)); SysFreeString( status_text );
hr = IWinHttpRequest_get_ResponseBody( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_SetCredentials( req, username, password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, &headers ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( headers );
hr = IWinHttpRequest_GetResponseHeader( req, NULL, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_GetResponseHeader( req, connection, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_GetResponseHeader( req, connection, &value ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( value );
hr = IWinHttpRequest_SetRequestHeader( req, date, today ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
VariantInit( &timeout ); V_VT( &timeout ) = VT_I4; V_I4( &timeout ) = 10; hr = IWinHttpRequest_WaitForResponse( req, timeout, &succeeded ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_StatusText( req, &status_text ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( status_text );
hr = IWinHttpRequest_SetCredentials( req, username, password, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( response );
hr = IWinHttpRequest_get_ResponseBody( req, NULL ); - ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( hr == E_INVALIDARG, "got %#lx\n", hr );
VariantInit( &body ); V_VT( &body ) = VT_ERROR; hr = IWinHttpRequest_get_ResponseBody( req, &body ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &body ) == (VT_ARRAY|VT_UI1), "got %08x\n", V_VT( &body ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &body ) == (VT_ARRAY|VT_UI1), "got %#x\n", V_VT( &body ) );
hr = VariantClear( &body ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
VariantInit( &body ); V_VT( &body ) = VT_ERROR; hr = IWinHttpRequest_get_ResponseStream( req, &body ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &body ) == VT_UNKNOWN, "got %08x\n", V_VT( &body ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &body ) == VT_UNKNOWN, "got %#x\n", V_VT( &body ) );
hr = IUnknown_QueryInterface( V_UNKNOWN( &body ), &IID_IStream, (void **)&stream ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( V_UNKNOWN( &body ) == (IUnknown *)stream, "got different interface pointer\n" );
buf[0] = 0; count = 0xdeadbeef; hr = IStream_Read( stream, buf, 128, &count ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( count != 0xdeadbeef, "count not set\n" ); ok( buf[0], "no data\n" );
VariantInit( &body2 ); V_VT( &body2 ) = VT_ERROR; hr = IWinHttpRequest_get_ResponseStream( req, &body2 ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( V_VT( &body2 ) == VT_UNKNOWN, "got %08x\n", V_VT( &body2 ) ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( V_VT( &body2 ) == VT_UNKNOWN, "got %#x\n", V_VT( &body2 ) ); ok( V_UNKNOWN( &body ) != V_UNKNOWN( &body2 ), "got same interface pointer\n" );
hr = IUnknown_QueryInterface( V_UNKNOWN( &body2 ), &IID_IStream, (void **)&stream2 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( V_UNKNOWN( &body2 ) == (IUnknown *)stream2, "got different interface pointer\n" ); IStream_Release( stream2 );
hr = VariantClear( &body ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = VariantClear( &body2 ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_PROXY, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_SetProxy( req, HTTPREQUEST_PROXYSETTING_DIRECT, proxy_server, bypass_list ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_GetAllResponseHeaders( req, &headers ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( headers );
hr = IWinHttpRequest_GetResponseHeader( req, connection, &value ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( value );
hr = IWinHttpRequest_SetRequestHeader( req, date, today ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND ), "got %#lx\n", hr );
hr = IWinHttpRequest_SetAutoLogonPolicy( req, AutoLogonPolicy_OnlyIfBypassProxy ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Abort( req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
IWinHttpRequest_Release( req );
pos.QuadPart = 0; hr = IStream_Seek( stream, pos, STREAM_SEEK_SET, NULL ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
buf[0] = 0; count = 0xdeadbeef; hr = IStream_Read( stream, buf, 128, &count ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( count != 0xdeadbeef, "count not set\n" ); ok( buf[0], "no data\n" ); IStream_Release( stream );
hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
V_VT( &async ) = VT_I4; V_I4( &async ) = 1; hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_Send( req, empty ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
hr = IWinHttpRequest_WaitForResponse( req, timeout, &succeeded ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
IWinHttpRequest_Release( req );
@@ -4588,31 +4584,31 @@ static void test_IWinHttpRequest(int port) VariantClear( &bypass_list );
hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
url = SysAllocString( L"https://test.winehq.org:443" ); method = SysAllocString( L"POST" ); V_VT( &async ) = VT_BOOL; V_BOOL( &async ) = VARIANT_FALSE; hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( method ); SysFreeString( url );
hr = IWinHttpRequest_Send( req, empty ); ok( hr == S_OK || hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_INVALID_SERVER_RESPONSE ) || - hr == SEC_E_ILLEGAL_MESSAGE /* winxp */, "got %08x\n", hr ); + hr == SEC_E_ILLEGAL_MESSAGE /* winxp */, "got %#lx\n", hr ); if (hr != S_OK) goto done;
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( !memcmp(response, data_start, sizeof(data_start)), "got %s\n", wine_dbgstr_wn(response, 32) ); SysFreeString( response );
IWinHttpRequest_Release( req );
hr = CoCreateInstance( &CLSID_WinHttpRequest, NULL, CLSCTX_INPROC_SERVER, &IID_IWinHttpRequest, (void **)&req ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr );
sprintf( buf, "http://localhost:%d/auth", port ); MultiByteToWideChar( CP_ACP, 0, buf, -1, bufW, ARRAY_SIZE( bufW )); @@ -4621,28 +4617,28 @@ static void test_IWinHttpRequest(int port) V_VT( &async ) = VT_BOOL; V_BOOL( &async ) = VARIANT_FALSE; hr = IWinHttpRequest_Open( req, method, url, async ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( method ); SysFreeString( url );
hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %08x\n", hr ); + ok( hr == HRESULT_FROM_WIN32( ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND ), "got %#lx\n", hr );
V_VT( &data ) = VT_BSTR; V_BSTR( &data ) = SysAllocString( L"testdata\x80" ); hr = IWinHttpRequest_Send( req, data ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); SysFreeString( V_BSTR( &data ) );
hr = IWinHttpRequest_get_ResponseText( req, &response ); - ok( hr == S_OK, "got %08x\n", hr ); + ok( hr == S_OK, "got %#lx\n", hr ); ok( !memcmp( response, L"Unauthorized", sizeof(L"Unauthorized") ), "got %s\n", wine_dbgstr_w(response) ); SysFreeString( response );
status = 0xdeadbeef; hr = IWinHttpRequest_get_Status( req, &status ); - ok( hr == S_OK, "got %08x\n", hr ); - ok( status == HTTP_STATUS_DENIED, "got %d\n", status ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( status == HTTP_STATUS_DENIED, "got %lu\n", status );
done: IWinHttpRequest_Release( req ); @@ -4666,7 +4662,7 @@ static void request_get_property(IWinHttpRequest *request, int property, VARIANT VariantInit(ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, ret, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr); }
static void test_IWinHttpRequest_Invoke(void) @@ -4688,28 +4684,28 @@ static void test_IWinHttpRequest_Invoke(void) CoInitialize(NULL);
hr = CLSIDFromProgID(L"WinHttp.WinHttpRequest.5.1", &clsid); - ok(hr == S_OK, "CLSIDFromProgID error %#x\n", hr); + ok(hr == S_OK, "CLSIDFromProgID error %#lx\n", hr); bret = IsEqualIID(&clsid, &CLSID_WinHttpRequest); ok(bret || broken(!bret) /* win2003 */, "not expected %s\n", wine_dbgstr_guid(&clsid));
hr = CoCreateInstance(&CLSID_WinHttpRequest, 0, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&request); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
hr = IWinHttpRequest_QueryInterface(request, &IID_IDispatch, (void **)&dispatch); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr); IDispatch_Release(dispatch);
hr = IWinHttpRequest_GetIDsOfNames(request, &IID_NULL, &open, 1, 0x0409, &id); - ok(hr == S_OK, "error %#x\n", hr); - ok(id == DISPID_HTTPREQUEST_OPEN, "expected DISPID_HTTPREQUEST_OPEN, got %u\n", id); + ok(hr == S_OK, "error %#lx\n", hr); + ok(id == DISPID_HTTPREQUEST_OPEN, "expected DISPID_HTTPREQUEST_OPEN, got %lu\n", id);
hr = IWinHttpRequest_GetIDsOfNames(request, &IID_NULL, &option, 1, 0x0409, &id); - ok(hr == S_OK, "error %#x\n", hr); - ok(id == DISPID_HTTPREQUEST_OPTION, "expected DISPID_HTTPREQUEST_OPTION, got %u\n", id); + ok(hr == S_OK, "error %#lx\n", hr); + ok(id == DISPID_HTTPREQUEST_OPTION, "expected DISPID_HTTPREQUEST_OPTION, got %lu\n", id);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
memset(¶ms, 0, sizeof(params)); params.cArgs = 2; @@ -4722,11 +4718,11 @@ static void test_IWinHttpRequest_Invoke(void) VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, NULL, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
memset(¶ms, 0, sizeof(params)); params.cArgs = 2; @@ -4739,11 +4735,11 @@ static void test_IWinHttpRequest_Invoke(void) VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD | DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
memset(¶ms, 0, sizeof(params)); params.cArgs = 2; @@ -4756,11 +4752,11 @@ static void test_IWinHttpRequest_Invoke(void) VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %ld\n", V_I4(&ret));
memset(¶ms, 0, sizeof(params)); params.cArgs = 2; @@ -4772,37 +4768,37 @@ static void test_IWinHttpRequest_Invoke(void) V_VT(&arg[1]) = VT_R8; V_R8(&arg[1]) = 2.0; /* WinHttpRequestOption_URLCodePage */ hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, NULL, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %ld\n", V_I4(&ret));
VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %ld\n", V_I4(&ret));
VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
hr = IWinHttpRequest_Invoke(request, 255, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, NULL); - ok(hr == DISP_E_MEMBERNOTFOUND, "error %#x\n", hr); + ok(hr == DISP_E_MEMBERNOTFOUND, "error %#lx\n", hr);
VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_IUnknown, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); - ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#x\n", hr); + ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#lx\n", hr);
VariantInit(&ret); if (0) /* crashes */ @@ -4810,13 +4806,13 @@ static void test_IWinHttpRequest_Invoke(void)
params.cArgs = 1; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); - ok(hr == DISP_E_TYPEMISMATCH, "error %#x\n", hr); + ok(hr == DISP_E_TYPEMISMATCH, "error %#lx\n", hr);
VariantInit(&arg[2]); params.cArgs = 3; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); todo_wine - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
VariantInit(&arg[0]); VariantInit(&arg[1]); @@ -4826,46 +4822,46 @@ static void test_IWinHttpRequest_Invoke(void) V_VT(&arg[0]) = VT_I4; V_I4(&arg[0]) = WinHttpRequestOption_URLCodePage; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
V_VT(&ret) = 0xdead; V_I4(&ret) = 0xbeef; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD|DISPATCH_PROPERTYGET, ¶ms, &ret, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(hr == S_OK, "error %#lx\n", hr); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
V_VT(&ret) = 0xdead; V_I4(&ret) = 0xbeef; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); - ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + ok(hr == S_OK, "error %#lx\n", hr); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %ld\n", V_I4(&ret));
hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD|DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
V_VT(&ret) = 0xdead; V_I4(&ret) = 0xbeef; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, 0, ¶ms, &ret, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); - ok(V_VT(&ret) == VT_EMPTY, "expected VT_EMPTY, got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 0xbeef || V_I4(&ret) == 0 /* Win8 */, "expected 0xdead, got %d\n", V_I4(&ret)); + ok(hr == S_OK, "error %#lx\n", hr); + ok(V_VT(&ret) == VT_EMPTY, "expected VT_EMPTY, got %#x\n", V_VT(&ret)); + ok(V_I4(&ret) == 0xbeef || V_I4(&ret) == 0 /* Win8 */, "expected 0xdead, got %ld\n", V_I4(&ret));
hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, 0, ¶ms, NULL, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_IUnknown, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); - ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#x\n", hr); + ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#lx\n", hr);
params.cArgs = 2; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); todo_wine - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
params.cArgs = 0; hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); - ok(hr == DISP_E_PARAMNOTFOUND, "error %#x\n", hr); + ok(hr == DISP_E_PARAMNOTFOUND, "error %#lx\n", hr);
SysFreeString(utf8);
@@ -4875,7 +4871,7 @@ static void test_IWinHttpRequest_Invoke(void) VariantInit(&ret); hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, NULL); - ok(hr == S_OK, "error %#x\n", hr); + ok(hr == S_OK, "error %#lx\n", hr);
IWinHttpRequest_Release(request);
@@ -4892,20 +4888,20 @@ static void test_WinHttpDetectAutoProxyConfigUrl(void) ret = WinHttpDetectAutoProxyConfigUrl( 0, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
url = NULL; SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( 0, &url ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( WINHTTP_AUTO_DETECT_TYPE_DNS_A, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
url = (WCHAR *)0xdeadbeef; SetLastError(0xdeadbeef); @@ -4913,7 +4909,7 @@ static void test_WinHttpDetectAutoProxyConfigUrl(void) error = GetLastError(); if (!ret) { - ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); + ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %lu\n", error ); ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else @@ -4928,12 +4924,12 @@ static void test_WinHttpDetectAutoProxyConfigUrl(void) error = GetLastError(); if (!ret) { - ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %u\n", error ); + ok( error == ERROR_WINHTTP_AUTODETECTION_FAILED, "got %lu\n", error ); ok( !url || broken(url == (WCHAR *)0xdeadbeef), "got %p\n", url ); } else { - ok( error == ERROR_SUCCESS, "got %u\n", error ); + ok( error == ERROR_SUCCESS, "got %lu\n", error ); trace("%s\n", wine_dbgstr_w(url)); GlobalFree( url ); } @@ -4951,13 +4947,13 @@ static void test_WinHttpGetIEProxyConfigForCurrentUser(void) ret = WinHttpGetIEProxyConfigForCurrentUser( NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError(0xdeadbeef); ret = WinHttpGetIEProxyConfigForCurrentUser( &cfg ); error = GetLastError(); ok( ret, "expected success\n" ); - ok( error == ERROR_SUCCESS || broken(error == ERROR_NO_TOKEN) /* < win7 */, "got %u\n", error ); + ok( error == ERROR_SUCCESS || broken(error == ERROR_NO_TOKEN) /* < win7 */, "got %lu\n", error );
trace("IEProxy.AutoDetect=%d\n", cfg.fAutoDetect); trace("IEProxy.AutoConfigUrl=%s\n", wine_dbgstr_w(cfg.lpszAutoConfigUrl)); @@ -4982,34 +4978,34 @@ static void test_WinHttpGetProxyForUrl(void) ret = WinHttpGetProxyForUrl( NULL, NULL, NULL, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_HANDLE, "got %u\n", error ); + ok( error == ERROR_INVALID_HANDLE, "got %lu\n", error );
session = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok( session != NULL, "failed to open session %u\n", GetLastError() ); + ok( session != NULL, "failed to open session %lu\n", GetLastError() );
SetLastError(0xdeadbeef); ret = WinHttpGetProxyForUrl( session, NULL, NULL, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError(0xdeadbeef); ret = WinHttpGetProxyForUrl( session, L"", NULL, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError(0xdeadbeef); ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", NULL, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
SetLastError(0xdeadbeef); ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", &options, &info ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DNS_A; @@ -5018,7 +5014,7 @@ static void test_WinHttpGetProxyForUrl(void) ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", &options, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; options.dwAutoDetectFlags = 0; @@ -5027,7 +5023,7 @@ static void test_WinHttpGetProxyForUrl(void) ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", &options, &info ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT | WINHTTP_AUTOPROXY_CONFIG_URL; options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DNS_A; @@ -5036,7 +5032,7 @@ static void test_WinHttpGetProxyForUrl(void) ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", &options, &info ); error = GetLastError(); ok( !ret, "expected failure\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + ok( error == ERROR_INVALID_PARAMETER, "got %lu\n", error );
options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DNS_A; @@ -5047,8 +5043,8 @@ static void test_WinHttpGetProxyForUrl(void) error = GetLastError(); if (ret) { - ok( error == ERROR_SUCCESS, "got %u\n", error ); - trace("Proxy.AccessType=%u\n", info.dwAccessType); + ok( error == ERROR_SUCCESS, "got %lu\n", error ); + trace("Proxy.AccessType=%lu\n", info.dwAccessType); trace("Proxy.Proxy=%s\n", wine_dbgstr_w(info.lpszProxy)); trace("Proxy.ProxyBypass=%s\n", wine_dbgstr_w(info.lpszProxyBypass)); GlobalFree( info.lpszProxy ); @@ -5066,7 +5062,7 @@ static void test_WinHttpGetProxyForUrl(void) ret = WinHttpGetProxyForUrl( session, L"http://winehq.org", &options, &info ); if (ret) { - trace("Proxy.AccessType=%u\n", info.dwAccessType); + trace("Proxy.AccessType=%lu\n", info.dwAccessType); trace("Proxy.Proxy=%s\n", wine_dbgstr_w(info.lpszProxy)); trace("Proxy.ProxyBypass=%s\n", wine_dbgstr_w(info.lpszProxyBypass)); GlobalFree( info.lpszProxy ); @@ -5092,15 +5088,15 @@ static void test_chunked_read(void) trace( "starting chunked read test\n" );
ses = WinHttpOpen( L"winetest", 0, NULL, NULL, 0 ); - ok( ses != NULL, "WinHttpOpen failed with error %u\n", GetLastError() ); + ok( ses != NULL, "WinHttpOpen failed with error %lu\n", GetLastError() ); if (!ses) goto done;
con = WinHttpConnect( ses, L"test.winehq.org", 0, 0 ); - ok( con != NULL, "WinHttpConnect failed with error %u\n", GetLastError() ); + ok( con != NULL, "WinHttpConnect failed with error %lu\n", GetLastError() ); if (!con) goto done;
req = WinHttpOpenRequest( con, NULL, L"/tests/chunked", NULL, NULL, NULL, 0 ); - ok( req != NULL, "WinHttpOpenRequest failed with error %u\n", GetLastError() ); + ok( req != NULL, "WinHttpOpenRequest failed with error %lu\n", GetLastError() ); if (!req) goto done;
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); @@ -5110,17 +5106,17 @@ static void test_chunked_read(void) skip("connection failed, skipping\n"); goto done; } - ok( ret, "WinHttpSendRequest failed with error %u\n", GetLastError() ); + ok( ret, "WinHttpSendRequest failed with error %lu\n", GetLastError() ); if (!ret) goto done;
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "WinHttpReceiveResponse failed with error %u\n", GetLastError() ); + ok( ret, "WinHttpReceiveResponse failed with error %lu\n", GetLastError() ); if (!ret) goto done;
header[0] = 0; len = sizeof(header); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_TRANSFER_ENCODING, NULL, header, &len, 0 ); - ok( ret, "failed to get TRANSFER_ENCODING header (error %u)\n", GetLastError() ); + ok( ret, "failed to get TRANSFER_ENCODING header (error %lu\n", GetLastError() ); ok( !lstrcmpW( header, L"chunked" ), "wrong transfer encoding %s\n", wine_dbgstr_w(header) ); trace( "transfer encoding: %s\n", wine_dbgstr_w(header) );
@@ -5129,27 +5125,27 @@ static void test_chunked_read(void) SetLastError( 0xdeadbeef ); ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_CONTENT_LENGTH, NULL, &header, &len, 0 ); ok( !ret, "unexpected CONTENT_LENGTH header %s\n", wine_dbgstr_w(header) ); - ok( GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_WINHTTP_HEADER_NOT_FOUND, "wrong error %lu\n", GetLastError() );
trace( "entering query loop\n" ); for (;;) { len = 0xdeadbeef; ret = WinHttpQueryDataAvailable( req, &len ); - ok( ret, "WinHttpQueryDataAvailable failed with error %u\n", GetLastError() ); + ok( ret, "WinHttpQueryDataAvailable failed with error %lu\n", GetLastError() ); if (ret) ok( len != 0xdeadbeef, "WinHttpQueryDataAvailable return wrong length\n" ); - trace( "got %u available\n", len ); + trace( "got %lu available\n", len ); if (len) { DWORD bytes_read; char *buf = HeapAlloc( GetProcessHeap(), 0, len + 1 );
ret = WinHttpReadData( req, buf, len, &bytes_read ); - ok(ret, "WinHttpReadData failed: %u.\n", GetLastError()); + ok(ret, "WinHttpReadData failed: %lu\n", GetLastError());
buf[bytes_read] = 0; - trace( "WinHttpReadData -> %d %u\n", ret, bytes_read ); - ok( len == bytes_read, "only got %u of %u available\n", bytes_read, len ); + trace( "WinHttpReadData -> %d %lu\n", ret, bytes_read ); + ok( len == bytes_read, "only got %lu of %lu available\n", bytes_read, len ); ok( buf[bytes_read - 1] == '\n', "received partial line '%s'\n", buf );
HeapFree( GetProcessHeap(), 0, buf ); @@ -5176,7 +5172,7 @@ static void test_max_http_automatic_redirects (void) ok(session != NULL, "WinHttpOpen failed to open session.\n");
connection = WinHttpConnect (session, L"test.winehq.org", INTERNET_DEFAULT_HTTP_PORT, 0); - ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %u.\n", GetLastError()); + ok(connection != NULL, "WinHttpConnect failed to open a connection, error: %lu\n", GetLastError());
/* Test with 2 redirects (page will try to redirect 3 times) */ request = WinHttpOpenRequest(connection, L"GET", L"tests/redirecttest.php?max=3", NULL, WINHTTP_NO_REFERER, @@ -5186,12 +5182,12 @@ static void test_max_http_automatic_redirects (void) skip("Network unreachable, skipping.\n"); goto done; } - ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %u.\n", GetLastError()); + ok(request != NULL, "WinHttpOpenRequest failed to open a request, error: %lu\n", GetLastError()); if (!request) goto done;
max_redirects = 2; ret = WinHttpSetOption(request, WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS, &max_redirects, sizeof(max_redirects)); - ok(ret, "WinHttpSetOption failed: %u\n", GetLastError()); + ok(ret, "WinHttpSetOption failed: %lu\n", GetLastError());
ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0); err = GetLastError(); @@ -5200,12 +5196,12 @@ static void test_max_http_automatic_redirects (void) skip("connection failed, skipping\n"); goto done; } - ok(ret == TRUE, "WinHttpSendRequest failed: %u\n", GetLastError()); + ok(ret == TRUE, "WinHttpSendRequest failed: %lu\n", GetLastError());
SetLastError(0xdeadbeef); ret = WinHttpReceiveResponse(request, NULL); ok(!ret, "WinHttpReceiveResponse succeeded, expected failure\n"); - ok(GetLastError() == ERROR_WINHTTP_REDIRECT_FAILED, "Expected ERROR_WINHTTP_REDIRECT_FAILED, got %u.\n", GetLastError()); + ok(GetLastError() == ERROR_WINHTTP_REDIRECT_FAILED, "Expected ERROR_WINHTTP_REDIRECT_FAILED, got %lu\n", GetLastError());
done: ret = WinHttpCloseHandle(request); @@ -5468,7 +5464,7 @@ static void test_client_cert_authentication(void) const CERT_CONTEXT *cert;
ses = WinHttpOpen( L"winetest", WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); - ok( ses != NULL, "failed to open session %u\n", GetLastError() ); + ok( ses != NULL, "failed to open session %lu\n", GetLastError() );
protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1; ret = WinHttpSetOption( ses, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols) ); @@ -5478,38 +5474,38 @@ static void test_client_cert_authentication(void) WinHttpCloseHandle( ses ); return; } - ok( ret, "failed to set protocols %u\n", GetLastError() ); + ok( ret, "failed to set protocols %lu\n", GetLastError() );
con = WinHttpConnect( ses, L"test.winehq.org", 443, 0 ); - ok( con != NULL, "failed to open a connection %u\n", GetLastError() ); + ok( con != NULL, "failed to open a connection %lu\n", GetLastError() );
req = WinHttpOpenRequest( con, NULL, L"/tests/clientcert/", NULL, NULL, NULL, WINHTTP_FLAG_SECURE ); - ok( req != NULL, "failed to open a request %u\n", GetLastError() ); + ok( req != NULL, "failed to open a request %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
SetLastError( 0xdeadbeef ); ret = WinHttpReceiveResponse( req, NULL ); ok( !ret, "unexpected success\n" ); - ok( GetLastError() == ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED, "got %u\n", GetLastError() ); + ok( GetLastError() == ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED, "got %lu\n", GetLastError() );
pfx.pbData = (BYTE *)pfxdata; pfx.cbData = sizeof(pfxdata); store = PFXImportCertStore( &pfx, NULL, CRYPT_EXPORTABLE|CRYPT_USER_KEYSET|PKCS12_NO_PERSIST_KEY ); - ok( store != NULL, "got %u\n", GetLastError() ); + ok( store != NULL, "got %lu\n", GetLastError() );
cert = CertFindCertificateInStore( store, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, NULL ); - ok( cert != NULL, "got %u\n", GetLastError() ); + ok( cert != NULL, "got %lu\n", GetLastError() );
ret = WinHttpSetOption( req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, (void *)cert, sizeof(*cert) ); - ok( ret, "failed to set client cert %u\n", GetLastError() ); + ok( ret, "failed to set client cert %lu\n", GetLastError() );
ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - ok( ret, "failed to send request %u\n", GetLastError() ); + ok( ret, "failed to send request %lu\n", GetLastError() );
ret = WinHttpReceiveResponse( req, NULL ); - ok( ret, "failed to receive response %u\n", GetLastError() ); + ok( ret, "failed to receive response %lu\n", GetLastError() );
CertFreeCertificateContext( cert ); CertCloseStore( store, 0 ); @@ -5557,10 +5553,10 @@ START_TEST (winhttp) si.port = 7532;
thread = CreateThread(NULL, 0, server_thread, &si, 0, NULL); - ok(thread != NULL, "failed to create thread %u\n", GetLastError()); + ok(thread != NULL, "failed to create thread %lu\n", GetLastError());
ret = WaitForSingleObject(si.event, 10000); - ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %u\n", GetLastError()); + ok(ret == WAIT_OBJECT_0, "failed to start winhttp test server %lu\n", GetLastError()); if (ret != WAIT_OBJECT_0) { CloseHandle(thread);