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

C++ KeEnterCriticalRegion函数代码示例

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

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



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

示例1: TestResourceExclusiveAccess

static
VOID
TestResourceExclusiveAccess(
    IN PERESOURCE Res)
{
    LONG Count = 0;

    KeEnterCriticalRegion();
    ok_bool_true(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned"); ++Count;

    CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU);

    ok_bool_true(ExAcquireResourceExclusiveLite(Res, TRUE), "ExAcquireResourceExclusiveLite returned"); ++Count;
    CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU);

    ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count;
    ok_bool_true(ExAcquireResourceSharedLite(Res, TRUE), "ExAcquireResourceSharedLite returned"); ++Count;
    ok_bool_true(ExAcquireSharedStarveExclusive(Res, FALSE), "ExAcquireSharedStarveExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedStarveExclusive(Res, TRUE), "ExAcquireSharedStarveExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedWaitForExclusive(Res, FALSE), "ExAcquireSharedWaitForExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedWaitForExclusive(Res, TRUE), "ExAcquireSharedWaitForExclusive returned"); ++Count;
    CheckResourceStatus(Res, TRUE, Count, 0LU, 0LU);

    ExConvertExclusiveToSharedLite(Res);
    CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU);

    while (Count--)
        ExReleaseResourceLite(Res);
    KeLeaveCriticalRegion();
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:30,代码来源:ExResource.c


示例2: DokanCheckKeepAlive

VOID DokanCheckKeepAlive(__in PDokanDCB Dcb) {
  LARGE_INTEGER tickCount;
  ULONG mounted;

  // DDbgPrint("==> DokanCheckKeepAlive\n");

  KeEnterCriticalRegion();
  KeQueryTickCount(&tickCount);
  ExAcquireResourceSharedLite(&Dcb->Resource, TRUE);

  if (Dcb->TickCount.QuadPart < tickCount.QuadPart) {

    mounted = Dcb->Mounted;

    ExReleaseResourceLite(&Dcb->Resource);

    DDbgPrint("  Timeout, umount\n");

    if (!mounted) {
      // not mounted
      KeLeaveCriticalRegion();
      return;
    }
    DokanUnmount(Dcb);

  } else {
    ExReleaseResourceLite(&Dcb->Resource);
  }

  KeLeaveCriticalRegion();
  // DDbgPrint("<== DokanCheckKeepAlive\n");
}
开发者ID:Driim,项目名称:dokany,代码行数:32,代码来源:timeout.c


示例3: ThreadNotifyCallback

VOID
ThreadNotifyCallback (
    HANDLE  ProcessId,
    HANDLE  ThreadId,
    BOOLEAN  Create )
{
    DbgPrint ( "%s ProcessId=%x ThreadId=%x %s\n", __FUNCTION__,
        ProcessId,
        ThreadId,
        Create ? "CREATED" : "DESTROYED" );

    if ( Create ) {

        // Step #2 : Acquire the lock that protects the g_Tidxxx globals 
        // (KeEnterCriticalRegion() and ExAcquireResourceExclusiveLite())
        KeEnterCriticalRegion();
        ExAcquireResourceExclusiveLite(&g_TidLock, TRUE);

        g_TidArray[g_TidIndex] = ThreadId;
        g_TidIndex++;
        if ( g_TidIndex >= TID_ARRAY_SIZE ) {
            g_TidIndex = 0;
        }

        // Step #3 : Release the lock that protects the g_Tidxxx globals 
        // (KeLeaveCriticalRegion() and ExReleaseResourceLite())
        ExReleaseResourceLite(&g_TidLock);
        KeLeaveCriticalRegion();
    }
}
开发者ID:EternalKeel,项目名称:CodeMachineCourse,代码行数:30,代码来源:locking.c


示例4: dc_clean_pass_cache

