Commit e30037f0 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Use proc instead of enum in SENDCALLBACK request.

parent bf250285
......@@ -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;
......
......@@ -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 {
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment