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

C++ ExAllocateFromNPagedLookasideList函数代码示例

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

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



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

示例1: LibTCPShutdown

err_t
LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx)
{
    struct lwip_callback_msg *msg;
    err_t ret;

    msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList);
    if (msg)
    {
        KeInitializeEvent(&msg->Event, NotificationEvent, FALSE);

        msg->Input.Shutdown.Connection = Connection;
        msg->Input.Shutdown.shut_rx = shut_rx;
        msg->Input.Shutdown.shut_tx = shut_tx;

        tcpip_callback_with_block(LibTCPShutdownCallback, msg, 1);

        if (WaitForEventSafely(&msg->Event))
            ret = msg->Output.Shutdown.Error;
        else
            ret = ERR_CLSD;

        ExFreeToNPagedLookasideList(&MessageLookasideList, msg);

        return ret;
    }

    return ERR_MEM;
}
开发者ID:RareHare,项目名称:reactos,代码行数:29,代码来源:rostcp.c


示例2: KphProtectAddEntry

/* KphProtectAddEntry
 * 
 * Protects the specified process.
 * 
 * Thread safety: Full
 * IRQL: <= DISPATCH_LEVEL
 */
PKPH_PROCESS_ENTRY KphProtectAddEntry(
    __in PEPROCESS Process,
    __in HANDLE Tag,
    __in LOGICAL AllowKernelMode,
    __in ACCESS_MASK ProcessAllowMask,
    __in ACCESS_MASK ThreadAllowMask
    )
{
    KIRQL oldIrql;
    PKPH_PROCESS_ENTRY entry;
    
    /* Prevent the lookaside list from being freed. */
    if (!ExAcquireRundownProtection(&ProtectedProcessRundownProtect))
        return NULL;
    
    entry = ExAllocateFromNPagedLookasideList(&ProtectedProcessLookasideList);
    /* Lookaside list no longer needed. */
    ExReleaseRundownProtection(&ProtectedProcessRundownProtect);
    
    if (!entry)
        return NULL;
    
    entry->Process = Process;
    entry->CreatorProcess = PsGetCurrentProcess();
    entry->Tag = Tag;
    entry->AllowKernelMode = AllowKernelMode;
    entry->ProcessAllowMask = ProcessAllowMask;
    entry->ThreadAllowMask = ThreadAllowMask;
    
    KeAcquireSpinLock(&ProtectedProcessListLock, &oldIrql);
    InsertHeadList(&ProtectedProcessListHead, &entry->ListEntry);
    KeReleaseSpinLock(&ProtectedProcessListLock, oldIrql);
    
    return entry;
}
开发者ID:andyvand,项目名称:ProcessHacker,代码行数:42,代码来源:protect.c


示例3: LibTCPClose

err_t
LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback)
{
    err_t ret;
    struct lwip_callback_msg *msg;

    msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList);
    if (msg)
    {
        KeInitializeEvent(&msg->Event, NotificationEvent, FALSE);

        msg->Input.Close.Connection = Connection;
        msg->Input.Close.Callback = callback;

        if (safe)
            LibTCPCloseCallback(msg);
        else
            tcpip_callback_with_block(LibTCPCloseCallback, msg, 1);

        if (WaitForEventSafely(&msg->Event))
            ret = msg->Output.Close.Error;
        else
            ret = ERR_CLSD;

        ExFreeToNPagedLookasideList(&MessageLookasideList, msg);

        return ret;
    }

    return ERR_MEM;
}
开发者ID:RareHare,项目名称:reactos,代码行数:31,代码来源:rostcp.c


示例4: LibTCPSocket

struct tcp_pcb *
LibTCPSocket(void *arg)
{
    struct lwip_callback_msg *msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList);
    struct tcp_pcb *ret;

    if (msg)
    {
        KeInitializeEvent(&msg->Event, NotificationEvent, FALSE);
        msg->Input.Socket.Arg = arg;

        tcpip_callback_with_block(LibTCPSocketCallback, msg, 1);

        if (WaitForEventSafely(&msg->Event))
            ret = msg->Output.Socket.NewPcb;
        else
            ret = NULL;

        ExFreeToNPagedLookasideList(&MessageLookasideList, msg);

        return ret;
    }

    return NULL;
}
开发者ID:RareHare,项目名称:reactos,代码行数:25,代码来源:rostcp.c


