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);
236 protocol->flags &= ~FLAG_REQUEST_COMPLETE;
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");
397 protocol->flags &= ~FLAG_REQUEST_COMPLETE;
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);
466 protocol->flags &= ~FLAG_REQUEST_COMPLETE;
473 hres = INET_E_DATA_NOT_AVAILABLE;
525 return INET_E_RESULT_DISPATCHED;
542 IStream_Release(
protocol->post_stream);
static WCHAR * heap_strdupAtoW(const char *str)
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
static HRESULT report_result(MimeHtmlProtocol *protocol, HRESULT result)
static void request_complete(Protocol *protocol, INTERNET_ASYNC_RESULT *ar)
HRESULT protocol_syncbinding(Protocol *protocol)
static void report_data(Protocol *protocol)
static void all_data_read(Protocol *protocol)
HRESULT protocol_lock_request(Protocol *protocol)
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
static HINTERNET create_internet_session(IInternetBindInfo *bind_info)
HINTERNET get_internet_session(IInternetBindInfo *bind_info)
static HRESULT write_post_stream(Protocol *protocol)
void update_user_agent(WCHAR *user_agent)
void protocol_close_connection(Protocol *protocol)
static void WINAPI internet_status_callback(HINTERNET internet, DWORD_PTR context, DWORD internet_status, LPVOID status_info, DWORD status_info_len)
static HRESULT start_downloading(Protocol *protocol)
HRESULT protocol_unlock_request(Protocol *protocol)
static HINTERNET internet_session
HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
static HRESULT report_progress(Protocol *protocol, ULONG status_code, LPCWSTR status_text)
LPWSTR get_useragent(void)
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten)
BOOL WINAPI InternetLockRequestFile(HINTERNET hInternet, HANDLE *lphLockReqHandle)
BOOL WINAPI InternetUnlockRequestFile(HANDLE hLockHandle)
BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnIntCB)
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
BOOL WINAPI InternetQueryDataAvailable(HINTERNET hFile, LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD_PTR dwContext)
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
VOID WINAPI CoTaskMemFree(LPVOID ptr)
#define InterlockedCompareExchangePointer
static IInternetProtocolSink protocol_sink
static IInternetBindInfo bind_info
#define protocol_start(p, u, e)
static const WCHAR * cache_file
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
#define FLAG_REQUEST_COMPLETE
#define FLAG_FIRST_DATA_REPORTED
#define FLAG_LAST_DATA_REPORTED
#define FLAG_FIRST_CONTINUE_COMPLETE
#define FLAG_RESULT_REPORTED
#define FLAG_ALL_DATA_READ
DWORD WINAPI GetLastError(void)
#define INTERNET_FLAG_NO_AUTO_REDIRECT
#define INTERNET_FLAG_ASYNC
#define INTERNET_FLAG_KEEP_CONNECTION
#define INTERNET_OPTION_USER_AGENT
#define INTERNET_STATUS_SENDING_REQUEST
#define INTERNET_OPTION_DATAFILE_NAME
#define INTERNET_STATUS_HANDLE_CLOSING
#define INTERNET_FLAG_NEED_FILE
#define INTERNET_STATUS_RESOLVING_NAME
#define INTERNET_FLAG_NO_CACHE_WRITE
#define INTERNET_STATUS_REDIRECT
#define INTERNET_STATUS_REQUEST_COMPLETE
#define INTERNET_STATUS_CONNECTING_TO_SERVER
#define INTERNET_STATUS_HANDLE_CREATED