void dc_clean_pass_cache()
{
	dsk_pass *d_pass;
	dsk_pass *c_pass;
	int       loirql;

	if (loirql = (KeGetCurrentIrql() == PASSIVE_LEVEL)) {
		KeEnterCriticalRegion();
		ExAcquireResourceExclusiveLite(&p_resource, TRUE);
	}

	for (d_pass = f_pass; d_pass;)
	{
		c_pass = d_pass;
		d_pass = d_pass->next;
		/* zero password data */
		burn(c_pass, sizeof(dsk_pass));
		/* free memory if possible */
		if (loirql != 0) mm_secure_free(c_pass);
	}
	f_pass = NULL;

	if (loirql != 0) {
		ExReleaseResourceLite(&p_resource);
		KeLeaveCriticalRegion();
	}
}
开发者ID:the-alien,项目名称:diskcryptor,代码行数:27,代码来源:mount.c


示例5: UserEnterExclusive

VOID FASTCALL UserEnterExclusive(VOID)
{
    ASSERT_NOGDILOCKS();
    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite(&UserLock, TRUE);
    gptiCurrent = PsGetCurrentThreadWin32Thread();
}
开发者ID:RPG-7,项目名称:reactos,代码行数:7,代码来源:ntuser.c


示例6: dc_add_password

void dc_add_password(dc_pass *pass)
{
	dsk_pass *d_pass;

	if (pass->size != 0)
	{
		KeEnterCriticalRegion();
		ExAcquireResourceExclusiveLite(&p_resource, TRUE);

		for (d_pass = f_pass; d_pass; d_pass = d_pass->next)
		{
			if (IS_EQUAL_PASS(pass, &d_pass->pass)) {
				break;
			}
		}

		if ( (d_pass == NULL) && (d_pass = mm_secure_alloc(sizeof(dsk_pass))) )
		{
			memcpy(&d_pass->pass, pass, sizeof(dc_pass));

			d_pass->next = f_pass;
			f_pass       = d_pass;
		}

		ExReleaseResourceLite(&p_resource);
		KeLeaveCriticalRegion();
	}
}
开发者ID:the-alien,项目名称:diskcryptor,代码行数:28,代码来源:mount.c


示例7: IoUnregisterFileSystem

/*
 * @implemented
 */
