Skip to content

Commit

Permalink
[MSAFD] Don't pass ConnectInfo, RecvInfo, SendInfo and RemoteAddress …
Browse files Browse the repository at this point in the history
…to APC function

They are not used by the APC function.
  • Loading branch information
TAN-Gaming committed Jan 16, 2024
1 parent ae015d7 commit 512d52f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
3 changes: 0 additions & 3 deletions dll/win32/msafd/misc/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
12 changes: 0 additions & 12 deletions dll/win32/msafd/misc/sndrcv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -299,7 +293,6 @@ WSPRecv(SOCKET Handle,
APCContext->lpCompletionRoutine = lpCompletionRoutine;
APCContext->lpOverlapped = lpOverlapped;
APCContext->lpSocket = Socket;
APCContext->lpRecvInfo = &RecvInfo;
RecvInfo.AfdFlags |= AFD_SKIP_FIO;
}

Expand Down Expand Up @@ -536,7 +529,6 @@ WSPRecvFrom(SOCKET Handle,
APCContext->lpCompletionRoutine = lpCompletionRoutine;
APCContext->lpOverlapped = lpOverlapped;
APCContext->lpSocket = Socket;
APCContext->lpRecvInfo = &RecvInfo;
RecvInfo.AfdFlags |= AFD_SKIP_FIO;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 0 additions & 4 deletions dll/win32/msafd/msafd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 512d52f

Please sign in to comment.