示例5: Filter

VOID __stdcall Filter(ULONG ServiceId, ULONG TableBase, ULONG Argc, ULONG StackAddr) {
	ULONG pid = (ULONG)PsGetCurrentProcessId();
	if (pid == g_nPid) {
		ULONG i;
		PXBoxData pData=(PXBoxData)ExAllocateFromNPagedLookasideList(&g_nPageList);
		if(!pData)
			return;
		
		if (StackAddr < MmUserProbeAddress)
			pData->bFromUser = 1;
		else
			pData->bFromUser = 0;
		
		if (TableBase == (ULONG)KeServiceDescriptorTable.ServiceTableBase)
			pData->bFromSSDT = 1;
		else
			pData->bFromSSDT = 0;

		if (Argc > 16)
			Argc = 16;
		pData->argc = (UCHAR)Argc;
		for (i = 0; i < Argc; ++i)
			pData->args[i] = ((PULONG)StackAddr)[i];

		pData->pid = (ULONG)pid;
		pData->tid = (ULONG)PsGetCurrentThreadId();
		pData->sid = ServiceId;
		KeQuerySystemTime(&pData->time);
		ExInterlockedInsertTailList(&g_linkListHead, &pData->ListEntry, &g_lock);
		KeReleaseSemaphore( &g_keySemaphore, 0, 1, FALSE );
	}
}
开发者ID:340211173,项目名称:hf-2011,代码行数:32,代码来源:XBox.c


示例6: LibTCPListen

PTCP_PCB
LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog)
{
    struct lwip_callback_msg *msg;
    PTCP_PCB ret;

    msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList);
    if (msg)
    {
        KeInitializeEvent(&msg->Event, NotificationEvent, FALSE);
        msg->Input.Listen.Connection = Connection;
        msg->Input.Listen.Backlog = backlog;

        tcpip_callback_with_block(LibTCPListenCallback, msg, 1);

        if (WaitForEventSafely(&msg->Event))
            ret = msg->Output.Listen.NewPcb;
        else
            ret = NULL;

        ExFreeToNPagedLookasideList(&MessageLookasideList, msg);

        return ret;
    }

    return NULL;
}
开发者ID:RareHare,项目名称:reactos,代码行数:27,代码来源:rostcp.c


示例7: ExAllocateFromNPagedLookasideList

void *mm_alloc(size_t size, int flags)
{
	alloc_block *block;
	char        *p_mem = NULL;
	int          i;
	
	if (flags & MEM_FAST)
	{
		for (i = 0; i < NUM_MEM_LISTS; i++) {
			if ((512u << i) < size) continue;
			p_mem = ExAllocateFromNPagedLookasideList(&mem_lists[i]); 
			break;
		}
	}
	if (p_mem == NULL) /* if memory not allocated, allocate from pool */
	{
		if (flags & MEM_SUCCESS)
			p_mem = mm_alloc_success(APOOL_TYPE(flags), ALLOC_SIZE(size), '1_cd'); else
			p_mem = ExAllocatePoolWithTag(APOOL_TYPE(flags), ALLOC_SIZE(size), '1_cd');
		
		if (p_mem == NULL) return NULL;
		flags &= ~MEM_FAST;
	}
	/* memory block must be 16byte aligned */
	if (dSZ(p_mem) & (16-1)) p_mem += 8, flags |= MEM_PADDED;
	/* initialize alloc_block struct */
	block = pv(p_mem);
	block->size  = size;
	block->flags = flags;
	block->index = i;
	/* zero memory if needed */
	if (flags & MEM_ZEROED) memset(block->data, 0, size);
	return &block->data;
}
开发者ID:capturePointer,项目名称:DiskCryptor-1,代码行数:34,代码来源:misc_mem.c


示例8: LibTCPConnect

err_t
LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
{
    struct lwip_callback_msg *msg;
    err_t ret;

    msg = ExAllocateFromNPagedLookasideList(&MessageLookasideList);
    if (msg)
    {
        KeInitializeEvent(&msg->Event, NotificationEvent, FALSE);
        msg->Input.Connect.Connection = Connection;
        msg->Input.Connect.IpAddress = ipaddr;
        msg->Input.Connect.Port = port;

        tcpip_callback_with_block(LibTCPConnectCallback, msg, 1);

        if (WaitForEventSafely(&msg->Event))
        {
            ret = msg->Output.Connect.Error;
        }
        else
            ret = ERR_CLSD;

        ExFreeToNPagedLookasideList(&MessageLookasideList, msg);

        return ret;
    }

    return ERR_MEM;
}
开发者ID:RareHare,项目名称:reactos,代码行数:30,代码来源:rostcp.c


示例9: Notification_Recieve

NTSTATUS Notification_Recieve(NOTIFICATION_QUEUE *queue, PIRP irp) {
	PIO_STACK_LOCATION irpstack = IoGetCurrentIrpStackLocation(irp);
	KIRQL irq;

	if(irpstack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(PGNOTIFICATION)) {
		irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
		irp->IoStatus.Information = 0;
		IoCompleteRequest(irp, IO_NO_INCREMENT);

		return STATUS_BUFFER_TOO_SMALL;
	}
	
	KeAcquireSpinLock(&queue->lock, &irq);

	if(IsListEmpty(&queue->notification_list)) {
		PGIRPNODE *irpnode;
		KIRQL crirq;

		irpnode = ExAllocateFromNPagedLookasideList(&queue->lookaside);

		InitializeListHead(&irpnode->entry);

		irpnode->irp = irp;
		//irp->Tail.Overlay.DriverContext[0] = irpnode;

		InsertTailList(&queue->irp_list, &irpnode->entry);

		IoMarkIrpPending(irp);

		IoAcquireCancelSpinLock(&crirq);

#pragma warning(push)
#pragma warning(disable:4311 4312)
		//IoSetCancelRoutine generates warnings in 32-bit due to silly macroisms.
		IoSetCancelRoutine(irp, Notification_OnCancel);
#pragma warning(pop)

		IoReleaseCancelSpinLock(crirq);
		
		KeReleaseSpinLock(&queue->lock, irq);

		return STATUS_PENDING;
	}
	else {
		PGNOTIFYNODE *notifynode = (PGNOTIFYNODE*)RemoveHeadList(&queue->notification_list);
		PGNOTIFICATION *notification = irp->AssociatedIrp.SystemBuffer;

		RtlCopyMemory(notification, &notifynode->notification, sizeof(PGNOTIFICATION));
		ExFreeToNPagedLookasideList(&queue->lookaside, notifynode);
		--queue->queued;
		
		KeReleaseSpinLock(&queue->lock, irq);

		irp->IoStatus.Status = STATUS_SUCCESS;
		irp->IoStatus.Information = sizeof(PGNOTIFICATION);
		IoCompleteRequest(irp, IO_NO_INCREMENT);

		return STATUS_SUCCESS;
	}
}
开发者ID:Tudi,项目名称:PG2-firewall,代码行数:60,代码来源:notifyqueue.c


示例10: LfsAllocateNonPagedFcb

INLINE
PNON_PAGED_FCB
LfsAllocateNonPagedFcb (
    )
{
    return (PNON_PAGED_FCB) ExAllocateFromNPagedLookasideList( &GlobalLfs.NonPagedFcbLookasideList );
}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:7,代码来源:lfsstruct.c


示例11: SympAddSymbol

BOOLEAN SympAddSymbol(IN PCHAR pszSymbolName, IN ULONG64 uSymbolAddress, IN ULONG uOffset, IN ULONG uBitPosition, IN ULONG uBitLength)
{
	ASSERTMSG("Cannot add symbol with NULL name", pszSymbolName != NULL);
	ASSERTMSG("SymbolEngine must be initialized prior to this call", bIsSymEngineInitialized == TRUE);

	// it is possible that we got symbol with zero address, offset -1, bit position -1, and length -1 if the symbol was not found during
	// enumeration in user mode. In that case, and only in that case, we return error!
	// NOTE: uSymbolAddress of -1 is used when symbols are initialized in order to send the array of wanted symbols to the user mode
	if(uSymbolAddress == 0 && uOffset == -1 && uBitPosition == -1 && uBitLength == -1)
	{
		KdPrint(("[DEBUG] WARNING - Symbol was probably not found in user mode, cannot add symbol with unknown address and unknown offset\n"));
		return FALSE;
	}

	// if symbol with this name already exists
	if(SympFindSymbol(pszSymbolName) != NULL)
	{
		// don't want to "update" the address -- use SymUpdateSymbol function instead
		KdPrint(("[DEBUG] WARNING - Symbol %s with address 0x%x already exists -- use SymUpdateFunction() to update the address\n", pszSymbolName, uSymbolAddress));
		return TRUE;
	}

	// get memory from lookaside list
	PSYMBOL_ENTRY pSymbolEntry = (PSYMBOL_ENTRY) ExAllocateFromNPagedLookasideList(&SymbolsLookasideList);
	if(pSymbolEntry == NULL)
	{
		KdPrint(("[DEBUG] ERROR - Not enough memory in lookaside list to allocate new symbol entry\n"));
		return FALSE;
	}

	// copy string from passed parameter
	if(RtlStringCbCopyA(pSymbolEntry->Symbol.name, MAX_SYM_NAME, pszSymbolName) == STATUS_INVALID_PARAMETER)
	{
		KdPrint(("[DEBUG] ERROR - Error while copying symbol name to SYMBOL_ENTRY structure\n"));
		return FALSE;
	}

	// copy address from the passed parameter
	pSymbolEntry->Symbol.u64address = uSymbolAddress;

	// copy offset from the passed parameter
	pSymbolEntry->Symbol.uOffset = uOffset;

	// copy bit position from the passed parameter
	pSymbolEntry->Symbol.uBitPosition = uBitPosition;

	// copy bit length from the passed parameter
	pSymbolEntry->Symbol.uBitLength = uBitLength;

	// insert it to list (thread safe)
	ASSERTMSG("Fast mutex acquire must occur at or below APC_LEVEL", KeGetCurrentIrql() <= APC_LEVEL);
	ExAcquireFastMutex(&SymbolsListMutex);
	InsertHeadList(&SymbolsListHead, &pSymbolEntry->ListEntry);
	++uSymbolCount;
	ASSERTMSG("Fast mutex release must occur at APC_LEVEL", KeGetCurrentIrql() == APC_LEVEL);
	ExReleaseFastMutex(&SymbolsListMutex);

	return TRUE;
}
开发者ID:angry7panda,项目名称:dementia-forensics,代码行数:59,代码来源:SymbolEngine.cpp


示例12: ExAllocateFromNPagedLookasideList

void *kmem_cache_alloc(struct kmem_cache *kmc, int flags)
{
	void *buf = NULL;

	buf = ExAllocateFromNPagedLookasideList(&(kmc->npll));

	return buf;
}
开发者ID:girishshilamkar,项目名称:lustre-release,代码行数:8,代码来源:winnt-mem.c


示例13: LibTCPEnqueuePacket

void LibTCPEnqueuePacket(PCONNECTION_ENDPOINT Connection, struct pbuf *p)
{
    PQUEUE_ENTRY qp;

    qp = (PQUEUE_ENTRY)ExAllocateFromNPagedLookasideList(&QueueEntryLookasideList);
    qp->p = p;
    qp->Offset = 0;

    ExInterlockedInsertTailList(&Connection->PacketQueue, &qp->ListEntry, &Connection->Lock);
}
开发者ID:RareHare,项目名称:reactos,代码行数:10,代码来源:rostcp.c


示例14: AllocateFltPacket

FLT_PKT*
AllocateFltPacket()
{
    FLT_PKT* pFltPkt = (FLT_PKT*)ExAllocateFromNPagedLookasideList(&g_PktLookaside);

    if (pFltPkt)
        RtlZeroMemory(pFltPkt, sizeof(*pFltPkt));

    return pFltPkt;
}
开发者ID:mnestratov,项目名称:natflt,代码行数:10,代码来源:parse.c


示例15: LockObject

