ipsec驱动源代码

本文档详细介绍了IPSec驱动的初始化函数`MPInitialize`,包括如何获取和设置适配器上下文、选择媒体类型、设置驱动特性、分配映射寄存器和共享内存,以及初始化定时器和数据结构。此外,还涉及了PNP事件处理函数,如`PtPNPHandler`,用于处理电源管理和配置更改事件。
摘要由CSDN通过智能技术生成

//-----------------------------------------------------------------------------

免费第一个miniport.c

#include "precomp.h"
#include "pgpNetKernel.h"

#include "stdio.h"

#pragma hdrstop

BOOLEAN VpnAdapterCreated = FALSE;
extern UINT MediumArraySize;

NDIS_STATUS
MPInitialize(
OUT PNDIS_STATUS OpenErrorStatus,
OUT PUINT SelectedMediumIndex,
IN PNDIS_MEDIUM MediumArray,
IN UINT MediumArraySize,
IN NDIS_HANDLE MiniportAdapterHandle,
IN NDIS_HANDLE WrapperConfigurationContext
)
/*++

Routine Description:

This is the initialize handler which gets called as a result of
the BindAdapter handler calling NdisIMInitializeDeviceInstanceEx.
The context parameter which we pass there is the adapter structure
which we retrieve here.

Arguments:

OpenErrorStatus Not used by us.
SelectedMediumIndex Place-holder for what media we are using
MediumArray Array of ndis media passed down to us to pick from
MediumArraySize Size of the array
MiniportAdapterHandle The handle NDIS uses to refer to us
WrapperConfigurationContext For use by NdisOpenConfiguration

Return Value:

NDIS_STATUS_SUCCESS unless something goes wrong

--*/
{
UINT i;
PADAPT pAdapt;
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
NDIS_MEDIUM Medium;
//add
PBINDING_CONTEXT bindingContext;
//end

UNREFERENCED_PARAMETER(WrapperConfigurationContext);

do
{
//
// Start off by retrieving our adapter context and storing
// the Miniport handle in it.
//
pAdapt = NdisIMGetDeviceContext(MiniportAdapterHandle);
pAdapt->MiniportHandle = MiniportAdapterHandle;

DBGPRINT(("==> Miniport Initialize: Adapt %p/n", pAdapt));

//
// Usually we export the medium type of the adapter below as our
// virtual miniport's medium type. However if the adapter below us
// is a WAN device, then we claim to be of medium type 802.3.
//
Medium = pAdapt->media;

if (Medium == NdisMediumWan)
{
Medium = NdisMedium802_3;
}

for (i = 0; i < MediumArraySize; i++)
{
if (MediumArray[i] == Medium)
{
*SelectedMediumIndex = i;
break;
}
}

if (i == MediumArraySize)
{
Status = NDIS_STATUS_UNSUPPORTED_MEDIA;
break;
}


//
// Set the attributes now. NDIS_ATTRIBUTE_DESERIALIZE enables us
// to make up-calls to NDIS without having to call NdisIMSwitchToMiniport
// or NdisIMQueueCallBack. This also forces us to protect our data using
// spinlocks where appropriate. Also in this case NDIS does not queue
// packets on our behalf. Since this is a very simple pass-thru
// miniport, we do not have a need to protect anything. However in
// a general case there will be a need to use per-adapter spin-locks
// for the packet queues at the very least.
//
NdisMSetAttributesEx(MiniportAdapterHandle,
pAdapt,
0, // CheckForHangTimeInSeconds
NDIS_ATTRIBUTE_BUS_MASTER | //add by hunter
NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT |
NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT|
NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER |
NDIS_ATTRIBUTE_DESERIALIZE |
NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND,
0);

//add
Status = NdisMAllocateMapRegisters(MiniportAdapterHandle,
NdisInterfaceInternal,
1,//NDIS_DMA_32_BITS
1,
0x1000
);

if (Status != NDIS_STATUS_SUCCESS)
return NDIS_STATUS_FAILURE;

pAdapt->SharedMemorySize = 1024*4; // Fix, should get from registry.
if (pAdapt->SharedMemorySize)
{
NdisMAllocateSharedMemory(MiniportAdapterHandle,
pAdapt->SharedMemorySize,
TRUE,
&pAdapt->SharedMemoryPtr,
&pAdapt->SharedMemoryPhysicalAddress
);
if (pAdapt->SharedMemoryPtr == NULL)
{
DBGPRINT(("!!!!! Could not allocate shared memory./n"));
}
else
{
DBGPRINT(("Allocate shared memory address is 0X%X./n",pAdapt->SharedMemoryPhysicalAddress));
NdisZeroMemory(pAdapt->SharedMemoryPtr,pAdapt->SharedMemorySize);
}
}

Status = AllocatePGPnetPacketPool(pAdapt);
if (Status != NDIS_STATUS_SUCCESS)
return NDIS_STATUS_FAILURE;

// InitializeListHead(&pAdapt->Bindings);

NdisInitializeTimer(&pAdapt->collection_timer,
FragmentCollection,
pAdapt);
/*
NdisInitializeTimer(&pAdapt->request_timer,
RequestTimerRoutine,
pAdapt);
*/
if (pAdapt->media == NdisMedium802_3 || pAdapt->media == NdisMediumWan)
pAdapt->eth_hdr_len = ETHER_HEADER_SIZE;

pAdapt->open = TRUE;
pAdapt->SendPackets = 0;
pAdapt->ReceivePackets = 0;

//这两个句柄可能设置不对,有可能没用
// pAdapt->MiniportHandle = BindContext;
// pAdapt->NdisAdapterRegistrationHandle = SystemSpecific1;

//该句柄是用来注册适配器和分配共享内存时使用的,在passthru里面
//没有对应的,在这里所有适配器句柄都沿用passthru的句柄,
//(除NdisAdapterRegistrationHandle之外),其他结构变量使用pgpnet的

InitializeListHead(&pAdapt->Bindings);

NdisAllocateMemoryWithTag(&bindingContext,
sizeof(BINDING_CONTEXT),
TAG
);

if (bindingContext == NULL)
{
Status = NDIS_STATUS_RESOURCES;
break;
}

NdisZeroMemory(bindingContext, sizeof(BINDING_CONTEXT));

//*MacBindingHandle = bindingContext;
bindingContext->NdisBindingContextFromProtocol = MiniportAdapterHandle;
bindingContext->adapter = pAdapt;

NdisAcquireSpinLock(&pAdapt->general_lock);
InsertTailList(&pAdapt->Bindings, &bindingContext->Next);
bindingContext->InstanceNumber = pAdapt->BindingNumber++;
NdisReleaseSpinLock(&pAdapt->general_lock);
NdisSetTimer(&pAdapt->collection_timer, 60000);
//end
//
// Initialize LastIndicatedStatus to be NDIS_STATUS_MEDIA_CONNECT
//
pAdapt->LastIndicatedStatus = NDIS_STATUS_MEDIA_CONNECT;

//
// Initialize the power states for both the lower binding (PTDeviceState)
// and our miniport edge to Powered On.
//
pAdapt->MPDeviceState = NdisDeviceStateD0;
pAdapt->PTDeviceState = NdisDeviceStateD0;

//
// Add this adapter to the global pAdapt List
//
NdisAcquireSpinLock(&GlobalLock);

pAdapt->Next = pAdaptList;
pAdaptList = pAdapt;

NdisReleaseSpinLock(&GlobalLock);

//
// Create an ioctl interface
//
(VOID)PtRegisterDevice();

Status = NDIS_STATUS_SUCCESS;
}
while (FALSE);

//
// If we had received an UnbindAdapter notification on the underlying
// adapter, we would have blocked that thread waiting for the IM Init
// process to complete. Wake up any such thread.
//
ASSERT(pAdapt->MiniportInitPending == TRUE);
pAdapt->MiniportInitPending = FALSE;
NdisSetEvent(&pAdapt->MiniportInitEvent);

DBGPRINT(("<== Miniport Initialize: Adapt %p, Status %x/n", pAdapt, Status));

*OpenErrorStatus = Status;

return Status;
}