VOID
NTAPI
IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
{
    PAGED_CODE();

    /* Acquire the FS lock */
    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite(&IopDatabaseResource, TRUE);

    /* Simply remove the entry - if queued */
    if (DeviceObject->Queue.ListEntry.Flink)
    {
        RemoveEntryList(&DeviceObject->Queue.ListEntry);
    }

    /* And notify all registered file systems */
    IopNotifyFileSystemChange(DeviceObject, FALSE);

    /* Update operations counter */
    IopFsRegistrationOps++;

    /* Then release the lock */
    ExReleaseResourceLite(&IopDatabaseResource);
    KeLeaveCriticalRegion();

    /* Decrease reference count to allow unload */
    IopInterlockedDecrementUlong(LockQueueIoDatabaseLock, (PULONG)&DeviceObject->ReferenceCount);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:32,代码来源:volume.c


示例8: DokanFreeCCB

NTSTATUS
DokanFreeCCB(
  __in PDokanCCB ccb
  )
{
	PDokanFCB fcb;

	ASSERT(ccb != NULL);
	
	fcb = ccb->Fcb;

	KeEnterCriticalRegion();
	ExAcquireResourceExclusiveLite(&fcb->Resource, TRUE);

	RemoveEntryList(&ccb->NextCCB);

	ExReleaseResourceLite(&fcb->Resource);
	KeLeaveCriticalRegion();

	ExDeleteResourceLite(&ccb->Resource);

	if (ccb->SearchPattern) {
		ExFreePool(ccb->SearchPattern);
	}

	ExFreePool(ccb);
	InterlockedIncrement(&fcb->Vcb->CcbFreed);

	return STATUS_SUCCESS;
}
开发者ID:nmlgc,项目名称:dokany,代码行数:30,代码来源:create.c


示例9: AcquireResourceThread

static
VOID
NTAPI
AcquireResourceThread(
    PVOID Context)
{
    NTSTATUS Status = STATUS_SUCCESS;
    PTHREAD_DATA ThreadData = Context;
    BOOLEAN Ret;

    KeEnterCriticalRegion();
    Ret = ThreadData->AcquireResource(ThreadData->Res, ThreadData->Wait);
    if (ThreadData->RetExpected)
        ok_bool_true(Ret, "AcquireResource returned");
    else
        ok_bool_false(Ret, "AcquireResource returned");

    ok_bool_false(KeSetEvent(&ThreadData->OutEvent, 0, TRUE), "KeSetEvent returned");
    Status = KeWaitForSingleObject(&ThreadData->InEvent, Executive, KernelMode, FALSE, NULL);
    ok_eq_hex(Status, STATUS_SUCCESS);

    if (Ret)
        ExReleaseResource(ThreadData->Res);
    KeLeaveCriticalRegion();
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:25,代码来源:ExResource.c


示例10: TestResourceSharedAccess

static
VOID
TestResourceSharedAccess(
    IN PERESOURCE Res)
{
    LONG Count = 0;

    KeEnterCriticalRegion();
    ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count;
    CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU);

    ok_bool_true(ExAcquireResourceSharedLite(Res, FALSE), "ExAcquireResourceSharedLite returned"); ++Count;
    ok_bool_true(ExAcquireResourceSharedLite(Res, TRUE), "ExAcquireResourceSharedLite returned"); ++Count;
    ok_bool_true(ExAcquireSharedStarveExclusive(Res, FALSE), "ExAcquireSharedStarveExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedStarveExclusive(Res, TRUE), "ExAcquireSharedStarveExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedWaitForExclusive(Res, FALSE), "ExAcquireSharedWaitForExclusive returned"); ++Count;
    ok_bool_true(ExAcquireSharedWaitForExclusive(Res, TRUE), "ExAcquireSharedWaitForExclusive returned"); ++Count;
    CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU);

    /* this one fails, TRUE would deadlock */
    ok_bool_false(ExAcquireResourceExclusiveLite(Res, FALSE), "ExAcquireResourceExclusiveLite returned");
    CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU);

    /* this asserts */
    if (!KmtIsCheckedBuild)
        ExConvertExclusiveToSharedLite(Res);
    CheckResourceStatus(Res, FALSE, Count, 0LU, 0LU);

    while (Count--)
        ExReleaseResourceLite(Res);
    KeLeaveCriticalRegion();
}
开发者ID:mutoso-mirrors,项目名称:reactos,代码行数:32,代码来源:ExResource.c


示例11: FilterDeleteControlObject

VOID
FilterDeleteControlObject(
)
{
    UNICODE_STRING      symbolicLinkName;
    PCONTROL_DEVICE_EXTENSION   deviceExtension;

    PAGED_CODE();    

    KeEnterCriticalRegion();
    KeWaitForSingleObject(&ControlLock, Executive, KernelMode, FALSE, NULL);

    //
    // If this is the last instance of the device then delete the controlobject
    // and symbolic link to enable the pnp manager to unload the driver.
    //
    
    if (!(--InstanceCount) && ControlDeviceObject)
    {
        RtlInitUnicodeString(&symbolicLinkName, SYMBOLIC_NAME_STRING);
        deviceExtension = ControlDeviceObject->DeviceExtension;
        deviceExtension->Deleted = TRUE;
        IoDeleteSymbolicLink(&symbolicLinkName);
        IoDeleteDevice(ControlDeviceObject);
        ControlDeviceObject = NULL;
    }

    KeSetEvent(&ControlLock, IO_NO_INCREMENT, FALSE);
    KeLeaveCriticalRegion();

}
开发者ID:kcrazy,项目名称:winekit,代码行数:31,代码来源:filter.c


示例12: EvhdDirectIoControl

static NTSTATUS EvhdDirectIoControl(ParserInstance *parser, ULONG ControlCode, PVOID pSystemBuffer, ULONG InputBufferSize,
	ULONG OutputBufferSize)
{
	NTSTATUS status = STATUS_SUCCESS;
	PDEVICE_OBJECT pDeviceObject = NULL;
	KeEnterCriticalRegion();
	FltAcquirePushLockExclusive(&parser->DirectIoPushLock);

	IoReuseIrp(parser->pDirectIoIrp, STATUS_PENDING);
	parser->pDirectIoIrp->Flags |= IRP_NOCACHE;
	parser->pDirectIoIrp->Tail.Overlay.Thread = (PETHREAD)__readgsqword(0x188);		// Pointer to calling thread control block
	parser->pDirectIoIrp->AssociatedIrp.SystemBuffer = pSystemBuffer;				// IO buffer for buffered control code
	// fill stack frame parameters for synchronous IRP call
	PIO_STACK_LOCATION pStackFrame = IoGetNextIrpStackLocation(parser->pDirectIoIrp);
	pDeviceObject = IoGetRelatedDeviceObject(parser->pVhdmpFileObject);
	pStackFrame->FileObject = parser->pVhdmpFileObject;
	pStackFrame->DeviceObject = pDeviceObject;
	pStackFrame->Parameters.DeviceIoControl.IoControlCode = ControlCode;
	pStackFrame->Parameters.DeviceIoControl.InputBufferLength = InputBufferSize;
	pStackFrame->Parameters.DeviceIoControl.OutputBufferLength = OutputBufferSize;
	pStackFrame->MajorFunction = IRP_MJ_DEVICE_CONTROL;
	pStackFrame->MinorFunction = 0;
	pStackFrame->Flags = 0;
	pStackFrame->Control = 0;
	IoSynchronousCallDriver(pDeviceObject, parser->pDirectIoIrp);
	status = parser->pDirectIoIrp->IoStatus.Status;
	FltReleasePushLock(&parser->DirectIoPushLock);
	KeLeaveCriticalRegion();
	return status;
}
开发者ID:the-alien,项目名称:evhdparser,代码行数:30,代码来源:parser.c


示例13: _KeEnterCriticalRegion

/*++
 * @name KeEnterCriticalRegion
 * @implemented NT4
 *
 *     The KeEnterCriticalRegion routine temporarily disables the delivery of
 *     normal kernel APCs; special kernel-mode APCs are still delivered.
 *
 * @param None.
 *
 * @return None.
 *
 * @remarks Highest-level drivers can call this routine while running in the
 *          context of the thread that requested the current I/O operation.
 *          Any caller of this routine should call KeLeaveCriticalRegion as
 *          quickly as possible.
 *
 *          Callers of KeEnterCriticalRegion must be running at IRQL <=
 *          APC_LEVEL.
 *
 *--*/
VOID
NTAPI
_KeEnterCriticalRegion(VOID)
{
    /* Use inlined function */
    KeEnterCriticalRegion();
}
开发者ID:GYGit,项目名称:reactos,代码行数:27,代码来源:apc.c


示例14: SymInit

VOID SymInit(void)
{
	KeEnterCriticalRegion();
	if(bIsSymEngineInitialized == TRUE)
	{
		KeLeaveCriticalRegion();
		return;
	}

	// initialize all required data structures
	ExInitializeNPagedLookasideList(&SymbolsLookasideList,				// list to initialize
									NULL,								// allocate function - OS supplied
									NULL,								// free function - OS supplied
									0,									// flags - always zero
									sizeof(SYMBOL_ENTRY),				// size of each entry to be allocated
									TAG_SYMBOL_LOOKASIDE,				// SymL(ookaside) tag
									0									// depth - always zero
									);
	InitializeListHead(&SymbolsListHead);

	ASSERTMSG("Fast mutex must be initialized at or below DISPATCH_LEVEL", KeGetCurrentIrql() <= DISPATCH_LEVEL);
	ExInitializeFastMutex(&SymbolsListMutex);

	bIsSymEngineInitialized = TRUE;

	KeLeaveCriticalRegion();
}
开发者ID:angry7panda,项目名称:dementia-forensics,代码行数:27,代码来源:SymbolEngine.cpp


示例15: LookupPdoData

//
//	Increment the reference count to a PDO.
//
PPDO_DEVICE_DATA
LookupPdoData(
	PFDO_DEVICE_DATA	FdoData,
	ULONG				SystemIoBusNumber
	)
{
	PPDO_DEVICE_DATA	pdoData = NULL;
    PLIST_ENTRY         entry;

    PAGED_CODE ();

    KeEnterCriticalRegion();
	ExAcquireFastMutex (&FdoData->Mutex);

    for (entry = FdoData->ListOfPDOs.Flink;
         entry != &FdoData->ListOfPDOs;
         entry = entry->Flink) {

			 pdoData = CONTAINING_RECORD (entry, PDO_DEVICE_DATA, Link);
             if(pdoData->SlotNo == SystemIoBusNumber)
				 break;
			pdoData = NULL;
		 }
	 if(pdoData) {
		 //
		 //	increment the reference count to the PDO.
		 //
		 ObReferenceObject(pdoData->Self);
	 }

	ExReleaseFastMutex (&FdoData->Mutex);
    KeLeaveCriticalRegion();

	return pdoData;
}
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:38,代码来源:busenum.c


示例16: KeEnterCriticalRegion

dev_hook *dc_find_hook(wchar_t *dev_name)
{
	PLIST_ENTRY entry;
	dev_hook   *hook;
	dev_hook   *found = NULL;

	KeEnterCriticalRegion();
	ExAcquireResourceSharedLite(&hooks_sync_resource, TRUE);

	entry = hooks_list_head.Flink;

	while (entry != &hooks_list_head)
	{
		hook  = CONTAINING_RECORD(entry, dev_hook, hooks_list);
		entry = entry->Flink;

		if (_wcsicmp(hook->dev_name, dev_name) == 0) {
			dc_reference_hook(hook);
			found = hook; break;
		}
	}
	
	ExReleaseResourceLite(&hooks_sync_resource);
	KeLeaveCriticalRegion();

	return found;
}
开发者ID:smartinm,项目名称:diskcryptor,代码行数:27,代码来源:devhook.c


示例17: CmpLockRegistry

VOID
CmpLockRegistry(
    VOID
)
/*++

Routine Description:

    Lock the registry for shared (read-only) access

Arguments:

    None.

Return Value:

    None, the registry lock will be held for shared access upon return.

--*/
{
#if DBG
    PVOID       Caller;
    PVOID       CallerCaller;
#endif

    KeEnterCriticalRegion();
    ExAcquireResourceShared(&CmpRegistryLock, TRUE);

#if DBG
    RtlGetCallersAddress(&Caller, &CallerCaller);
    CMLOG(CML_FLOW, CMS_LOCKING) {
        KdPrint(("CmpLockRegistry: c, cc: %08lx  %08lx\n", Caller, CallerCaller));
    }
开发者ID:conioh,项目名称:os-design,代码行数:33,代码来源:cmsubs3.c


示例18: DokanFilterCallbackAcquireForCreateSection

NTSTATUS
DokanFilterCallbackAcquireForCreateSection(__in PFS_FILTER_CALLBACK_DATA
                                               CallbackData,
                                           __out PVOID *CompletionContext) {
  PFSRTL_ADVANCED_FCB_HEADER header;
  PDokanFCB fcb = NULL;
  PDokanCCB ccb;

  UNREFERENCED_PARAMETER(CompletionContext);

  DDbgPrint("DokanFilterCallbackAcquireForCreateSection\n");

  header = CallbackData->FileObject->FsContext;
  ccb = CallbackData->FileObject->FsContext2;

  if (ccb)
    fcb = ccb->Fcb;

  if (header && header->Resource) {
    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite(header->Resource, TRUE);
    KeLeaveCriticalRegion();
  }

  if (CallbackData->Parameters.AcquireForSectionSynchronization.SyncType !=
      SyncTypeCreateSection) {
    return STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY;
  } else if (fcb && fcb->ShareAccess.Writers == 0) {
    return STATUS_FILE_LOCKED_WITH_ONLY_READERS;
  } else {
    return STATUS_FILE_LOCKED_WITH_WRITERS;
  }
}
开发者ID:2asoft,项目名称:dokany,代码行数:33,代码来源:dokan.c


示例19: dc_probe_decrypt

static 
int dc_probe_decrypt(dev_hook *hook, dc_header **header, xts_key **res_key, dc_pass *password)
{
	xts_key  *hdr_key;
	dsk_pass *d_pass;	
	int       resl, succs;

	hdr_key = NULL; succs = 0; *header = NULL;
	do
	{
		/* read raw volume header */
		if ( (resl = io_read_header(hook, header, NULL, NULL)) != ST_OK ) {
			break;
		}
		if ( (hdr_key = mm_secure_alloc(sizeof(xts_key))) == NULL ) {
			resl = ST_NOMEM; break;
		}

		/* derive header key and decrypt header */
		do
		{
			if (password != NULL)
			{
				/* probe mount with entered password */
				if (succs = cp_decrypt_header(hdr_key, *header, password)) {
					break;
				}
			}

			KeEnterCriticalRegion();
			ExAcquireResourceSharedLite(&p_resource, TRUE);

			/* probe mount with cached passwords */
			for (d_pass = f_pass; d_pass; d_pass = d_pass->next)
			{
				if (succs = cp_decrypt_header(hdr_key, *header, &d_pass->pass)) {
					break;
				}
			}

			ExReleaseResourceLite(&p_resource);
			KeLeaveCriticalRegion();
		} while (0);

		if (succs != 0) {
			*res_key = hdr_key; hdr_key = NULL; resl = ST_OK; 
		} else {
			resl = ST_PASS_ERR;
		}
	} while (0);

	if (resl != ST_OK && *header != NULL) {
		mm_secure_free(*header); *header = NULL;
	}
	if (hdr_key != NULL) {
		mm_secure_free(hdr_key);
	}
	return resl;
}
开发者ID:the-alien,项目名称:diskcryptor,代码行数:59,代码来源:mount.c


示例20: DokanEventRelease

NTSTATUS
DokanEventRelease(__in PDEVICE_OBJECT DeviceObject) {
  PDokanDCB dcb;
  PDokanVCB vcb;
  PDokanFCB fcb;
  PDokanCCB ccb;
  PLIST_ENTRY fcbEntry, fcbNext, fcbHead;
  PLIST_ENTRY ccbEntry, ccbNext, ccbHead;
  NTSTATUS status = STATUS_SUCCESS;

  vcb = DeviceObject->DeviceExtension;
  if (GetIdentifierType(vcb) != VCB) {
    return STATUS_INVALID_PARAMETER;
  }
  dcb = vcb->Dcb;

  // ExAcquireResourceExclusiveLite(&dcb->Resource, TRUE);
  dcb->Mounted = 0;
  // ExReleaseResourceLite(&dcb->Resource);

  // search CCB list to complete not completed Directory Notification

  KeEnterCriticalRegion();
  ExAcquireResourceExclusiveLite(&vcb->Resource, TRUE);

  fcbHead = &vcb->NextFCB;

  for (fcbEntry = fcbHead->Flink; fcbEntry != fcbHead; fcbEntry = fcbNext) {

    fcbNext = fcbEntry->Flink;
    fcb = CONTAINING_RECORD(fcbEntry, DokanFCB, NextFCB);

    ExAcquireResourceExclusiveLite(&fcb->Resource, TRUE);

    ccbHead = &fcb->NextCCB;

    for (ccbEntry = ccbHead->Flink; ccbEntry != ccbHead; ccbEntry = ccbNext) {
      ccbNext = ccbEntry->Flink;
      ccb = CONTAINING_RECORD(ccbEntry, DokanCCB, NextCCB);

      DDbgPrint("  NotifyCleanup ccb:%p, context:%X, filename:%wZ\n", ccb,
                (ULONG)ccb->UserContext, &fcb->FileName);
      FsRtlNotifyCleanup(vcb->NotifySync, &vcb->DirNotifyList, ccb);
    }
    ExReleaseResourceLite(&fcb->Resource);
  }

  ExReleaseResourceLite(&vcb->Resource);
  KeLeaveCriticalRegion();

  ReleasePendingIrp(&dcb->PendingIrp);
  ReleasePendingIrp(&dcb->PendingEvent);
  DokanStopCheckThread(dcb);
  DokanStopEventNotificationThread(dcb);

  DokanDeleteDeviceObject(dcb);

  return status;
}
开发者ID:shinyhaskett,项目名称:dokany,代码行数:59,代码来源:notification.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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