• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NdisFreeMemory函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NdisFreeMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisFreeMemory函数的具体用法?C++ NdisFreeMemory怎么用?C++ NdisFreeMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NdisFreeMemory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DEBUGMSG

void        BackOut				(MINIPORT_ADAPTER *pAdapter)
{
	DEBUGMSG(ZONE_INIT, (TEXT("LPC3xxx NDIS==> BackOut\r\n")));
	DEBUGMSG(ZONE_INIT, (TEXT("LPC3xxx NDIS==> Releasing all LPC3250 NDIS resources\r\n")));

	if (pAdapter->IsInterruptSet)
		NdisMDeregisterInterrupt(&pAdapter->InterruptInfo);

	if(pAdapter->pVAEMACBuffers != NULL)
	{
		UnMapRegisters (pAdapter->pVAEMACBuffers,pAdapter->dwEMACBuffersSize);
		pAdapter->pVAEMACBuffers = NULL;
	}

	if(pAdapter->pVALookAheadBuffer != NULL)
	{
		NdisFreeMemory(pAdapter->pVALookAheadBuffer,pAdapter->dwLookAheadBufferSize,0);
		pAdapter->pVALookAheadBuffer = NULL;
	}

	if(pAdapter->pTXPackets != NULL)
	{
		NdisFreeMemory(pAdapter->pTXPackets, sizeof(TX_PACKET) * pAdapter->dwTxStrides, 0);
		pAdapter->pTXPackets = NULL;
	}

	//Release the adapter structure.
    NdisFreeMemory(pAdapter, MINIPORT_ADAPTER_SIZE, 0);
	DEBUGMSG(ZONE_INIT, (TEXT("LPC3xxx NDIS<== BackOut\r\n")));
}
开发者ID:blueskycoco,项目名称:d5,代码行数:30,代码来源:lpc3250_NDIS_Init.c


示例2: CleanupRSSParameters

static VOID CleanupRSSParameters(PARANDIS_RSS_PARAMS *RSSParameters)
{
    if(RSSParameters->ActiveRSSScalingSettings.CPUIndexMapping != NULL)
        NdisFreeMemory(RSSParameters->ActiveRSSScalingSettings.CPUIndexMapping, 0, 0);

    if(RSSParameters->RSSScalingSettings.CPUIndexMapping != NULL)
        NdisFreeMemory(RSSParameters->RSSScalingSettings.CPUIndexMapping, 0, 0);

}
开发者ID:YehudaItkin,项目名称:kvm-guest-drivers-windows,代码行数:9,代码来源:ParaNdis6-RSS.cpp


示例3: NdisCloseConfiguration

VOID
NdisCloseConfiguration(
	IN NDIS_HANDLE					ConfigurationHandle
	)
