您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ExAllocateFromNPagedLookasideList函数代码示例

51自学网 2021-06-01 20:39:21
  C++
这篇教程C++ ExAllocateFromNPagedLookasideList函数代码示例写得很实用,希望能帮到您。

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

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

示例1: LibTCPShutdown

err_tLibTCPShutdown(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,


示例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,


示例3: LibTCPClose

err_tLibTCPClose(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,


示例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,


示例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,


示例6: LibTCPListen

PTCP_PCBLibTCPListen(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,


示例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,


示例8: LibTCPConnect

err_tLibTCPConnect(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,


示例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,


示例10: LfsAllocateNonPagedFcb

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例17: LfsAllocateResource

INLINEPERESOURCELfsAllocateResource (    ){    PERESOURCE Resource;    Resource = (PERESOURCE) ExAllocateFromNPagedLookasideList( &GlobalLfs.EResourceLookasideList );    ExInitializeResourceLite( Resource );    return Resource;}
开发者ID:Nevermore2015,项目名称:ndas4windows,代码行数:13,


示例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,


示例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,


示例20: FFSAllocateCcb

__drv_mustHoldCriticalRegionPFFS_CCBFFSAllocateCcb(	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,


示例21: ExDeleteNPagedLookasideList

VOIDExDeleteNPagedLookasideList (    IN PNPAGED_LOOKASIDE_LIST Lookaside    )/*++Routine Description:    This function removes a paged lookaside structure from the system paged    lookaside list and frees any entries specified by the lookaside structure.Arguments:    Lookaside - Supplies a pointer to a nonpaged lookaside list structure.Return Value:    None.--*/{    PVOID Entry;    KIRQL OldIrql;    //    // Acquire the nonpaged system lookaside list lock and remove the    // specified lookaside list structure from the list.    //    ExAcquireSpinLock(&ExNPagedLookasideLock, &OldIrql);    RemoveEntryList(&Lookaside->L.ListEntry);    ExReleaseSpinLock(&ExNPagedLookasideLock, OldIrql);    //    // Remove all pool entries from the specified lookaside structure    // and free them.    //    Lookaside->L.Allocate = ExpDummyAllocate;    while ((Entry = ExAllocateFromNPagedLookasideList(Lookaside)) != NULL) {        (Lookaside->L.Free)(Entry);    }    return;}
开发者ID:chunhualiu,项目名称:OpenNT,代码行数:48,


示例22: FatBuildIrpContext

PFAT_IRP_CONTEXTNTAPIFatBuildIrpContext(PIRP Irp,                   BOOLEAN CanWait){    PIO_STACK_LOCATION IrpSp;    PFAT_IRP_CONTEXT IrpContext;    PVOLUME_DEVICE_OBJECT VolumeObject;    /* Get current IRP stack location */    IrpSp = IoGetCurrentIrpStackLocation(Irp);    /* Allocate memory for the Irp context */    IrpContext = ExAllocateFromNPagedLookasideList(&FatGlobalData.IrpContextList);    /* Zero init memory */    RtlZeroMemory(IrpContext, sizeof(FAT_IRP_CONTEXT));    /* Save IRP, MJ and MN */    IrpContext->Irp = Irp;    IrpContext->Stack = IrpSp;    IrpContext->MajorFunction = IrpSp->MajorFunction;    IrpContext->MinorFunction = IrpSp->MinorFunction;    /* Set DeviceObject */    if (IrpSp->FileObject)    {        IrpContext->DeviceObject = IrpSp->FileObject->DeviceObject;        /* Save VCB pointer */        VolumeObject = (PVOLUME_DEVICE_OBJECT)IrpSp->DeviceObject;        IrpContext->Vcb = &VolumeObject->Vcb;        /* TODO: Handle write-through */    }    else if (IrpContext->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL)    {        /* Handle FSCTRL case */        IrpContext->DeviceObject = IrpSp->Parameters.MountVolume.Vpb->RealDevice;    }    /* Set Wait flag */    if (CanWait) IrpContext->Flags |= IRPCONTEXT_CANWAIT;    /* Return prepared context */    return IrpContext;}
开发者ID:GYGit,项目名称:reactos,代码行数:47,


示例23: NtfsCreateFCB

PNTFS_FCBNtfsCreateFCB(PCWSTR FileName,              PCWSTR Stream,              PNTFS_VCB Vcb){    PNTFS_FCB Fcb;    ASSERT(Vcb);    ASSERT(Vcb->Identifier.Type == NTFS_TYPE_VCB);    Fcb = ExAllocateFromNPagedLookasideList(&NtfsGlobalData->FcbLookasideList);    RtlZeroMemory(Fcb, sizeof(NTFS_FCB));    Fcb->Identifier.Type = NTFS_TYPE_FCB;    Fcb->Identifier.Size = sizeof(NTFS_TYPE_FCB);    Fcb->Vcb = Vcb;    if (FileName)    {        wcscpy(Fcb->PathName, FileName);        if (wcsrchr(Fcb->PathName, '//') != 0)        {            Fcb->ObjectName = wcsrchr(Fcb->PathName, '//');        }        else        {            Fcb->ObjectName = Fcb->PathName;        }    }    if (Stream)    {        wcscpy(Fcb->Stream, Stream);    }    else    {        Fcb->Stream[0] = UNICODE_NULL;    }    ExInitializeResourceLite(&Fcb->MainResource);    Fcb->RFCB.Resource = &(Fcb->MainResource);    return Fcb;}
开发者ID:GYGit,项目名称:reactos,代码行数:46,


示例24: DefaultDispatch

static NTSTATUSDefaultDispatch(	PDEVICE_OBJECT	DeviceObject,	PIRP			Irp	){	NTSTATUS				status;	PIO_STACK_LOCATION		IrpStack;	PMYCONTEXT				MyContext;	PDRIVER_ENTRY			DrvEntry;	PDEVICE_ENTRY			DevEntry;	IrpStack = IoGetCurrentIrpStackLocation(Irp);	DevEntry = LookupEntryByDevObj(DeviceObject);	if ( DevEntry )	{		MyContext = ExAllocateFromNPagedLookasideList(&ContextLookaside);		if ( MyContext )		{			MyContext->Context = IrpStack->Context;			MyContext->Control = IrpStack->Control;			MyContext->MajorFunction = IrpStack->MajorFunction;			MyContext->CompletionRoutine = IrpStack->CompletionRoutine;			IrpStack->CompletionRoutine = MyCompletionRoutine;			IrpStack->Context = MyContext;			IrpStack->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR | SL_INVOKE_ON_CANCEL;		}		status = (DevEntry->DrvEntry->DriverDispatch[IrpStack->MajorFunction])(DeviceObject, Irp);	}	else	{		DrvEntry = LookupEntryByDrvObj(DeviceObject->DriverObject);		if ( !DrvEntry )		{			DbgPrint("***** UH-OH/n");			return STATUS_DEVICE_NOT_READY;		}		status = (DrvEntry->DriverDispatch[IrpStack->MajorFunction])(DeviceObject, Irp);	}	return status;}
开发者ID:maodapeng,项目名称:WDUtils,代码行数:46,


示例25: Insert

void Insert(DWORD key, PDATA pData, PHASHTABLE pHashTable){	PTWOWAY pNode = NULL; 	PTWOWAY pNewNode = NULL;	PLIST_ENTRY pListHead = NULL;	pNode = Find(key, pHashTable);	// The node with the given key was not found.	if (pNode == NULL)	{		pNewNode = ExAllocateFromNPagedLookasideList(pLookasideList_TWOWAY);		if (pNewNode == NULL)		{			DbgPrint("ExAllocateFromNPagedLookasideList returned NULL!/n");			return;		}				// Insert the data to the node.		pNewNode->key = key;		pNewNode->data.threadID = pData->threadID;		pNewNode->data.processID = pData->processID;		if (STATUS_SUCCESS != RtlStringCbCopyA(pNewNode->data.imageName, 16, pData->imageName))		{			DbgPrint("RtlStringCbCopyA failed!/n");		}		// Insert the node to the doubly-linked list.		pListHead = pHashTable->pListHeads[Hash(key, pHashTable->tableSize)];		InsertTailList(pListHead, &pNewNode->linkfield);#ifdef MY_DEBUG		DbgPrint("INSERT: thread ID = 0x%x process ID = 0x%x image = %s/n", pData->threadID, pData->processID, pData->imageName);#endif	}#ifdef MY_DEBUG	else	{		if (pNode->data.processID != pData->processID)		{			DbgPrint("Node with key = 0x%x already in list/n", key);			DbgPrint("OLD: thread ID = 0x%x process ID = 0x%x image = %s/n", pNode->data.threadID, pNode->data.processID, pNode->data.imageName);			DbgPrint("NEW: thread ID = 0x%x process ID = 0x%x image = %s/n", pData->threadID, pData->processID, pData->imageName);		}	}#endif}
开发者ID:Artorios,项目名称:rootkit.com,代码行数:45,


示例26: CreateNodeEventHandler

// Create a node event handler for the specified nodeNodeEventHandler* CreateNodeEventHandler(EventHandlerManager* event_handler_manager, PFILE_OBJECT node){	NodeEventHandler* node_event_handler = NULL;	node_event_handler = (NodeEventHandler*)ExAllocateFromNPagedLookasideList(&event_handler_manager->event_handlers_pool);	if(node_event_handler == NULL)		return NULL;	node_event_handler->node = node;	node_event_handler->num_handlers = 0;	RtlZeroMemory(node_event_handler->handlers, sizeof(EventHandler) * TDI_EVENT_HANDLERS_MAX);	InsertHashMap(&event_handler_manager->event_handlers, (UINT)node, node_event_handler);	return node_event_handler;}
开发者ID:340211173,项目名称:capture-hpc,代码行数:19,


示例27: CreateFltPacketWithBuffer

FLT_PKT*CreateFltPacketWithBuffer(){    FLT_PKT* pFltPkt;    pFltPkt = AllocateFltPacket();    if (NULL == pFltPkt)        return NULL;    pFltPkt->pBuf = ExAllocateFromNPagedLookasideList(&g_DataLookaside);    if (NULL == pFltPkt->pBuf) {        FreeFltPkt(pFltPkt);        return NULL;    }    RtlZeroMemory(pFltPkt->pBuf, MAX_ETHER_SIZE);    return pFltPkt;}
开发者ID:mnestratov,项目名称:natflt,代码行数:18,


示例28: XixFsdAllocateFCB

PXIFS_FCB 	XixFsdAllocateFCB(VOID){	BOOLEAN				IsFromLookasideList = FALSE;	PXIFS_FCB			FCB = NULL;	uint32				i = 0;		PAGED_CODE();	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CREATE|DEBUG_TARGET_FCB), 		("Enter XixFsdAllocateFCB/n"));	// allocate memory	FCB = ExAllocateFromNPagedLookasideList(&(XifsFcbLookasideList));	if(!FCB)	{		FCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(XIFS_FCB),TAG_FCB);		if(!FCB)		{			//debug message			DebugTrace(DEBUG_LEVEL_ERROR, (DEBUG_TARGET_CREATE|DEBUG_TARGET_FCB), 				("ERROR XixFsAllocateFCB Can't allocate/n"));			return NULL;		}		IsFromLookasideList = FALSE;	} else {		IsFromLookasideList = TRUE;	}		RtlZeroMemory(FCB,sizeof(XIFS_FCB));		if (!IsFromLookasideList) {		XifsdSetFlag(FCB->FCBFlags, XIFSD_FCB_NOT_FROM_POOL);				DebugTrace(DEBUG_LEVEL_CRITICAL, (DEBUG_TARGET_CREATE|DEBUG_TARGET_FCB), 			("XixFsdAllocateFCB FCBFlags(0x%x)/n",FCB->FCBFlags));	}			FCB->NodeTypeCode = XIFS_NODE_FCB;	FCB->NodeByteSize = sizeof(sizeof(XIFS_FCB));	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CREATE|DEBUG_TARGET_FCB), 		("Exit XixFsdAllocateFCB(%p)/n",FCB));	return FCB;	}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:44,


示例29: cp_parallelized_crypt

void cp_parallelized_crypt(	   int   is_encrypt, xts_key *key, fc_callback on_complete, 	   void *param, const unsigned char *in, unsigned char *out, u32 len, u64 offset){	req_item *item;	req_part *part;	u32       part_sz;	u32       part_of;	if ( (len < F_OP_THRESOLD) ||		 ((item = ExAllocateFromNPagedLookasideList(&pool_req_mem)) == NULL) )	{		if (is_encrypt != 0) {			xts_encrypt(in, out, len, offset, key);		} else {			xts_decrypt(in, out, len, offset, key);		}		on_complete(param); return;	}	item->is_encrypt = is_encrypt;	item->length = len;	item->in  = in;	item->out = out;	item->offset      = offset;	item->on_complete = on_complete;	item->param = param;	item->key   = key;	part_sz = _align(len / dc_cpu_count, F_MIN_REQ);	part_of = 0; part = &item->parts[0];	do	{		part_sz      = min(part_sz, len);		part->item   = item;		part->offset = part_of;		part->length = part_sz;		InterlockedPushEntrySList(&pool_head, &part->entry);		part_of += part_sz; len -= part_sz; part++;	} while (len != 0);	KeSetEvent(&pool_signal_event, IO_NO_INCREMENT, FALSE);}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:44,


示例30: XixFsdAllocateCloseFcbCtx

PXIFS_CLOSE_FCB_CTX	XixFsdAllocateCloseFcbCtx(VOID){	BOOLEAN						IsFromLookasideList = FALSE;	PXIFS_CLOSE_FCB_CTX			Ctx = NULL;	PAGED_CODE();	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CLOSE), 		("Enter XixFsdAllocateCloseFcbCtx /n"));	// allocate memory	Ctx = ExAllocateFromNPagedLookasideList(&(XifsCloseFcbCtxList));	if(!Ctx)	{		Ctx = ExAllocatePoolWithTag(PagedPool, sizeof(XIFS_CLOSE_FCB_CTX),TAG_CLOSEFCBCTX);		if(!Ctx)		{			DebugTrace(DEBUG_LEVEL_ERROR, (DEBUG_TARGET_CLOSE), 				("ERROR XixFsdAllocateCloseFcbCtx Can't allocate/n"));			//debug message			return NULL;		}		IsFromLookasideList = FALSE;	} else {		IsFromLookasideList = TRUE;	}	RtlZeroMemory(Ctx,sizeof(XIFS_CLOSE_FCB_CTX));	InitializeListHead(&(Ctx->DelayedCloseLink));		if (!IsFromLookasideList) {		XifsdSetFlag(Ctx->CtxFlags, XIFSD_CTX_FLAGS_NOT_FROM_POOL);		DebugTrace(DEBUG_LEVEL_CRITICAL, (DEBUG_TARGET_CLOSE), 			(" XixFsdAllocateCloseFcbCtx CtxFlags(0x%x)/n",Ctx->CtxFlags));	}	DebugTrace((DEBUG_LEVEL_TRACE|DEBUG_LEVEL_INFO), (DEBUG_TARGET_CLOSE), 		("Exit XixFsdAllocateCloseFcbCtx (%p)/n", Ctx));	return Ctx;	}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:43,



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


C++ ExAllocatePoolWithTag函数代码示例
C++ ExAcquireResourceSharedLite函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。