Is it possible for GetLastError() to return ERROR_WINHTTP_RESEND_REQUEST after calling WinHttpSendRequest?
Documentation for WinHttpSendRequest:
ERROR_WINHTTP_RESEND_REQUEST
The application must call WinHttpSendRequest again due to a redirect or authentication challenge. Windows Server 2003 with SP1, Windows XP with SP2 and Windows 2000: This error is not supported.
But samples from MSDN (Authentication in WinHTTP) checks for this value after WinHttpReceiveResponse.