NTSTATUS TCPSendData
( PCONNECTION_ENDPOINT Connection,
  PCHAR BufferData,
  ULONG SendLength,
  PULONG BytesSent,
  ULONG Flags,
  PTCP_COMPLETION_ROUTINE Complete,
  PVOID Context )
{
    NTSTATUS Status;
    PTDI_BUCKET Bucket;
    KIRQL OldIrql;

    LockObject(Connection, &OldIrql);

    TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Called for %d bytes (on socket %x)\n",
                           SendLength, Connection->SocketContext));

    TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection = %x\n", Connection));
    TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Connection->SocketContext = %x\n",
                           Connection->SocketContext));

    Status = TCPTranslateError(LibTCPSend(Connection,
                                          BufferData,
                                          SendLength,
                                          BytesSent,
                                          FALSE));
    
    TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Send: %x, %d\n", Status, SendLength));

    /* Keep this request around ... there was no data yet */
    if (Status == STATUS_PENDING)
    {
        /* Freed in TCPSocketState */
        Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
        if (!Bucket)
        {
            UnlockObject(Connection, OldIrql);
            TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Failed to allocate bucket\n"));
            return STATUS_NO_MEMORY;
        }
        
        Bucket->Request.RequestNotifyObject = Complete;
        Bucket->Request.RequestContext = Context;
        
        InsertTailList( &Connection->SendRequest, &Bucket->Entry );
        TI_DbgPrint(DEBUG_TCP,("[IP, TCPSendData] Queued write irp\n"));
    }

    UnlockObject(Connection, OldIrql);

    TI_DbgPrint(DEBUG_TCP, ("[IP, TCPSendData] Leaving. Status = %x\n", Status));

    return Status;
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:55,代码来源:tcp.c


示例16: win_make_mbuf

/*
 * For packets coming from the generic adapter, netmap expects
 * an mbuf with a persistent copy of the data.
 * For the time being we construct a brand new mbuf and
 * pass it to the handler.
 * We use this routine also in a way similar to m_getcl(),
 * passing a NULL pointer does not initialize the buffer (we need the length).
 * We have two pools, one for the mbuf and one for the cluster.
 * XXX we could do with a single allocation.
 */
struct mbuf *
win_make_mbuf(struct net_device *ifp, uint32_t length, const char *data)
{
	struct mbuf *m = ExAllocateFromNPagedLookasideList(&ifp->mbuf_pool);
	//DbgPrint("win_make_mbuf - Data: %p - length: %i", data, length);
	if (m == NULL) {
		DbgPrint("Netmap.sys: Failed to allocate memory from the mbuf!!!");
		return NULL;
	}
	m->m_len = length;
	m->pkt = ExAllocateFromNPagedLookasideList(&ifp->mbuf_packets_pool);
	if (m->pkt == NULL) {
		DbgPrint("Netmap.sys: Failed to allocate memory from the mbuf packet!!!");
		ExFreeToNPagedLookasideList(&ifp->mbuf_pool, m);
		return NULL;
	}
	m->dev = ifp;
	if (data) // XXX otherwise zero memory ?
		RtlCopyMemory(m->pkt, data, length);
	return m;
}
开发者ID:hemantagr,项目名称:netmap,代码行数:31,代码来源:netmap_windows.c


示例17: LfsAllocateResource

INLINE
PERESOURCE
LfsAllocateResource (
    )
{
    PERESOURCE Resource;

    Resource = (PERESOURCE) ExAllocateFromNPagedLookasideList( &GlobalLfs.EResourceLookasideList );

    ExInitializeResourceLite( Resource );

    return Resource;
}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:13,代码来源:lfsstruct.c


示例18: TI_DbgPrint

NTSTATUS TCPReceiveData
( PCONNECTION_ENDPOINT Connection,
  PNDIS_BUFFER Buffer,
  ULONG ReceiveLength,
  PULONG BytesReceived,
  ULONG ReceiveFlags,
  PTCP_COMPLETION_ROUTINE Complete,
  PVOID Context )
{
    PTDI_BUCKET Bucket;
    PUCHAR DataBuffer;
    UINT DataLen, Received;
    NTSTATUS Status;

    TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Called for %d bytes (on socket %x)\n",
                           ReceiveLength, Connection->SocketContext));

    NdisQueryBuffer(Buffer, &DataBuffer, &DataLen);

    Status = LibTCPGetDataFromConnectionQueue(Connection, DataBuffer, DataLen, &Received);

    if (Status == STATUS_PENDING)
    {
        Bucket = ExAllocateFromNPagedLookasideList(&TdiBucketLookasideList);
        if (!Bucket)
        {
            TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Failed to allocate bucket\n"));

            return STATUS_NO_MEMORY;
        }
    
        Bucket->Request.RequestNotifyObject = Complete;
        Bucket->Request.RequestContext = Context;

        ExInterlockedInsertTailList( &Connection->ReceiveRequest, &Bucket->Entry, &Connection->Lock );
        TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Queued read irp\n"));

        TI_DbgPrint(DEBUG_TCP,("[IP, TCPReceiveData] Leaving. Status = STATUS_PENDING\n"));

        (*BytesReceived) = 0;
    }
    else
    {
        (*BytesReceived) = Received;
    }

    return Status;
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:48,代码来源:tcp.c