/*++

Routine Description:

	This routine is used to close a configuration database opened by
	NdisOpenConfiguration.

Arguments:

	ConfigurationHandle - Handle returned by NdisOpenConfiguration.

Return Value:

	None.

--*/
{
	//
	// Obtain the actual configuration handle structure
	//
	PNDIS_CONFIGURATION_HANDLE NdisConfigHandle = (PNDIS_CONFIGURATION_HANDLE)ConfigurationHandle;

	//
	// Pointer to a parameter node
	//
	PNDIS_CONFIGURATION_PARAMETER_QUEUE ParameterNode;

	ASSERT (KeGetCurrentIrql() < DISPATCH_LEVEL);

	//
	// deallocate the parameter nodes
	//
	ParameterNode = NdisConfigHandle->ParameterList;

	while (ParameterNode != NULL)
	{
		NdisConfigHandle->ParameterList = ParameterNode->Next;

		NdisFreeMemory(ParameterNode,
					   sizeof(NDIS_CONFIGURATION_PARAMETER_QUEUE),
					   0);

		ParameterNode = NdisConfigHandle->ParameterList;
	}

	NdisFreeMemory(ConfigurationHandle,
				   sizeof(NDIS_CONFIGURATION_HANDLE),
				   0);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:53,代码来源:init.c


示例4: trc_destroy

/* delte a trace object */
INT
trc_destroy(VOID *trc_1)
{
	TRC		*trc = (TRC*)trc_1;
    
    D_LOG(D_ENTRY, ("trc_destroy: entry, trc: 0x%lx", trc));

    /* free memory */
    NdisFreeMemory(trc->ent_tbl, sizeof(TRC_ENTRY) * trc->stat.depth, 0);
    NdisFreeMemory(trc, sizeof(*trc), 0);

    return(TRC_E_SUCC);        
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:14,代码来源:trc_core.c


示例5: FilterPacket_ReceiveHandler

BOOLEAN
FilterPacket_ReceiveHandler (
	PVOID pHeadBuffer,
	ULONG ulHeadSize,
	PNDIS_PACKET pPacket
	)
/*++

Routine Description:

	Filters network packets for NDISReceiveHandler.


Arguments:

	...


Return Value:

	TRUE: This packet should be blocked.

	FALSE: This packet should pass through.


Author:

	xiaonie

	2012/07/12


--*/
{
	ULONG ulPacketSize;
	PUCHAR pBuffer = NULL;
	NDIS_STATUS status;
	PNDIS_BUFFER pFirstBuffer, pNextBuffer;
	BOOLEAN bRet = FALSE;

	NdisQueryPacket(pPacket, NULL, NULL, NULL, &ulPacketSize);
	if (ulPacketSize == 0)
		return FALSE;

	DbgPrint("ulHeadSize == %d, ulPacketSize == %d in FilterPacket_ReceiveHandler!\r\n", ulHeadSize, ulPacketSize);

	status = NdisAllocateMemoryWithTag(&pBuffer, ulPacketSize + ulHeadSize, '!nmN');
	if (status != NDIS_STATUS_SUCCESS/* || pBuffer == NULL */)
		return FALSE;

	//obtain content from the packet
	NdisMoveMemory(pBuffer, pHeadBuffer, ulHeadSize);
	ReadPacket(pPacket, pBuffer + ulHeadSize, ulPacketSize);

	bRet = RabbitHole(pBuffer, ulPacketSize + ulHeadSize);

	NdisFreeMemory(pBuffer, ulPacketSize + ulHeadSize, 0);

	return bRet;
}
开发者ID:geemion,项目名称:HookNdis,代码行数:60,代码来源:HookNdis.c


示例6: ParaNdis6_Reset

/**********************************************************
Required NDIS handler for RESET operation
Never happens under normal condition, only if
OID or other call returns PENDING and not completed or if
ParaNdis6_CheckForHang returns true
***********************************************************/
static NDIS_STATUS ParaNdis6_Reset(
        NDIS_HANDLE miniportAdapterContext,
        PBOOLEAN  pAddressingReset)
{
    NDIS_STATUS  status = NDIS_STATUS_FAILURE;
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;
    NDIS_HANDLE hwo;
    tGeneralWorkItem *pwi;
    DEBUG_ENTRY(0);
    *pAddressingReset = TRUE;
    ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 1, 0, 0);
    hwo = NdisAllocateIoWorkItem(pContext->MiniportHandle);
    pwi = ParaNdis_AllocateMemory(pContext, sizeof(tGeneralWorkItem));
    if (pwi && hwo)
    {
        pwi->pContext = pContext;
        pwi->WorkItem = hwo;
        NdisQueueIoWorkItem(hwo, OnResetWorkItem, pwi);
        status = NDIS_STATUS_PENDING;
    }
    else
    {
        if (pwi) NdisFreeMemory(pwi, 0, 0);
        if (hwo) NdisFreeIoWorkItem(hwo);
        ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 0, status, 0);
    }
    DEBUG_EXIT_STATUS(0, status);
    return status;
}
开发者ID:represent-communications,项目名称:kvm-guest-drivers-windows,代码行数:35,代码来源:ParaNdis6-Driver.c


示例7: ApplySettings

