From 750a7fa2aed49b1ffeb7da5ab3381bb4d3d31feb Mon Sep 17 00:00:00 2001 From: Thamatip Chitpong Date: Tue, 16 Jan 2024 08:40:14 +0700 Subject: [PATCH] [MSAFD] Don't pass ConnectInfo, RecvInfo, SendInfo and RemoteAddress to APC function They are not used by the APC function. --- dll/win32/msafd/misc/dllmain.c | 3 --- dll/win32/msafd/misc/sndrcv.c | 12 ------------ dll/win32/msafd/msafd.h | 4 ---- 3 files changed, 19 deletions(-) diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c index 3396f8acad87b..82597bc0b059c 100644 --- a/dll/win32/msafd/misc/dllmain.c +++ b/dll/win32/msafd/misc/dllmain.c @@ -1833,8 +1833,6 @@ AfdConnectAPC(PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved) TRACE("AfdConnectAPC %p %lx %lx\n", ApcContext, IoStatusBlock->Status, IoStatusBlock->Information); - if (Context->lpConnectInfo) - HeapFree(GlobalHeap, 0, Context->lpConnectInfo); if (!Context->lpSocket) { HeapFree(GlobalHeap, 0, ApcContext); @@ -2030,7 +2028,6 @@ WSPConnect(SOCKET Handle, ERR("Not enough memory for APC Context\n"); return MsafdReturnWithErrno(STATUS_INSUFFICIENT_RESOURCES, lpErrno, 0, NULL); } - APCContext->lpConnectInfo = ConnectInfo; APCContext->lpSocket = Socket; IOSB = &APCContext->IoStatusBlock; } diff --git a/dll/win32/msafd/misc/sndrcv.c b/dll/win32/msafd/misc/sndrcv.c index 0088193b233b9..d37994fa5f0e1 100644 --- a/dll/win32/msafd/misc/sndrcv.c +++ b/dll/win32/msafd/misc/sndrcv.c @@ -153,8 +153,6 @@ AfdRecvAPC(PVOID ApcContext, if (Context->lpCompletionRoutine) Context->lpCompletionRoutine(IoStatusBlock->Status, IoStatusBlock->Information, Context->lpOverlapped, 0); - if (Context->lpRecvInfo) - HeapFree(GlobalHeap, 0, Context->lpRecvInfo); HeapFree(GlobalHeap, 0, ApcContext); } @@ -174,10 +172,6 @@ AfdSendAPC(PVOID ApcContext, } if (Context->lpCompletionRoutine) Context->lpCompletionRoutine(IoStatusBlock->Status, IoStatusBlock->Information, Context->lpOverlapped, 0); - if (Context->lpSendInfo) - HeapFree(GlobalHeap, 0, Context->lpSendInfo); - if (Context->lpRemoteAddress) - HeapFree(GlobalHeap, 0, Context->lpRemoteAddress); HeapFree(GlobalHeap, 0, ApcContext); } @@ -299,7 +293,6 @@ WSPRecv(SOCKET Handle, APCContext->lpCompletionRoutine = lpCompletionRoutine; APCContext->lpOverlapped = lpOverlapped; APCContext->lpSocket = Socket; - APCContext->lpRecvInfo = &RecvInfo; RecvInfo.AfdFlags |= AFD_SKIP_FIO; } @@ -536,7 +529,6 @@ WSPRecvFrom(SOCKET Handle, APCContext->lpCompletionRoutine = lpCompletionRoutine; APCContext->lpOverlapped = lpOverlapped; APCContext->lpSocket = Socket; - APCContext->lpRecvInfo = &RecvInfo; RecvInfo.AfdFlags |= AFD_SKIP_FIO; } @@ -718,8 +710,6 @@ WSPSend(SOCKET Handle, APCContext->lpCompletionRoutine = lpCompletionRoutine; APCContext->lpOverlapped = lpOverlapped; APCContext->lpSocket = Socket; - APCContext->lpSendInfo = &SendInfo; - APCContext->lpRemoteAddress = NULL; SendInfo.AfdFlags |= AFD_SKIP_FIO; } @@ -921,8 +911,6 @@ WSPSendTo(SOCKET Handle, APCContext->lpCompletionRoutine = lpCompletionRoutine; APCContext->lpOverlapped = lpOverlapped; APCContext->lpSocket = Socket; - APCContext->lpSendInfo = &SendInfo; - APCContext->lpRemoteAddress = RemoteAddress; SendInfo.AfdFlags |= AFD_SKIP_FIO; } diff --git a/dll/win32/msafd/msafd.h b/dll/win32/msafd/msafd.h index cef4f5b340669..dc650d9825cda 100644 --- a/dll/win32/msafd/msafd.h +++ b/dll/win32/msafd/msafd.h @@ -145,8 +145,6 @@ typedef struct _AFDSENDAPCCONTEXT LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine; PSOCKET_INFORMATION lpSocket; IO_STATUS_BLOCK IoStatusBlock; - LPVOID lpSendInfo; - PTRANSPORT_ADDRESS lpRemoteAddress; } AFDSENDAPCCONTEXT, *PAFDSENDAPCCONTEXT; typedef struct _AFDRECVAPCCONTEXT @@ -155,12 +153,10 @@ typedef struct _AFDRECVAPCCONTEXT LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine; PSOCKET_INFORMATION lpSocket; IO_STATUS_BLOCK IoStatusBlock; - LPVOID lpRecvInfo; } AFDRECVAPCCONTEXT, *PAFDRECVAPCCONTEXT; typedef struct _AFDCONNECTAPCCONTEXT { - PAFD_CONNECT_INFO lpConnectInfo; PSOCKET_INFORMATION lpSocket; IO_STATUS_BLOCK IoStatusBlock; } AFDCONNECTAPCCONTEXT, *PAFDCONNECTAPCCONTEXT;