Commit 3c695e3c authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp/tests: Build without -DWINE_NO_LONG_TYPES.

parent ce76fc6f
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = winhttp.dll
IMPORTS = winhttp oleaut32 ole32 crypt32 advapi32 ws2_32
......
......@@ -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);
......
......@@ -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)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment