winhttp: Get rid of get/set_last_error.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ce9ad42056
commit
3fb5d2f98d
@ -225,7 +225,7 @@ struct netconn *netconn_create( struct hostdata *host, const struct sockaddr_sto
|
|||||||
FD_ZERO( &set );
|
FD_ZERO( &set );
|
||||||
FD_SET( conn->socket, &set );
|
FD_SET( conn->socket, &set );
|
||||||
if ((res = select( conn->socket + 1, NULL, &set, NULL, &timeval )) > 0) ret = TRUE;
|
if ((res = select( conn->socket + 1, NULL, &set, NULL, &timeval )) > 0) ret = TRUE;
|
||||||
else if (!res) set_last_error( ERROR_WINHTTP_TIMEOUT );
|
else if (!res) SetLastError( ERROR_WINHTTP_TIMEOUT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ struct netconn *netconn_create( struct hostdata *host, const struct sockaddr_sto
|
|||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
WARN("unable to connect to host (%u)\n", get_last_error());
|
WARN("unable to connect to host (%u)\n", GetLastError());
|
||||||
closesocket( conn->socket );
|
closesocket( conn->socket );
|
||||||
heap_free( conn );
|
heap_free( conn );
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -378,7 +378,7 @@ BOOL netconn_secure_connect( struct netconn *conn, WCHAR *hostname, DWORD securi
|
|||||||
heap_free(conn->ssl_buf);
|
heap_free(conn->ssl_buf);
|
||||||
conn->ssl_buf = NULL;
|
conn->ssl_buf = NULL;
|
||||||
DeleteSecurityContext(&ctx);
|
DeleteSecurityContext(&ctx);
|
||||||
set_last_error(res ? res : ERROR_WINHTTP_SECURE_CHANNEL_ERROR);
|
SetLastError(res ? res : ERROR_WINHTTP_SECURE_CHANNEL_ERROR);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -690,7 +690,7 @@ BOOL netconn_resolve( WCHAR *hostname, INTERNET_PORT port, struct sockaddr_stora
|
|||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
set_last_error( ret );
|
SetLastError( ret );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -420,7 +420,7 @@ static BOOL process_header( struct request *request, const WCHAR *field, const W
|
|||||||
}
|
}
|
||||||
else if (!(flags & WINHTTP_ADDREQ_FLAG_ADD))
|
else if (!(flags & WINHTTP_ADDREQ_FLAG_ADD))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_HEADER_NOT_FOUND );
|
SetLastError( ERROR_WINHTTP_HEADER_NOT_FOUND );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,25 +520,25 @@ BOOL WINAPI WinHttpAddRequestHeaders( HINTERNET hrequest, LPCWSTR headers, DWORD
|
|||||||
|
|
||||||
if (!headers || !len)
|
if (!headers || !len)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = add_request_headers( request, headers, len, flags );
|
ret = add_request_headers( request, headers, len, flags );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,7 +652,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
for (len = 0; *p; p++) if (*p != '\r') len++;
|
for (len = 0; *p; p++) if (*p != '\r') len++;
|
||||||
|
|
||||||
if (!buffer || len * sizeof(WCHAR) > *buflen)
|
if (!buffer || len * sizeof(WCHAR) > *buflen)
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (p = headers, q = buffer; *p; p++, q++)
|
for (p = headers, q = buffer; *p; p++, q++)
|
||||||
@ -686,7 +686,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
||||||
{
|
{
|
||||||
len += sizeof(WCHAR);
|
len += sizeof(WCHAR);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -703,7 +703,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
||||||
{
|
{
|
||||||
len += sizeof(WCHAR);
|
len += sizeof(WCHAR);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -719,7 +719,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
||||||
{
|
{
|
||||||
len += sizeof(WCHAR);
|
len += sizeof(WCHAR);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -747,14 +747,14 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
}
|
}
|
||||||
if (!header || (request_only && !header->is_request))
|
if (!header || (request_only && !header->is_request))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_HEADER_NOT_FOUND );
|
SetLastError( ERROR_WINHTTP_HEADER_NOT_FOUND );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (level & WINHTTP_QUERY_FLAG_NUMBER)
|
if (level & WINHTTP_QUERY_FLAG_NUMBER)
|
||||||
{
|
{
|
||||||
if (!buffer || sizeof(int) > *buflen)
|
if (!buffer || sizeof(int) > *buflen)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -770,7 +770,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
SYSTEMTIME *st = buffer;
|
SYSTEMTIME *st = buffer;
|
||||||
if (!buffer || sizeof(SYSTEMTIME) > *buflen)
|
if (!buffer || sizeof(SYSTEMTIME) > *buflen)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else if ((ret = WinHttpTimeToSystemTime( header->value, st )))
|
else if ((ret = WinHttpTimeToSystemTime( header->value, st )))
|
||||||
{
|
{
|
||||||
@ -786,7 +786,7 @@ static BOOL query_headers( struct request *request, DWORD level, const WCHAR *na
|
|||||||
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
if (!buffer || len + sizeof(WCHAR) > *buflen)
|
||||||
{
|
{
|
||||||
len += sizeof(WCHAR);
|
len += sizeof(WCHAR);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -812,20 +812,20 @@ BOOL WINAPI WinHttpQueryHeaders( HINTERNET hrequest, DWORD level, LPCWSTR name,
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = query_headers( request, level, name, buffer, buflen, index );
|
ret = query_headers( request, level, name, buffer, buflen, index );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,7 +882,7 @@ static BOOL query_auth_schemes( struct request *request, DWORD level, DWORD *sup
|
|||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
query_headers( request, level, NULL, NULL, &size, &index );
|
query_headers( request, level, NULL, NULL, &size, &index );
|
||||||
if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) break;
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) break;
|
||||||
|
|
||||||
if (!(buffer = heap_alloc( size ))) return FALSE;
|
if (!(buffer = heap_alloc( size ))) return FALSE;
|
||||||
if (!query_headers( request, level, NULL, buffer, &size, &index ))
|
if (!query_headers( request, level, NULL, buffer, &size, &index ))
|
||||||
@ -920,19 +920,19 @@ BOOL WINAPI WinHttpQueryAuthSchemes( HINTERNET hrequest, LPDWORD supported, LPDW
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!supported || !first || !target)
|
if (!supported || !first || !target)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -947,10 +947,10 @@ BOOL WINAPI WinHttpQueryAuthSchemes( HINTERNET hrequest, LPDWORD supported, LPDW
|
|||||||
*target = WINHTTP_AUTH_TARGET_PROXY;
|
*target = WINHTTP_AUTH_TARGET_PROXY;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else set_last_error( ERROR_INVALID_OPERATION );
|
else SetLastError( ERROR_INVALID_OPERATION );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2255,7 +2255,7 @@ end:
|
|||||||
{
|
{
|
||||||
WINHTTP_ASYNC_RESULT result;
|
WINHTTP_ASYNC_RESULT result;
|
||||||
result.dwResult = API_SEND_REQUEST;
|
result.dwResult = API_SEND_REQUEST;
|
||||||
result.dwError = get_last_error();
|
result.dwError = GetLastError();
|
||||||
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2283,13 +2283,13 @@ BOOL WINAPI WinHttpSendRequest( HINTERNET hrequest, LPCWSTR headers, DWORD heade
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2316,7 +2316,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNET hrequest, LPCWSTR headers, DWORD heade
|
|||||||
ret = send_request( request, headers, headers_len, optional, optional_len, total_len, context, FALSE );
|
ret = send_request( request, headers, headers_len, optional, optional_len, total_len, context, FALSE );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2327,7 +2327,7 @@ static BOOL set_credentials( struct request *request, DWORD target, DWORD scheme
|
|||||||
|
|
||||||
if (scheme == SCHEME_INVALID || ((scheme == SCHEME_BASIC || scheme == SCHEME_DIGEST) && (!username || !password)))
|
if (scheme == SCHEME_INVALID || ((scheme == SCHEME_BASIC || scheme == SCHEME_DIGEST) && (!username || !password)))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
switch (target)
|
switch (target)
|
||||||
@ -2374,20 +2374,20 @@ BOOL WINAPI WinHttpSetCredentials( HINTERNET hrequest, DWORD target, DWORD schem
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = set_credentials( request, target, scheme, username, password );
|
ret = set_credentials( request, target, scheme, username, password );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2612,7 +2612,7 @@ static WCHAR *get_redirect_url( struct request *request, DWORD *len )
|
|||||||
WCHAR *ret;
|
WCHAR *ret;
|
||||||
|
|
||||||
query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL );
|
query_headers( request, WINHTTP_QUERY_LOCATION, NULL, NULL, &size, NULL );
|
||||||
if (get_last_error() != ERROR_INSUFFICIENT_BUFFER) return FALSE;
|
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return FALSE;
|
||||||
if (!(ret = heap_alloc( size ))) return NULL;
|
if (!(ret = heap_alloc( size ))) return NULL;
|
||||||
*len = size / sizeof(WCHAR) - 1;
|
*len = size / sizeof(WCHAR) - 1;
|
||||||
if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret;
|
if (query_headers( request, WINHTTP_QUERY_LOCATION, NULL, ret, &size, NULL )) return ret;
|
||||||
@ -2741,7 +2741,7 @@ static BOOL receive_response( struct request *request, BOOL async )
|
|||||||
{
|
{
|
||||||
if (!(ret = read_reply( request )))
|
if (!(ret = read_reply( request )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_INVALID_SERVER_RESPONSE );
|
SetLastError( ERROR_WINHTTP_INVALID_SERVER_RESPONSE );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
size = sizeof(DWORD);
|
size = sizeof(DWORD);
|
||||||
@ -2784,7 +2784,7 @@ static BOOL receive_response( struct request *request, BOOL async )
|
|||||||
{
|
{
|
||||||
WINHTTP_ASYNC_RESULT result;
|
WINHTTP_ASYNC_RESULT result;
|
||||||
result.dwResult = API_RECEIVE_RESPONSE;
|
result.dwResult = API_RECEIVE_RESPONSE;
|
||||||
result.dwError = get_last_error();
|
result.dwError = GetLastError();
|
||||||
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2809,13 +2809,13 @@ BOOL WINAPI WinHttpReceiveResponse( HINTERNET hrequest, LPVOID reserved )
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2834,7 +2834,7 @@ BOOL WINAPI WinHttpReceiveResponse( HINTERNET hrequest, LPVOID reserved )
|
|||||||
ret = receive_response( request, FALSE );
|
ret = receive_response( request, FALSE );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2880,13 +2880,13 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available )
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2906,7 +2906,7 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available )
|
|||||||
ret = query_data_available( request, available, FALSE );
|
ret = query_data_available( request, available, FALSE );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2928,13 +2928,13 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, LPVOID buffer, DWORD to_read, L
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2956,7 +2956,7 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, LPVOID buffer, DWORD to_read, L
|
|||||||
ret = read_data( request, buffer, to_read, read, FALSE );
|
ret = read_data( request, buffer, to_read, read, FALSE );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2974,7 +2974,7 @@ static BOOL write_data( struct request *request, const void *buffer, DWORD to_wr
|
|||||||
{
|
{
|
||||||
WINHTTP_ASYNC_RESULT result;
|
WINHTTP_ASYNC_RESULT result;
|
||||||
result.dwResult = API_WRITE_DATA;
|
result.dwResult = API_WRITE_DATA;
|
||||||
result.dwError = get_last_error();
|
result.dwError = GetLastError();
|
||||||
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, &result, sizeof(result) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3000,13 +3000,13 @@ BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write
|
|||||||
|
|
||||||
if (!(request = (struct request *)grab_object( hrequest )))
|
if (!(request = (struct request *)grab_object( hrequest )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
|
||||||
{
|
{
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3028,7 +3028,7 @@ BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write
|
|||||||
ret = write_data( request, buffer, to_write, written, FALSE );
|
ret = write_data( request, buffer, to_write, written, FALSE );
|
||||||
|
|
||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3429,7 +3429,7 @@ static HRESULT WINAPI winhttp_request_SetCredentials(
|
|||||||
}
|
}
|
||||||
if (!WinHttpSetCredentials( request->hrequest, target, scheme, username, password, NULL ))
|
if (!WinHttpSetCredentials( request->hrequest, target, scheme, username, password, NULL ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
LeaveCriticalSection( &request->cs );
|
LeaveCriticalSection( &request->cs );
|
||||||
@ -3515,7 +3515,7 @@ static HRESULT WINAPI winhttp_request_Open(
|
|||||||
uc.dwHostNameLength = ~0u;
|
uc.dwHostNameLength = ~0u;
|
||||||
uc.dwUrlPathLength = ~0u;
|
uc.dwUrlPathLength = ~0u;
|
||||||
uc.dwExtraInfoLength = ~0u;
|
uc.dwExtraInfoLength = ~0u;
|
||||||
if (!WinHttpCrackUrl( url, 0, 0, &uc )) return HRESULT_FROM_WIN32( get_last_error() );
|
if (!WinHttpCrackUrl( url, 0, 0, &uc )) return HRESULT_FROM_WIN32( GetLastError() );
|
||||||
|
|
||||||
EnterCriticalSection( &request->cs );
|
EnterCriticalSection( &request->cs );
|
||||||
if (request->state < REQUEST_STATE_INITIALIZED) initialize_request( request );
|
if (request->state < REQUEST_STATE_INITIALIZED) initialize_request( request );
|
||||||
@ -3538,20 +3538,20 @@ static HRESULT WINAPI winhttp_request_Open(
|
|||||||
if (!(request->hsession = WinHttpOpen( user_agentW, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL,
|
if (!(request->hsession = WinHttpOpen( user_agentW, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, NULL, NULL,
|
||||||
WINHTTP_FLAG_ASYNC )))
|
WINHTTP_FLAG_ASYNC )))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 )))
|
if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 )))
|
||||||
{
|
{
|
||||||
WinHttpCloseHandle( request->hsession );
|
WinHttpCloseHandle( request->hsession );
|
||||||
request->hsession = NULL;
|
request->hsession = NULL;
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 )))
|
else if (!(request->hconnect = WinHttpConnect( request->hsession, hostname, uc.nPort, 0 )))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3562,7 +3562,7 @@ static HRESULT WINAPI winhttp_request_Open(
|
|||||||
}
|
}
|
||||||
if (!(request->hrequest = WinHttpOpenRequest( request->hconnect, method, path, NULL, NULL, acceptW, flags )))
|
if (!(request->hrequest = WinHttpOpenRequest( request->hconnect, method, path, NULL, NULL, acceptW, flags )))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
WinHttpSetOption( request->hrequest, WINHTTP_OPTION_CONTEXT_VALUE, &request, sizeof(request) );
|
WinHttpSetOption( request->hrequest, WINHTTP_OPTION_CONTEXT_VALUE, &request, sizeof(request) );
|
||||||
@ -3621,7 +3621,7 @@ static HRESULT WINAPI winhttp_request_SetRequestHeader(
|
|||||||
if (!WinHttpAddRequestHeaders( request->hrequest, str, len,
|
if (!WinHttpAddRequestHeaders( request->hrequest, str, len,
|
||||||
WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE ))
|
WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
}
|
}
|
||||||
heap_free( str );
|
heap_free( str );
|
||||||
|
|
||||||
@ -3654,7 +3654,7 @@ static HRESULT WINAPI winhttp_request_GetResponseHeader(
|
|||||||
size = 0;
|
size = 0;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CUSTOM, header, NULL, &size, NULL ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CUSTOM, header, NULL, &size, NULL ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
||||||
}
|
}
|
||||||
if (!(*value = SysAllocStringLen( NULL, size / sizeof(WCHAR) )))
|
if (!(*value = SysAllocStringLen( NULL, size / sizeof(WCHAR) )))
|
||||||
@ -3665,7 +3665,7 @@ static HRESULT WINAPI winhttp_request_GetResponseHeader(
|
|||||||
err = ERROR_SUCCESS;
|
err = ERROR_SUCCESS;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CUSTOM, header, *value, &size, NULL ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CUSTOM, header, *value, &size, NULL ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
SysFreeString( *value );
|
SysFreeString( *value );
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
@ -3693,7 +3693,7 @@ static HRESULT WINAPI winhttp_request_GetAllResponseHeaders(
|
|||||||
size = 0;
|
size = 0;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, NULL, &size, NULL ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
||||||
}
|
}
|
||||||
if (!(*headers = SysAllocStringLen( NULL, size / sizeof(WCHAR) )))
|
if (!(*headers = SysAllocStringLen( NULL, size / sizeof(WCHAR) )))
|
||||||
@ -3704,7 +3704,7 @@ static HRESULT WINAPI winhttp_request_GetAllResponseHeaders(
|
|||||||
err = ERROR_SUCCESS;
|
err = ERROR_SUCCESS;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, *headers, &size, NULL ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_RAW_HEADERS_CRLF, NULL, *headers, &size, NULL ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
SysFreeString( *headers );
|
SysFreeString( *headers );
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
@ -3755,7 +3755,7 @@ static DWORD wait_for_completion( struct winhttp_request *request )
|
|||||||
request->error = ERROR_CANCELLED;
|
request->error = ERROR_CANCELLED;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
request->error = get_last_error();
|
request->error = GetLastError();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return request->error;
|
return request->error;
|
||||||
@ -3768,7 +3768,7 @@ static HRESULT request_receive( struct winhttp_request *request )
|
|||||||
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE );
|
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE );
|
||||||
if (!WinHttpReceiveResponse( request->hrequest, NULL ))
|
if (!WinHttpReceiveResponse( request->hrequest, NULL ))
|
||||||
{
|
{
|
||||||
return HRESULT_FROM_WIN32( get_last_error() );
|
return HRESULT_FROM_WIN32( GetLastError() );
|
||||||
}
|
}
|
||||||
if ((err = wait_for_completion( request ))) return HRESULT_FROM_WIN32( err );
|
if ((err = wait_for_completion( request ))) return HRESULT_FROM_WIN32( err );
|
||||||
if (!strcmpW( request->verb, headW ))
|
if (!strcmpW( request->verb, headW ))
|
||||||
@ -3784,7 +3784,7 @@ static HRESULT request_receive( struct winhttp_request *request )
|
|||||||
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE );
|
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE );
|
||||||
if (!WinHttpQueryDataAvailable( request->hrequest, &request->bytes_available ))
|
if (!WinHttpQueryDataAvailable( request->hrequest, &request->bytes_available ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((err = wait_for_completion( request ))) goto error;
|
if ((err = wait_for_completion( request ))) goto error;
|
||||||
@ -3805,7 +3805,7 @@ static HRESULT request_receive( struct winhttp_request *request )
|
|||||||
if (!WinHttpReadData( request->hrequest, request->buffer + request->offset,
|
if (!WinHttpReadData( request->hrequest, request->buffer + request->offset,
|
||||||
request->bytes_available, &request->bytes_read ))
|
request->bytes_available, &request->bytes_read ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((err = wait_for_completion( request ))) goto error;
|
if ((err = wait_for_completion( request ))) goto error;
|
||||||
@ -3824,19 +3824,19 @@ error:
|
|||||||
static DWORD request_set_parameters( struct winhttp_request *request )
|
static DWORD request_set_parameters( struct winhttp_request *request )
|
||||||
{
|
{
|
||||||
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_PROXY, &request->proxy,
|
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_PROXY, &request->proxy,
|
||||||
sizeof(request->proxy) )) return get_last_error();
|
sizeof(request->proxy) )) return GetLastError();
|
||||||
|
|
||||||
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_AUTOLOGON_POLICY, &request->logon_policy,
|
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_AUTOLOGON_POLICY, &request->logon_policy,
|
||||||
sizeof(request->logon_policy) )) return get_last_error();
|
sizeof(request->logon_policy) )) return GetLastError();
|
||||||
|
|
||||||
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_DISABLE_FEATURE, &request->disable_feature,
|
if (!WinHttpSetOption( request->hrequest, WINHTTP_OPTION_DISABLE_FEATURE, &request->disable_feature,
|
||||||
sizeof(request->disable_feature) )) return get_last_error();
|
sizeof(request->disable_feature) )) return GetLastError();
|
||||||
|
|
||||||
if (!WinHttpSetTimeouts( request->hrequest,
|
if (!WinHttpSetTimeouts( request->hrequest,
|
||||||
request->resolve_timeout,
|
request->resolve_timeout,
|
||||||
request->connect_timeout,
|
request->connect_timeout,
|
||||||
request->send_timeout,
|
request->send_timeout,
|
||||||
request->receive_timeout )) return get_last_error();
|
request->receive_timeout )) return GetLastError();
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3901,7 +3901,7 @@ static HRESULT request_send( struct winhttp_request *request )
|
|||||||
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT );
|
wait_set_status_callback( request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT );
|
||||||
if (!WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 ))
|
if (!WinHttpSendRequest( request->hrequest, NULL, 0, ptr, size, size, 0 ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((err = wait_for_completion( request ))) goto error;
|
if ((err = wait_for_completion( request ))) goto error;
|
||||||
@ -3955,7 +3955,7 @@ static DWORD request_wait( struct winhttp_request *request, DWORD timeout )
|
|||||||
break;
|
break;
|
||||||
case WAIT_FAILED:
|
case WAIT_FAILED:
|
||||||
default:
|
default:
|
||||||
ret = get_last_error();
|
ret = GetLastError();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
EnterCriticalSection( &request->cs );
|
EnterCriticalSection( &request->cs );
|
||||||
@ -3991,7 +3991,7 @@ static HRESULT WINAPI winhttp_request_Send(
|
|||||||
if (!(request->thread = CreateThread( NULL, 0, send_and_receive_proc, request, 0, NULL )))
|
if (!(request->thread = CreateThread( NULL, 0, send_and_receive_proc, request, 0, NULL )))
|
||||||
{
|
{
|
||||||
LeaveCriticalSection( &request->cs );
|
LeaveCriticalSection( &request->cs );
|
||||||
return HRESULT_FROM_WIN32( get_last_error() );
|
return HRESULT_FROM_WIN32( GetLastError() );
|
||||||
}
|
}
|
||||||
request->wait = CreateEventW( NULL, FALSE, FALSE, NULL );
|
request->wait = CreateEventW( NULL, FALSE, FALSE, NULL );
|
||||||
request->cancel = CreateEventW( NULL, FALSE, FALSE, NULL );
|
request->cancel = CreateEventW( NULL, FALSE, FALSE, NULL );
|
||||||
@ -4023,7 +4023,7 @@ static HRESULT WINAPI winhttp_request_get_Status(
|
|||||||
flags = WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER;
|
flags = WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, flags, NULL, &status_code, &len, &index ))
|
if (!WinHttpQueryHeaders( request->hrequest, flags, NULL, &status_code, &len, &index ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
*status = status_code;
|
*status = status_code;
|
||||||
@ -4052,7 +4052,7 @@ static HRESULT WINAPI winhttp_request_get_StatusText(
|
|||||||
}
|
}
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, NULL, &len, &index ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, NULL, &len, &index ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
if (err != ERROR_INSUFFICIENT_BUFFER) goto done;
|
||||||
}
|
}
|
||||||
if (!(*status = SysAllocStringLen( NULL, len / sizeof(WCHAR) )))
|
if (!(*status = SysAllocStringLen( NULL, len / sizeof(WCHAR) )))
|
||||||
@ -4064,7 +4064,7 @@ static HRESULT WINAPI winhttp_request_get_StatusText(
|
|||||||
err = ERROR_SUCCESS;
|
err = ERROR_SUCCESS;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, *status, &len, &index ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_STATUS_TEXT, NULL, *status, &len, &index ))
|
||||||
{
|
{
|
||||||
err = get_last_error();
|
err = GetLastError();
|
||||||
SysFreeString( *status );
|
SysFreeString( *status );
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
@ -4081,12 +4081,12 @@ static DWORD request_get_codepage( struct winhttp_request *request, UINT *codepa
|
|||||||
|
|
||||||
*codepage = CP_ACP;
|
*codepage = CP_ACP;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CONTENT_TYPE, NULL, NULL, &size, NULL ) &&
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CONTENT_TYPE, NULL, NULL, &size, NULL ) &&
|
||||||
get_last_error() == ERROR_INSUFFICIENT_BUFFER)
|
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||||
{
|
{
|
||||||
if (!(buffer = heap_alloc( size ))) return ERROR_OUTOFMEMORY;
|
if (!(buffer = heap_alloc( size ))) return ERROR_OUTOFMEMORY;
|
||||||
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CONTENT_TYPE, NULL, buffer, &size, NULL ))
|
if (!WinHttpQueryHeaders( request->hrequest, WINHTTP_QUERY_CONTENT_TYPE, NULL, buffer, &size, NULL ))
|
||||||
{
|
{
|
||||||
return get_last_error();
|
return GetLastError();
|
||||||
}
|
}
|
||||||
if ((p = strstrW( buffer, charsetW )))
|
if ((p = strstrW( buffer, charsetW )))
|
||||||
{
|
{
|
||||||
|
@ -52,18 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
|
|||||||
#define DEFAULT_RECEIVE_TIMEOUT 30000
|
#define DEFAULT_RECEIVE_TIMEOUT 30000
|
||||||
#define DEFAULT_RECEIVE_RESPONSE_TIMEOUT ~0u
|
#define DEFAULT_RECEIVE_RESPONSE_TIMEOUT ~0u
|
||||||
|
|
||||||
void set_last_error( DWORD error )
|
|
||||||
{
|
|
||||||
/* FIXME */
|
|
||||||
SetLastError( error );
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD get_last_error( void )
|
|
||||||
{
|
|
||||||
/* FIXME */
|
|
||||||
return GetLastError();
|
|
||||||
}
|
|
||||||
|
|
||||||
void send_callback( struct object_header *hdr, DWORD status, void *info, DWORD buflen )
|
void send_callback( struct object_header *hdr, DWORD status, void *info, DWORD buflen )
|
||||||
{
|
{
|
||||||
if (hdr->callback && (hdr->notify_mask & status))
|
if (hdr->callback && (hdr->notify_mask & status))
|
||||||
@ -117,7 +105,7 @@ static BOOL session_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(DWORD))
|
if (!buffer || *buflen < sizeof(DWORD))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(DWORD);
|
*buflen = sizeof(DWORD);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +140,7 @@ static BOOL session_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -176,7 +164,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
if (buflen != sizeof(policy))
|
if (buflen != sizeof(policy))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +177,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
{
|
{
|
||||||
if (buflen != sizeof(session->secure_protocols))
|
if (buflen != sizeof(session->secure_protocols))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
EnterCriticalSection( &session->cs );
|
EnterCriticalSection( &session->cs );
|
||||||
@ -199,7 +187,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case WINHTTP_OPTION_DISABLE_FEATURE:
|
case WINHTTP_OPTION_DISABLE_FEATURE:
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
case WINHTTP_OPTION_RESOLVE_TIMEOUT:
|
case WINHTTP_OPTION_RESOLVE_TIMEOUT:
|
||||||
@ -241,7 +229,7 @@ static BOOL session_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_WINHTTP_INVALID_OPTION );
|
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +301,7 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST
|
|||||||
end:
|
end:
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
TRACE("returning %p\n", handle);
|
TRACE("returning %p\n", handle);
|
||||||
if (handle) set_last_error( ERROR_SUCCESS );
|
if (handle) SetLastError( ERROR_SUCCESS );
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +334,7 @@ static BOOL connect_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(HINTERNET))
|
if (!buffer || *buflen < sizeof(HINTERNET))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(HINTERNET);
|
*buflen = sizeof(HINTERNET);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +369,7 @@ static BOOL connect_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -553,18 +541,18 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
|
|||||||
|
|
||||||
if (!server)
|
if (!server)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!(session = (struct session *)grab_object( hsession )))
|
if (!(session = (struct session *)grab_object( hsession )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (session->hdr.type != WINHTTP_HANDLE_TYPE_SESSION)
|
if (session->hdr.type != WINHTTP_HANDLE_TYPE_SESSION)
|
||||||
{
|
{
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!(connect = heap_alloc_zero( sizeof(struct connect) )))
|
if (!(connect = heap_alloc_zero( sizeof(struct connect) )))
|
||||||
@ -599,7 +587,7 @@ end:
|
|||||||
release_object( &connect->hdr );
|
release_object( &connect->hdr );
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
TRACE("returning %p\n", hconnect);
|
TRACE("returning %p\n", hconnect);
|
||||||
if (hconnect) set_last_error( ERROR_SUCCESS );
|
if (hconnect) SetLastError( ERROR_SUCCESS );
|
||||||
return hconnect;
|
return hconnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -718,7 +706,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(flags))
|
if (!buffer || *buflen < sizeof(flags))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(flags);
|
*buflen = sizeof(flags);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -746,7 +734,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(cert))
|
if (!buffer || *buflen < sizeof(cert))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(cert);
|
*buflen = sizeof(cert);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,7 +754,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(*ci))
|
if (!buffer || *buflen < sizeof(*ci))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(*ci);
|
*buflen = sizeof(*ci);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!cert) return FALSE;
|
if (!cert) return FALSE;
|
||||||
@ -792,7 +780,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(DWORD))
|
if (!buffer || *buflen < sizeof(DWORD))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(DWORD);
|
*buflen = sizeof(DWORD);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,12 +798,12 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
if (!buffer || *buflen < sizeof(*info))
|
if (!buffer || *buflen < sizeof(*info))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(*info);
|
*buflen = sizeof(*info);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!request->netconn)
|
if (!request->netconn)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_STATE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (getsockname( request->netconn->socket, &local, &len )) return FALSE;
|
if (getsockname( request->netconn->socket, &local, &len )) return FALSE;
|
||||||
@ -867,7 +855,7 @@ static BOOL request_query_option( struct object_header *hdr, DWORD option, void
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -881,7 +869,7 @@ static WCHAR *buffer_to_str( WCHAR *buffer, DWORD buflen )
|
|||||||
ret[buflen] = 0;
|
ret[buflen] = 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
set_last_error( ERROR_OUTOFMEMORY );
|
SetLastError( ERROR_OUTOFMEMORY );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -904,7 +892,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
if (buflen != sizeof(DWORD))
|
if (buflen != sizeof(DWORD))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -919,7 +907,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
if (buflen != sizeof(DWORD))
|
if (buflen != sizeof(DWORD))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -934,7 +922,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
if (buflen != sizeof(DWORD))
|
if (buflen != sizeof(DWORD))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -949,7 +937,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
if (buflen < sizeof(DWORD))
|
if (buflen < sizeof(DWORD))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
flags = *(DWORD *)buffer;
|
flags = *(DWORD *)buffer;
|
||||||
@ -959,7 +947,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
SECURITY_FLAG_IGNORE_UNKNOWN_CA |
|
SECURITY_FLAG_IGNORE_UNKNOWN_CA |
|
||||||
SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)))
|
SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE)))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
request->security_flags = flags;
|
request->security_flags = flags;
|
||||||
@ -1045,7 +1033,7 @@ static BOOL request_set_option( struct object_header *hdr, DWORD option, void *b
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_WINHTTP_INVALID_OPTION );
|
SetLastError( ERROR_WINHTTP_INVALID_OPTION );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1125,13 +1113,13 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
|
|||||||
|
|
||||||
if (!(connect = (struct connect *)grab_object( hconnect )))
|
if (!(connect = (struct connect *)grab_object( hconnect )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (connect->hdr.type != WINHTTP_HANDLE_TYPE_CONNECT)
|
if (connect->hdr.type != WINHTTP_HANDLE_TYPE_CONNECT)
|
||||||
{
|
{
|
||||||
release_object( &connect->hdr );
|
release_object( &connect->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!(request = heap_alloc_zero( sizeof(struct request) )))
|
if (!(request = heap_alloc_zero( sizeof(struct request) )))
|
||||||
@ -1177,7 +1165,7 @@ end:
|
|||||||
release_object( &request->hdr );
|
release_object( &request->hdr );
|
||||||
release_object( &connect->hdr );
|
release_object( &connect->hdr );
|
||||||
TRACE("returning %p\n", hrequest);
|
TRACE("returning %p\n", hrequest);
|
||||||
if (hrequest) set_last_error( ERROR_SUCCESS );
|
if (hrequest) SetLastError( ERROR_SUCCESS );
|
||||||
return hrequest;
|
return hrequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1192,12 +1180,12 @@ BOOL WINAPI WinHttpCloseHandle( HINTERNET handle )
|
|||||||
|
|
||||||
if (!(hdr = grab_object( handle )))
|
if (!(hdr = grab_object( handle )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
release_object( hdr );
|
release_object( hdr );
|
||||||
free_handle( handle );
|
free_handle( handle );
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1207,7 +1195,7 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
|
|||||||
|
|
||||||
if (!buflen)
|
if (!buflen)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1218,7 +1206,7 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
|
|||||||
if (!buffer || *buflen < sizeof(DWORD_PTR))
|
if (!buffer || *buflen < sizeof(DWORD_PTR))
|
||||||
{
|
{
|
||||||
*buflen = sizeof(DWORD_PTR);
|
*buflen = sizeof(DWORD_PTR);
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1231,7 +1219,7 @@ static BOOL query_option( struct object_header *hdr, DWORD option, void *buffer,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1251,14 +1239,14 @@ BOOL WINAPI WinHttpQueryOption( HINTERNET handle, DWORD option, LPVOID buffer, L
|
|||||||
|
|
||||||
if (!(hdr = grab_object( handle )))
|
if (!(hdr = grab_object( handle )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = query_option( hdr, option, buffer, buflen );
|
ret = query_option( hdr, option, buffer, buflen );
|
||||||
|
|
||||||
release_object( hdr );
|
release_object( hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1268,7 +1256,7 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D
|
|||||||
|
|
||||||
if (!buffer && buflen)
|
if (!buffer && buflen)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1278,7 +1266,7 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D
|
|||||||
{
|
{
|
||||||
if (buflen != sizeof(DWORD_PTR))
|
if (buflen != sizeof(DWORD_PTR))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1290,7 +1278,7 @@ static BOOL set_option( struct object_header *hdr, DWORD option, void *buffer, D
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FIXME("unimplemented option %u\n", option);
|
FIXME("unimplemented option %u\n", option);
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1310,14 +1298,14 @@ BOOL WINAPI WinHttpSetOption( HINTERNET handle, DWORD option, LPVOID buffer, DWO
|
|||||||
|
|
||||||
if (!(hdr = grab_object( handle )))
|
if (!(hdr = grab_object( handle )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = set_option( hdr, option, buffer, buflen );
|
ret = set_option( hdr, option, buffer, buflen );
|
||||||
|
|
||||||
release_object( hdr );
|
release_object( hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1421,7 +1409,7 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
|
|||||||
|
|
||||||
if (!flags || !url)
|
if (!flags || !url)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (get_system_proxy_autoconfig_url( system_url, sizeof(system_url) ))
|
if (get_system_proxy_autoconfig_url( system_url, sizeof(system_url) ))
|
||||||
@ -1430,7 +1418,7 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
|
|||||||
|
|
||||||
if (!(urlW = strdupAW( system_url ))) return FALSE;
|
if (!(urlW = strdupAW( system_url ))) return FALSE;
|
||||||
*url = urlW;
|
*url = urlW;
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (flags & WINHTTP_AUTO_DETECT_TYPE_DHCP)
|
if (flags & WINHTTP_AUTO_DETECT_TYPE_DHCP)
|
||||||
@ -1484,10 +1472,10 @@ BOOL WINAPI WinHttpDetectAutoProxyConfigUrl( DWORD flags, LPWSTR *url )
|
|||||||
}
|
}
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_AUTODETECTION_FAILED );
|
SetLastError( ERROR_WINHTTP_AUTODETECTION_FAILED );
|
||||||
*url = NULL;
|
*url = NULL;
|
||||||
}
|
}
|
||||||
else set_last_error( ERROR_SUCCESS );
|
else SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1646,7 +1634,7 @@ BOOL WINAPI WinHttpGetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
|
|||||||
info->lpszProxy = NULL;
|
info->lpszProxy = NULL;
|
||||||
info->lpszProxyBypass = NULL;
|
info->lpszProxyBypass = NULL;
|
||||||
}
|
}
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1666,7 +1654,7 @@ BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser( WINHTTP_CURRENT_USER_IE_PROXY
|
|||||||
|
|
||||||
if (!config)
|
if (!config)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
memset( config, 0, sizeof(*config) );
|
memset( config, 0, sizeof(*config) );
|
||||||
@ -1729,7 +1717,7 @@ done:
|
|||||||
GlobalFree( config->lpszProxyBypass );
|
GlobalFree( config->lpszProxyBypass );
|
||||||
config->lpszProxyBypass = NULL;
|
config->lpszProxyBypass = NULL;
|
||||||
}
|
}
|
||||||
else set_last_error( ERROR_SUCCESS );
|
else SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1823,7 +1811,7 @@ done:
|
|||||||
WinHttpCloseHandle( con );
|
WinHttpCloseHandle( con );
|
||||||
WinHttpCloseHandle( ses );
|
WinHttpCloseHandle( ses );
|
||||||
heap_free( hostname );
|
heap_free( hostname );
|
||||||
if (!buffer) set_last_error( ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT );
|
if (!buffer) SetLastError( ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT );
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1895,13 +1883,13 @@ BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTO
|
|||||||
|
|
||||||
if (!(session = (struct session *)grab_object( hsession )))
|
if (!(session = (struct session *)grab_object( hsession )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (session->hdr.type != WINHTTP_HANDLE_TYPE_SESSION)
|
if (session->hdr.type != WINHTTP_HANDLE_TYPE_SESSION)
|
||||||
{
|
{
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!url || !options || !info ||
|
if (!url || !options || !info ||
|
||||||
@ -1911,7 +1899,7 @@ BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTO
|
|||||||
(options->dwFlags & WINHTTP_AUTOPROXY_CONFIG_URL)))
|
(options->dwFlags & WINHTTP_AUTOPROXY_CONFIG_URL)))
|
||||||
{
|
{
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (options->dwFlags & WINHTTP_AUTOPROXY_AUTO_DETECT &&
|
if (options->dwFlags & WINHTTP_AUTOPROXY_AUTO_DETECT &&
|
||||||
@ -1930,7 +1918,7 @@ BOOL WINAPI WinHttpGetProxyForUrl( HINTERNET hsession, LPCWSTR url, WINHTTP_AUTO
|
|||||||
done:
|
done:
|
||||||
GlobalFree( detected_pac_url );
|
GlobalFree( detected_pac_url );
|
||||||
release_object( &session->hdr );
|
release_object( &session->hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1948,7 +1936,7 @@ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
|
|||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
switch (info->dwAccessType)
|
switch (info->dwAccessType)
|
||||||
@ -1958,14 +1946,14 @@ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
|
|||||||
case WINHTTP_ACCESS_TYPE_NAMED_PROXY:
|
case WINHTTP_ACCESS_TYPE_NAMED_PROXY:
|
||||||
if (!info->lpszProxy)
|
if (!info->lpszProxy)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* Only ASCII characters are allowed */
|
/* Only ASCII characters are allowed */
|
||||||
for (src = info->lpszProxy; *src; src++)
|
for (src = info->lpszProxy; *src; src++)
|
||||||
if (*src > 0x7f)
|
if (*src > 0x7f)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (info->lpszProxyBypass)
|
if (info->lpszProxyBypass)
|
||||||
@ -1973,13 +1961,13 @@ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
|
|||||||
for (src = info->lpszProxyBypass; *src; src++)
|
for (src = info->lpszProxyBypass; *src; src++)
|
||||||
if (*src > 0x7f)
|
if (*src > 0x7f)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2038,7 +2026,7 @@ BOOL WINAPI WinHttpSetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
|
|||||||
}
|
}
|
||||||
RegCloseKey( key );
|
RegCloseKey( key );
|
||||||
}
|
}
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2055,7 +2043,7 @@ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHT
|
|||||||
|
|
||||||
if (!(hdr = grab_object( handle )))
|
if (!(hdr = grab_object( handle )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return WINHTTP_INVALID_STATUS_CALLBACK;
|
return WINHTTP_INVALID_STATUS_CALLBACK;
|
||||||
}
|
}
|
||||||
ret = hdr->callback;
|
ret = hdr->callback;
|
||||||
@ -2063,7 +2051,7 @@ WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback( HINTERNET handle, WINHT
|
|||||||
hdr->notify_mask = flags;
|
hdr->notify_mask = flags;
|
||||||
|
|
||||||
release_object( hdr );
|
release_object( hdr );
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2079,13 +2067,13 @@ BOOL WINAPI WinHttpSetTimeouts( HINTERNET handle, int resolve, int connect, int
|
|||||||
|
|
||||||
if (resolve < -1 || connect < -1 || send < -1 || receive < -1)
|
if (resolve < -1 || connect < -1 || send < -1 || receive < -1)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(hdr = grab_object( handle )))
|
if (!(hdr = grab_object( handle )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_HANDLE );
|
SetLastError( ERROR_INVALID_HANDLE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2128,11 +2116,11 @@ BOOL WINAPI WinHttpSetTimeouts( HINTERNET handle, int resolve, int connect, int
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
release_object( hdr );
|
release_object( hdr );
|
||||||
if (ret) set_last_error( ERROR_SUCCESS );
|
if (ret) SetLastError( ERROR_SUCCESS );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2157,7 +2145,7 @@ BOOL WINAPI WinHttpTimeFromSystemTime( const SYSTEMTIME *time, LPWSTR string )
|
|||||||
|
|
||||||
if (!time || !string)
|
if (!time || !string)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2170,7 +2158,7 @@ BOOL WINAPI WinHttpTimeFromSystemTime( const SYSTEMTIME *time, LPWSTR string )
|
|||||||
time->wMinute,
|
time->wMinute,
|
||||||
time->wSecond );
|
time->wSecond );
|
||||||
|
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2187,7 +2175,7 @@ BOOL WINAPI WinHttpTimeToSystemTime( LPCWSTR string, SYSTEMTIME *time )
|
|||||||
|
|
||||||
if (!string || !time)
|
if (!string || !time)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2198,7 +2186,7 @@ BOOL WINAPI WinHttpTimeToSystemTime( LPCWSTR string, SYSTEMTIME *time )
|
|||||||
* a SYSTEMTIME structure.
|
* a SYSTEMTIME structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
|
|
||||||
while (*s && !isalphaW( *s )) s++;
|
while (*s && !isalphaW( *s )) s++;
|
||||||
if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
|
if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
|
||||||
|
@ -181,7 +181,7 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
|
|||||||
|
|
||||||
if (!url || !uc || uc->dwStructSize != sizeof(URL_COMPONENTS))
|
if (!url || !uc || uc->dwStructSize != sizeof(URL_COMPONENTS))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!len) len = strlenW( url );
|
if (!len) len = strlenW( url );
|
||||||
@ -190,7 +190,7 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
|
|||||||
{
|
{
|
||||||
if ((err = escape_url( url, &len, &url_escaped )))
|
if ((err = escape_url( url, &len, &url_escaped )))
|
||||||
{
|
{
|
||||||
set_last_error( err );
|
SetLastError( err );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
url = url_escaped;
|
url = url_escaped;
|
||||||
@ -199,14 +199,14 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
|
|||||||
{
|
{
|
||||||
if (!(url_decoded = decode_url( url, &len )))
|
if (!(url_decoded = decode_url( url, &len )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_OUTOFMEMORY );
|
SetLastError( ERROR_OUTOFMEMORY );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
url = url_decoded;
|
url = url_decoded;
|
||||||
}
|
}
|
||||||
if (!(p = strchrW( url, ':' )))
|
if (!(p = strchrW( url, ':' )))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_WINHTTP_UNRECOGNIZED_SCHEME );
|
SetLastError( ERROR_WINHTTP_UNRECOGNIZED_SCHEME );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (p - url == 4 && !strncmpiW( url, scheme_http, 4 )) scheme = INTERNET_SCHEME_HTTP;
|
if (p - url == 4 && !strncmpiW( url, scheme_http, 4 )) scheme = INTERNET_SCHEME_HTTP;
|
||||||
@ -307,7 +307,7 @@ exit:
|
|||||||
}
|
}
|
||||||
heap_free( url_decoded );
|
heap_free( url_decoded );
|
||||||
heap_free( url_escaped );
|
heap_free( url_escaped );
|
||||||
set_last_error( err );
|
SetLastError( err );
|
||||||
return !err;
|
return !err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ static BOOL get_url_length( URL_COMPONENTS *uc, DWORD flags, DWORD *len )
|
|||||||
{
|
{
|
||||||
if (uc->lpszPassword)
|
if (uc->lpszPassword)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW
|
|||||||
|
|
||||||
if (!uc || uc->dwStructSize != sizeof(URL_COMPONENTS) || !required)
|
if (!uc || uc->dwStructSize != sizeof(URL_COMPONENTS) || !required)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,12 +421,12 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW
|
|||||||
if (*required < len)
|
if (*required < len)
|
||||||
{
|
{
|
||||||
*required = len + 1;
|
*required = len + 1;
|
||||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!url)
|
if (!url)
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW
|
|||||||
{
|
{
|
||||||
if (!escape_string( uc->lpszUrlPath, len, url, &len_escaped ))
|
if (!escape_string( uc->lpszUrlPath, len, url, &len_escaped ))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
url += len_escaped;
|
url += len_escaped;
|
||||||
@ -515,7 +515,7 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW
|
|||||||
{
|
{
|
||||||
if (!escape_string( uc->lpszExtraInfo, len, url, &len_escaped ))
|
if (!escape_string( uc->lpszExtraInfo, len, url, &len_escaped ))
|
||||||
{
|
{
|
||||||
set_last_error( ERROR_INVALID_PARAMETER );
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
url += len_escaped;
|
url += len_escaped;
|
||||||
@ -527,6 +527,6 @@ BOOL WINAPI WinHttpCreateUrl( LPURL_COMPONENTS uc, DWORD flags, LPWSTR url, LPDW
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*url = 0;
|
*url = 0;
|
||||||
set_last_error( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -265,8 +265,6 @@ void release_object( struct object_header * ) DECLSPEC_HIDDEN;
|
|||||||
HINTERNET alloc_handle( struct object_header * ) DECLSPEC_HIDDEN;
|
HINTERNET alloc_handle( struct object_header * ) DECLSPEC_HIDDEN;
|
||||||
BOOL free_handle( HINTERNET ) DECLSPEC_HIDDEN;
|
BOOL free_handle( HINTERNET ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
void set_last_error( DWORD ) DECLSPEC_HIDDEN;
|
|
||||||
DWORD get_last_error( void ) DECLSPEC_HIDDEN;
|
|
||||||
void send_callback( struct object_header *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN;
|
void send_callback( struct object_header *, DWORD, LPVOID, DWORD ) DECLSPEC_HIDDEN;
|
||||||
void close_connection( struct request * ) DECLSPEC_HIDDEN;
|
void close_connection( struct request * ) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user