static void SendAsyncCallbackProc(task_header_t *hdr) { send_callback_task_t *task = (send_callback_task_t*)hdr; TRACE("%p\n", task->hdr.hdr); INTERNET_SendCallback(task->hdr.hdr, task->context, task->status, task->status_info, task->status_info_len); /* And frees the copy of the status info */ heap_free(task->status_info); }
static void SendAsyncCallbackProc(WORKREQUEST *workRequest) { struct WORKREQ_SENDCALLBACK const *req = &workRequest->u.SendCallback; TRACE("%p\n", workRequest->hdr); INTERNET_SendCallback(workRequest->hdr, req->dwContext, req->dwInternetStatus, req->lpvStatusInfo, req->dwStatusInfoLength); /* And frees the copy of the status info */ HeapFree(GetProcessHeap(), 0, req->lpvStatusInfo); }
VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength) { TRACE("(%p, %08lx, %d (%s), %p, %d): %sasync call with callback %p\n", hdr, dwContext, dwInternetStatus, get_callback_name(dwInternetStatus), lpvStatusInfo, dwStatusInfoLength, hdr->dwFlags & INTERNET_FLAG_ASYNC ? "" : "non ", hdr->lpfnStatusCB); if (!(hdr->lpfnStatusCB)) return; if (hdr->dwFlags & INTERNET_FLAG_ASYNC) { WORKREQUEST workRequest; struct WORKREQ_SENDCALLBACK *req; void *lpvStatusInfo_copy = lpvStatusInfo; if (lpvStatusInfo) { lpvStatusInfo_copy = HeapAlloc(GetProcessHeap(), 0, dwStatusInfoLength); memcpy(lpvStatusInfo_copy, lpvStatusInfo, dwStatusInfoLength); } workRequest.asyncproc = SendAsyncCallbackProc; workRequest.hdr = WININET_AddRef( hdr ); req = &workRequest.u.SendCallback; req->dwContext = dwContext; req->dwInternetStatus = dwInternetStatus; req->lpvStatusInfo = lpvStatusInfo_copy; req->dwStatusInfoLength = dwStatusInfoLength; INTERNET_AsyncCall(&workRequest); } else INTERNET_SendCallback(hdr, dwContext, dwInternetStatus, lpvStatusInfo, dwStatusInfoLength); }
void SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength) { TRACE("(%p, %08lx, %d (%s), %p, %d): %sasync call with callback %p\n", hdr, dwContext, dwInternetStatus, get_callback_name(dwInternetStatus), lpvStatusInfo, dwStatusInfoLength, hdr->dwFlags & INTERNET_FLAG_ASYNC ? "" : "non ", hdr->lpfnStatusCB); if (!(hdr->lpfnStatusCB)) return; if (hdr->dwFlags & INTERNET_FLAG_ASYNC) { send_callback_task_t *task; void *lpvStatusInfo_copy = lpvStatusInfo; if (lpvStatusInfo) { lpvStatusInfo_copy = heap_alloc(dwStatusInfoLength); memcpy(lpvStatusInfo_copy, lpvStatusInfo, dwStatusInfoLength); } task = alloc_async_task(hdr, SendAsyncCallbackProc, sizeof(*task)); task->context = dwContext; task->status = dwInternetStatus; task->status_info = lpvStatusInfo_copy; task->status_info_len = dwStatusInfoLength; INTERNET_AsyncCall(&task->hdr); } else INTERNET_SendCallback(hdr, dwContext, dwInternetStatus, lpvStatusInfo, dwStatusInfoLength); }