Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2022
- 87 participants
- 926 discussions
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/winhttp/Makefile.in | 1 -
dlls/winhttp/handle.c | 10 ++--
dlls/winhttp/net.c | 39 +++++++-------
dlls/winhttp/request.c | 106 +++++++++++++++++++--------------------
dlls/winhttp/session.c | 76 ++++++++++++++--------------
dlls/winhttp/url.c | 8 +--
6 files changed, 119 insertions(+), 121 deletions(-)
diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in
index 44ccf738d99..97266fbc92a 100644
--- a/dlls/winhttp/Makefile.in
+++ b/dlls/winhttp/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winhttp.dll
IMPORTLIB = winhttp
IMPORTS = uuid jsproxy user32 advapi32 ws2_32
diff --git a/dlls/winhttp/handle.c b/dlls/winhttp/handle.c
index 4fc94f10d01..38959fd6456 100644
--- a/dlls/winhttp/handle.c
+++ b/dlls/winhttp/handle.c
@@ -48,7 +48,7 @@ static ULONG_PTR max_handles;
struct object_header *addref_object( struct object_header *hdr )
{
ULONG refs = InterlockedIncrement( &hdr->refs );
- TRACE("%p -> refcount = %d\n", hdr, refs);
+ TRACE( "%p -> refcount = %lu\n", hdr, refs );
return hdr;
}
@@ -64,21 +64,21 @@ struct object_header *grab_object( HINTERNET hinternet )
LeaveCriticalSection( &handle_cs );
- TRACE("handle 0x%lx -> %p\n", handle, hdr);
+ TRACE( "handle %Ix -> %p\n", handle, hdr );
return hdr;
}
void release_object( struct object_header *hdr )
{
ULONG refs = InterlockedDecrement( &hdr->refs );
- TRACE("object %p refcount = %d\n", hdr, refs);
+ TRACE( "object %p refcount = %lu\n", hdr, refs );
if (!refs)
{
if (hdr->type == WINHTTP_HANDLE_TYPE_REQUEST) close_connection( (struct request *)hdr );
send_callback( hdr, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, &hdr->handle, sizeof(HINTERNET) );
- TRACE("destroying object %p\n", hdr);
+ TRACE( "destroying object %p\n", hdr );
hdr->vtbl->destroy( hdr );
}
}
@@ -134,7 +134,7 @@ BOOL free_handle( HINTERNET hinternet )
if (handles[handle])
{
hdr = handles[handle];
- TRACE("destroying handle 0x%lx for object %p\n", handle + 1, hdr);
+ TRACE( "destroying handle %Ix for object %p\n", handle + 1, hdr );
handles[handle] = NULL;
ret = TRUE;
}
diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index 446dbc996e7..19fafb25804 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -36,7 +36,7 @@ static int sock_send(int fd, const void *msg, size_t len, WSAOVERLAPPED *ovr)
{
WSABUF wsabuf;
DWORD size;
- DWORD err;
+ int err;
wsabuf.len = len;
wsabuf.buf = (void *)msg;
@@ -47,7 +47,7 @@ static int sock_send(int fd, const void *msg, size_t len, WSAOVERLAPPED *ovr)
return size;
}
err = WSAGetLastError();
- if (!(ovr && err == WSA_IO_PENDING)) WARN( "send error %u\n", err );
+ if (!(ovr && err == WSA_IO_PENDING)) WARN( "send error %d\n", err );
return -1;
}
@@ -56,7 +56,7 @@ static int sock_recv(int fd, void *msg, size_t len, int flags)
int ret;
do
{
- if ((ret = recv(fd, msg, len, flags)) == -1) WARN("recv error %u\n", WSAGetLastError());
+ if ((ret = recv(fd, msg, len, flags)) == -1) WARN( "recv error %d\n", WSAGetLastError() );
}
while(ret == -1 && WSAGetLastError() == WSAEINTR);
return ret;
@@ -154,7 +154,7 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, WCHAR *server, DWORD secu
}
else
err = ERROR_WINHTTP_SECURE_CHANNEL_ERROR;
- TRACE("returning %08x\n", err);
+ TRACE( "returning %#lx\n", err );
return err;
}
@@ -201,7 +201,7 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock
if ((conn->socket = WSASocketW( sockaddr->ss_family, SOCK_STREAM, 0, NULL, 0, WSA_FLAG_OVERLAPPED )) == -1)
{
ret = WSAGetLastError();
- WARN("unable to create socket (%u)\n", ret);
+ WARN( "unable to create socket (%lu)\n", ret );
free( conn );
return ret;
}
@@ -243,7 +243,7 @@ DWORD netconn_create( struct hostdata *host, const struct sockaddr_storage *sock
if (ret)
{
- WARN("unable to connect to host (%u)\n", ret);
+ WARN( "unable to connect to host (%lu)\n", ret );
closesocket( conn->socket );
free( conn );
return ret;
@@ -296,7 +296,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur
if(out_buf.cbBuffer) {
assert(status == SEC_I_CONTINUE_NEEDED);
- TRACE("sending %u bytes\n", out_buf.cbBuffer);
+ TRACE( "sending %lu bytes\n", out_buf.cbBuffer );
size = sock_send(conn->socket, out_buf.pvBuffer, out_buf.cbBuffer, NULL);
if(size != out_buf.cbBuffer) {
@@ -343,13 +343,13 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur
break;
}
- TRACE("recv %lu bytes\n", size);
+ TRACE( "recv %Iu bytes\n", size );
in_bufs[0].cbBuffer += size;
in_bufs[0].pvBuffer = read_buf;
status = InitializeSecurityContextW(cred_handle, &ctx, hostname, isc_req_flags, 0, 0, &in_desc,
0, NULL, &out_desc, &attrs, NULL);
- TRACE("InitializeSecurityContext ret %08x\n", status);
+ TRACE( "InitializeSecurityContext ret %#lx\n", status );
if(status == SEC_E_OK) {
if(in_bufs[1].BufferType == SECBUFFER_EXTRA)
@@ -366,7 +366,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur
res = netconn_verify_cert(cert, hostname, security_flags, check_revocation);
CertFreeCertificateContext(cert);
if(res != ERROR_SUCCESS) {
- WARN("cert verify failed: %u\n", res);
+ WARN( "cert verify failed: %lu\n", res );
break;
}
}else {
@@ -390,7 +390,7 @@ DWORD netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD secur
free(read_buf);
if(status != SEC_E_OK || res != ERROR_SUCCESS) {
- WARN("Failed to initialize security context: %08x\n", status);
+ WARN( "Failed to initialize security context: %#lx\n", status );
free(conn->ssl_read_buf);
conn->ssl_read_buf = NULL;
free(conn->ssl_write_buf);
@@ -420,12 +420,11 @@ static DWORD send_ssl_chunk( struct netconn *conn, const void *msg, size_t size,
memcpy( bufs[1].pvBuffer, msg, size );
if ((res = EncryptMessage(&conn->ssl_ctx, 0, &buf_desc, 0)) != SEC_E_OK)
{
- WARN("EncryptMessage failed: %08x\n", res);
+ WARN( "EncryptMessage failed: %#lx\n", res );
return res;
}
- if (sock_send( conn->socket, conn->ssl_write_buf,
- bufs[0].cbBuffer + bufs[1].cbBuffer + bufs[2].cbBuffer, ovr ) < 1)
+ if (sock_send( conn->socket, conn->ssl_write_buf, bufs[0].cbBuffer + bufs[1].cbBuffer + bufs[2].cbBuffer, ovr ) < 1)
{
WARN("send failed\n");
return WSAGetLastError();
@@ -531,7 +530,7 @@ static DWORD read_ssl_chunk( struct netconn *conn, void *buf, SIZE_T buf_size, S
continue;
default:
- WARN("failed: %08x\n", res);
+ WARN( "failed: %#lx\n", res );
return res;
}
} while (res != SEC_E_OK);
@@ -601,7 +600,7 @@ DWORD netconn_recv( struct netconn *conn, void *buf, size_t len, int flags, int
SIZE_T cread = 0;
if ((res = read_ssl_chunk( conn, (BYTE *)buf + size, len - size, &cread, &eof )))
{
- WARN("read_ssl_chunk failed: %u\n", res);
+ WARN( "read_ssl_chunk failed: %lu\n", res );
if (!size) return res;
break;
}
@@ -614,7 +613,7 @@ DWORD netconn_recv( struct netconn *conn, void *buf, size_t len, int flags, int
} while (!size || ((flags & MSG_WAITALL) && size < len));
- TRACE("received %ld bytes\n", size);
+ TRACE( "received %Iu bytes\n", size );
*recvd = size;
return ERROR_SUCCESS;
}
@@ -634,7 +633,7 @@ DWORD netconn_set_timeout( struct netconn *netconn, BOOL send, int value )
if (setsockopt( netconn->socket, SOL_SOCKET, opt, (void *)&value, sizeof(value) ) == -1)
{
DWORD err = WSAGetLastError();
- WARN("setsockopt failed (%u)\n", err );
+ WARN( "setsockopt failed (%lu)\n", err );
return err;
}
return ERROR_SUCCESS;
@@ -654,7 +653,7 @@ BOOL netconn_is_alive( struct netconn *netconn )
while (!netconn->peek_msg && !(err = read_ssl_chunk( netconn, NULL, 0, &size, &eof )) && !eof)
;
- TRACE("Checking secure connection, err %d.\n", err);
+ TRACE( "checking secure connection, err %lu\n", err );
if (netconn->peek_msg || err == WSAEWOULDBLOCK)
{
@@ -772,6 +771,6 @@ int netconn_get_cipher_strength( struct netconn *conn )
if (!conn->secure) return 0;
res = QueryContextAttributesW(&conn->ssl_ctx, SECPKG_ATTR_CONNECTION_INFO, (void*)&conn_info);
if(res != SEC_E_OK)
- WARN("QueryContextAttributesW failed: %08x\n", res);
+ WARN( "QueryContextAttributesW failed: %#lx\n", res );
return res == SEC_E_OK ? conn_info.dwCipherStrength : 0;
}
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index c32a33cbaf2..d0732952e11 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -299,7 +299,7 @@ DWORD process_header( struct request *request, const WCHAR *field, const WCHAR *
int index;
struct header hdr;
- TRACE("%s: %s 0x%08x\n", debugstr_w(field), debugstr_w(value), flags);
+ TRACE( "%s: %s %#lx\n", debugstr_w(field), debugstr_w(value), flags );
if ((index = get_header_index( request, field, 0, request_only )) >= 0)
{
@@ -405,12 +405,12 @@ DWORD add_request_headers( struct request *request, const WCHAR *headers, DWORD
/***********************************************************************
* WinHttpAddRequestHeaders (winhttp.@)
*/
-BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, LPCWSTR headers, DWORD len, DWORD flags )
+BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, const WCHAR *headers, DWORD len, DWORD flags )
{
DWORD ret;
struct request *request;
- TRACE("%p, %s, %u, 0x%08x\n", hrequest, debugstr_wn(headers, len), len, flags);
+ TRACE( "%p, %s, %lu, %#lx\n", hrequest, debugstr_wn(headers, len), len, flags );
if (!headers || !len)
{
@@ -637,7 +637,7 @@ static DWORD query_headers( struct request *request, DWORD level, const WCHAR *n
if (attr >= ARRAY_SIZE(attribute_table)) return ERROR_INVALID_PARAMETER;
if (!attribute_table[attr])
{
- FIXME("attribute %u not implemented\n", attr);
+ FIXME( "attribute %lu not implemented\n", attr );
return ERROR_WINHTTP_HEADER_NOT_FOUND;
}
TRACE("attribute %s\n", debugstr_w(attribute_table[attr]));
@@ -698,12 +698,13 @@ static DWORD query_headers( struct request *request, DWORD level, const WCHAR *n
/***********************************************************************
* WinHttpQueryHeaders (winhttp.@)
*/
-BOOL WINAPI WinHttpQueryHeaders( HINTERNET hrequest, DWORD level, LPCWSTR name, LPVOID buffer, LPDWORD buflen, LPDWORD index )
+BOOL WINAPI WinHttpQueryHeaders( HINTERNET hrequest, DWORD level, const WCHAR *name, void *buffer, DWORD *buflen,
+ DWORD *index )
{
DWORD ret;
struct request *request;
- TRACE("%p, 0x%08x, %s, %p, %p, %p\n", hrequest, level, debugstr_w(name), buffer, buflen, index);
+ TRACE( "%p, %#lx, %s, %p, %p, %p\n", hrequest, level, debugstr_w(name), buffer, buflen, index );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -1047,7 +1048,7 @@ static BOOL do_authorization( struct request *request, DWORD target, DWORD schem
break;
default:
- WARN("unknown target %x\n", target);
+ WARN( "unknown target %#lx\n", target );
return FALSE;
}
authinfo = *auth_ptr;
@@ -1126,8 +1127,8 @@ static BOOL do_authorization( struct request *request, DWORD target, DWORD schem
}
if (status != SEC_E_OK)
{
- WARN("AcquireCredentialsHandleW for scheme %s failed with error 0x%08x\n",
- debugstr_w(auth_schemes[scheme].str), status);
+ WARN( "AcquireCredentialsHandleW for scheme %s failed with error %#lx\n",
+ debugstr_w(auth_schemes[scheme].str), status );
free( authinfo );
return FALSE;
}
@@ -1199,7 +1200,7 @@ static BOOL do_authorization( struct request *request, DWORD target, DWORD schem
}
else
{
- ERR("InitializeSecurityContextW failed with error 0x%08x\n", status);
+ ERR( "InitializeSecurityContextW failed with error %#lx\n", status );
free( out.pvBuffer );
destroy_authinfo( authinfo );
*auth_ptr = NULL;
@@ -1437,7 +1438,7 @@ static DWORD ensure_cred_handle( struct request *request )
if (status != SEC_E_OK)
{
- WARN( "AcquireCredentialsHandleW failed: 0x%08x\n", status );
+ WARN( "AcquireCredentialsHandleW failed: %#lx\n", status );
return status;
}
return ERROR_SUCCESS;
@@ -1735,7 +1736,7 @@ static DWORD start_next_chunk( struct request *request, BOOL notify )
else if (ch >= 'A' && ch <= 'F') chunk_size = chunk_size * 16 + ch - 'A' + 10;
else if (ch == ';' || ch == '\r' || ch == '\n')
{
- TRACE("reading %u byte chunk\n", chunk_size);
+ TRACE( "reading %lu byte chunk\n", chunk_size );
if (request->content_length == ~0u) request->content_length = chunk_size;
else request->content_length += chunk_size;
@@ -1847,7 +1848,7 @@ static DWORD read_data( struct request *request, void *buffer, DWORD size, DWORD
if (request->read_chunked && !request->read_chunked_size) ret = refill_buffer( request, async );
done:
- TRACE( "retrieved %u bytes (%u/%u)\n", bytes_read, request->content_read, request->content_length );
+ TRACE( "retrieved %u bytes (%lu/%lu)\n", bytes_read, request->content_read, request->content_length );
if (end_of_read_data( request )) finished_reading( request );
if (async)
{
@@ -2117,12 +2118,12 @@ static DWORD send_request( struct request *request, const WCHAR *headers, DWORD
if (headers && (ret = add_request_headers( request, headers, headers_len,
WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE )))
{
- TRACE("failed to add request headers: %u\n", ret);
+ TRACE( "failed to add request headers: %lu\n", ret );
return ret;
}
if (!(request->hdr.disable_flags & WINHTTP_DISABLE_COOKIES) && (ret = add_cookie_headers( request )))
{
- WARN("failed to add cookie headers: %u\n", ret);
+ WARN( "failed to add cookie headers: %lu\n", ret );
return ret;
}
@@ -2181,14 +2182,14 @@ static void CALLBACK task_send_request( TP_CALLBACK_INSTANCE *instance, void *ct
/***********************************************************************
* WinHttpSendRequest (winhttp.@)
*/
-BOOL WINAPI WinHttpSendRequest( HINTERNET hrequest, LPCWSTR headers, DWORD headers_len,
- LPVOID optional, DWORD optional_len, DWORD total_len, DWORD_PTR context )
+BOOL WINAPI WinHttpSendRequest( HINTERNET hrequest, const WCHAR *headers, DWORD headers_len,
+ void *optional, DWORD optional_len, DWORD total_len, DWORD_PTR context )
{
DWORD ret;
struct request *request;
- TRACE("%p, %s, %u, %p, %u, %u, %lx\n", hrequest, debugstr_wn(headers, headers_len), headers_len, optional,
- optional_len, total_len, context);
+ TRACE( "%p, %s, %lu, %p, %lu, %lu, %Ix\n", hrequest, debugstr_wn(headers, headers_len), headers_len, optional,
+ optional_len, total_len, context );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -2266,7 +2267,7 @@ static DWORD set_credentials( struct request *request, DWORD target, DWORD schem
break;
}
default:
- WARN("unknown target %u\n", target);
+ WARN( "unknown target %lu\n", target );
return ERROR_INVALID_PARAMETER;
}
return ERROR_SUCCESS;
@@ -2275,13 +2276,13 @@ static DWORD set_credentials( struct request *request, DWORD target, DWORD schem
/***********************************************************************
* WinHttpSetCredentials (winhttp.@)
*/
-BOOL WINAPI WinHttpSetCredentials( HINTERNET hrequest, DWORD target, DWORD scheme, LPCWSTR username,
- LPCWSTR password, LPVOID params )
+BOOL WINAPI WinHttpSetCredentials( HINTERNET hrequest, DWORD target, DWORD scheme, const WCHAR *username,
+ const WCHAR *password, void *params )
{
DWORD ret;
struct request *request;
- TRACE("%p, %x, 0x%08x, %s, %p, %p\n", hrequest, target, scheme, debugstr_w(username), password, params);
+ TRACE( "%p, %lu, %#lx, %s, %p, %p\n", hrequest, target, scheme, debugstr_w(username), password, params );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -2319,7 +2320,7 @@ static DWORD handle_authorization( struct request *request, DWORD status )
break;
default:
- ERR("unhandled status %u\n", status);
+ ERR( "unhandled status %lu\n", status );
return ERROR_WINHTTP_INTERNAL_ERROR;
}
@@ -2834,7 +2835,7 @@ static DWORD query_data_available( struct request *request, DWORD *available, BO
}
done:
- TRACE("%u bytes available\n", count);
+ TRACE( "%lu bytes available\n", count );
if (async)
{
if (!ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, &count, sizeof(count) );
@@ -2922,13 +2923,13 @@ static void CALLBACK task_read_data( TP_CALLBACK_INSTANCE *instance, void *ctx,
/***********************************************************************
* WinHttpReadData (winhttp.@)
*/
-BOOL WINAPI WinHttpReadData( HINTERNET hrequest, LPVOID buffer, DWORD to_read, LPDWORD read )
+BOOL WINAPI WinHttpReadData( HINTERNET hrequest, void *buffer, DWORD to_read, DWORD *read )
{
DWORD ret;
struct request *request;
BOOL async;
- TRACE("%p, %p, %d, %p\n", hrequest, buffer, to_read, read);
+ TRACE( "%p, %p, %lu, %p\n", hrequest, buffer, to_read, read );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -3003,12 +3004,12 @@ static void CALLBACK task_write_data( TP_CALLBACK_INSTANCE *instance, void *ctx,
/***********************************************************************
* WinHttpWriteData (winhttp.@)
*/
-BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write, LPDWORD written )
+BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, const void *buffer, DWORD to_write, DWORD *written )
{
DWORD ret;
struct request *request;
- TRACE("%p, %p, %d, %p\n", hrequest, buffer, to_write, written);
+ TRACE( "%p, %p, %lu, %p\n", hrequest, buffer, to_write, written );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -3048,7 +3049,7 @@ BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write
static BOOL socket_query_option( struct object_header *hdr, DWORD option, void *buffer, DWORD *buflen )
{
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
return FALSE;
}
@@ -3069,7 +3070,7 @@ static void socket_destroy( struct object_header *hdr )
static BOOL socket_set_option( struct object_header *hdr, DWORD option, void *buffer, DWORD buflen )
{
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
return FALSE;
}
@@ -3087,7 +3088,7 @@ HINTERNET WINAPI WinHttpWebSocketCompleteUpgrade( HINTERNET hrequest, DWORD_PTR
struct request *request;
HINTERNET hsocket = NULL;
- TRACE("%p, %08lx\n", hrequest, context);
+ TRACE( "%p, %Ix\n", hrequest, context );
if (!(request = (struct request *)grab_object( hrequest )))
{
@@ -3146,13 +3147,12 @@ static DWORD send_bytes( struct socket *socket, char *bytes, int len, int *sent,
static DWORD send_frame( struct socket *socket, enum socket_opcode opcode, USHORT status, const char *buf,
DWORD buflen, BOOL final, WSAOVERLAPPED *ovr )
{
- DWORD i, offset = 2, len = buflen;
- DWORD buffer_size, ret = 0;
+ DWORD i, offset = 2, len = buflen, buffer_size, ret = 0;
int sent_size;
char hdr[14];
char *ptr;
- TRACE( "sending %02x frame, len %u.\n", opcode, len );
+ TRACE( "sending %02x frame, len %lu\n", opcode, len );
if (opcode == SOCKET_OPCODE_CLOSE) len += sizeof(status);
@@ -3188,7 +3188,7 @@ static DWORD send_frame( struct socket *socket, enum socket_opcode opcode, USHOR
new_size = min( buffer_size, MAX_FRAME_BUFFER_SIZE );
if (!(new = realloc( socket->send_frame_buffer, new_size )))
{
- ERR("Out of memory, buffer_size %u.\n", buffer_size);
+ ERR( "out of memory, buffer_size %lu\n", buffer_size);
return ERROR_OUTOFMEMORY;
}
socket->send_frame_buffer = new;
@@ -3360,7 +3360,7 @@ DWORD WINAPI WinHttpWebSocketSend( HINTERNET hsocket, WINHTTP_WEB_SOCKET_BUFFER_
struct socket *socket;
DWORD ret = 0;
- TRACE("%p, %u, %p, %u\n", hsocket, type, buf, len);
+ TRACE( "%p, %u, %p, %lu\n", hsocket, type, buf, len );
if (len && !buf) return ERROR_INVALID_PARAMETER;
if (type != WINHTTP_WEB_SOCKET_UTF8_MESSAGE_BUFFER_TYPE && type != WINHTTP_WEB_SOCKET_BINARY_MESSAGE_BUFFER_TYPE)
@@ -3729,7 +3729,7 @@ DWORD WINAPI WinHttpWebSocketReceive( HINTERNET hsocket, void *buf, DWORD len, D
struct socket *socket;
DWORD ret;
- TRACE("%p, %p, %u, %p, %p\n", hsocket, buf, len, ret_len, ret_type);
+ TRACE( "%p, %p, %lu, %p, %p\n", hsocket, buf, len, ret_len, ret_type );
if (!buf || !len) return ERROR_INVALID_PARAMETER;
@@ -3874,7 +3874,7 @@ DWORD WINAPI WinHttpWebSocketShutdown( HINTERNET hsocket, USHORT status, void *r
struct socket *socket;
DWORD ret;
- TRACE("%p, %u, %p, %u\n", hsocket, status, reason, len);
+ TRACE( "%p, %u, %p, %lu\n", hsocket, status, reason, len );
if ((len && !reason) || len > sizeof(socket->reason)) return ERROR_INVALID_PARAMETER;
@@ -3949,7 +3949,7 @@ DWORD WINAPI WinHttpWebSocketClose( HINTERNET hsocket, USHORT status, void *reas
struct socket *socket;
DWORD ret;
- TRACE("%p, %u, %p, %u\n", hsocket, status, reason, len);
+ TRACE( "%p, %u, %p, %lu\n", hsocket, status, reason, len );
if ((len && !reason) || len > sizeof(socket->reason)) return ERROR_INVALID_PARAMETER;
@@ -4022,7 +4022,7 @@ DWORD WINAPI WinHttpWebSocketQueryCloseStatus( HINTERNET hsocket, USHORT *status
struct socket *socket;
DWORD ret;
- TRACE("%p, %p, %p, %u, %p\n", hsocket, status, reason, len, ret_len);
+ TRACE( "%p, %p, %p, %lu, %p\n", hsocket, status, reason, len, ret_len );
if (!status || (len && !reason) || !ret_len) return ERROR_INVALID_PARAMETER;
@@ -4218,7 +4218,7 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
hr = LoadRegTypeLib( &LIBID_WinHttp, 5, 1, LOCALE_SYSTEM_DEFAULT, &typelib );
if (FAILED(hr))
{
- ERR("LoadRegTypeLib failed: %08x\n", hr);
+ ERR( "LoadRegTypeLib failed: %#lx\n", hr );
return hr;
}
if (InterlockedCompareExchangePointer( (void **)&winhttp_typelib, typelib, NULL ))
@@ -4231,7 +4231,7 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
hr = ITypeLib_GetTypeInfoOfGuid( winhttp_typelib, winhttp_tid_id[tid], &typeinfo );
if (FAILED(hr))
{
- ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(winhttp_tid_id[tid]), hr);
+ ERR( "GetTypeInfoOfGuid(%s) failed: %#lx\n", debugstr_guid(winhttp_tid_id[tid]), hr );
return hr;
}
if (InterlockedCompareExchangePointer( (void **)(winhttp_typeinfo + tid), typeinfo, NULL ))
@@ -4261,7 +4261,7 @@ static HRESULT WINAPI winhttp_request_GetTypeInfo(
ITypeInfo **info )
{
struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
- TRACE("%p, %u, %u, %p\n", request, index, lcid, info);
+ TRACE( "%p, %u, %lu, %p\n", request, index, lcid, info );
return get_typeinfo( IWinHttpRequest_tid, info );
}
@@ -4278,7 +4278,7 @@ static HRESULT WINAPI winhttp_request_GetIDsOfNames(
ITypeInfo *typeinfo;
HRESULT hr;
- TRACE("%p, %s, %p, %u, %u, %p\n", request, debugstr_guid(riid), names, count, lcid, dispid);
+ TRACE( "%p, %s, %p, %u, %lu, %p\n", request, debugstr_guid(riid), names, count, lcid, dispid );
if (!names || !count || !dispid) return E_INVALIDARG;
@@ -4306,8 +4306,8 @@ static HRESULT WINAPI winhttp_request_Invoke(
ITypeInfo *typeinfo;
HRESULT hr;
- TRACE("%p, %d, %s, %d, %d, %p, %p, %p, %p\n", request, member, debugstr_guid(riid),
- lcid, flags, params, result, excep_info, arg_err);
+ TRACE( "%p, %ld, %s, %lu, %d, %p, %p, %p, %p\n", request, member, debugstr_guid(riid),
+ lcid, flags, params, result, excep_info, arg_err );
if (!IsEqualIID( riid, &IID_NULL )) return DISP_E_UNKNOWNINTERFACE;
@@ -4331,7 +4331,7 @@ static HRESULT WINAPI winhttp_request_Invoke(
hr = IWinHttpRequest_put_Option( &request->IWinHttpRequest_iface, V_I4( &option ), params->rgvarg[0] );
if (FAILED(hr))
- WARN("put_Option(%d) failed: %x\n", V_I4( &option ), hr);
+ WARN( "put_Option(%ld) failed: %#lx\n", V_I4( &option ), hr );
return hr;
}
else if (flags & (DISPATCH_PROPERTYGET | DISPATCH_METHOD))
@@ -4341,7 +4341,7 @@ static HRESULT WINAPI winhttp_request_Invoke(
hr = IWinHttpRequest_get_Option( &request->IWinHttpRequest_iface, V_I4( &option ), result );
if (FAILED(hr))
- WARN("get_Option(%d) failed: %x\n", V_I4( &option ), hr);
+ WARN( "get_Option(%ld) failed: %#lx\n", V_I4( &option ), hr );
return hr;
}
@@ -4370,8 +4370,8 @@ static HRESULT WINAPI winhttp_request_SetProxy(
struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
DWORD err = ERROR_SUCCESS;
- TRACE("%p, %u, %s, %s\n", request, proxy_setting, debugstr_variant(&proxy_server),
- debugstr_variant(&bypass_list));
+ TRACE( "%p, %lu, %s, %s\n", request, proxy_setting, debugstr_variant(&proxy_server),
+ debugstr_variant(&bypass_list) );
EnterCriticalSection( &request->cs );
switch (proxy_setting)
@@ -4424,7 +4424,7 @@ static HRESULT WINAPI winhttp_request_SetCredentials(
DWORD target, scheme = WINHTTP_AUTH_SCHEME_BASIC; /* FIXME: query supported schemes */
DWORD err = ERROR_SUCCESS;
- TRACE("%p, %s, %p, 0x%08x\n", request, debugstr_w(username), password, flags);
+ TRACE( "%p, %s, %p, %#lx\n", request, debugstr_w(username), password, flags );
EnterCriticalSection( &request->cs );
if (request->state < REQUEST_STATE_OPEN)
@@ -5508,7 +5508,7 @@ static HRESULT WINAPI winhttp_request_SetTimeouts(
{
struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
- TRACE("%p, %d, %d, %d, %d\n", request, resolve_timeout, connect_timeout, send_timeout, receive_timeout);
+ TRACE( "%p, %ld, %ld, %ld, %ld\n", request, resolve_timeout, connect_timeout, send_timeout, receive_timeout );
EnterCriticalSection( &request->cs );
request->resolve_timeout = resolve_timeout;
diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index 2620bf30ac0..971c51ada4f 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -48,11 +48,11 @@ void send_callback( struct object_header *hdr, DWORD status, void *info, DWORD b
{
if (hdr->callback && (hdr->notify_mask & status))
{
- TRACE("%p, 0x%08x, %p, %u, %u\n", hdr, status, info, buflen, hdr->recursion_count);
+ TRACE( "%p, %#lx, %p, %lu, %lu\n", hdr, status, info, buflen, hdr->recursion_count );
InterlockedIncrement( &hdr->recursion_count );
hdr->callback( hdr->handle, hdr->context, status, info, buflen );
InterlockedDecrement( &hdr->recursion_count );
- TRACE("returning from 0x%08x callback\n", status);
+ TRACE("returning from %#lx callback\n", status);
}
}
@@ -145,7 +145,7 @@ static BOOL session_query_option( struct object_header *hdr, DWORD option, void
return TRUE;
default:
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
@@ -161,7 +161,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
{
WINHTTP_PROXY_INFO *pi = buffer;
- FIXME("%u %s %s\n", pi->dwAccessType, debugstr_w(pi->lpszProxy), debugstr_w(pi->lpszProxyBypass));
+ FIXME( "%lu %s %s\n", pi->dwAccessType, debugstr_w(pi->lpszProxy), debugstr_w(pi->lpszProxyBypass) );
return TRUE;
}
case WINHTTP_OPTION_REDIRECT_POLICY:
@@ -175,7 +175,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
}
policy = *(DWORD *)buffer;
- TRACE("0x%x\n", policy);
+ TRACE( "%#lx\n", policy );
hdr->redirect_policy = policy;
return TRUE;
}
@@ -189,7 +189,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
EnterCriticalSection( &session->cs );
session->secure_protocols = *(DWORD *)buffer;
LeaveCriticalSection( &session->cs );
- TRACE("0x%x\n", session->secure_protocols);
+ TRACE( "%#lx\n", session->secure_protocols );
return TRUE;
}
case WINHTTP_OPTION_DISABLE_FEATURE:
@@ -226,15 +226,15 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
return TRUE;
case WINHTTP_OPTION_MAX_CONNS_PER_SERVER:
- FIXME("WINHTTP_OPTION_MAX_CONNS_PER_SERVER: %d\n", *(DWORD *)buffer);
+ FIXME( "WINHTTP_OPTION_MAX_CONNS_PER_SERVER: %lu\n", *(DWORD *)buffer );
return TRUE;
case WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER:
- FIXME("WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: %d\n", *(DWORD *)buffer);
+ FIXME( "WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: %lu\n", *(DWORD *)buffer );
return TRUE;
default:
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
return FALSE;
}
@@ -255,7 +255,7 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST
struct session *session;
HINTERNET handle = NULL;
- TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags);
+ TRACE( "%s, %lu, %s, %s, %#lx\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags );
if (!(session = calloc( 1, sizeof(*session) ))) return NULL;
@@ -374,7 +374,7 @@ static BOOL connect_query_option( struct object_header *hdr, DWORD option, void
return TRUE;
default:
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
@@ -533,13 +533,13 @@ end:
/***********************************************************************
* WinHttpConnect (winhttp.@)
*/
-HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PORT port, DWORD reserved )
+HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, const WCHAR *server, INTERNET_PORT port, DWORD reserved )
{
struct connect *connect;
struct session *session;
HINTERNET hconnect = NULL;
- TRACE("%p, %s, %u, %x\n", hsession, debugstr_w(server), port, reserved);
+ TRACE( "%p, %s, %u, %#lx\n", hsession, debugstr_w(server), port, reserved );
if (!server)
{
@@ -841,7 +841,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
return TRUE;
default:
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
@@ -870,7 +870,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
{
WINHTTP_PROXY_INFO *pi = buffer;
- FIXME("%u %s %s\n", pi->dwAccessType, debugstr_w(pi->lpszProxy), debugstr_w(pi->lpszProxyBypass));
+ FIXME( "%lu %s %s\n", pi->dwAccessType, debugstr_w(pi->lpszProxy), debugstr_w(pi->lpszProxyBypass) );
return TRUE;
}
case WINHTTP_OPTION_DISABLE_FEATURE:
@@ -884,7 +884,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
disable = *(DWORD *)buffer;
- TRACE("0x%x\n", disable);
+ TRACE( "%#lx\n", disable );
hdr->disable_flags |= disable;
return TRUE;
}
@@ -899,7 +899,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
policy = *(DWORD *)buffer;
- TRACE("0x%x\n", policy);
+ TRACE( "%#lx\n", policy );
hdr->logon_policy = policy;
return TRUE;
}
@@ -914,7 +914,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
}
policy = *(DWORD *)buffer;
- TRACE("0x%x\n", policy);
+ TRACE( "%#lx\n", policy );
hdr->redirect_policy = policy;
return TRUE;
}
@@ -932,7 +932,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
return FALSE;
}
flags = *(DWORD *)buffer;
- TRACE("0x%x\n", flags);
+ TRACE( "%#lx\n", flags );
if (flags && (flags & ~accepted))
{
SetLastError( ERROR_INVALID_PARAMETER );
@@ -1070,14 +1070,14 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
case WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL:
if (buflen == sizeof(DWORD))
{
- FIXME("WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL %08x\n", *(DWORD *)buffer);
+ FIXME( "WINHTTP_OPTION_ENABLE_HTTP_PROTOCOL %#lx\n", *(DWORD *)buffer );
return TRUE;
}
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
default:
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
return FALSE;
}
@@ -1119,15 +1119,15 @@ static WCHAR *get_request_path( const WCHAR *object )
/***********************************************************************
* WinHttpOpenRequest (winhttp.@)
*/
-HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR object, LPCWSTR version,
- LPCWSTR referrer, LPCWSTR *types, DWORD flags )
+HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, const WCHAR *verb, const WCHAR *object, const WCHAR *version,
+ const WCHAR *referrer, const WCHAR **types, DWORD flags )
{
struct request *request;
struct connect *connect;
HINTERNET hrequest = NULL;
- TRACE("%p, %s, %s, %s, %s, %p, 0x%08x\n", hconnect, debugstr_w(verb), debugstr_w(object),
- debugstr_w(version), debugstr_w(referrer), types, flags);
+ TRACE( "%p, %s, %s, %s, %s, %p, %#lx\n", hconnect, debugstr_w(verb), debugstr_w(object),
+ debugstr_w(version), debugstr_w(referrer), types, flags );
if (types && TRACE_ON(winhttp))
{
@@ -1236,7 +1236,7 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
if (hdr->vtbl->query_option) ret = hdr->vtbl->query_option( hdr, option, buffer, buflen );
else
{
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
return FALSE;
}
@@ -1248,12 +1248,12 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
/***********************************************************************
* WinHttpQueryOption (winhttp.@)
*/
-BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, LPVOID buffer, LPDWORD buflen )
+BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, void *buffer, DWORD *buflen )
{
BOOL ret = FALSE;
struct object_header *hdr;
- TRACE("%p, %u, %p, %p\n", handle, option, buffer, buflen);
+ TRACE( "%p, %lu, %p, %p\n", handle, option, buffer, buflen );
if (!(hdr = grab_object( handle )))
{
@@ -1295,7 +1295,7 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D
if (hdr->vtbl->set_option) ret = hdr->vtbl->set_option( hdr, option, buffer, buflen );
else
{
- FIXME("unimplemented option %u\n", option);
+ FIXME( "unimplemented option %lu\n", option );
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
return FALSE;
}
@@ -1307,12 +1307,12 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D
/***********************************************************************
* WinHttpSetOption (winhttp.@)
*/
-BOOL WINAPI WinHttpSetOption( HINTERNET handle, DWORD option, LPVOID buffer, DWORD buflen )
+BOOL WINAPI WinHttpSetOption( HINTERNET handle, DWORD option, void *buffer, DWORD buflen )
{
BOOL ret = FALSE;
struct object_header *hdr;
- TRACE("%p, %u, %p, %u\n", handle, option, buffer, buflen);
+ TRACE( "%p, %lu, %p, %lu\n", handle, option, buffer, buflen );
if (!(hdr = grab_object( handle )))
{
@@ -1366,7 +1366,7 @@ static WCHAR *detect_autoproxyconfig_url_dhcp(void)
for (ptr = adapters; ptr; ptr = ptr->Next)
{
MultiByteToWideChar( CP_ACP, 0, ptr->AdapterName, -1, name, ARRAY_SIZE(name) );
- TRACE( "adapter '%s' type %u dhcpv4 enabled %d\n", wine_dbgstr_w(name), ptr->IfType, ptr->Dhcpv4Enabled );
+ TRACE( "adapter '%s' type %lu dhcpv4 enabled %d\n", wine_dbgstr_w(name), ptr->IfType, ptr->Dhcpv4Enabled );
if (ptr->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
/* FIXME: also skip adapters where DHCP is disabled */
@@ -1503,9 +1503,9 @@ static WCHAR *detect_autoproxyconfig_url_dns(void)
/***********************************************************************
* WinHttpDetectAutoProxyConfigUrl (winhttp.@)
*/
-BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
+BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, WCHAR **url )
{
- TRACE("0x%08x, %p\n", flags, url);
+ TRACE( "%#lx, %p\n", flags, url );
if (!flags || !url)
{
@@ -2104,7 +2104,7 @@ void WINAPI WinHttpFreeProxySettings( WINHTTP_PROXY_SETTINGS *settings )
DWORD WINAPI WinHttpGetProxyForUrlEx( HINTERNET hresolver, const WCHAR *url, WINHTTP_AUTOPROXY_OPTIONS *options,
DWORD_PTR ctx )
{
- FIXME("%p, %s, %p, %lx\n", hresolver, debugstr_w(url), options, ctx);
+ FIXME( "%p, %s, %p, %Ix\n", hresolver, debugstr_w(url), options, ctx );
return ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR;
}
@@ -2114,7 +2114,7 @@ DWORD WINAPI WinHttpGetProxyForUrlEx( HINTERNET hresolver, const WCHAR *url, WIN
DWORD WINAPI WinHttpGetProxyForUrlEx2( HINTERNET hresolver, const WCHAR *url, WINHTTP_AUTOPROXY_OPTIONS *options,
DWORD selection_len, BYTE *selection, DWORD_PTR ctx )
{
- FIXME("%p, %s, %p, %u, %p, %lx\n", hresolver, debugstr_w(url), options, selection_len, selection, ctx);
+ FIXME( "%p, %s, %p, %lu, %p, %Ix\n", hresolver, debugstr_w(url), options, selection_len, selection, ctx );
return ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR;
}
@@ -2162,7 +2162,7 @@ DWORD WINAPI WinHttpReadProxySettings( HINTERNET hsession, const WCHAR *connecti
*/
DWORD WINAPI WinHttpResetAutoProxy( HINTERNET hsession, DWORD flags )
{
- FIXME("%p, %08x\n", hsession, flags);
+ FIXME( "%p, %#lx\n", hsession, flags );
return ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR;
}
@@ -2181,7 +2181,7 @@ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHT
struct object_header *hdr;
WINHTTP_STATUS_CALLBACK ret;
- TRACE("%p, %p, 0x%08x, 0x%lx\n", handle, callback, flags, reserved);
+ TRACE( "%p, %p, %#lx, %Ix\n", handle, callback, flags, reserved );
if (!(hdr = grab_object( handle )))
{
diff --git a/dlls/winhttp/url.c b/dlls/winhttp/url.c
index 8efd5ed0c49..9e7f5478dfe 100644
--- a/dlls/winhttp/url.c
+++ b/dlls/winhttp/url.c
@@ -170,7 +170,7 @@ static DWORD parse_port( const WCHAR *str, DWORD len, INTERNET_PORT *ret )
/***********************************************************************
* WinHttpCrackUrl (winhttp.@)
*/
-BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc )
+BOOL WINAPI WinHttpCrackUrl( const WCHAR *url, DWORD len, DWORD flags, URL_COMPONENTSW *uc )
{
WCHAR *p, *q, *r, *url_transformed = NULL;
INTERNET_SCHEME scheme_number = 0;
@@ -178,7 +178,7 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
BOOL overflow = FALSE;
DWORD err;
- TRACE("%s, %d, %x, %p\n", debugstr_wn(url, len), len, flags, uc);
+ TRACE( "%s, %lu, %#lx, %p\n", debugstr_wn(url, len), len, flags, uc );
if (!url || !uc || uc->dwStructSize != sizeof(*uc))
{
@@ -427,12 +427,12 @@ static BOOL get_url_length( URL_COMPONENTS *uc, DWORD flags, DWORD *len )
/***********************************************************************
* WinHttpCreateUrl (winhttp.@)
*/
-BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDWORD required )
+BOOL WINAPI WinHttpCreateUrl( URL_COMPONENTS *uc, DWORD flags, WCHAR *url, DWORD *required )
{
DWORD len, len_escaped;
INTERNET_SCHEME scheme;
- TRACE("%p, 0x%08x, %p, %p\n", uc, flags, url, required);
+ TRACE( "%p, %#lx, %p, %p\n", uc, flags, url, required );
if (!uc || uc->dwStructSize != sizeof(URL_COMPONENTS) || !required)
{
--
2.30.2
1
0
08 Feb '22
Signed-off-by: Hans Leidekker <hans(a)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);
--
2.30.2
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/tests/action.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 7de4fb7c52c..224637eb286 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -3022,7 +3022,7 @@ error:
DeleteFileA(msifile);
DeleteFileA("msitest\\maximus");
RemoveDirectoryA("msitest");
- free(usersid);
+ LocalFree(usersid);
}
static void test_publish_product(void)
@@ -3259,7 +3259,7 @@ error:
DeleteFileA(msifile);
DeleteFileA("msitest\\maximus");
RemoveDirectoryA("msitest");
- free(usersid);
+ LocalFree(usersid);
}
static void test_publish_features(void)
@@ -3384,7 +3384,7 @@ error:
DeleteFileA(msifile);
DeleteFileA("msitest\\maximus");
RemoveDirectoryA("msitest");
- free(usersid);
+ LocalFree(usersid);
}
static LPSTR reg_get_val_str(HKEY hkey, LPCSTR name)
--
2.30.2
1
0
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
dlls/dinput/ansi.c | 54 ++++++++---------
dlls/dinput/device.c | 4 +-
dlls/dinput/device_private.h | 4 +-
dlls/dinput/dinput_main.c | 111 +++++++++++++++++------------------
dlls/dinput/dinput_private.h | 29 +++++----
dlls/dinput/joystick_hid.c | 2 +-
dlls/dinput/keyboard.c | 2 +-
dlls/dinput/mouse.c | 2 +-
8 files changed, 103 insertions(+), 105 deletions(-)
diff --git a/dlls/dinput/ansi.c b/dlls/dinput/ansi.c
index b7ec426b2e0..99ec3c73327 100644
--- a/dlls/dinput/ansi.c
+++ b/dlls/dinput/ansi.c
@@ -54,22 +54,22 @@ static inline IDirectInputDeviceA *IDirectInputDeviceA_from_IDirectInputDeviceW(
return (IDirectInputDeviceA *)IDirectInputDevice8A_from_IDirectInputDevice8W( (IDirectInputDevice8W *)iface );
}
-static IDirectInputImpl *impl_from_IDirectInput7A( IDirectInput7A *iface )
+static struct dinput *impl_from_IDirectInput7A( IDirectInput7A *iface )
{
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7A_iface );
+ return CONTAINING_RECORD( iface, struct dinput, IDirectInput7A_iface );
}
-static IDirectInput7W *IDirectInput7W_from_impl( IDirectInputImpl *impl )
+static IDirectInput7W *IDirectInput7W_from_impl( struct dinput *impl )
{
return &impl->IDirectInput7W_iface;
}
-static IDirectInputImpl *impl_from_IDirectInput8A( IDirectInput8A *iface )
+static struct dinput *impl_from_IDirectInput8A( IDirectInput8A *iface )
{
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8A_iface );
+ return CONTAINING_RECORD( iface, struct dinput, IDirectInput8A_iface );
}
-static IDirectInput8W *IDirectInput8W_from_impl( IDirectInputImpl *impl )
+static IDirectInput8W *IDirectInput8W_from_impl( struct dinput *impl )
{
return &impl->IDirectInput8W_iface;
}
@@ -678,28 +678,28 @@ const IDirectInputDevice8AVtbl dinput_device_a_vtbl =
static HRESULT WINAPI dinput8_a_QueryInterface( IDirectInput8A *iface_a, REFIID iid, void **out )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_QueryInterface( iface_w, iid, out );
}
static ULONG WINAPI dinput8_a_AddRef( IDirectInput8A *iface_a )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_AddRef( iface_w );
}
static ULONG WINAPI dinput8_a_Release( IDirectInput8A *iface_a )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_Release( iface_w );
}
static HRESULT WINAPI dinput8_a_CreateDevice( IDirectInput8A *iface_a, REFGUID guid, IDirectInputDevice8A **out, IUnknown *outer )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
IDirectInputDevice8W *outw;
HRESULT hr;
@@ -730,7 +730,7 @@ static HRESULT WINAPI dinput8_a_EnumDevices( IDirectInput8A *iface_a, DWORD type
void *ref, DWORD flags )
{
struct enum_devices_wtoa_params params = {callback, ref};
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
if (!callback) return DIERR_INVALIDPARAM;
@@ -740,28 +740,28 @@ static HRESULT WINAPI dinput8_a_EnumDevices( IDirectInput8A *iface_a, DWORD type
static HRESULT WINAPI dinput8_a_GetDeviceStatus( IDirectInput8A *iface_a, REFGUID instance_guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_GetDeviceStatus( iface_w, instance_guid );
}
static HRESULT WINAPI dinput8_a_RunControlPanel( IDirectInput8A *iface_a, HWND owner, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_RunControlPanel( iface_w, owner, flags );
}
static HRESULT WINAPI dinput8_a_Initialize( IDirectInput8A *iface_a, HINSTANCE instance, DWORD version )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
return IDirectInput8_Initialize( iface_w, instance, version );
}
static HRESULT WINAPI dinput8_a_FindDevice( IDirectInput8A *iface_a, REFGUID guid, const char *name_a, GUID *instance_guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
HRESULT hr;
WCHAR *name_w;
@@ -794,7 +794,7 @@ static HRESULT WINAPI dinput8_a_EnumDevicesBySemantics( IDirectInput8A *iface_a,
LPDIENUMDEVICESBYSEMANTICSCBA callback, void *ref, DWORD flags )
{
struct enum_devices_by_semantics_wtoa_params params = {callback, ref};
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
DIACTIONFORMATW format_w = {sizeof(format_w), sizeof(DIACTIONW)};
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
HRESULT hr;
@@ -821,7 +821,7 @@ static HRESULT WINAPI dinput8_a_EnumDevicesBySemantics( IDirectInput8A *iface_a,
static HRESULT WINAPI dinput8_a_ConfigureDevices( IDirectInput8A *iface_a, LPDICONFIGUREDEVICESCALLBACK callback,
DICONFIGUREDEVICESPARAMSA *params_a, DWORD flags, void *ref )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput8A( iface_a );
IDirectInput8W *iface_w = IDirectInput8W_from_impl( impl );
DICONFIGUREDEVICESPARAMSW params_w = {sizeof(params_w)};
DIACTIONFORMATA *format_a = params_a->lprgFormats;
@@ -873,28 +873,28 @@ const IDirectInput8AVtbl dinput8_a_vtbl =
static HRESULT WINAPI dinput7_a_QueryInterface( IDirectInput7A *iface_a, REFIID iid, void **out )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_QueryInterface( iface_w, iid, out );
}
static ULONG WINAPI dinput7_a_AddRef( IDirectInput7A *iface_a )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_AddRef( iface_w );
}
static ULONG WINAPI dinput7_a_Release( IDirectInput7A *iface_a )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_Release( iface_w );
}
static HRESULT WINAPI dinput7_a_CreateDevice( IDirectInput7A *iface_a, REFGUID guid, IDirectInputDeviceA **out_a, IUnknown *outer )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
IDirectInputDeviceW *out_w;
HRESULT hr;
@@ -910,7 +910,7 @@ static HRESULT WINAPI dinput7_a_EnumDevices( IDirectInput7A *iface_a, DWORD type
void *ref, DWORD flags )
{
struct enum_devices_wtoa_params params = {callback, ref};
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
if (!callback) return DIERR_INVALIDPARAM;
@@ -920,28 +920,28 @@ static HRESULT WINAPI dinput7_a_EnumDevices( IDirectInput7A *iface_a, DWORD type
static HRESULT WINAPI dinput7_a_GetDeviceStatus( IDirectInput7A *iface_a, REFGUID instance_guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_GetDeviceStatus( iface_w, instance_guid );
}
static HRESULT WINAPI dinput7_a_RunControlPanel( IDirectInput7A *iface_a, HWND owner, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_RunControlPanel( iface_w, owner, flags );
}
static HRESULT WINAPI dinput7_a_Initialize( IDirectInput7A *iface_a, HINSTANCE instance, DWORD version )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_Initialize( iface_w, instance, version );
}
static HRESULT WINAPI dinput7_a_FindDevice( IDirectInput7A *iface_a, REFGUID guid, const char *name_a, GUID *instance_guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
HRESULT hr;
WCHAR *name_w;
@@ -955,7 +955,7 @@ static HRESULT WINAPI dinput7_a_FindDevice( IDirectInput7A *iface_a, REFGUID gui
static HRESULT WINAPI dinput7_a_CreateDeviceEx( IDirectInput7A *iface_a, REFGUID guid, REFIID iid, void **out, IUnknown *outer )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7A( iface_a );
+ struct dinput *impl = impl_from_IDirectInput7A( iface_a );
IDirectInput7W *iface_w = IDirectInput7W_from_impl( impl );
return IDirectInput7_CreateDeviceEx( iface_w, guid, iid, out, outer );
}
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index ff8e2252a40..8c48fa7b53b 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -2153,8 +2153,8 @@ static const IDirectInputDevice8WVtbl dinput_device_w_vtbl =
dinput_device_GetImageInfo,
};
-HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl,
- const GUID *guid, IDirectInputImpl *dinput, void **out )
+HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl, const GUID *guid,
+ struct dinput *dinput, void **out )
{
struct dinput_device *This;
DIDATAFORMAT *format;
diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
index 15a8a6f83b5..4e76d1ba738 100644
--- a/dlls/dinput/device_private.h
+++ b/dlls/dinput/device_private.h
@@ -84,7 +84,7 @@ struct dinput_device
LONG ref;
GUID guid;
CRITICAL_SECTION crit;
- IDirectInputImpl *dinput;
+ struct dinput *dinput;
struct list entry; /* entry into acquired device list */
HANDLE hEvent;
DIDEVICEINSTANCEW instance;
@@ -124,7 +124,7 @@ struct dinput_device
};
extern HRESULT dinput_device_alloc( SIZE_T size, const struct dinput_device_vtbl *vtbl, const GUID *guid,
- IDirectInputImpl *dinput, void **out ) DECLSPEC_HIDDEN;
+ struct dinput *dinput, void **out ) DECLSPEC_HIDDEN;
extern HRESULT dinput_device_init( IDirectInputDevice8W *iface );
extern void dinput_device_destroy( IDirectInputDevice8W *iface );
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index d3d5206a1e4..b9d44f140c8 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -59,14 +59,14 @@ static const IDirectInput7WVtbl dinput7_vtbl;
static const IDirectInput8WVtbl dinput8_vtbl;
static const IDirectInputJoyConfig8Vtbl joy_config_vtbl;
-static inline IDirectInputImpl *impl_from_IDirectInput7W( IDirectInput7W *iface )
+static inline struct dinput *impl_from_IDirectInput7W( IDirectInput7W *iface )
{
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput7W_iface );
+ return CONTAINING_RECORD( iface, struct dinput, IDirectInput7W_iface );
}
-static inline IDirectInputImpl *impl_from_IDirectInput8W( IDirectInput8W *iface )
+static inline struct dinput *impl_from_IDirectInput8W( IDirectInput8W *iface )
{
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8W_iface );
+ return CONTAINING_RECORD( iface, struct dinput, IDirectInput8W_iface );
}
static inline struct dinput_device *impl_from_IDirectInputDevice8W( IDirectInputDevice8W *iface )
@@ -95,8 +95,8 @@ static struct list acquired_rawmouse_list = LIST_INIT( acquired_rawmouse_list );
static struct list acquired_keyboard_list = LIST_INIT( acquired_keyboard_list );
static struct list acquired_device_list = LIST_INIT( acquired_device_list );
-static HRESULT initialize_directinput_instance(IDirectInputImpl *This, DWORD dwVersion);
-static void uninitialize_directinput_instance(IDirectInputImpl *This);
+static HRESULT initialize_directinput_instance( struct dinput *impl, DWORD version );
+static void uninitialize_directinput_instance( struct dinput *impl );
void dinput_hooks_acquire_device( IDirectInputDevice8W *iface )
{
@@ -137,28 +137,27 @@ static void dinput_device_internal_unacquire( IDirectInputDevice8W *iface )
LeaveCriticalSection( &impl->crit );
}
-static HRESULT create_directinput_instance(REFIID riid, LPVOID *ppDI, IDirectInputImpl **out)
+static HRESULT dinput_create( REFIID riid, LPVOID *ppDI, struct dinput **out )
{
- IDirectInputImpl *This = calloc( 1, sizeof(IDirectInputImpl) );
+ struct dinput *impl = calloc( 1, sizeof(struct dinput) );
HRESULT hr;
- if (!This)
- return E_OUTOFMEMORY;
+ if (!impl) return E_OUTOFMEMORY;
- This->IDirectInput7A_iface.lpVtbl = &dinput7_a_vtbl;
- This->IDirectInput7W_iface.lpVtbl = &dinput7_vtbl;
- This->IDirectInput8A_iface.lpVtbl = &dinput8_a_vtbl;
- This->IDirectInput8W_iface.lpVtbl = &dinput8_vtbl;
- This->IDirectInputJoyConfig8_iface.lpVtbl = &joy_config_vtbl;
+ impl->IDirectInput7A_iface.lpVtbl = &dinput7_a_vtbl;
+ impl->IDirectInput7W_iface.lpVtbl = &dinput7_vtbl;
+ impl->IDirectInput8A_iface.lpVtbl = &dinput8_a_vtbl;
+ impl->IDirectInput8W_iface.lpVtbl = &dinput8_vtbl;
+ impl->IDirectInputJoyConfig8_iface.lpVtbl = &joy_config_vtbl;
- hr = IDirectInput_QueryInterface( &This->IDirectInput7A_iface, riid, ppDI );
+ hr = IDirectInput_QueryInterface( &impl->IDirectInput7A_iface, riid, ppDI );
if (FAILED(hr))
{
- free( This );
+ free( impl );
return hr;
}
- if (out) *out = This;
+ if (out) *out = impl;
return DI_OK;
}
@@ -169,7 +168,7 @@ HRESULT WINAPI DirectInputCreateEx(
HINSTANCE hinst, DWORD dwVersion, REFIID riid, LPVOID *ppDI,
LPUNKNOWN punkOuter)
{
- IDirectInputImpl *This;
+ struct dinput *impl;
HRESULT hr;
TRACE("(%p,%04x,%s,%p,%p)\n", hinst, dwVersion, debugstr_guid(riid), ppDI, punkOuter);
@@ -181,17 +180,17 @@ HRESULT WINAPI DirectInputCreateEx(
IsEqualGUID( &IID_IDirectInput2W, riid ) ||
IsEqualGUID( &IID_IDirectInput7W, riid ))
{
- hr = create_directinput_instance(riid, ppDI, &This);
+ hr = dinput_create( riid, ppDI, &impl );
if (FAILED(hr))
return hr;
}
else
return DIERR_NOINTERFACE;
- hr = IDirectInput_Initialize( &This->IDirectInput7A_iface, hinst, dwVersion );
+ hr = IDirectInput_Initialize( &impl->IDirectInput7A_iface, hinst, dwVersion );
if (FAILED(hr))
{
- IDirectInput_Release( &This->IDirectInput7A_iface );
+ IDirectInput_Release( &impl->IDirectInput7A_iface );
*ppDI = NULL;
return hr;
}
@@ -205,7 +204,7 @@ HRESULT WINAPI DirectInputCreateEx(
HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst,
DWORD version, REFIID iid, void **out, IUnknown *outer)
{
- IDirectInputImpl *This;
+ struct dinput *impl;
HRESULT hr;
TRACE("hinst %p, version %#x, iid %s, out %p, outer %p.\n",
@@ -222,7 +221,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst,
return DIERR_NOINTERFACE;
}
- hr = create_directinput_instance(iid, out, &This);
+ hr = dinput_create( iid, out, &impl );
if (FAILED(hr))
{
@@ -233,10 +232,10 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst,
/* When aggregation is used, the application needs to manually call Initialize(). */
if (!outer && IsEqualGUID(&IID_IDirectInput8A, iid))
{
- hr = IDirectInput8_Initialize(&This->IDirectInput8A_iface, hinst, version);
+ hr = IDirectInput8_Initialize( &impl->IDirectInput8A_iface, hinst, version );
if (FAILED(hr))
{
- IDirectInput8_Release(&This->IDirectInput8A_iface);
+ IDirectInput8_Release( &impl->IDirectInput8A_iface );
*out = NULL;
return hr;
}
@@ -244,10 +243,10 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst,
if (!outer && IsEqualGUID(&IID_IDirectInput8W, iid))
{
- hr = IDirectInput8_Initialize(&This->IDirectInput8W_iface, hinst, version);
+ hr = IDirectInput8_Initialize( &impl->IDirectInput8W_iface, hinst, version );
if (FAILED(hr))
{
- IDirectInput8_Release(&This->IDirectInput8W_iface);
+ IDirectInput8_Release( &impl->IDirectInput8W_iface );
*out = NULL;
return hr;
}
@@ -324,7 +323,7 @@ __ASM_GLOBAL_FUNC( enum_callback_wrapper,
static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LPDIENUMDEVICESCALLBACKW callback,
void *context, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
TRACE( "iface %p, type %#x, callback %p, context %p, flags %#x.\n", iface, type, callback, context, flags );
@@ -339,7 +338,7 @@ static HRESULT WINAPI dinput7_EnumDevices( IDirectInput7W *iface, DWORD type, LP
static ULONG WINAPI dinput7_AddRef( IDirectInput7W *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
ULONG ref = InterlockedIncrement( &impl->ref );
TRACE( "iface %p increasing refcount to %u.\n", iface, ref );
return ref;
@@ -347,7 +346,7 @@ static ULONG WINAPI dinput7_AddRef( IDirectInput7W *iface )
static ULONG WINAPI dinput7_Release( IDirectInput7W *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
ULONG ref = InterlockedDecrement( &impl->ref );
TRACE( "iface %p decreasing refcount to %u.\n", iface, ref );
@@ -363,7 +362,7 @@ static ULONG WINAPI dinput7_Release( IDirectInput7W *iface )
static HRESULT WINAPI dinput7_QueryInterface( IDirectInput7W *iface, REFIID iid, void **out )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
@@ -450,7 +449,7 @@ static void unregister_di_em_win_class(void)
WARN( "Unable to unregister message window class\n" );
}
-static HRESULT initialize_directinput_instance( IDirectInputImpl *impl, DWORD version )
+static HRESULT initialize_directinput_instance( struct dinput *impl, DWORD version )
{
if (!impl->initialized)
{
@@ -465,7 +464,7 @@ static HRESULT initialize_directinput_instance( IDirectInputImpl *impl, DWORD ve
return DI_OK;
}
-static void uninitialize_directinput_instance( IDirectInputImpl *impl )
+static void uninitialize_directinput_instance( struct dinput *impl )
{
if (impl->initialized)
{
@@ -491,7 +490,7 @@ enum directinput_versions
static HRESULT WINAPI dinput7_Initialize( IDirectInput7W *iface, HINSTANCE hinst, DWORD version )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
TRACE( "iface %p, hinst %p, version %#x.\n", iface, hinst, version );
@@ -512,7 +511,7 @@ static HRESULT WINAPI dinput7_Initialize( IDirectInput7W *iface, HINSTANCE hinst
static HRESULT WINAPI dinput7_GetDeviceStatus( IDirectInput7W *iface, const GUID *guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
HRESULT hr;
IDirectInputDeviceW *device;
@@ -531,7 +530,7 @@ static HRESULT WINAPI dinput7_GetDeviceStatus( IDirectInput7W *iface, const GUID
static HRESULT WINAPI dinput7_RunControlPanel( IDirectInput7W *iface, HWND owner, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
WCHAR control_exe[] = {L"control.exe"};
STARTUPINFOW si = {0};
PROCESS_INFORMATION pi;
@@ -558,7 +557,7 @@ static HRESULT WINAPI dinput7_FindDevice( IDirectInput7W *iface, const GUID *gui
static HRESULT WINAPI dinput7_CreateDeviceEx( IDirectInput7W *iface, const GUID *guid,
REFIID iid, void **out, IUnknown *outer )
{
- IDirectInputImpl *impl = impl_from_IDirectInput7W( iface );
+ struct dinput *impl = impl_from_IDirectInput7W( iface );
IDirectInputDevice8W *device;
HRESULT hr;
@@ -593,26 +592,26 @@ static HRESULT WINAPI dinput7_CreateDevice( IDirectInput7W *iface, const GUID *g
static ULONG WINAPI dinput8_AddRef( IDirectInput8W *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_AddRef( &impl->IDirectInput7W_iface );
}
static HRESULT WINAPI dinput8_QueryInterface( IDirectInput8W *iface, REFIID iid, void **out )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_QueryInterface( &impl->IDirectInput7W_iface, iid, out );
}
static ULONG WINAPI dinput8_Release( IDirectInput8W *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_Release( &impl->IDirectInput7W_iface );
}
static HRESULT WINAPI dinput8_CreateDevice( IDirectInput8W *iface, const GUID *guid,
IDirectInputDevice8W **out, IUnknown *outer )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_CreateDeviceEx( &impl->IDirectInput7W_iface, guid,
&IID_IDirectInputDevice8W, (void **)out, outer );
}
@@ -630,7 +629,7 @@ static HRESULT WINAPI dinput8_EnumDevices( IDirectInput8W *iface, DWORD type, LP
DWORD flags )
{
DIDEVICEINSTANCEW instance = {.dwSize = sizeof(DIDEVICEINSTANCEW)};
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
DWORD device_class = 0, device_type = 0;
unsigned int i = 0;
HRESULT hr;
@@ -679,19 +678,19 @@ static HRESULT WINAPI dinput8_EnumDevices( IDirectInput8W *iface, DWORD type, LP
static HRESULT WINAPI dinput8_GetDeviceStatus( IDirectInput8W *iface, const GUID *guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_GetDeviceStatus( &impl->IDirectInput7W_iface, guid );
}
static HRESULT WINAPI dinput8_RunControlPanel( IDirectInput8W *iface, HWND owner, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_RunControlPanel( &impl->IDirectInput7W_iface, owner, flags );
}
static HRESULT WINAPI dinput8_Initialize( IDirectInput8W *iface, HINSTANCE hinst, DWORD version )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
TRACE( "iface %p, hinst %p, version %#x.\n", iface, hinst, version );
@@ -709,7 +708,7 @@ static HRESULT WINAPI dinput8_Initialize( IDirectInput8W *iface, HINSTANCE hinst
static HRESULT WINAPI dinput8_FindDevice( IDirectInput8W *iface, const GUID *guid, const WCHAR *name, GUID *instance_guid )
{
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
return IDirectInput7_FindDevice( &impl->IDirectInput7W_iface, guid, name, instance_guid );
}
@@ -767,7 +766,7 @@ struct enum_device_by_semantics_params
static BOOL CALLBACK enum_device_by_semantics( const DIDEVICEINSTANCEW *instance, void *context )
{
struct enum_device_by_semantics_params *params = context;
- IDirectInputImpl *impl = impl_from_IDirectInput8W( params->iface );
+ struct dinput *impl = impl_from_IDirectInput8W( params->iface );
if (should_enumerate_device( params->username, params->flags, &impl->device_players, &instance->guidInstance ))
{
@@ -786,7 +785,7 @@ static HRESULT WINAPI dinput8_EnumDevicesBySemantics( IDirectInput8W *iface, con
DWORD callbackFlags, enum_flags = DIEDFL_ATTACHEDONLY | (flags & DIEDFL_FORCEFEEDBACK);
static const GUID *guids[2] = {&GUID_SysKeyboard, &GUID_SysMouse};
static const DWORD actionMasks[] = { DIKEYBOARD_MASK, DIMOUSE_MASK };
- IDirectInputImpl *impl = impl_from_IDirectInput8W( iface );
+ struct dinput *impl = impl_from_IDirectInput8W( iface );
DIDEVICEINSTANCEW didevi;
IDirectInputDevice8W *lpdid;
unsigned int i = 0;
@@ -870,26 +869,26 @@ static HRESULT WINAPI dinput8_ConfigureDevices( IDirectInput8W *iface, LPDICONFI
* IDirectInputJoyConfig8 interface
*/
-static inline IDirectInputImpl *impl_from_IDirectInputJoyConfig8(IDirectInputJoyConfig8 *iface)
+static inline struct dinput *impl_from_IDirectInputJoyConfig8( IDirectInputJoyConfig8 *iface )
{
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInputJoyConfig8_iface );
+ return CONTAINING_RECORD( iface, struct dinput, IDirectInputJoyConfig8_iface );
}
static HRESULT WINAPI joy_config_QueryInterface( IDirectInputJoyConfig8 *iface, REFIID iid, void **out )
{
- IDirectInputImpl *impl = impl_from_IDirectInputJoyConfig8( iface );
+ struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
return IDirectInput7_QueryInterface( &impl->IDirectInput7W_iface, iid, out );
}
static ULONG WINAPI joy_config_AddRef( IDirectInputJoyConfig8 *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInputJoyConfig8( iface );
+ struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
return IDirectInput7_AddRef( &impl->IDirectInput7W_iface );
}
static ULONG WINAPI joy_config_Release( IDirectInputJoyConfig8 *iface )
{
- IDirectInputImpl *impl = impl_from_IDirectInputJoyConfig8( iface );
+ struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
return IDirectInput7_Release( &impl->IDirectInput7W_iface );
}
@@ -960,7 +959,7 @@ static BOOL CALLBACK find_device_from_index( const DIDEVICEINSTANCEW *instance,
static HRESULT WINAPI joy_config_GetConfig( IDirectInputJoyConfig8 *iface, UINT id, DIJOYCONFIG *info, DWORD flags )
{
- IDirectInputImpl *impl = impl_from_IDirectInputJoyConfig8( iface );
+ struct dinput *impl = impl_from_IDirectInputJoyConfig8( iface );
struct find_device_from_index_params params = {.index = id};
HRESULT hr;
@@ -1124,7 +1123,7 @@ static HRESULT WINAPI class_factory_CreateInstance( IClassFactory *iface, IUnkno
if (outer) return CLASS_E_NOAGGREGATION;
- if (FAILED(hr = create_directinput_instance( &IID_IUnknown, (void **)&unknown, NULL ))) return hr;
+ if (FAILED(hr = dinput_create( &IID_IUnknown, (void **)&unknown, NULL ))) return hr;
hr = IUnknown_QueryInterface( unknown, iid, out );
IUnknown_Release( unknown );
diff --git a/dlls/dinput/dinput_private.h b/dlls/dinput/dinput_private.h
index 4b36a69c0e1..de48c4c5298 100644
--- a/dlls/dinput/dinput_private.h
+++ b/dlls/dinput/dinput_private.h
@@ -30,31 +30,30 @@
extern HINSTANCE DINPUT_instance;
/* Implementation specification */
-typedef struct IDirectInputImpl IDirectInputImpl;
-struct IDirectInputImpl
+struct dinput
{
- IDirectInput7A IDirectInput7A_iface;
- IDirectInput7W IDirectInput7W_iface;
- IDirectInput8A IDirectInput8A_iface;
- IDirectInput8W IDirectInput8W_iface;
- IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
+ IDirectInput7A IDirectInput7A_iface;
+ IDirectInput7W IDirectInput7W_iface;
+ IDirectInput8A IDirectInput8A_iface;
+ IDirectInput8W IDirectInput8W_iface;
+ IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
+ LONG ref;
- LONG ref;
- BOOL initialized;
- DWORD evsequence; /* unique sequence number for events */
- DWORD dwVersion; /* direct input version number */
- struct list device_players; /* device instance guid to player name */
+ BOOL initialized;
+ DWORD dwVersion; /* direct input version number */
+ DWORD evsequence; /* unique sequence number for events */
+ struct list device_players; /* device instance guid to player name */
};
extern const IDirectInput7AVtbl dinput7_a_vtbl DECLSPEC_HIDDEN;
extern const IDirectInput8AVtbl dinput8_a_vtbl DECLSPEC_HIDDEN;
extern HRESULT mouse_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance, DWORD version );
-extern HRESULT mouse_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out );
+extern HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out );
extern HRESULT keyboard_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance, DWORD version );
-extern HRESULT keyboard_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out );
+extern HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out );
extern HRESULT hid_joystick_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance, DWORD version, int index );
-extern HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out );
+extern HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out );
struct DevicePlayer {
GUID instance_guid;
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index 597a3da4ef8..067ffabaaa9 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -1964,7 +1964,7 @@ static BOOL init_pid_caps( struct hid_joystick *impl, struct hid_value_caps *cap
return DIENUM_CONTINUE;
}
-HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out )
+HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
{
static const DIPROPHEADER filter =
{
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index 1421e56ac3a..c483fb6e66a 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -164,7 +164,7 @@ HRESULT keyboard_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instan
return DI_OK;
}
-HRESULT keyboard_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out )
+HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
{
struct keyboard *impl;
HRESULT hr;
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 64b2c30008d..43f3a6ad334 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -91,7 +91,7 @@ HRESULT mouse_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instance,
return DI_OK;
}
-HRESULT mouse_create_device( IDirectInputImpl *dinput, const GUID *guid, IDirectInputDevice8W **out )
+HRESULT mouse_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
{
struct mouse *impl;
HKEY hkey, appkey;
--
2.34.1
1
4
08 Feb '22
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
dlls/kernel32/console.c | 7 -------
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/tests/console.c | 30 +++++++++++++-------------
dlls/kernelbase/console.c | 37 +++++++++++++++++++++++++++++++++
dlls/kernelbase/kernelbase.spec | 1 +
include/wine/condrv.h | 6 ++++++
programs/conhost/conhost.c | 9 +++++++-
programs/conhost/conhost.h | 14 ++++++++-----
programs/conhost/window.c | 5 +++--
9 files changed, 80 insertions(+), 31 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 80f3419cd7a..58bd18d2a5f 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -480,10 +480,3 @@ BOOL WINAPI GetConsoleFontInfo(HANDLE hConsole, BOOL maximize, DWORD numfonts, C
SetLastError(LOWORD(E_NOTIMPL) /* win10 1709+ */);
return FALSE;
}
-
-BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
-{
- FIXME("(%p %d %p): stub!\n", hConsole, maxwindow, cfix);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 87fa0c39381..6e063bfaa7b 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1390,7 +1390,7 @@
@ stdcall -import SetConsoleTitleW(wstr)
@ stdcall -import SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) NTDLL.RtlSetCriticalSectionSpinCount
-@ stdcall SetCurrentConsoleFontEx(long long ptr)
+@ stdcall -import SetCurrentConsoleFontEx(long long ptr)
@ stdcall -import SetCurrentDirectoryA(str)
@ stdcall -import SetCurrentDirectoryW(wstr)
@ stub SetDaylightFlag
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index e4d9d43f4c4..0943a318f6a 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -3576,18 +3576,18 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CreatePipe(&pipe1, &pipe2, NULL, 0);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3595,36 +3595,36 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError());
cfix = orig_cfix;
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(NULL, TRUE, &cfix);
@@ -3635,7 +3635,7 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(pipe1, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
CloseHandle(pipe1);
CloseHandle(pipe2);
@@ -3650,7 +3650,7 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, FALSE, &cfix);
ok(!ret, "got %d, expected 0\n", ret);
- todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_input, TRUE, &cfix);
@@ -3659,8 +3659,8 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, TRUE, &cfix);
@@ -3670,8 +3670,8 @@ static void test_SetCurrentConsoleFontEx(HANDLE std_output)
/* Restore original console font parameters */
SetLastError(0xdeadbeef);
ret = SetCurrentConsoleFontEx(std_output, FALSE, &orig_cfix);
- todo_wine ok(ret, "got %d, expected non-zero\n", ret);
- todo_wine ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
+ ok(ret, "got %d, expected non-zero\n", ret);
+ ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError());
}
static void test_GetConsoleFontSize(HANDLE std_output)
diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c
index a7eeb439232..0501e140a03 100644
--- a/dlls/kernelbase/console.c
+++ b/dlls/kernelbase/console.c
@@ -1303,6 +1303,43 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleWindowInfo( HANDLE handle, BOOL absolute
}
+/******************************************************************************
+ * SetCurrentConsoleFontEx (kernelbase.@)
+ */
+BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix)
+{
+ struct condrv_output_info_params_font data;
+
+ TRACE( "(%p %d %p)\n", hConsole, maxwindow, cfix );
+
+ if (cfix->cbSize != sizeof(CONSOLE_FONT_INFOEX))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ if (maxwindow)
+ {
+ FIXME( "(%p %d %p): semi-stub\n", hConsole, maxwindow, cfix);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+ }
+
+ data.params.mask = SET_CONSOLE_OUTPUT_INFO_FONT;
+
+ data.params.info.font_width = cfix->dwFontSize.X;
+ data.params.info.font_height = cfix->dwFontSize.Y;
+ data.params.info.font_pitch_family = cfix->FontFamily;
+ data.params.info.font_weight = cfix->FontWeight;
+
+ memcpy( data.face_name, cfix->FaceName, sizeof(cfix->FaceName) );
+ data.face_name[ LF_FACESIZE - 1 ] = 0;
+
+ return console_ioctl( hConsole, IOCTL_CONDRV_SET_OUTPUT_INFO,
+ &data, sizeof(data), NULL, 0, NULL );
+}
+
+
/***********************************************************************
* ReadConsoleInputA (kernelbase.@)
*/
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
index 01135d6250a..91c4909e006 100644
--- a/dlls/kernelbase/kernelbase.spec
+++ b/dlls/kernelbase/kernelbase.spec
@@ -1422,6 +1422,7 @@
@ stdcall SetConsoleTitleW(wstr)
@ stdcall SetConsoleWindowInfo(long long ptr)
@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount
+@ stdcall SetCurrentConsoleFontEx(long long ptr)
@ stdcall SetCurrentDirectoryA(str)
@ stdcall SetCurrentDirectoryW(wstr)
@ stdcall SetDefaultDllDirectories(long)
diff --git a/include/wine/condrv.h b/include/wine/condrv.h
index 4d2332a1ee9..605e6f2c2fe 100644
--- a/include/wine/condrv.h
+++ b/include/wine/condrv.h
@@ -148,6 +148,11 @@ struct condrv_output_info_params
struct condrv_output_info info; /* output info */
};
+struct condrv_output_info_params_font {
+ struct condrv_output_info_params params;
+ WCHAR face_name[LF_FACESIZE];
+};
+
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001
#define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002
#define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004
@@ -155,6 +160,7 @@ struct condrv_output_info_params
#define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x0010
#define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x0020
#define SET_CONSOLE_OUTPUT_INFO_POPUP_ATTR 0x0040
+#define SET_CONSOLE_OUTPUT_INFO_FONT 0x0080
/* IOCTL_CONDRV_FILL_OUTPUT params */
struct condrv_fill_output_params
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 78f6e345170..456f3a4889e 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -1913,6 +1913,13 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
screen_buffer->max_width = info->max_width;
screen_buffer->max_height = info->max_height;
}
+ if (params->mask & SET_CONSOLE_OUTPUT_INFO_FONT)
+ {
+ WCHAR *face_name = (WCHAR *)(params + 1);
+
+ update_console_font( screen_buffer->console, face_name,
+ info->font_height, info->font_weight );
+ }
if (is_active( screen_buffer ))
{
@@ -2425,7 +2432,7 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
return get_output_info( screen_buffer, out_size );
case IOCTL_CONDRV_SET_OUTPUT_INFO:
- if (in_size != sizeof(struct condrv_output_info_params) || *out_size) return STATUS_INVALID_PARAMETER;
+ if (in_size < sizeof(struct condrv_output_info) || *out_size) return STATUS_INVALID_PARAMETER;
return set_output_info( screen_buffer, in_data );
case IOCTL_CONDRV_FILL_OUTPUT:
diff --git a/programs/conhost/conhost.h b/programs/conhost/conhost.h
index 5e9b999380c..88a26f70fd0 100644
--- a/programs/conhost/conhost.h
+++ b/programs/conhost/conhost.h
@@ -130,17 +130,21 @@ struct screen_buffer
struct wine_rb_entry entry; /* map entry */
};
-BOOL init_window( struct console *console );
-void init_message_window( struct console *console );
-void update_window_region( struct console *console, const RECT *update );
-void update_window_config( struct console *console, BOOL delay );
-
+/* conhost.c */
NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *records,
unsigned int count, BOOL flush );
void notify_screen_buffer_size( struct screen_buffer *screen_buffer );
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
+/* window.c */
+void update_console_font( struct console *console, const WCHAR *font,
+ unsigned int height, unsigned int weight );
+BOOL init_window( struct console *console );
+void init_message_window( struct console *console );
+void update_window_region( struct console *console, const RECT *update );
+void update_window_config( struct console *console, BOOL delay );
+
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
{
SetRect( rect, screen_buffer->width, screen_buffer->height, 0, 0 );
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index 7ad0d48effd..0d450774d23 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -705,6 +705,7 @@ static BOOL set_console_font( struct console *console, const LOGFONTW *logfont )
font_info->width = tm.tmAveCharWidth;
font_info->height = tm.tmHeight + tm.tmExternalLeading;
+ font_info->pitch_family = tm.tmPitchAndFamily;
font_info->weight = tm.tmWeight;
free( font_info->face_name );
@@ -851,8 +852,8 @@ static int WINAPI get_first_font_enum( const LOGFONTW *lf, const TEXTMETRICW *tm
/* sets logfont as the new font for the console */
-static void update_console_font( struct console *console, const WCHAR *font,
- unsigned int height, unsigned int weight )
+void update_console_font( struct console *console, const WCHAR *font,
+ unsigned int height, unsigned int weight )
{
struct font_chooser fc;
LOGFONTW lf;
--
2.34.1
2
2
08 Feb '22
The NVDA screen reader needs this.
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/comctl32/button.c | 1 +
dlls/user32/tests/msg.c | 18 +++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 88b48a4a5c0..faf0212b256 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -656,6 +656,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
break;
}
SendMessageW( hWnd, BM_SETSTATE, FALSE, 0 );
+ NotifyWinEvent( EVENT_OBJECT_STATECHANGE, hWnd, OBJID_CLIENT, 0 );
GetClientRect( hWnd, &rect );
if (uMsg == WM_KEYUP || PtInRect( &rect, pt ))
{
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index f0e0d0fba76..cb8d4f07fe7 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -1774,7 +1774,7 @@ static const struct message WmModalDialogSeq[] = {
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_KILLFOCUS, sent|parent },
{ WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_ENABLE, sent|parent|wparam, 0 },
{ HCBT_CREATEWND, hook },
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|optional, 0, 0 }, /* Not sent on Win10. */
@@ -1829,7 +1829,7 @@ static const struct message WmModalDialogSeq[] = {
{ WM_ENTERIDLE, sent|parent|optional },
{ WM_ENTERIDLE, sent|parent|optional },
{ WM_TIMER, sent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_ENABLE, sent|parent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE },
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
@@ -1860,14 +1860,14 @@ static const struct message WmModalDialogSeq_2[] = {
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_KILLFOCUS, sent },
{ WM_IME_SETCONTEXT, sent|parent|wparam|optional, 0 },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_ENABLE, sent|wparam, 0 },
{ HCBT_CREATEWND, hook },
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_SETFONT, sent },
{ WM_INITDIALOG, sent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_CHANGEUISTATE, sent|optional },
{ WM_UPDATEUISTATE, sent|optional },
{ WM_ENABLE, sent|wparam, 1 },
@@ -7297,24 +7297,24 @@ static const struct message auto_radio_button_VK_DOWN_dialog[] =
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO1 },
{ WM_CTLCOLORSTATIC, sent|parent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_LBUTTONUP, sent|wparam|lparam|defwinproc, 0, 0 },
{ BM_SETSTATE, sent|wparam|lparam|defwinproc, BST_UNCHECKED, ID_RADIO1 },
{ WM_CTLCOLORSTATIC, sent|parent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO1, 0 },
{ BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_CHECKED, ID_RADIO1 },
{ WM_CTLCOLORSTATIC, sent|parent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO3, 0 },
{ BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_UNCHECKED, ID_RADIO3 },
{ WM_CTLCOLORSTATIC, sent|parent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_TEXT, 0 },
{ WM_GETDLGCODE, sent|wparam|lparam|defwinproc, ID_RADIO2, 0 },
{ BM_SETCHECK, sent|wparam|lparam|defwinproc, BST_UNCHECKED, ID_RADIO2 },
{ WM_CTLCOLORSTATIC, sent|parent },
- { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|winevent_hook_todo, OBJID_CLIENT, 0 },
+ { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|winevent_hook_todo, 0, 0 },
{ WM_CAPTURECHANGED, sent|wparam|lparam|defwinproc, 0, 0 },
{ WM_COMMAND, sent|wparam|parent, MAKEWPARAM(ID_RADIO1, BN_CLICKED) },
--
2.35.1
3
6
08 Feb '22
Some update packages use both lowercase and uppercase names for
expressions.
For example, Microsoft-Windows-MediaFeaturePack-OOB-Package_x64.msu
uses both Runtime and runtime for expressions.
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf(a)gmail.com>
---
programs/wusa/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/wusa/main.c b/programs/wusa/main.c
index bcb795a80fa..db745edbe5a 100644
--- a/programs/wusa/main.c
+++ b/programs/wusa/main.c
@@ -480,10 +480,10 @@ static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *ke
{
WCHAR path[MAX_PATH];
- if (!wcscmp(key, L"runtime.system32"))
+ if (!wcsicmp(key, L"runtime.system32"))
{
#ifdef __x86_64__
- if (!wcscmp(assembly->identity.architecture, L"x86"))
+ if (!wcsicmp(assembly->identity.architecture, L"x86"))
{
GetSystemWow64DirectoryW(path, ARRAY_SIZE(path));
return strdupW(path);
@@ -492,7 +492,7 @@ static WCHAR *lookup_expression(struct assembly_entry *assembly, const WCHAR *ke
GetSystemDirectoryW(path, ARRAY_SIZE(path));
return strdupW(path);
}
- if (!wcscmp(key, L"runtime.windows"))
+ if (!wcsicmp(key, L"runtime.windows"))
{
GetWindowsDirectoryW(path, ARRAY_SIZE(path));
return strdupW(path);
--
2.34.1
1
1
This program is not shipped by Windows. Rather, it is a redistributable
component shipped with some drivers, which appears to be a thin wrapper over the
undocumented DriverStore* APIs exported from setupapi. Since the behaviour of
this program is much easier to determine and implement, it seems much more
worthwhile to do so despite not being an OS component.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42424
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
There is a snag, though, which is that Wine's default load order is
"native,builtin" for the main EXE when loaded with an absolute path, as will
pretty much always be the case for dpinst.exe. As such anyone who intends to
install a package that requires it will need to manually set the program to
prefer builtin. Ideally this wouldn't be necessary, but it's not clear to me how
to avoid it:
* Set *dpinst.exe to have a default override of builtin,native in the
DllOverrides key? There's no precedent for this, though.
* Introduce an analog of the --prefer-native switch? Seems excessive for
something that would so rarely useful.
configure.ac | 2 ++
loader/wine.inf.in | 1 +
programs/dpinst/Makefile.in | 4 ++++
programs/dpinst/dpinst.c | 35 +++++++++++++++++++++++++++++++++++
programs/dpinst64/Makefile.in | 5 +++++
5 files changed, 47 insertions(+)
create mode 100644 programs/dpinst/Makefile.in
create mode 100644 programs/dpinst/dpinst.c
create mode 100644 programs/dpinst64/Makefile.in
diff --git a/configure.ac b/configure.ac
index e51e114c45e..33d2ba15ebf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3547,6 +3547,8 @@ WINE_CONFIG_MAKEFILE(programs/conhost/tests)
WINE_CONFIG_MAKEFILE(programs/control)
WINE_CONFIG_MAKEFILE(programs/cscript)
WINE_CONFIG_MAKEFILE(programs/dism)
+WINE_CONFIG_MAKEFILE(programs/dpinst,,[test "x$enable_win64" = xyes])
+WINE_CONFIG_MAKEFILE(programs/dpinst64,enable_dpinst,[test "x$enable_win64" = xno])
WINE_CONFIG_MAKEFILE(programs/dplaysvr)
WINE_CONFIG_MAKEFILE(programs/dpnsvr)
WINE_CONFIG_MAKEFILE(programs/dpvsetup)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 0e488d87dcb..4ad9dc09efd 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2646,6 +2646,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G"
11,,services.exe,-
11,,spoolsv.exe,-
11,,winemenubuilder.exe,-
+11,,dpinst.exe,-
; registration order matters for these
11,,msxml.dll
11,,msxml2.dll
diff --git a/programs/dpinst/Makefile.in b/programs/dpinst/Makefile.in
new file mode 100644
index 00000000000..bd97b860ce7
--- /dev/null
+++ b/programs/dpinst/Makefile.in
@@ -0,0 +1,4 @@
+MODULE = dpinst.exe
+EXTRADLLFLAGS = -mconsole -municode
+
+C_SRCS = dpinst.c
diff --git a/programs/dpinst/dpinst.c b/programs/dpinst/dpinst.c
new file mode 100644
index 00000000000..52b4119760b
--- /dev/null
+++ b/programs/dpinst/dpinst.c
@@ -0,0 +1,35 @@
+/*
+ * Driver Store installer replacement
+ *
+ * Copyright 2022 Zebediah Figura
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "windef.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dpinst);
+
+int __cdecl wmain(int argc, WCHAR *argv[])
+{
+ int i;
+
+ for (i = 0; i < argc; i++)
+ FIXME(" %s", debugstr_w(argv[i]));
+ FIXME("\n");
+
+ return 0;
+}
diff --git a/programs/dpinst64/Makefile.in b/programs/dpinst64/Makefile.in
new file mode 100644
index 00000000000..f79ed3e0dba
--- /dev/null
+++ b/programs/dpinst64/Makefile.in
@@ -0,0 +1,5 @@
+MODULE = dpinst64.exe
+EXTRADLLFLAGS = -mconsole -municode
+PARENTSRC = ../dpinst
+
+C_SRCS = dpinst.c
--
2.34.1
1
3
[PATCH 1/5] qcap: Use CoCreateInstance() directly instead of BaseOutputPinImpl_InitAllocator().
by Zebediah Figura 08 Feb '22
by Zebediah Figura 08 Feb '22
08 Feb '22
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/qcap/avimux.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index fe4add83b7c..45b995cc2ff 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1177,9 +1177,12 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base,
TRACE("(%p)->(%p %p)\n", base, pPin, pAlloc);
- hr = BaseOutputPinImpl_InitAllocator(base, pAlloc);
- if(FAILED(hr))
+ if (FAILED(hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL,
+ CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (void **)pAlloc)))
+ {
+ ERR("Failed to create allocator, hr %#x.\n", hr);
return hr;
+ }
hr = IMemInputPin_GetAllocatorRequirements(pPin, &req);
if(FAILED(hr))
--
2.34.1
1
4
08 Feb '22
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Immediate issue was that constants like 1e1 were not parsed without a suffix.
libs/vkd3d-shader/hlsl.l | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.l b/libs/vkd3d-shader/hlsl.l
index e9281ec..60aca79 100644
--- a/libs/vkd3d-shader/hlsl.l
+++ b/libs/vkd3d-shader/hlsl.l
@@ -188,11 +188,7 @@ row_major {return KW_ROW_MAJOR; }
yylval->floatval = atof(yytext);
return C_FLOAT;
}
-[0-9]+\.([eE][+-]?[0-9]+)?[h|H|f|F]? {
- yylval->floatval = atof(yytext);
- return C_FLOAT;
- }
-[0-9]+([eE][+-]?[0-9]+)?[h|H|f|F] {
+[0-9]+(\.)?([eE][+-]?[0-9]+)?[h|H|f|F]? {
yylval->floatval = atof(yytext);
return C_FLOAT;
}
--
2.34.1
2
2