NDIS_STATUS
MPSend(
IN NDIS_HANDLE MiniportAdapterContext,
IN PNDIS_PACKET Packet,
IN UINT Flags
)
/*++

Routine Description:

Send Packet handler. Either this or our SendPackets (array) handler is called
based on which one is enabled in our Miniport Characteristics.

Arguments:

MiniportAdapterContext Pointer to the adapter
Packet Packet to send
Flags Unused, passed down below

Return Value:

Return code from NdisSend

--*/
{
PADAPT pAdapt = (PADAPT)MiniportAdapterContext;
NDIS_STATUS Status;
PNDIS_PACKET MyPacket;
PVOID MediaSpecificInfo = NULL;
ULONG MediaSpecificInfoSize = 0;
//add0
// NDIS_STATUS status;
PBINDING_CONTEXT binding = NULL;
// PVPN_ADAPTER adapter;
PNDIS_BUFFER src_buffer;
UINT src_len;
PNDIS_BUFFER working_buffer;
PVOID working_block;
UINT working_block_len;

PETHERNET_HEADER eth_header;
USHORT eth_protocol;
USHORT eth_header_len;
PIP_HEADER ip_header;
PUDP_HEADER udp_header = 0;

PPGPNDIS_PACKET pgpPacket;
PPGPNDIS_PACKET_HEAD packetHead;

BOOLEAN newHead = FALSE;
PGPnetPMStatus pmstatus;
BOOLEAN assembleComplete = FALSE;

//add1
UINT j,len;
PUCHAR bBlock;
UCHAR hBuffer[1500] = "";

DBGPRINT(("MPSend function has been called.../n"));

//end0
//
// The driver should fail the send if the virtual miniport is in low
// power state
//

if (pAdapt->MPDeviceState > NdisDeviceStateD0)
{
return NDIS_STATUS_FAILURE;
}

NdisAcquireSpinLock(&pAdapt->general_lock);
if (pAdapt->PTDeviceState > NdisDeviceStateD0)
{
NdisReleaseSpinLock(&pAdapt->general_lock);
return NDIS_STATUS_FAILURE;

}
pAdapt->OutstandingSends++;
NdisReleaseSpinLock(&pAdapt->general_lock);

NdisQueryPacket(Packet, NULL, NULL, &src_buffer, &src_len);
NdisQueryBuffer(src_buffer, &working_block, &working_block_len);

eth_header = (PETHERNET_HEADER) working_block;
eth_protocol = *((PUSHORT)(ð_header->eth_protocolType[0]));
eth_header_len = sizeof(ETHERNET_HEADER);
if (eth_protocol != IPPROT_NET)
{
if (eth_protocol == ARPPROT_NET && pAdapt->media != NdisMediumWan)
{
DBGPRINT(( "GetIPAddressFromARP to be called/n" ));
GetIPAddressFromARP(pAdapt, (PVOID)((UCHAR*)eth_header + eth_header_len));
}
goto bailout;
}

if (BroadcastEthernetAddress(eth_header->eth_dstAddress))
goto bailout;

if (pAdapt->media != NdisMedium802_3 && pAdapt->media != NdisMediumWan)
{
Status = NDIS_STATUS_NOT_ACCEPTED;
goto failout;
}

if (working_block_len >= eth_header_len + sizeof(IP_HEADER))
{
ip_header = (PIP_HEADER) ( (PCHAR)working_block + eth_header_len);
working_block = (PCHAR)working_block + eth_header_len;
working_block_len -= eth_header_len;
}
else if (working_block_len == eth_header_len)
{

NdisGetNextBuffer(src_buffer, &working_buffer);
if (working_buffer == NULL)
{
Status = NDIS_STATUS_NOT_ACCEPTED;
goto failout;
}
NdisQueryBuffer(working_buffer, &working_block, &working_block_len);

ip_header = (PIP_HEADER)working_block;
}
else
{
Status = NDIS_STATUS_NOT_ACCEPTED;
goto failout;
}

if (ip_header->ip_prot == PROTOCOL_IGMP)
goto bailout;
//add
bBlock = (PUCHAR)ip_header;
if (bBlock[0] == 0X45 && bBlock[9] == 0X06)
{
DBGPRINT(("ip_header_len:0X%X/n",ntohs(ip_header->ip_len)));
DBGPRINT(("ip_header:/n"));
len = (ntohs(ip_header->ip_len)>500) ? 500 : ntohs(ip_header->ip_len);
for (j=0;j sprintf(hBuffer + (2+1)*j,"%2.2X ",bBlock[j]);
DBGPRINT(("%s/n",hBuffer));
}
//end
if (ip_header->ip_prot == PROTOCOL_UDP)
{
if( working_block_len <= sizeof(struct tag_IP_HEADER) ) // FIX!!! ONLY work for ordinary ipv4 header.
{
NdisGetNextBuffer(working_buffer, &working_buffer);
if (working_buffer == NULL)
{
Status = NDIS_STATUS_NOT_ACCEPTED;
goto failout;
}
NdisQueryBuffer(working_buffer, &working_block, &working_block_len);
udp_header = (PUDP_HEADER)working_block;
}
else
udp_header = (PUDP_HEADER)( (UCHAR*)working_block + sizeof(IP_HEADER));
}

if (ip_header->ip_foff)
pmstatus = PGPnetPMNeedTransformLight(PGPnetDriver.PolicyManagerHandle,
ip_header->ip_dest,
FALSE,
pAdapt);
else
pmstatus = PGPnetPMNeedTransform(PGPnetDriver.PolicyManagerHandle,
ip_header->ip_dest,
(PGPUInt16)(udp_header ? udp_header->dest_port : 0),
FALSE,
0,
0,
eth_header->eth_dstAddress,
pAdapt);

if ( kPGPNetPMPacketSent == pmstatus)
goto dropout;
if ( kPGPNetPMPacketWaiting == pmstatus)
goto dropout;
if ( kPGPNetPMPacketDrop == pmstatus)
goto dropout;
if ( kPGPNetPMPacketClear == pmstatus)
goto bailout;
if ( kPGPNetPMPacketEncrypt != pmstatus)
{
Status = NDIS_STATUS_FAILURE;
goto failout;
}

DBGPRINT(("We send a packet need to encrypt.../n"));

pgpPacket = PGPNdisPacketAllocWithXformPacket(&Status, pAdapt);

if (Status != NDIS_STATUS_SUCCESS)
goto failout;

pgpPacket->Binding = binding;
pgpPacket->srcPacket = Packet;

pgpPacket->NeedsEthernetTransform = FALSE;

PGPCopyPacketToBlock(pgpPacket->srcPacket, pgpPacket->srcBlock, &pgpPacket->srcBlockLen);

pgpPacket->ipAddress = ntohl(ip_header->ip_dest);

pgpPacket->port = udp_header ? udp_header->dest_port : 0;

pgpPacket->offset = ntohs(ip_header->ip_foff & IP_OFFSET) << 3;
if (pgpPacket->offset == 0)
pgpPacket->firstSrcBlock = TRUE;
// Check to see if it's in the outgoing fragment list.
packetHead = PacketHeadListQuery(pAdapt,
&pAdapt->outgoing_packet_head_list,
ip_header->ip_id,
pgpPacket->ipAddress);
// If there is no outgoing fragment list. Create one.
if (packetHead == NULL)
{
packetHead = PGPNdisPacketHeadAlloc(&Status, pAdapt);
newHead = TRUE;
}

if (Status != NDIS_STATUS_SUCCESS)
goto failout;

// Add timestamp, update head information.
if (packetHead->id == 0)
{
// Initialize packetHead
packetHead->ipAddress = pgpPacket->ipAddress;
packetHead->id = ip_header->ip_id;
packetHead->timeStamp = PgpKernelGetSystemTime();
}

if (packetHead->numFragments ==0)
packetHead->accumulatedLength = htons(ip_header->ip_len);
else
packetHead->accumulatedLength += htons(ip_header->ip_len) - IP_HEADER_SIZE;
packetHead->numFragments++;

if (IP_LAST_FRAGMENT(ip_header->ip_foff))
{
ASSERT(packetHead->totalLength == 0);
pgpPacket->lastSrcBlock = TRUE;
packetHead->totalLength = htons(ip_header->ip_len) + pgpPacket->offset;
}

// Insert this pgpPacket to the packet list
InsertPGPNdisPacket(pAdapt, packetHead, pgpPacket);
// Check status, if finished fire up the send sequence.

if ((packetHead->totalLength) && (packetHead->totalLength == packetHead->accumulatedLength))
{
// Have them all, send them all.
PGPnetPMStatus pm_status;
PPGPNDIS_PACKET extraPacket;

// Put an extra buffer there.
extraPacket = PGPNdisPacketAllocWithXformPacket(&Status, pAdapt);

AppendPGPNdisPacket(pAdapt, packetHead, extraPacket);

if ( !(packetHead->link)->lastSrcBlock )
{
// More fragment. Adjust packet length.
PIP_HEADER first_ip_hdr;
PUCHAR first_srcBlock;

first_srcBlock = (packetHead->link)->srcBlock;
first_ip_hdr = (PIP_HEADER)(first_srcBlock + ETHER_HEADER_SIZE);

// It is no longer a fragment
first_ip_hdr->ip_foff = ~(IP_MF) & first_ip_hdr->ip_foff;
first_ip_hdr->ip_len = htons(packetHead->totalLength);

first_ip_hdr->ip_chksum = 0;
first_ip_hdr->ip_chksum = iphdr_cksum((USHORT*)first_ip_hdr);
}

pm_status = PGPnetPMDoTransform(PGPnetDriver.PolicyManagerHandle,
packetHead->link,
FALSE,
pAdapt);

if (pm_status != kPGPNetPMPacketSent)
{
DBGPRINT(("!!!!! Yellow Alert! PGPnetPMDoTransform Error!/n"));
//PGPNdisPacketFree(pAdapt, pgpPacket);
PGPNdisPacketHeadFreeList(pAdapt, packetHead, TRUE);
PacketHeadListRemove(pAdapt, &pAdapt->outgoing_packet_head_list, packetHead);
PGPNdisPacketHeadFree(pAdapt, packetHead);

goto dropout;
}

if (packetHead->link->NeedsEthernetTransform)
PGPNetDoEthernetTransform(packetHead);

Status = MacSendPackets(pAdapt, packetHead);

assembleComplete = TRUE;

}
else
{
// Not finished, add to the outgoing list
if (newHead)
PacketHeadEnqueue(pAdapt, &pAdapt->outgoing_packet_head_list, packetHead);
}

goto dropout;
// Either way, return successful.
return Status;

/*
#ifdef NDIS51
//
// Use NDIS 5.1 packet stacking:
//
{
PNDIS_PACKET_STACK pStack;
BOOLEAN Remaining;

//
// Packet stacks: Check if we can use the same packet for sending down.
//

pStack = NdisIMGetCurrentPacketStack(Packet, &Remaining);
if (Remaining)
{
//
// We can reuse "Packet".
//
// NOTE: if we needed to keep per-packet information in packets
// sent down, we can use pStack->IMReserved[].
//
ASSERT(pStack);
//
// If the below miniport is going to low power state, stop sending down any packet.
//
NdisAcquireSpinLock(&pAdapt->general_lock);
if (pAdapt->PTDeviceState > NdisDeviceStateD0)
{
NdisReleaseSpinLock(&pAdapt->general_lock);
return NDIS_STATUS_FAILURE;
}
pAdapt->OutstandingSends++;
NdisReleaseSpinLock(&pAdapt->general_lock);
NdisSend(&Status,
pAdapt->BindingHandle,
Packet);

if (Status != NDIS_STATUS_PENDING)
{
ADAPT_DECR_PENDING_SENDS(pAdapt);
}

return(Status);
}
}
#endif // NDIS51

//
// We are either not using packet stacks, or there isn't stack space
// in the original packet passed down to us. Allocate a new packet
// to wrap the data with.
//
//
// If the below miniport is going to low power state, stop sending down any packet.
//

NdisAllocatePacket(&Status,
&MyPacket,
pAdapt->SendPacketPoolHandle);

if (Status == NDIS_STATUS_SUCCESS)
{
PSEND_RSVD SendRsvd;

//
// Save a pointer to the original packet in our reserved
// area in the new packet. This is needed so that we can
// get back to the original packet when the new packet's send
// is completed.
//
SendRsvd = (PSEND_RSVD)(MyPacket->ProtocolReserved);
SendRsvd->OriginalPkt = Packet;

MyPacket->Private.Flags = Flags;

//
// Set up the new packet so that it describes the same
// data as the original packet.
//
MyPacket->Private.Head = Packet->Private.Head;
MyPacket->Private.Tail = Packet->Private.Tail;
#ifdef WIN9X
//
// Work around the fact that NDIS does not initialize this
// to FALSE on Win9x.
//
MyPacket->Private.ValidCounts = FALSE;
#endif

//
// Copy the OOB Offset from the original packet to the new
// packet.
//
NdisMoveMemory(NDIS_OOB_DATA_FROM_PACKET(MyPacket),
NDIS_OOB_DATA_FROM_PACKET(Packet),
sizeof(NDIS_PACKET_OOB_DATA));

#ifndef WIN9X
//
// Copy the right parts of per packet info into the new packet.
// This API is not available on Win9x since task offload is
// not supported on that platform.
//
NdisIMCopySendPerPacketInfo(MyPacket, Packet);
#endif

//
// Copy the Media specific information
//
NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(Packet,
&MediaSpecificInfo,
&MediaSpecificInfoSize);

if (MediaSpecificInfo || MediaSpecificInfoSize)
{
NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(MyPacket,
MediaSpecificInfo,
MediaSpecificInfoSize);
}

NdisSend(&Status,
pAdapt->BindingHandle,
MyPacket);


if (Status != NDIS_STATUS_PENDING)
{
#ifndef WIN9X
NdisIMCopySendCompletePerPacketInfo (Packet, MyPacket);
#endif
NdisFreePacket(MyPacket);
ADAPT_DECR_PENDING_SENDS(pAdapt);
}
}
else
{
ADAPT_DECR_PENDING_SENDS(pAdapt);
//
// We are out of packets. Silently drop it. Alternatively we can deal with it:
// - By keeping separate send and receive pools
// - Dynamically allocate more pools as needed and free them when not needed
//
}

return(Status);
*/

bailout:

pgpPacket = PGPNdisPacketAllocWithBindingContext(&Status, pAdapt);

if (Status != NDIS_STATUS_SUCCESS)
goto failout;

NdisAllocatePacket(&Status,
&MyPacket,
pAdapt->SendPacketPoolHandle);

if (Status == NDIS_STATUS_SUCCESS)
{
PSEND_RSVD SendRsvd;

SendRsvd = (PSEND_RSVD)(MyPacket->ProtocolReserved);
SendRsvd->OriginalPkt = Packet;

MyPacket->Private.Flags = Flags;

MyPacket->Private.Head = Packet->Private.Head;
MyPacket->Private.Tail = Packet->Private.Tail;
#ifdef WIN9X
MyPacket->Private.ValidCounts = FALSE;
#endif
/*
NdisMoveMemory(NDIS_OOB_DATA_FROM_PACKET(MyPacket),
NDIS_OOB_DATA_FROM_PACKET(Packet),
sizeof(NDIS_PACKET_OOB_DATA));
*/

#ifndef WIN9X
NdisIMCopySendPerPacketInfo(MyPacket, Packet);
#endif

NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(Packet,
&MediaSpecificInfo,
&MediaSpecificInfoSize);

if (MediaSpecificInfo || MediaSpecificInfoSize)
{
NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(MyPacket,
MediaSpecificInfo,
MediaSpecificInfoSize);
}

pgpPacket->srcPacket = MyPacket;
pgpPacket->Binding = binding;

PacketEnqueue(pAdapt, &pAdapt->sent_plainpacket_list, pgpPacket);

NdisSend(&Status,
pAdapt->BindingHandle,
MyPacket);


if (Status != NDIS_STATUS_PENDING)
{
/*
#ifndef WIN9X
NdisIMCopySendCompletePerPacketInfo (Packet, MyPacket);
#endif
*/
NdisFreePacket(Packet);

pgpPacket = PacketRemoveBySrcPacket(pAdapt, &pAdapt->sent_plainpacket_list, MyPacket);
PGPNdisPacketFreeWithBindingContext(pAdapt, pgpPacket);

ADAPT_DECR_PENDING_SENDS(pAdapt);
}
}
/*
NdisSend(&Status,
pAdapt->BindingHandle,
Packet);

if (Status != NDIS_STATUS_PENDING)
{
pgpPacket = PacketRemoveBySrcPacket(pAdapt, &pAdapt->sent_plainpacket_list, Packet);
PGPNdisPacketFreeWithBindingContext(pAdapt, pgpPacket);
//add
ADAPT_DECR_PENDING_SENDS(pAdapt);
//end
}
*/
pAdapt->SendPackets++;

failout:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值