技术贴--网络(WIN)-3一些数据结构
发送的OVERLAPPED结构
00037 typedef struct _SOCK_OVERLAPPED_SEND_CONTEXT {
00038
00039 //
00040 // Links onto the queue list.
00041 //
00042
00043 LIST_ENTRY QueueListEntry;
00044
00045 //
00046 // Captured WSABUF array.
00047 //
00048
00049 LPWSABUF CapturedBufferArray;
00050 DWORD CapturedBufferCount;
00051
00052 //
00053 // Send flags.
00054 //
00055
00056 DWORD Flags;
00057
00058 //
00059 // send[to] flag.
00060 //
00061
00062 BOOL SendTo;
00063
00064 //
00065 // Address info (for WSPSendTo() only).
00066 //
00067
00068 LPSOCKADDR SocketAddress;
00069 INT SocketAddressLength;
00070
00071 //
00072 // Overlapped completion info.
00073 //
00074
00075 LPWSAOVERLAPPED Overlapped;
00076 LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
00077 WSATHREADID ThreadId;
00078
00079 } SOCK_OVERLAPPED_SEND_CONTEXT, *PSOCK_OVERLAPPED_SEND_CONTEXT;
recv的overlapped数据结构
00037 typedef struct _SOCK_OVERLAPPED_RECEIVE_CONTEXT {
00038
00039 //
00040 // Links onto the queue list.
00041 //
00042
00043 LIST_ENTRY QueueListEntry;
00044
00045 //
00046 // Captured WSABUF array.
00047 //
00048
00049 LPWSABUF CapturedBufferArray;
00050 DWORD CapturedBufferCount;
00051
00052 //
00053 // Receive flags.
00054 //
00055
00056 DWORD Flags;
00057
00058 //
00059 // recv[from] flag.
00060 //
00061
00062 BOOL RecvFrom;
00063
00064 //
00065 // Address info (for WSPRecvFrom() only).
00066 //
00067
00068 LPSOCKADDR SocketAddress;
00069 LPINT SocketAddressLength;
00070
00071 //
00072 // Overlapped completion info.
00073 //
00074
00075 LPWSAOVERLAPPED Overlapped;
00076 LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine;
00077 WSATHREADID ThreadId;
00078
00079 } SOCK_OVERLAPPED_RECEIVE_CONTEXT, *PSOCK_OVERLAPPED_RECEIVE_CONTEXT;
完成端口请求的包结构
00374 typedef enum _COMPLETION_PACKET_TYPE {
00375 IopCompletionPacketIrp,
00376 IopCompletionPacketMini,
00377 IopCompletionPacketQuota
00378 } COMPLETION_PACKET_TYPE, *PCOMPLETION_PACKET_TYPE;
00379
00380 //
00381 // Define the type for completion packets inserted onto completion ports when
00382 // there is no full I/O request packet that was used to perform the I/O
00383 // operation. This occurs when the fast I/O path is used, and when the user
00384 // directly inserts a completion message.
00385 //
00386 typedef struct _IOP_MINI_COMPLETION_PACKET {
00387
00388 //
00389 // The following unnamed structure must be exactly identical
00390 // to the unnamed structure used in the IRP overlay section used
00391 // for completion queue entries.
00392 //
00393
00394 struct {
00395
00396 //
00397 // List entry - used to queue the packet to completion queue, among
00398 // others.
00399 //
00400
00401 LIST_ENTRY ListEntry;
00402
00403 union {
00404
00405 //
00406 // Current stack location - contains a pointer to the current
00407 // IO_STACK_LOCATION structure in the IRP stack. This field
00408 // should never be directly accessed by drivers. They should
00409 // use the standard functions.
00410 //
00411
00412 struct _IO_STACK_LOCATION *CurrentStackLocation;
00413
00414 //
00415 // Minipacket type.
00416 //
00417
00418 ULONG PacketType;
00419 };
00420 };
00421
00422 PVOID KeyContext;
00423 PVOID ApcContext;
00424 NTSTATUS IoStatus;
00425 ULONG_PTR IoStatusInformation;
00426 } IOP_MINI_COMPLETION_PACKET, *PIOP_MINI_COMPLETION_PACKET;