diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index b96556e4e69..d5a4976b57d 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3213,6 +3213,10 @@ static VOID INTERNET_ExecuteWork(void) switch (workRequest.asyncall) { + case CALLASYNCPROC: + workRequest.asyncproc(&workRequest); + break; + case FTPPUTFILEW: { struct WORKREQ_FTPPUTFILEW *req = &workRequest.u.FtpPutFileW; @@ -3392,21 +3396,6 @@ static VOID INTERNET_ExecuteWork(void) } break; - case SENDCALLBACK: - { - struct WORKREQ_SENDCALLBACK *req = &workRequest.u.SendCallback; - - TRACE("SENDCALLBACK %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); - } - break; - case INTERNETOPENURLW: { struct WORKREQ_INTERNETOPENURLW *req = &workRequest.u.InternetOpenUrlW; diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 235e32076f6..6868b78e950 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -249,6 +249,7 @@ typedef struct typedef enum { + CALLASYNCPROC, FTPPUTFILEW, FTPSETCURRENTDIRECTORYW, FTPCREATEDIRECTORYW, @@ -262,7 +263,6 @@ typedef enum FTPFINDNEXTW, HTTPSENDREQUESTW, HTTPOPENREQUESTW, - SENDCALLBACK, INTERNETOPENURLW, INTERNETREADFILEEXA, } ASYNC_FUNC; @@ -385,6 +385,7 @@ struct WORKREQ_INTERNETREADFILEEXA typedef struct WORKREQ { ASYNC_FUNC asyncall; + void (*asyncproc)(struct WORKREQ*); WININETHANDLEHEADER *hdr; union { diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c index 4f969f82c4c..02693651988 100644 --- a/dlls/wininet/utility.c +++ b/dlls/wininet/utility.c @@ -254,7 +254,19 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, HeapFree(GetProcessHeap(), 0, lpvNewInfo); } +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 dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, @@ -281,7 +293,8 @@ VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext, memcpy(lpvStatusInfo_copy, lpvStatusInfo, dwStatusInfoLength); } - workRequest.asyncall = SENDCALLBACK; + workRequest.asyncall = CALLASYNCPROC; + workRequest.asyncproc = SendAsyncCallbackProc; workRequest.hdr = WININET_AddRef( hdr ); req = &workRequest.u.SendCallback; req->dwContext = dwContext;