Commit 6619e54d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Implement WinHttpWriteData.

parent 728bf77c
......@@ -105,18 +105,6 @@ BOOL WINAPI WinHttpSetOption (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuff
return FALSE;
}
/***********************************************************************
* WinHttpWriteData (winhttp.@)
*/
BOOL WINAPI WinHttpWriteData (HINTERNET hRequest, LPCVOID lpBuffer,
DWORD dwNumberOfBytesToWrite, LPDWORD lpdwNumberOfBytesWritten)
{
FIXME("(%p, %d, %p): stub\n", lpBuffer, dwNumberOfBytesToWrite, lpdwNumberOfBytesWritten);
SetLastError(ERROR_NOT_SUPPORTED);
return FALSE;
}
BOOL WINAPI InternetCrackUrlW( LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW );
BOOL WINAPI InternetCreateUrlW( LPURL_COMPONENTS, DWORD, LPWSTR, LPDWORD );
......
......@@ -1109,3 +1109,31 @@ BOOL WINAPI WinHttpReadData( HINTERNET hrequest, LPVOID buffer, DWORD to_read, L
release_object( &request->hdr );
return ret;
}
/***********************************************************************
* WinHttpWriteData (winhttp.@)
*/
BOOL WINAPI WinHttpWriteData( HINTERNET hrequest, LPCVOID buffer, DWORD to_write, LPDWORD written )
{
BOOL ret;
request_t *request;
TRACE("%p, %p, %d, %p\n", hrequest, buffer, to_write, written);
if (!(request = (request_t *)grab_object( hrequest )))
{
set_last_error( ERROR_INVALID_HANDLE );
return FALSE;
}
if (request->hdr.type != WINHTTP_HANDLE_TYPE_REQUEST)
{
release_object( &request->hdr );
set_last_error( ERROR_WINHTTP_INCORRECT_HANDLE_TYPE );
return FALSE;
}
ret = netconn_send( &request->netconn, buffer, to_write, 0, (int *)written );
release_object( &request->hdr );
return ret;
}
......@@ -117,8 +117,8 @@ static void test_SendRequest (void)
{
bytes_rw = -1;
ret = WinHttpWriteData(request, &post_data[i], 1, &bytes_rw);
todo_wine ok(ret == TRUE, "WinHttpWriteData failed: %u.\n", GetLastError());
todo_wine ok(bytes_rw == 1, "WinHttpWriteData failed, wrote %u bytes instead of 1 byte.\n", bytes_rw);
ok(ret == TRUE, "WinHttpWriteData failed: %u.\n", GetLastError());
ok(bytes_rw == 1, "WinHttpWriteData failed, wrote %u bytes instead of 1 byte.\n", bytes_rw);
}
ret = WinHttpReceiveResponse(request, NULL);
......
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