Fix 'SendAsyncCallback' when it's really asynchronous.

oldstable
Lionel Ulmer 2005-01-04 20:38:53 +00:00 committed by Alexandre Julliard
parent cc89feb9c4
commit 58b1e2a4e9
2 changed files with 14 additions and 4 deletions

View File

@ -2733,8 +2733,11 @@ static VOID INTERNET_ExecuteWork(void)
TRACE("SENDCALLBACK %p\n", workRequest.hdr);
SendSyncCallback(workRequest.hdr,
req->dwContext, req->dwInternetStatus, req->lpvStatusInfo,
req->dwStatusInfoLength);
req->dwContext, req->dwInternetStatus, req->lpvStatusInfo,
req->dwStatusInfoLength);
/* And frees the copy of the status info */
HeapFree(GetProcessHeap(), 0, req->lpvStatusInfo);
}
break;

View File

@ -276,13 +276,20 @@ VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext,
{
WORKREQUEST workRequest;
struct WORKREQ_SENDCALLBACK *req;
void *lpvStatusInfo_copy = lpvStatusInfo;
if (lpvStatusInfo)
{
lpvStatusInfo_copy = HeapAlloc(GetProcessHeap(), 0, dwStatusInfoLength);
memcpy(lpvStatusInfo_copy, lpvStatusInfo, dwStatusInfoLength);
}
workRequest.asyncall = SENDCALLBACK;
workRequest.hdr = WININET_AddRef( hdr );
req = &workRequest.u.SendCallback;
req->dwContext = dwContext;
req->dwInternetStatus = dwInternetStatus;
req->lpvStatusInfo = lpvStatusInfo;
req->lpvStatusInfo = lpvStatusInfo_copy;
req->dwStatusInfoLength = dwStatusInfoLength;
INTERNET_AsyncCall(&workRequest);