static VOID ApplySettings(PPARANDIS_RSS_PARAMS RSSParameters,
        PARANDIS_RSS_MODE NewRSSMode,
        PARANDIS_HASHING_SETTINGS *ReceiveHashingSettings,
        PARANDIS_SCALING_SETTINGS *ReceiveScalingSettings)
{
    NdisAcquireSpinLock(&RSSParameters->RSSSettingsLock);

    RSSParameters->RSSMode = NewRSSMode;

    if(NewRSSMode != PARANDIS_RSS_DISABLED)
    {
        RSSParameters->ActiveHashingSettings = *ReceiveHashingSettings;

        if(NewRSSMode == PARANDIS_RSS_FULL)
        {
            if(RSSParameters->ActiveRSSScalingSettings.CPUIndexMapping != NULL)
                NdisFreeMemory(RSSParameters->ActiveRSSScalingSettings.CPUIndexMapping, 0, 0);

            RSSParameters->ActiveRSSScalingSettings = *ReceiveScalingSettings;

            ReceiveScalingSettings->CPUIndexMapping = NULL;
        }
    }

    NdisReleaseSpinLock(&RSSParameters->RSSSettingsLock);
}
开发者ID:bdacode,项目名称:kvm-guest-drivers-windows,代码行数:26,代码来源:ParaNdis6-RSS.cpp


示例8: tapAdapterContextFree

// Free adapter context memory and associated resources.
VOID tapAdapterContextFree(__in PTAP_ADAPTER_CONTEXT Adapter) {
  PLIST_ENTRY listEntry = &Adapter->AdapterListLink;

  DEBUGP(("[TAP] --> tapAdapterContextFree\n"));

  // Adapter context should already be removed.
  ASSERT((listEntry->Flink == listEntry) && (listEntry->Blink == listEntry));

  // Insure that adapter context has been removed from global adapter list.
  RemoveEntryList(&Adapter->AdapterListLink);

  // Free the adapter lock.
  NdisFreeSpinLock(&Adapter->AdapterLock);

  // Free the ANSI NetCfgInstanceId buffer.
  if (Adapter->NetCfgInstanceIdAnsi.Buffer != NULL) {
    RtlFreeAnsiString(&Adapter->NetCfgInstanceIdAnsi);
  }

  Adapter->NetCfgInstanceIdAnsi.Buffer = NULL;

  // Free the receive NBL pool.
  if (Adapter->ReceiveNblPool != NULL) {
    NdisFreeNetBufferListPool(Adapter->ReceiveNblPool);
  }

  Adapter->ReceiveNblPool = NULL;

  NdisFreeMemory(Adapter, 0, 0);

  DEBUGP(("[TAP] <-- tapAdapterContextFree\n"));
}
开发者ID:hlyu368,项目名称:outline-client,代码行数:33,代码来源:adapter.c


示例9: _rtw_mfree

void	_rtw_mfree(u8 *pbuf, u32 sz)
{

#ifdef	PLATFORM_LINUX
#ifdef RTK_DMP_PLATFORM
	if(sz > 0x4000)
		dvr_free(pbuf);
	else
#endif
		kfree(pbuf);

#endif	
#ifdef PLATFORM_FREEBSD
	free(pbuf,M_DEVBUF);	
#endif		
#ifdef PLATFORM_WINDOWS

	NdisFreeMemory(pbuf,sz, 0);

#endif
	
#ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
	atomic_dec(&_malloc_cnt);
	atomic_sub(sz, &_malloc_size);
#endif
#endif /* DBG_MEMORY_LEAK */
	
}
开发者ID:Dee-UK,项目名称:RK3188_KK_4.4.02_Beta,代码行数:29,代码来源:osdep_service.c


示例10: PKTCloseAdapter

/*
 * Closes the open adapter
 *
 */
BOOL PKTCloseAdapter (POPEN_INSTANCE pOI)
{
	BOOL			bRet = TRUE;
	NDIS_STATUS		nsError;


	// close the adapter
	NdisCloseAdapter (&nsError, pOI->AdapterHandle);

	if (nsError == NDIS_STATUS_PENDING) {
		SuspendExecution (pOI);
	} else {
		PacketCloseAdapterComplete (pOI, nsError);
	}

	if (pOI->Status != NDIS_STATUS_SUCCESS) {
		bRet = FALSE;
	}

	// set all the events to release the waits
	SetEvent (pOI->ReadEvent);
	CloseHandle (pOI->ReadEvent);

	// Free the open instance memory
	NdisFreeMemory (pOI, sizeof (OPEN_INSTANCE), 0);

	// set no instances open
	g_pDeviceExtension->pOpenInstance = NULL;

	return bRet;
}
开发者ID:469306621,项目名称:Languages,代码行数:35,代码来源:Openclose.c


示例11: procedure

/*************************************************************
Required NDIS procedure
Called when some procedure (like OID handler) returns PENDING and
does not complete or when CheckForHang return TRUE
*************************************************************/
static NDIS_STATUS ParaNdis5_Reset(
	OUT PBOOLEAN AddressingReset,
	IN NDIS_HANDLE MiniportAdapterContext)
{
	NDIS_STATUS status;
	tGeneralWorkItem *pwi;
	PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
	DEBUG_ENTRY(0);
	ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 1, 0, 0);
	status = NDIS_STATUS_FAILURE;
	pwi = ParaNdis_AllocateMemory(pContext, sizeof(tGeneralWorkItem));
	if (pwi)
	{
		pwi->pContext = pContext;
		NdisInitializeWorkItem(&pwi->wi, OnResetWorkItem, pwi);
		if (NdisScheduleWorkItem(&pwi->wi) == NDIS_STATUS_SUCCESS)
		{
			status = NDIS_STATUS_PENDING;
		}
		else
		{
			NdisFreeMemory(pwi, 0, 0);
		}
	}
	if (status != NDIS_STATUS_PENDING)
	{
		ParaNdis_DebugHistory(pContext, hopSysReset, NULL, 0, status, 0);
	}
	return status;
}
开发者ID:bloomier,项目名称:kvm-guest-drivers-windows,代码行数:35,代码来源:ParaNdis5-Driver.c


示例12: MpFreeAllocatedBlocks

/**
 * This function will dump out the contents of the GlobalMemoryList and free them as well.
 * Used to dump out leaking memory when driver is exiting
 * 
 * \sa MpAllocateMemory, MpFreeMemory
 */
VOID 
MpFreeAllocatedBlocks ()
{
    if (GlobalMemoryManagerInitialized)
    {
        NdisAcquireSpinLock (&GlobalMemoryLock);   
        if (!IsListEmpty (&GlobalMemoryList))
        {
            PLIST_ENTRY currentEntry;
            PMP_MEMORY_BLOCK currentMemory;

            while (!IsListEmpty (&GlobalMemoryList))
            {
                currentEntry = RemoveHeadList(&GlobalMemoryList);

                currentMemory = CONTAINING_RECORD (currentEntry, MP_MEMORY_BLOCK, ListEntry);
                MpTrace(COMP_DBG, DBG_SERIOUS, ("LEAK in %s on line %u\n", currentMemory->File,
                                      currentMemory->Line));

                NdisFreeMemory (currentMemory, 0, 0);
            }
        }
        NdisReleaseSpinLock (&GlobalMemoryLock);

        NdisFreeSpinLock(&GlobalMemoryLock);
        GlobalMemoryManagerInitialized = FALSE;
    }
}
开发者ID:kcrazy,项目名称:winekit,代码行数:34,代码来源:mp_dbg.c


示例13: ParaNdis5_Halt

/*************************************************************
Required NDIS procedure
Stops TX and RX path and finished the function of adapter
*************************************************************/
static VOID ParaNdis5_Halt(
	IN NDIS_HANDLE MiniportAdapterContext)
{
	NDIS_STATUS status = NDIS_STATUS_SUCCESS;
	BOOLEAN bUnused;
	PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)MiniportAdapterContext;
	DEBUG_ENTRY(0);

	ParaNdis_DebugHistory(pContext, hopHalt, NULL, 1, 0, 0);

	NdisCancelTimer(&pContext->ConnectTimer, &bUnused);
	NdisResetEvent(&pContext->HaltEvent);
	if (NDIS_STATUS_PENDING != ParaNdis5_StopSend(pContext, TRUE, OnSendStopped))
		NdisSetEvent(&pContext->HaltEvent);
	WaitHaltEvent(pContext, "Send");
	NdisResetEvent(&pContext->HaltEvent);
	if (NDIS_STATUS_PENDING != ParaNdis5_StopReceive(pContext, TRUE, OnReceiveStopped))
		NdisSetEvent(&pContext->HaltEvent);
	WaitHaltEvent(pContext, "Receive");
	ParaNdis_CleanupContext(pContext);
	NdisCancelTimer(&pContext->DPCPostProcessTimer, &bUnused);
	ParaNdis_DebugHistory(pContext, hopHalt, NULL, 0, 0, 0);
	ParaNdis_DebugRegisterMiniport(pContext, FALSE);
	NdisFreeMemory(pContext, 0, 0);
	DEBUG_EXIT_STATUS(0, status);
}
开发者ID:bloomier,项目名称:kvm-guest-drivers-windows,代码行数:30,代码来源:ParaNdis5-Driver.c


示例14: PacketUnbindAdapterComplete

VOID NDIS_API PacketUnbindAdapterComplete(IN POPEN_INSTANCE Open,
                                          IN NDIS_STATUS Status)
{
  // upcall on NdisCloseAdapter completion


  // If Open->Status == NDIS_STATUS_PENDING then we must complete the pended unbinding
  if (Open->Status == NDIS_STATUS_PENDING) {
    NdisCompleteUnbindAdapter(Open->BindAdapterContext, Status);
    Open->Status = NDIS_STATUS_SUCCESS;
  }

  if (Status != NDIS_STATUS_SUCCESS)
    return;

  // Remove Adapter from global list
  RemoveEntryList(&Open->ListElement);

  // Free Memory
  NdisFreeSpinLock(&Open->RequestSpinLock);
  NdisFreeSpinLock(&Open->RcvQSpinLock);
  NdisFreeSpinLock(&Open->ResetSpinLock);

  NdisFreeBufferPool(Open->BufferPool);

  NdisFreePacketPool(Open->PacketPool);

  NdisFreeMemory(Open, sizeof(OPEN_INSTANCE), 0);
}
开发者ID:OPSF,项目名称:uClinux,代码行数:29,代码来源:epacket.c


示例15: ParaNdis_OnSetPower

/**********************************************************
NDIS5.X handler of power management
***********************************************************/
NDIS_STATUS ParaNdis_OnSetPower(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
{
	NDIS_STATUS status;
	NDIS_DEVICE_POWER_STATE newState;
	DEBUG_ENTRY(0);
	status = ParaNdis_OidSetCopy(pOid, &newState, sizeof(newState));
	if (status == NDIS_STATUS_SUCCESS)
	{
		tPowerWorkItem *pwi = ParaNdis_AllocateMemory(pContext, sizeof(tPowerWorkItem));
		status = NDIS_STATUS_FAILURE;
		if (pwi)
		{
			pwi->pContext = pContext;
			pwi->state    = newState;
			NdisInitializeWorkItem(&pwi->wi, OnSetPowerWorkItem, pwi);
			if (NdisScheduleWorkItem(&pwi->wi) == NDIS_STATUS_SUCCESS)
			{
				status = NDIS_STATUS_PENDING;
			}
			else
				NdisFreeMemory(pwi, 0, 0);
		}
	}
	return status;
}
开发者ID:HitMann1,项目名称:kvm-guest-drivers-windows,代码行数:28,代码来源:ParaNdis5-Oid.c


示例16: MSI

/******************************************************************
Registered procedure for filtering if resource requirement
Required when the device supports MSI, but the driver decides - will it work with MSI or not
(currently MSI is supported but does not work, exactly our case).
In this case the resource requirement list must be replaced - we need to remove from it
all the "message interrupt" resources.

When we are ready to work with MSI (VIRTIO_USE_MSIX_INTERRUPT is DEFINED),
we just enumerate allocated resources and do not modify them.
*******************************************************************/
static NDIS_STATUS ParaNdis6_FilterResource(IN NDIS_HANDLE  MiniportAddDeviceContext, IN PIRP  Irp)
{
    DPrintf(0, ("[%s] entered\n", __FUNCTION__));
    PIO_RESOURCE_REQUIREMENTS_LIST prrl = (PIO_RESOURCE_REQUIREMENTS_LIST)(PVOID)Irp->IoStatus.Information;

#ifdef DBG
    PrintPRRL(prrl);
#endif

    PIO_RESOURCE_REQUIREMENTS_LIST newPrrl = ParseFilterResourceIrp(MiniportAddDeviceContext, prrl, BOOLEAN(bDisableMSI));

        if (newPrrl)
        {
            Irp->IoStatus.Information = (ULONG_PTR)newPrrl;
            NdisFreeMemory(prrl, 0, 0);
#ifdef DBG
        PrintPRRL(newPrrl);
#endif
    }
    else
    {
        DPrintf(0, ("[%s] Resource requirement unchanged\n", __FUNCTION__));
    }
    return NDIS_STATUS_SUCCESS;
}
开发者ID:pccq2002,项目名称:kvm-guest-drivers-windows,代码行数:35,代码来源:ParaNdis6-Driver.cpp


示例17: DriverEntry

NTSTATUS NDIS_API DriverEntry(IN PDRIVER_OBJECT  DriverObject,
                              IN PUNICODE_STRING RegistryPath)

{
  // initialiae the driver

  NDIS_PROTOCOL_CHARACTERISTICS ProtocolChar;
  NDIS_STRING ProtoName = NDIS_STRING_CONST("EPACKET");
  NDIS_STATUS Status;


  // Because the driver can be loaded once for each Netcard on the system,
  // and because DriverEntry is called each time, we must ensure that
  // initialization is performed only once.
  if (GlobalDeviceExtension != NULL)
    return NDIS_STATUS_SUCCESS;
        
  NdisAllocateMemory((PVOID *)&GlobalDeviceExtension, sizeof(DEVICE_EXTENSION), 0, -1 );
  if (GlobalDeviceExtension == NULL)
    return NDIS_STATUS_RESOURCES;

  NdisZeroMemory((UCHAR*)GlobalDeviceExtension, sizeof(DEVICE_EXTENSION));
  NdisZeroMemory((UCHAR*)&ProtocolChar, sizeof(NDIS_PROTOCOL_CHARACTERISTICS));
  ProtocolChar.MajorNdisVersion            = 0x03;
  ProtocolChar.MinorNdisVersion            = 0x0a;
  ProtocolChar.Reserved                    = 0;
  ProtocolChar.OpenAdapterCompleteHandler  = PacketBindAdapterComplete;
  ProtocolChar.CloseAdapterCompleteHandler = PacketUnbindAdapterComplete;
  ProtocolChar.SendCompleteHandler         = PacketSendComplete;
  ProtocolChar.TransferDataCompleteHandler = PacketTransferDataComplete;
  ProtocolChar.ResetCompleteHandler        = PacketResetComplete;
  ProtocolChar.RequestCompleteHandler      = PacketRequestComplete;
  ProtocolChar.ReceiveHandler              = PacketReceiveIndicate;
  ProtocolChar.ReceiveCompleteHandler      = PacketReceiveComplete;
  ProtocolChar.StatusHandler               = PacketStatus;
  ProtocolChar.StatusCompleteHandler       = PacketStatusComplete;
  ProtocolChar.BindAdapterHandler          = PacketBindAdapter;
  ProtocolChar.UnbindAdapterHandler        = PacketUnbindAdapter;
  ProtocolChar.UnloadProtocolHandler       = PacketUnload;
  ProtocolChar.Name                        = ProtoName;
  
  NdisRegisterProtocol(&Status,
                       &GlobalDeviceExtension->NdisProtocolHandle,
                       &ProtocolChar,
                       sizeof(NDIS_PROTOCOL_CHARACTERISTICS));
  
  if (Status != NDIS_STATUS_SUCCESS) {
    NdisFreeMemory(GlobalDeviceExtension, sizeof(DEVICE_EXTENSION), 0);
    return Status;
  }
  
  // initialize open list
  InitializeListHead(&GlobalDeviceExtension->OpenList);
  
  // initialize global device extension
  GlobalDeviceExtension->DriverObject = DriverObject;
  
  return Status;
}
开发者ID:OPSF,项目名称:uClinux,代码行数:59,代码来源:epacket.c


示例18: RefreshUdpListEntrySafe

VOID
RefreshUdpListEntrySafe(
    VOID
    )
/*++

Routine Description:

    Remove stale mapping info from UDP port map list entries.
    This function is thread-safe. Do NOT acquire id list 
    spin lock around this function.

--*/
{
    LARGE_INTEGER now;
    PLIST_ENTRY p, temp;
    
    NdisAcquireSpinLock(&PortListLock);
    
    if (IsListEmpty(&PortListHead))
    {
        // List is empty, nothing to be done.
        NdisReleaseSpinLock(&PortListLock);
        return;
    }
    
    NdisGetCurrentSystemTime(&now);
    p = PortListHead.Flink;
    while (p != &PortListHead)
    {
        PUDP_MAP_CONTEXT Map = CONTAINING_RECORD(p, UDP_MAP_CONTEXT, ListEntry);
        
        if (IsTimeOut(&now, &(Map->MapSetTime), &UdpTimeOut))
        {
            // Time out. Release mapping info and reset corresponding hash table entry
            DBGPRINT(("==> RefreshUdpListEntrySafe: map %d -> %d time out. Delete.\n", 
                      Map->OriginalPort, Map->MappedPort));
            // Protect the loop from break
            temp = p;
            p = p->Flink;
            // Clear hash table pointer
            UdpPortMapOutTable[Map->OriginalPort].Map = NULL;
            UdpPortMapInTable[Map->MappedPort].Map = NULL;
            // Remove entry and clear memory
            RemoveEntryList(temp);
            PortListLength--;
            NdisFreeMemory(Map, 0, 0);
            //DBGPRINT(("==> RefreshUdpListEntrySafe: map context memory freed.\n"));
            // Go to next entry
        }
        else
        {
            // Go to next entry
            // Map set time is refreshed when this map is accessed by mapping functions, no need to refresh it here
            p = p->Flink;
        }
    }
    NdisReleaseSpinLock(&PortListLock);
}
开发者ID:wentaoshang,项目名称:PassThruIVI2,代码行数:59,代码来源:portmap.c


示例19: res_term

/* terminate support */
VOID
res_term(VOID)
{
//	DbgPrint ("Resource Term: Entry\n");
//	NdisFreeSpinLock(&res__lock);
    /* free memory */
    NdisFreeMemory(res__tbl, (sizeof(RES) * MAX_RES), 0);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:9,代码来源:res_core.c


示例20: MiniportHalt5

VOID
MiniportHalt5(
    IN NDIS_HANDLE                MiniportAdapterContext
    )
{
    PADAPTER           pAdapt = (PADAPTER)MiniportAdapterContext;
    NDIS_STATUS        Status;


    //
    // Delete the ioctl interface that was created when the miniport
    // was created.
    //
    (VOID)ProtocolDeregisterDevice();

#ifdef _DEBUG
	// 关闭直接包发送接口
	if(pAdapt->FileObject)
	{
		//
		//  Make sure any threads trying to send have finished.
		//
		pAdapt->FileObject->FsContext = NULL;
		pAdapt->FileObject = NULL;
	}
#endif

    //
    // If we have a valid bind, close the miniport below the protocol
    //
    if (pAdapt->BindingHandle != NULL)
    {
        //
        // Close the binding below. and wait for it to complete
        //
        NdisResetEvent(&pAdapt->Event);

        NdisCloseAdapter(&Status, pAdapt->BindingHandle);

        if (Status == NDIS_STATUS_PENDING)
        {
            NdisWaitEvent(&pAdapt->Event, 0);
            Status = pAdapt->Status;
        }

        ASSERT (Status == NDIS_STATUS_SUCCESS);

        pAdapt->BindingHandle = NULL;
    }

    //
    //  Free all resources on this adapter structure.
    //
    MiniportFreeAllPacketPools5(pAdapt);
    NdisFreeSpinLock(&pAdapt->Lock);
    NdisFreeMemory(pAdapt, 0, 0);

}
开发者ID:aldertotori,项目名称:antiarp,代码行数:58,代码来源:miniport51.c



注:本文中的NdisFreeMemory函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NdisGetSystemUpTime函数代码示例发布时间:2022-05-30
下一篇:
C++ NdisEqualMemory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap