28 return IInternetProtocolSink_ReportProgress(
protocol->protocol_sink,
status_code, status_text);
49 bscf = BSCF_INTERMEDIATEDATANOTIFICATION;
52 bscf = BSCF_FIRSTDATANOTIFICATION;
57 bscf |= BSCF_LASTDATANOTIFICATION;
60 IInternetProtocolSink_ReportData(
protocol->protocol_sink, bscf,
79 if(
hres == INET_E_REDIRECT_FAILED)
86 if(
protocol->bindf & BINDF_NEEDFILE) {
93 FIXME(
"Could not get cache file\n");
119 IInternetProtocolSink_ReportData(
protocol->protocol_sink, BSCF_LASTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE,
132 data.dwState = 0xf1000000;
152 if (
protocol->bindf & BINDF_FROMURLMON)
153 IInternetProtocolSink_Switch(
protocol->protocol_sink, &
data);
163 switch(internet_status) {
172 TRACE(
"%p INTERNET_STATUS_CONNECTING_TO_SERVER %s\n",
protocol, (
const char*)status_info);
199 IInternetProtocol_AddRef(
protocol->protocol);
208 IInternetProtocolSink_Release(
protocol->protocol_sink);
220 IInternetProtocol_Release(
protocol->protocol);
224 WARN(
"Unhandled Internet status callback %d\n", internet_status);
252 IStream_Release(
protocol->post_stream);
325 protocol->bind_info.cbSize =
sizeof(BINDINFO);
328 WARN(
"GetBindInfo failed: %08x\n",
hres);
332 if(!(
protocol->bindf & BINDF_FROMURLMON))
339 if(
protocol->bindf & BINDF_NOWRITECACHE)
341 if(
protocol->bindf & BINDF_NEEDFILE)
343 if(
protocol->bind_info.dwOptions & BINDINFO_OPTIONS_DISABLEAUTOREDIRECTS)
363 WARN(
"Expected request to be non-NULL\n");
368 WARN(
"Expected IInternetProtocolSink pointer to be non-NULL\n");
439 while(read < size && protocol->available_bytes) {
446 hres = INET_E_DOWNLOAD_FAILURE;
460 TRACE(
"current_position %d, available_bytes %d\n",
protocol->current_position,
protocol->available_bytes);
473 hres = INET_E_DATA_NOT_AVAILABLE;
525 return INET_E_RESULT_DISPATCHED;
542 IStream_Release(
protocol->post_stream);
#define FLAG_ALL_DATA_READ
HRESULT protocol_unlock_request(Protocol *protocol)
#define INTERNET_FLAG_NO_CACHE_WRITE
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define INTERNET_FLAG_NEED_FILE
#define INTERNET_STATUS_HANDLE_CLOSING
static void report_data(Protocol *protocol)
LPWSTR get_useragent(void)
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
HRESULT protocol_read(Protocol *protocol, void *buf, ULONG size, ULONG *read_ret)
#define INTERNET_STATUS_CONNECTING_TO_SERVER
HRESULT protocol_syncbinding(Protocol *protocol)
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
DWORD WINAPI GetLastError(VOID)
static HINTERNET internet_session
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
static void request_complete(Protocol *protocol, INTERNET_ASYNC_RESULT *ar)
static HRESULT write_post_stream(Protocol *protocol)
void protocol_close_connection(Protocol *protocol)
static IInternetProtocolSink protocol_sink
GLenum GLuint GLenum GLsizei const GLchar * buf
static struct _test_info info[]
#define InterlockedCompareExchangePointer
static const WCHAR * cache_file
BOOL WINAPI InternetQueryDataAvailable(HINTERNET hFile, LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD_PTR dwContext)
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
static WCHAR * heap_strdupAtoW(const char *str)
BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten)
static IInternetBindInfo bind_info
static HINTERNET create_internet_session(IInternetBindInfo *bind_info)
BOOL WINAPI InternetLockRequestFile(HINTERNET hInternet, HANDLE *lphLockReqHandle)
void update_user_agent(WCHAR *user_agent)
INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnIntCB)
#define FLAG_FIRST_DATA_REPORTED
#define INTERNET_FLAG_NO_AUTO_REDIRECT
static void WINAPI internet_status_callback(HINTERNET internet, DWORD_PTR context, DWORD internet_status, LPVOID status_info, DWORD status_info_len)
static HRESULT report_result(Protocol *protocol, HRESULT hres)
#define INTERNET_STATUS_REDIRECT
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define INTERNET_FLAG_ASYNC
HRESULT protocol_lock_request(Protocol *protocol)
#define INTERNET_STATUS_SENDING_REQUEST
#define FLAG_RESULT_REPORTED
HRESULT protocol_start(Protocol *protocol, IInternetProtocol *prot, IUri *uri, IInternetProtocolSink *protocol_sink, IInternetBindInfo *bind_info)
#define INTERNET_STATUS_RESOLVING_NAME
#define FLAG_FIRST_CONTINUE_COMPLETE
HINTERNET get_internet_session(IInternetBindInfo *bind_info)
BOOL WINAPI InternetUnlockRequestFile(HANDLE hLockHandle)
#define INTERNET_OPTION_USER_AGENT
#define INTERNET_STATUS_REQUEST_COMPLETE
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
static HRESULT start_downloading(Protocol *protocol)
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
#define FLAG_LAST_DATA_REPORTED
#define INTERNET_STATUS_HANDLE_CREATED
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
#define INTERNET_OPTION_DATAFILE_NAME
#define FLAG_REQUEST_COMPLETE
static void all_data_read(Protocol *protocol)
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
WINE_DEFAULT_DEBUG_CHANNEL(inetcomm)
static BOOL heap_free(void *mem)
static HRESULT report_progress(Protocol *protocol, ULONG status_code, LPCWSTR status_text)
#define INTERNET_FLAG_KEEP_CONNECTION