示例19: XixFsdAllocateCCB

PXIFS_CCB	
XixFsdAllocateCCB(VOID)
{
	BOOLEAN				IsFromLookasideList = FALSE;
	PXIFS_CCB			CCB = NULL;

	PAGED_CODE();
	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CREATE|DEBUG_TARGET_CCB), 
		("Enter XixFsdAllocateCCB\n"));


	// allocate memory
	CCB = ExAllocateFromNPagedLookasideList(&(XifsCcbLookasideList));
	if(!CCB)
	{
		CCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(XIFS_CCB),TAG_CCB);
		if(!CCB)
		{
			//debug message
			DebugTrace(DEBUG_LEVEL_ERROR, (DEBUG_TARGET_CREATE|DEBUG_TARGET_CCB), 
				("ERROR XixFsdAllocateCCB Can't allocate\n"));
			return NULL;
		}
		IsFromLookasideList = FALSE;
	} else {
		IsFromLookasideList = TRUE;
	}

	RtlZeroMemory(CCB,sizeof(XIFS_CCB));

	CCB->NodeTypeCode = XIFS_NODE_CCB;
	CCB->NodeByteSize = sizeof(sizeof(XIFS_CCB));
	
	InitializeListHead(&CCB->LinkToFCB);

	
	if (!IsFromLookasideList) {
		XifsdSetFlag(CCB->CCBFlags, XIFSD_CCB_NOT_FROM_POOL);

		DebugTrace(DEBUG_LEVEL_CRITICAL, (DEBUG_TARGET_CREATE|DEBUG_TARGET_CCB), 
			("XixFsdAllocateCCB CCBFlags(0x%x)\n",CCB->CCBFlags));
	}

	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CREATE|DEBUG_TARGET_CCB), 
		("Exit XixFsdAllocateCCB(%p)\n",CCB));

	return CCB;	
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:48,代码来源:XixFsAllocate.c


示例20: FFSAllocateCcb

__drv_mustHoldCriticalRegion
PFFS_CCB
FFSAllocateCcb(
	VOID)
{
	PFFS_CCB Ccb;

    PAGED_CODE();

	ExAcquireResourceExclusiveLite(
			&FFSGlobal->LAResource,
			TRUE);

	Ccb = (PFFS_CCB)(ExAllocateFromNPagedLookasideList(&(FFSGlobal->FFSCcbLookasideList)));

	ExReleaseResourceForThreadLite(
			&FFSGlobal->LAResource,
			ExGetCurrentResourceThread());

	if (Ccb == NULL)
	{
		Ccb = (PFFS_CCB)ExAllocatePoolWithTag(NonPagedPool, sizeof(FFS_CCB), FFS_POOL_TAG);

		RtlZeroMemory(Ccb, sizeof(FFS_CCB));

		SetFlag(Ccb->Flags, CCB_FROM_POOL);
	}
	else
	{
		RtlZeroMemory(Ccb, sizeof(FFS_CCB));
	}

	if (!Ccb)
	{
		return NULL;
	}

	Ccb->Identifier.Type = FFSCCB;
	Ccb->Identifier.Size = sizeof(FFS_CCB);

	Ccb->CurrentByteOffset = 0;

	Ccb->DirectorySearchPattern.Length = 0;
	Ccb->DirectorySearchPattern.MaximumLength = 0;
	Ccb->DirectorySearchPattern.Buffer = 0;

	return Ccb;
}
开发者ID:GYGit,项目名称:reactos,代码行数:48,代码来源:memory.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ExAllocatePoolWithTag函数代码示例发布时间:2022-05-30
下一篇:
C++ ExAcquireResourceSharedLite函数代码示例发布时间: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