Commit 120244ae authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Build without -DWINE_NO_LONG_TYPES.

parent 3c695e3c
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winhttp.dll
IMPORTLIB = winhttp
IMPORTS = uuid jsproxy user32 advapi32 ws2_32
......
......@@ -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;
}
......
......@@ -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;
}
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment