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

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

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

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

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

示例1: InitTimerImpl

INIT_FUNCTIONNTSTATUSNTAPIInitTimerImpl(VOID){   ULONG BitmapBytes;   ExInitializeFastMutex(&Mutex);   BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;   WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(NonPagedPool, BitmapBytes, TAG_TIMERBMP);   if (WindowLessTimersBitMapBuffer == NULL)   {      return STATUS_UNSUCCESSFUL;   }   RtlInitializeBitMap(&WindowLessTimersBitMap,                       WindowLessTimersBitMapBuffer,                       BitmapBytes * 8);   /* yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */   RtlClearAllBits(&WindowLessTimersBitMap);   ExInitializeResourceLite(&TimerLock);   InitializeListHead(&TimersListHead);   return STATUS_SUCCESS;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:28,


示例2: ExpInitializeEventIds

BOOLEANExpInitializeEventIds( VOID ){    ExInitializeFastMutex( &ExpEventIdListMutex );    InitializeListHead( &ExpEventIdListHead );    ExpNextEventId = 1;    return TRUE;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:8,


示例3: PspInitializeJobStructures

VOIDNTAPIINIT_FUNCTIONPspInitializeJobStructures(VOID){    InitializeListHead(&PsJobListHead);    ExInitializeFastMutex(&PsJobListLock);}
开发者ID:RPG-7,项目名称:reactos,代码行数:8,


示例4: dump_hook_init

int dump_hook_init(PDRIVER_OBJECT drv_obj){	PLDR_DATA_TABLE_ENTRY table;	PHYSICAL_ADDRESS      high_addr;	PLIST_ENTRY           entry;	NTSTATUS              status;	int                   resl = 0;	ExInitializeFastMutex(&dump_sync);	ExAcquireFastMutex(&dump_sync);	/* find PsLoadedModuleListHead */	entry = ((PLIST_ENTRY)(drv_obj->DriverSection))->Flink;	while (entry != drv_obj->DriverSection)	{		table = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);		entry = entry->Flink;		if ( (table->BaseDllName.Length == 0x18) && 			 (p32(table->BaseDllName.Buffer)[0] == 0x0074006E) )		{			ps_loaded_mod_list = pv(table->InLoadOrderLinks.Blink);			break;		}	}	ExReleaseFastMutex(&dump_sync);	do	{		if (ps_loaded_mod_list == NULL) break;		status = PsSetLoadImageNotifyRoutine(load_img_routine);		if (NT_SUCCESS(status) == FALSE) break;		high_addr.HighPart = 0;		high_addr.LowPart  = 0xFFFFFFFF;		dump_mem = MmAllocateContiguousMemory(DUMP_MEM_SIZE, high_addr);		if (dump_mem == NULL) break;		dump_mdl = IoAllocateMdl(dump_mem, DUMP_MEM_SIZE, FALSE, FALSE, NULL); 		if (dump_mdl == NULL) break;		MmBuildMdlForNonPagedPool(dump_mdl);		memset(dump_mem, 0, DUMP_MEM_SIZE);		resl = 1;	} while (0);	if (resl == 0) {		if (dump_mdl != NULL) IoFreeMdl(dump_mdl);		if (dump_mem != NULL) MmFreeContiguousMemory(dump_mem);	}	return resl;	}
开发者ID:capturePointer,项目名称:DiskCryptor-1,代码行数:56,


示例5: DokanAllocateFCB

// We must NOT call without VCB lcokPDokanFCBDokanAllocateFCB(	__in PDokanVCB Vcb	){	PDokanFCB fcb = ExAllocatePool(sizeof(DokanFCB));	if (fcb == NULL) {		return NULL;	}	ASSERT(fcb != NULL);	ASSERT(Vcb != NULL);	RtlZeroMemory(fcb, sizeof(DokanFCB));	fcb->Identifier.Type = FCB;	fcb->Identifier.Size = sizeof(DokanFCB);	fcb->Vcb = Vcb;	ExInitializeResourceLite(&fcb->MainResource);	ExInitializeResourceLite(&fcb->PagingIoResource);	ExInitializeFastMutex(&fcb->AdvancedFCBHeaderMutex);#if _WIN32_WINNT >= 0x0501	FsRtlSetupAdvancedHeader(&fcb->AdvancedFCBHeader, &fcb->AdvancedFCBHeaderMutex);#else	if (DokanFsRtlTeardownPerStreamContexts) {		FsRtlSetupAdvancedHeader(&fcb->AdvancedFCBHeader, &fcb->AdvancedFCBHeaderMutex);	}#endif	fcb->AdvancedFCBHeader.ValidDataLength.LowPart = 0xffffffff;	fcb->AdvancedFCBHeader.ValidDataLength.HighPart = 0x7fffffff;	fcb->AdvancedFCBHeader.Resource = &fcb->MainResource;	fcb->AdvancedFCBHeader.PagingIoResource = &fcb->PagingIoResource;	fcb->AdvancedFCBHeader.AllocationSize.QuadPart = 4096;	fcb->AdvancedFCBHeader.FileSize.QuadPart = 4096;	fcb->AdvancedFCBHeader.IsFastIoPossible = FastIoIsNotPossible;	ExInitializeResourceLite(&fcb->Resource);	InitializeListHead(&fcb->NextCCB);	InsertTailList(&Vcb->NextFCB, &fcb->NextFCB);	InterlockedIncrement(&Vcb->FcbAllocated);	return fcb;}
开发者ID:nmlgc,项目名称:dokany,代码行数:56,


示例6: FatCreateDcb

PFCBNTAPIFatCreateDcb(IN PFAT_IRP_CONTEXT IrpContext,             IN PVCB Vcb,             IN PFCB ParentDcb,             IN FF_FILE *FileHandle){    PFCB Fcb;    /* Allocate it and zero it */    Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(FCB), TAG_FCB);    RtlZeroMemory(Fcb, sizeof(FCB));    /* Set node types */    Fcb->Header.NodeTypeCode = FAT_NTC_DCB;    Fcb->Header.NodeByteSize = sizeof(FCB);    Fcb->Condition = FcbGood;    /* Initialize resources */    Fcb->Header.Resource = &Fcb->Resource;    ExInitializeResourceLite(Fcb->Header.Resource);    Fcb->Header.PagingIoResource = &Fcb->PagingIoResource;    ExInitializeResourceLite(Fcb->Header.PagingIoResource);    /* Initialize mutexes */    Fcb->Header.FastMutex = &Fcb->HeaderMutex;    ExInitializeFastMutex(&Fcb->HeaderMutex);    FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);    /* Insert into parent's DCB list */    InsertHeadList(&ParentDcb->Dcb.ParentDcbList, &Fcb->ParentDcbLinks);    /* Set backlinks */    Fcb->ParentFcb = ParentDcb;    Fcb->Vcb = Vcb;    /* Initialize parent dcb list */    InitializeListHead(&Fcb->Dcb.ParentDcbList);    /* Set FullFAT handle */    Fcb->FatHandle = FileHandle;    /* Set names */    if (FileHandle)    {        FatSetFcbNames(IrpContext, Fcb);        /* Ensure the full name is set */        FatSetFullFileNameInFcb(IrpContext, Fcb);    }    return Fcb;}
开发者ID:hoangduit,项目名称:reactos,代码行数:54,


示例7: DriverEntry

NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath){ NTSTATUS	ntStatus;  ntStatus= STATUS_SUCCESS; PPJoyBus_DebugLevel= PPJOY_DEFAULT_DEBUGLEVEL; PPJOY_DBGPRINT (FILE_PPJOYBUS|PPJOY_WARN, ("Built " __DATE__ " at " __TIME__) ); PPJOY_DBGPRINT (FILE_PPJOYBUS|PPJOY_FENTRY, ("DriverEntry (DriverObject=0x%p,RegistryPath=0x%p)",DriverObject, RegistryPath) ); RtlZeroMemory (&Globals,sizeof(Globals)); /* Setup copy of DriverObject first so we can use it for event log function */ Globals.DriverObject= DriverObject; /* Allocate buffer to store registry path to the parameters registry key */ Globals.ParamRegistryPath.MaximumLength= RegistryPath->Length+sizeof(UNICODE_NULL)+sizeof(PARAM_KEY_NAME); Globals.ParamRegistryPath.Length= RegistryPath->Length; Globals.ParamRegistryPath.Buffer= ExAllocatePoolWithTag (PagedPool,Globals.ParamRegistryPath.MaximumLength,PPJOYBUS_POOL_TAG);     if (!Globals.ParamRegistryPath.Buffer) {  PPJoyBus_WriteEventLog (PPJ_MSG_ERRORALLOCMEM,&ntStatus,sizeof(ntStatus),L"");  ntStatus= STATUS_INSUFFICIENT_RESOURCES;  goto Exit; } /* Copy driver registry path and append the parameters subkey name */ RtlCopyUnicodeString (&Globals.ParamRegistryPath,RegistryPath); RtlAppendUnicodeToString (&Globals.ParamRegistryPath,PARAM_KEY_NAME); ExInitializeFastMutex (&Globals.Mutex); PPJOY_DBGPRINT (FILE_PPJOYBUS|PPJOY_BABBLE2, ("ParamRegistryPath=%S",Globals.ParamRegistryPath.Buffer) ); /* Set up pointers to our other entry points in the DeviceObject */ DriverObject->MajorFunction[IRP_MJ_CREATE]= PPJoyBus_CreateClose; DriverObject->MajorFunction[IRP_MJ_CLOSE]=	PPJoyBus_CreateClose; DriverObject->MajorFunction[IRP_MJ_POWER]= PPJoyBus_Power; DriverObject->MajorFunction[IRP_MJ_PNP]= PPJoyBus_PnP; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]= PPJoyBus_Ioctl; DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL]= PPJoyBus_InternalIoctl; DriverObject->DriverUnload= PPJoyBus_Unload; DriverObject->DriverExtension->AddDevice= PPJoyBus_AddDevice; PPJoyBus_WriteEventLog (PPJ_MSG_DRIVERSTARTEDVER,&ntStatus,sizeof(ntStatus),LVER_PRODUCTVERSION_STR);Exit: PPJOY_EXITPROC (FILE_PPJOYBUS|PPJOY_FEXIT_STATUSOK , "DriverEntry", ntStatus); return ntStatus;} /* DriverEntry */
开发者ID:Cyborg11,项目名称:PPJoy,代码行数:52,


示例8: ExpInitUuids

VOIDINIT_FUNCTIONNTAPIExpInitUuids(VOID){    ExInitializeFastMutex(&UuidMutex);    KeQuerySystemTime((PLARGE_INTEGER)&UuidLastTime);    UuidLastTime.QuadPart += TICKS_15_OCT_1582_TO_1601;    UuidCount = TICKS_PER_CLOCK_TICK;    RtlZeroMemory(UuidSeed, SEED_BUFFER_SIZE);}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:13,


示例9: CfixkrpInitializeFilament

VOID CfixkrpInitializeFilament(	__in PCFIXKRP_REPORT_CHANNEL Channel,	__in ULONG MainThreadId,	__out PCFIXKRP_FILAMENT Filament	){	RtlZeroMemory( Filament, sizeof( CFIXKRP_FILAMENT ) );	Filament->Channel		= Channel;	Filament->MainThreadId	= MainThreadId;	ExInitializeFastMutex( &Filament->ChildThreads.Lock );}
开发者ID:jpassing,项目名称:cfix,代码行数:13,


示例10: FatCreateFcb

PFCBNTAPIFatCreateFcb(IN PFAT_IRP_CONTEXT IrpContext,             IN PVCB Vcb,             IN PFCB ParentDcb,             IN FF_FILE *FileHandle){    PFCB Fcb;    /* Allocate it and zero it */    Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(FCB), TAG_FCB);    RtlZeroMemory(Fcb, sizeof(FCB));    /* Set node types */    Fcb->Header.NodeTypeCode = FAT_NTC_FCB;    Fcb->Header.NodeByteSize = sizeof(FCB);    Fcb->Condition = FcbGood;    /* Initialize resources */    Fcb->Header.Resource = &Fcb->Resource;    ExInitializeResourceLite(Fcb->Header.Resource);    Fcb->Header.PagingIoResource = &Fcb->PagingIoResource;    ExInitializeResourceLite(Fcb->Header.PagingIoResource);    /* Initialize mutexes */    Fcb->Header.FastMutex = &Fcb->HeaderMutex;    ExInitializeFastMutex(&Fcb->HeaderMutex);    FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);    /* Insert into parent's DCB list */    InsertTailList(&ParentDcb->Dcb.ParentDcbList, &Fcb->ParentDcbLinks);    /* Set backlinks */    Fcb->ParentFcb = ParentDcb;    Fcb->Vcb = Vcb;    /* Set file handle and sizes */    Fcb->Header.FileSize.LowPart = FileHandle->Filesize;    Fcb->Header.ValidDataLength.LowPart = FileHandle->Filesize;    Fcb->FatHandle = FileHandle;    /* Initialize locks */    FsRtlInitializeFileLock(&Fcb->Fcb.Lock, NULL, NULL);    FsRtlInitializeOplock(&Fcb->Fcb.Oplock);    /* Set names */    FatSetFcbNames(IrpContext, Fcb);    return Fcb;}
开发者ID:hoangduit,项目名称:reactos,代码行数:51,


示例11: vcos_global_lock

void vcos_global_lock(void){#ifdef WIN32_KERN     if (global_lock_init == FALSE) {        ExInitializeFastMutex(&lock);        global_lock_init = TRUE;    }    ExAcquireFastMutex(&lock);#else    if (global_lock_init == FALSE) {        InitializeCriticalSection(&lock);        global_lock_init = TRUE;    }    EnterCriticalSection(&lock);#endif}
开发者ID:MHesham,项目名称:bsp,代码行数:16,


示例12: CcPfInitializePrefetcher

VOIDNTAPICcPfInitializePrefetcher(VOID){    /* Notify debugger */    DbgPrintEx(DPFLTR_PREFETCHER_ID,               DPFLTR_TRACE_LEVEL,               "CCPF: InitializePrefetecher()/n");    /* Setup the Prefetcher Data */    InitializeListHead(&CcPfGlobals.ActiveTraces);    InitializeListHead(&CcPfGlobals.CompletedTraces);    ExInitializeFastMutex(&CcPfGlobals.CompletedTracesLock);    /* FIXME: Setup the rest of the prefetecher */}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:16,


示例13: IntCreateMonitorObject

/* IntCreateMonitorObject * * Creates a MONITOR * * Return value *   If the function succeeds a pointer to a MONITOR is returned. On failure *   NULL is returned. */staticPMONITORIntCreateMonitorObject(){    HANDLE Handle;    PMONITOR Monitor;    Monitor = UserCreateObject(gHandleTable, NULL, &Handle, otMonitor, sizeof (MONITOR));    if (Monitor == NULL)    {        return NULL;    }    ExInitializeFastMutex(&Monitor->Lock);    return Monitor;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,


示例14: DriverEntry

NTSTATUSNTAPIDriverEntry(IN PDRIVER_OBJECT DriverObject,            IN PUNICODE_STRING RegistryPath){    PDEVICE_EXTENSION DeviceExtension;    PDEVICE_OBJECT DeviceObject;    UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"//Device//Beep");    NTSTATUS Status;    UNREFERENCED_PARAMETER(RegistryPath);    /* Create the device */    Status = IoCreateDevice(DriverObject,                            sizeof(DEVICE_EXTENSION),                            &DeviceName,                            FILE_DEVICE_BEEP,                            0,                            FALSE,                            &DeviceObject);    if (!NT_SUCCESS(Status)) return Status;    /* Make it use buffered I/O */    DeviceObject->Flags |= DO_BUFFERED_IO;    /* Setup the Driver Object */    DriverObject->MajorFunction[IRP_MJ_CREATE] = BeepCreate;    DriverObject->MajorFunction[IRP_MJ_CLOSE] = BeepClose;    DriverObject->MajorFunction[IRP_MJ_CLEANUP] = BeepCleanup;    DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = BeepDeviceControl;    DriverObject->DriverUnload = BeepUnload;    DriverObject->DriverStartIo = BeepStartIo;    /* Set up device extension */    DeviceExtension = DeviceObject->DeviceExtension;    DeviceExtension->ReferenceCount = 0;    DeviceExtension->TimerActive = FALSE;    IoInitializeDpcRequest(DeviceObject, (PIO_DPC_ROUTINE)BeepDPC);    KeInitializeTimer(&DeviceExtension->Timer);    ExInitializeFastMutex(&DeviceExtension->Mutex);    /* Page the entire driver */    MmPageEntireDriver(DriverEntry);    return STATUS_SUCCESS;}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:45,


示例15: FspFileNodeCreate

NTSTATUS FspFileNodeCreate(PDEVICE_OBJECT DeviceObject,    ULONG ExtraSize, FSP_FILE_NODE **PFileNode){    PAGED_CODE();    *PFileNode = 0;    FSP_FILE_NODE_NONPAGED *NonPaged = FspAllocNonPaged(sizeof *NonPaged);    if (0 == NonPaged)        return STATUS_INSUFFICIENT_RESOURCES;    FSP_FILE_NODE *FileNode = FspAlloc(sizeof *FileNode + ExtraSize);    if (0 == FileNode)    {        FspFree(NonPaged);        return STATUS_INSUFFICIENT_RESOURCES;    }    RtlZeroMemory(NonPaged, sizeof *NonPaged);    ExInitializeResourceLite(&NonPaged->Resource);    ExInitializeResourceLite(&NonPaged->PagingIoResource);    ExInitializeFastMutex(&NonPaged->HeaderFastMutex);    KeInitializeSpinLock(&NonPaged->DirInfoSpinLock);    RtlZeroMemory(FileNode, sizeof *FileNode + ExtraSize);    FileNode->Header.NodeTypeCode = FspFileNodeFileKind;    FileNode->Header.NodeByteSize = sizeof *FileNode;    FileNode->Header.IsFastIoPossible = FastIoIsNotPossible;    FileNode->Header.Resource = &NonPaged->Resource;    FileNode->Header.PagingIoResource = &NonPaged->PagingIoResource;    FileNode->Header.ValidDataLength.QuadPart = MAXLONGLONG;        /* disable ValidDataLength functionality */    FsRtlSetupAdvancedHeader(&FileNode->Header, &NonPaged->HeaderFastMutex);    FileNode->NonPaged = NonPaged;    FileNode->RefCount = 1;    FileNode->FsvolDeviceObject = DeviceObject;    FspDeviceReference(FileNode->FsvolDeviceObject);    RtlInitEmptyUnicodeString(&FileNode->FileName, FileNode->FileNameBuf, (USHORT)ExtraSize);    FsRtlInitializeFileLock(&FileNode->FileLock, FspFileNodeCompleteLockIrp, 0);    *PFileNode = FileNode;    return STATUS_SUCCESS;}
开发者ID:LucaBongiorni,项目名称:winfsp,代码行数:45,


示例16: DiskHook

BOOLEAN DiskHook(VOID){	if(UnloadInProgress) {		DbPrint(DC_DISK,DL_WARNING, ("DiskHook when UnloadInProgress!/n"));		return FALSE;	}	if(!DiskHooked) {		DbPrint(DC_DISK,DL_NOTIFY, ("DiskHook!/n"));		ExInitializeFastMutex(&DiskDevListMutex); 		if(NT_SUCCESS(EnumDrivers(FindDiskDev, NULL))) {			DiskHooked=TRUE;		} else {			ExDestroyFastMutex(&DiskDevListMutex);			return FALSE;		}	}	return TRUE;}
开发者ID:hackshields,项目名称:antivirus,代码行数:18,


示例17: RTDECL

RTDECL(int) RTSemMutexCreateEx(PRTSEMMUTEX phMutexSem, uint32_t fFlags,                               RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszNameFmt, ...){    AssertReturn(!(fFlags & ~RTSEMMUTEX_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);    AssertCompile(sizeof(RTSEMMUTEXINTERNAL) > sizeof(void *));    PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)RTMemAlloc(sizeof(*pThis));    if (!pThis)        return VERR_NO_MEMORY;    pThis->u32Magic = RTSEMMUTEX_MAGIC;#ifdef RT_USE_FAST_MUTEX    ExInitializeFastMutex(&pThis->Mutex);#else    KeInitializeMutex(&pThis->Mutex, 0);#endif    *phMutexSem = pThis;    return VINF_SUCCESS;}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:20,


示例18: DriverEntry

//.........这里部分代码省略.........    }    //    //  Initialize our global resource and fire up the lookaside lists.    //    ExInitializeResourceLite( &FatData.Resource );    ExInitializeNPagedLookasideList( &FatIrpContextLookasideList,                                     NULL,                                     NULL,                                     POOL_RAISE_IF_ALLOCATION_FAILURE,                                     sizeof(IRP_CONTEXT),                                     TAG_IRP_CONTEXT,                                     MaxDepth );    ExInitializeNPagedLookasideList( &FatNonPagedFcbLookasideList,                                     NULL,                                     NULL,                                     POOL_RAISE_IF_ALLOCATION_FAILURE,                                     sizeof(NON_PAGED_FCB),                                     TAG_FCB_NONPAGED,                                     MaxDepth );    ExInitializeNPagedLookasideList( &FatEResourceLookasideList,                                     NULL,                                     NULL,                                     POOL_RAISE_IF_ALLOCATION_FAILURE,                                     sizeof(ERESOURCE),                                     TAG_ERESOURCE,                                     MaxDepth );    ExInitializeSListHead( &FatCloseContextSList );    ExInitializeFastMutex( &FatCloseQueueMutex );    KeInitializeEvent( &FatReserveEvent, SynchronizationEvent, TRUE );    //    //  Register the file system with the I/O system    //    IoRegisterFileSystem(FatDiskFileSystemDeviceObject);    ObReferenceObject (FatDiskFileSystemDeviceObject);#if __NDAS_FAT__	if (FatCdromFileSystemDeviceObject) {		IoRegisterFileSystem(FatCdromFileSystemDeviceObject);		ObReferenceObject (FatCdromFileSystemDeviceObject);	}#else    IoRegisterFileSystem(FatCdromFileSystemDeviceObject);    ObReferenceObject (FatCdromFileSystemDeviceObject);#endif#if __NDAS_FAT__	FatData.FileSystemRegistered = TRUE;	RtlInitEmptyUnicodeString( &FatData.Root, 							   FatData.RootBuffer,							   sizeof(FatData.RootBuffer) );	RtlInitUnicodeString( &tempUnicode, L"//" );	RtlCopyUnicodeString( &FatData.Root, &tempUnicode );	RtlInitEmptyUnicodeString( &FatData.MountMgrRemoteDatabase, 							   FatData.MountMgrRemoteDatabaseBuffer,
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:67,


示例19: DriverEntry

NTSTATUSDriverEntry (    IN  PDRIVER_OBJECT  DriverObject,    IN  PUNICODE_STRING RegistryPath    )/*++Routine Description:    Initialize the driver dispatch table. Arguments:    DriverObject - pointer to the driver object    RegistryPath - pointer to a unicode string representing the path,                   to driver-specific key in the registry.Return Value:  NT Status Code--*/{	NTSTATUS	status;	ULONG		tempUlong;    Bus_KdPrint_Def (BUS_DBG_SS_INFO, ("%s, %s/n", __DATE__, __TIME__));    //    // Save the RegistryPath for WMI.    //    Globals.RegistryPath.MaximumLength = RegistryPath->Length +                                          sizeof(UNICODE_NULL);    Globals.RegistryPath.Length = RegistryPath->Length;    Globals.RegistryPath.Buffer = ExAllocatePoolWithTag(                                       PagedPool,                                       Globals.RegistryPath.MaximumLength,                                       BUSENUM_POOL_TAG_DRIVER_REGISTRYPATH                                       );        if (!Globals.RegistryPath.Buffer) {        return STATUS_INSUFFICIENT_RESOURCES;    }        RtlCopyUnicodeString(&Globals.RegistryPath, RegistryPath);	//	// Query OS Versions	//	Globals.bCheckVersion = PsGetVersion(								&Globals.MajorVersion,								&Globals.MinorVersion,								&Globals.BuildNumber,								NULL								);	if(Globals.bCheckVersion == TRUE) {		Bus_KdPrint_Def (BUS_DBG_SS_INFO, 			("Checkd Build, Major Ver %d, Minor Ver %d, Build %d/n", 				Globals.MajorVersion, Globals.MinorVersion, Globals.BuildNumber));	} else {		Bus_KdPrint_Def (BUS_DBG_SS_INFO, 			("Free Build, Major Ver %d, Minor Ver %d, Build %d/n", 				Globals.MajorVersion, Globals.MinorVersion, Globals.BuildNumber));	}    //    // Set entry points into the driver    //    DriverObject->MajorFunction [IRP_MJ_CREATE] =    DriverObject->MajorFunction [IRP_MJ_CLOSE] = Bus_CreateClose;    DriverObject->MajorFunction [IRP_MJ_PNP] = Bus_PnP;    DriverObject->MajorFunction [IRP_MJ_POWER] = Bus_Power;    DriverObject->MajorFunction [IRP_MJ_DEVICE_CONTROL] = Bus_IoCtl;    DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = Bus_SystemControl;    DriverObject->DriverUnload = Bus_DriverUnload;    DriverObject->DriverExtension->AddDevice = Bus_AddDevice;	//	//	Init mutex	//	ExInitializeFastMutex(&Globals.Mutex);	//	//	Default setting	//	Globals.PersistentPdo = TRUE;	Globals.LfsFilterInstalled = FALSE;	//	//	Read options in the registry	//	// Disable persistent PDO option	status = DrReadKeyValueInstantly(	RegistryPath,									BUSENUM_DRVREG_DISABLE_PERSISTENTPDO,									REG_DWORD,									&tempUlong,//.........这里部分代码省略.........
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:101,


示例20: LfsInitializeLogFileService

BOOLEANLfsInitializeLogFileService (    )/*++Routine Description:    This routine must be called during system initialization before the    first call to logging service, to allow the Log File Service to initialize    its global data structures.  This routine has no dependencies on other    system components being initialized.    This routine will initialize the global structures used by the logging    service and start the Lfs worker thread.Arguments:    NoneReturn Value:    TRUE if initialization was successful--*/{    LARGE_INTEGER CurrentTime;    PAGED_CODE();    DebugTrace( +1, Dbg, "LfsInitializeLogFileService:  Enter/n", 0 );    //    //  If the structure has already been initialized then we can return    //  immediately.    //    if (LfsData.NodeTypeCode == LFS_NTC_DATA        && LfsData.NodeByteSize == sizeof( LFS_DATA )        && FlagOn( LfsData.Flags, LFS_DATA_INITIALIZED )) {        DebugTrace( -1, Dbg, "LfsInitializeLogFileService:  Exit  ->  %01x/n", TRUE );        return TRUE;    }    //    //  Zero out the structure initially.    //    RtlZeroMemory( &LfsData, sizeof( LFS_DATA ));    //    //  Assume the operation will fail.    //    LfsData.Flags = LFS_DATA_INIT_FAILED;    //    //  Initialize the global structure for Lfs.    //    LfsData.NodeTypeCode = LFS_NTC_DATA;    LfsData.NodeByteSize = sizeof( LFS_DATA );    InitializeListHead( &LfsData.LfcbLinks );    //    //  Initialize the synchronization objects.    //    ExInitializeFastMutex( &LfsData.LfsDataLock );    //    //  Initialize the buffer allocation.  System will be robust enough to tolerate    //  allocation failures.    //    ExInitializeFastMutex( &LfsData.BufferLock );    KeInitializeEvent( &LfsData.BufferNotification, NotificationEvent, TRUE );    LfsData.Buffer1 = LfsAllocatePoolNoRaise( PagedPool, LFS_BUFFER_SIZE );    if (LfsData.Buffer1 == NULL) {        return FALSE;    }    LfsData.Buffer2 = LfsAllocatePoolNoRaise( PagedPool, LFS_BUFFER_SIZE );    //    //  Make sure we got both.    //    if (LfsData.Buffer2 == NULL) {        LfsFreePool( LfsData.Buffer1 );        LfsData.Buffer1 = NULL;        return FALSE;    }//.........这里部分代码省略.........
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:101,


示例21: ExpInitializeWorkerThreads

/*++ * @name ExpInitializeWorkerThreads * *     The ExpInitializeWorkerThreads routine initializes worker thread and *     work queue support. * * @param None. * * @return None. * * @remarks This routine is only called once during system initialization. * *--*/VOIDINIT_FUNCTIONNTAPIExpInitializeWorkerThreads(VOID){    ULONG WorkQueueType;    ULONG CriticalThreads, DelayedThreads;    HANDLE ThreadHandle;    PETHREAD Thread;    ULONG i;    /* Setup the stack swap support */    ExInitializeFastMutex(&ExpWorkerSwapinMutex);    InitializeListHead(&ExpWorkerListHead);    ExpWorkersCanSwap = TRUE;    /* Set the number of critical and delayed threads. We shouldn't hardcode */    DelayedThreads = EX_DELAYED_WORK_THREADS;    CriticalThreads = EX_CRITICAL_WORK_THREADS;    /* Protect against greedy registry modifications */    ExpAdditionalDelayedWorkerThreads =        min(ExpAdditionalDelayedWorkerThreads, 16);    ExpAdditionalCriticalWorkerThreads =        min(ExpAdditionalCriticalWorkerThreads, 16);    /* Calculate final count */    DelayedThreads += ExpAdditionalDelayedWorkerThreads;    CriticalThreads += ExpAdditionalCriticalWorkerThreads;    /* Initialize the Array */    for (WorkQueueType = 0; WorkQueueType < MaximumWorkQueue; WorkQueueType++)    {        /* Clear the structure and initialize the queue */        RtlZeroMemory(&ExWorkerQueue[WorkQueueType], sizeof(EX_WORK_QUEUE));        KeInitializeQueue(&ExWorkerQueue[WorkQueueType].WorkerQueue, 0);    }    /* Dynamic threads are only used for the critical queue */    ExWorkerQueue[CriticalWorkQueue].Info.MakeThreadsAsNecessary = TRUE;    /* Initialize the balance set manager events */    KeInitializeEvent(&ExpThreadSetManagerEvent, SynchronizationEvent, FALSE);    KeInitializeEvent(&ExpThreadSetManagerShutdownEvent,                      NotificationEvent,                      FALSE);    /* Create the built-in worker threads for the critical queue */    for (i = 0; i < CriticalThreads; i++)    {        /* Create the thread */        ExpCreateWorkerThread(CriticalWorkQueue, FALSE);        ExpCriticalWorkerThreads++;    }    /* Create the built-in worker threads for the delayed queue */    for (i = 0; i < DelayedThreads; i++)    {        /* Create the thread */        ExpCreateWorkerThread(DelayedWorkQueue, FALSE);        ExpDelayedWorkerThreads++;    }    /* Create the built-in worker thread for the hypercritical queue */    ExpCreateWorkerThread(HyperCriticalWorkQueue, FALSE);    /* Create the balance set manager thread */    PsCreateSystemThread(&ThreadHandle,                         THREAD_ALL_ACCESS,                         NULL,                         0,                         NULL,                         ExpWorkerThreadBalanceManager,                         NULL);    /* Get a pointer to it for the shutdown process */    ObReferenceObjectByHandle(ThreadHandle,                              THREAD_ALL_ACCESS,                              NULL,                              KernelMode,                              (PVOID*)&Thread,                              NULL);    ExpWorkerThreadBalanceManagerPtr = Thread;    /* Close the handle and return */    ObCloseHandle(ThreadHandle, KernelMode);}
开发者ID:killvxk,项目名称:NT_OS,代码行数:100,


示例22: Secondary_Create

PSECONDARYSecondary_Create(	IN  PIRP_CONTEXT			IrpContext,	IN	PVOLUME_DEVICE_OBJECT	VolDo		 	){	NTSTATUS			status;	PSECONDARY			secondary;	OBJECT_ATTRIBUTES	objectAttributes;	LARGE_INTEGER		timeOut;	ULONG				tryQuery;	BOOLEAN				isLocalAddress;		UNREFERENCED_PARAMETER( IrpContext );	secondary = ExAllocatePoolWithTag( NonPagedPool, sizeof(SECONDARY), NDFAT_ALLOC_TAG );		if (secondary == NULL) {		ASSERT( NDFAT_INSUFFICIENT_RESOURCES );		return NULL;	}		RtlZeroMemory( secondary, sizeof(SECONDARY) );#define MAX_TRY_QUERY 2	for (tryQuery = 0; tryQuery < MAX_TRY_QUERY; tryQuery++) {		status = ((PVOLUME_DEVICE_OBJECT) FatData.DiskFileSystemDeviceObject)->			NdfsCallback.QueryPrimaryAddress( &VolDo->NetdiskPartitionInformation, &secondary->PrimaryAddress, &isLocalAddress );		DebugTrace2( 0, Dbg2, ("Secondary_Create: QueryPrimaryAddress %08x/n", status) );		if (NT_SUCCESS(status)) {			DebugTrace2( 0, Dbg2, ("Secondary_Create: QueryPrimaryAddress: Found PrimaryAddress :%02x:%02x:%02x:%02x:%02x:%02x/%d/n",				secondary->PrimaryAddress.Node[0], secondary->PrimaryAddress.Node[1],				secondary->PrimaryAddress.Node[2], secondary->PrimaryAddress.Node[3],				secondary->PrimaryAddress.Node[4], secondary->PrimaryAddress.Node[5],				NTOHS(secondary->PrimaryAddress.Port)) );			break;		}	}	if (status != STATUS_SUCCESS || isLocalAddress) {		ExFreePoolWithTag( secondary, NDFAT_ALLOC_TAG );		return NULL;	}	secondary->Flags = SECONDARY_FLAG_INITIALIZING;	ExInitializeResourceLite( &secondary->RecoveryResource );	ExInitializeResourceLite( &secondary->Resource );	ExInitializeResourceLite( &secondary->SessionResource );	ExInitializeResourceLite( &secondary->CreateResource );	ExInitializeFastMutex( &secondary->FastMutex );	secondary->ReferenceCount = 1;	VolDo_Reference( VolDo );	secondary->VolDo = VolDo;	secondary->ThreadHandle = NULL;	InitializeListHead( &secondary->RecoveryCcbQueue );    ExInitializeFastMutex( &secondary->RecoveryCcbQMutex );	InitializeListHead( &secondary->DeletedFcbQueue );	KeQuerySystemTime( &secondary->TryCloseTime );	secondary->TryCloseWorkItem = IoAllocateWorkItem( (PDEVICE_OBJECT)VolDo );	KeInitializeEvent( &secondary->ReadyEvent, NotificationEvent, FALSE );    	InitializeListHead( &secondary->RequestQueue );	KeInitializeSpinLock( &secondary->RequestQSpinLock );	KeInitializeEvent( &secondary->RequestEvent, NotificationEvent, FALSE );	////////////////////////////////////////	InitializeListHead( &secondary->FcbQueue );	ExInitializeFastMutex( &secondary->FcbQMutex );	/////////////////////////////////////////	InitializeObjectAttributes( &objectAttributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL );	secondary->SessionId = 0;		status = PsCreateSystemThread( &secondary->ThreadHandle,								   THREAD_ALL_ACCESS,								   &objectAttributes,								   NULL,								   NULL,								   SecondaryThreadProc,//.........这里部分代码省略.........
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:101,


示例23: DriverEntry

//.........这里部分代码省略.........    NtfsFastIoDispatch.FastIoWrite =             NtfsCopyWriteA;             //  Write    NtfsFastIoDispatch.FastIoQueryBasicInfo =    NtfsFastQueryBasicInfo;     //  QueryBasicInfo    NtfsFastIoDispatch.FastIoQueryStandardInfo = NtfsFastQueryStdInfo;       //  QueryStandardInfo    NtfsFastIoDispatch.FastIoLock =              NtfsFastLock;               //  Lock    NtfsFastIoDispatch.FastIoUnlockSingle =      NtfsFastUnlockSingle;       //  UnlockSingle    NtfsFastIoDispatch.FastIoUnlockAll =         NtfsFastUnlockAll;          //  UnlockAll    NtfsFastIoDispatch.FastIoUnlockAllByKey =    NtfsFastUnlockAllByKey;     //  UnlockAllByKey    NtfsFastIoDispatch.FastIoDeviceControl =     NULL;                       //  IoDeviceControl    NtfsFastIoDispatch.FastIoDetachDevice            = NULL;    NtfsFastIoDispatch.FastIoQueryNetworkOpenInfo    = NtfsFastQueryNetworkOpenInfo;    NtfsFastIoDispatch.AcquireFileForNtCreateSection =  NtfsAcquireForCreateSection;    NtfsFastIoDispatch.ReleaseFileForNtCreateSection =  NtfsReleaseForCreateSection;    NtfsFastIoDispatch.AcquireForModWrite =          NtfsAcquireFileForModWrite;    NtfsFastIoDispatch.MdlRead =                     NtfsMdlReadA;    NtfsFastIoDispatch.MdlReadComplete =             FsRtlMdlReadCompleteDev;    NtfsFastIoDispatch.PrepareMdlWrite =             NtfsPrepareMdlWriteA;    NtfsFastIoDispatch.MdlWriteComplete =            FsRtlMdlWriteCompleteDev;#ifdef _CAIRO_    NtfsFastIoDispatch.FastIoReadCompressed =        NtfsCopyReadC;    NtfsFastIoDispatch.FastIoWriteCompressed =       NtfsCopyWriteC;    NtfsFastIoDispatch.MdlReadCompleteCompressed =   NtfsMdlReadCompleteCompressed;    NtfsFastIoDispatch.MdlWriteCompleteCompressed =  NtfsMdlWriteCompleteCompressed;#endif _CAIRO_    NtfsFastIoDispatch.FastIoQueryOpen =             NtfsNetworkOpenCreate;    NtfsFastIoDispatch.AcquireForCcFlush =           NtfsAcquireFileForCcFlush;    NtfsFastIoDispatch.ReleaseForCcFlush =           NtfsReleaseFileForCcFlush;    //    //  Initialize the global ntfs data structure    //    NtfsInitializeNtfsData( DriverObject );    ExInitializeFastMutex( &StreamFileCreationFastMutex );    //    //  Initialize the Ntfs Mcb global data queue and variables    //    ExInitializeFastMutex( &NtfsMcbFastMutex );    InitializeListHead( &NtfsMcbLruQueue );    NtfsMcbCleanupInProgress = FALSE;    switch ( MmQuerySystemSize() ) {    case MmSmallSystem:        NtfsMcbHighWaterMark = 1000;        NtfsMcbLowWaterMark = 500;        NtfsMcbCurrentLevel = 0;        break;    case MmMediumSystem:        NtfsMcbHighWaterMark = 1000;        NtfsMcbLowWaterMark = 500;        NtfsMcbCurrentLevel = 0;        break;    case MmLargeSystem:    default:        NtfsMcbHighWaterMark = 1000;        NtfsMcbLowWaterMark = 500;        NtfsMcbCurrentLevel = 0;        break;
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:67,


示例24: Bus_AddDevice

NTSTATUSBus_AddDevice(    __in PDRIVER_OBJECT DriverObject,    __in PDEVICE_OBJECT PhysicalDeviceObject    )/*++Routine Description.    Our Toaster bus has been found.  Attach our FDO to it.    Allocate any required resources.  Set things up.    And be prepared for the ``start device''Arguments:    DriverObject - pointer to driver object.    PhysicalDeviceObject  - Device object representing the bus to which we                            will attach a new FDO.--*/{    NTSTATUS            status;    PDEVICE_OBJECT      deviceObject = NULL;    PFDO_DEVICE_DATA    deviceData = NULL;    PWCHAR              deviceName = NULL;    ULONG               nameLength;    PKTIMER		timer;    PKDPC		dpc;    PAGED_CODE ();    Bus_KdPrint_Def (BUS_DBG_SS_TRACE, ("Add Device: 0x%p/n",                                          PhysicalDeviceObject));    status = IoCreateDevice (                    DriverObject,               // our driver object                    sizeof (FDO_DEVICE_DATA),   // device object extension size                    NULL,                       // FDOs do not have names                    FILE_DEVICE_BUS_EXTENDER,   // We are a bus                    FILE_DEVICE_SECURE_OPEN,    //                    TRUE,                       // our FDO is exclusive                    &deviceObject);             // The device object created    if (!NT_SUCCESS (status))    {        goto End;    }    deviceData = (PFDO_DEVICE_DATA) deviceObject->DeviceExtension;    RtlZeroMemory (deviceData, sizeof (FDO_DEVICE_DATA));    //    // Set the initial state of the FDO    //    INITIALIZE_PNP_STATE(deviceData);    deviceData->DebugLevel = BusEnumDebugLevel;    deviceData->IsFDO = TRUE;    deviceData->Self = deviceObject;    ExInitializeFastMutex (&deviceData->Mutex);    InitializeListHead (&deviceData->ListOfPDOs);    // Set the PDO for use with PlugPlay functions    deviceData->UnderlyingPDO = PhysicalDeviceObject;    //    // Set the initial powerstate of the FDO    //    deviceData->DevicePowerState = PowerDeviceUnspecified;    deviceData->SystemPowerState = PowerSystemWorking;    //    // Biased to 1. Transition to zero during remove device    // means IO is finished. Transition to 1 means the device    // can be stopped.    //    deviceData->OutstandingIO = 1;    //    // Initialize the remove event to Not-Signaled.  This event    // will be set when the OutstandingIO will become 0.    //    KeInitializeEvent(&deviceData->RemoveEvent,                  SynchronizationEvent,                  FALSE);    //    // Initialize the stop event to Signaled:    // there are no Irps that prevent the device from being    // stopped. This event will be set when the OutstandingIO    // will become 0.//.........这里部分代码省略.........
开发者ID:wl500g,项目名称:usbip-no-glib,代码行数:101,


示例25: FdoQueryBusRelations

NTSTATUSFdoQueryBusRelations(    PDEVICE_OBJECT DeviceObject,    PDEVICE_RELATIONS* pDeviceRelations){    PFDO_DEVICE_EXTENSION DeviceExtension;    PDEVICE_RELATIONS DeviceRelations = NULL;    PDEVICE_OBJECT Pdo;    PPDO_DEVICE_EXTENSION PdoDeviceExtension;    NTSTATUS Status;    ULONG UsbDeviceNumber = 0;    WCHAR CharDeviceName[64];    UNICODE_STRING DeviceName;    DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;    DPRINT1("Ehci: QueryBusRelations/n");    /* FIXME: Currently only support for one ehci controller */    if (DeviceExtension->Pdo)        goto Done;    /* Create the PDO with the next available number */    while (TRUE)    {        /* FIXME: Use safe string */        /* RtlStringCchPrintfW(CharDeviceName, 64, L"USBPDO-%d", UsbDeviceNumber); */        swprintf(CharDeviceName, L"//Device//USBPDO-%d", UsbDeviceNumber);        RtlInitUnicodeString(&DeviceName, CharDeviceName);        DPRINT("DeviceName %wZ/n", &DeviceName);        Status = IoCreateDevice(DeviceObject->DriverObject,                                sizeof(PDO_DEVICE_EXTENSION),                                &DeviceName,                                FILE_DEVICE_BUS_EXTENDER,                                0,                                FALSE,                                &Pdo);        if (NT_SUCCESS(Status))            break;        if ((Status == STATUS_OBJECT_NAME_EXISTS) || (Status == STATUS_OBJECT_NAME_COLLISION))        {            /* Try the next name */            UsbDeviceNumber++;            continue;        }        /* Bail on any other error */        if (!NT_SUCCESS(Status))        {            DPRINT1("Ehci: Failed to create PDO %wZ, Status %x/n", &DeviceName, Status);            return Status;        }    }    PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension;    RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION));    PdoDeviceExtension->Common.IsFdo = FALSE;    PdoDeviceExtension->ControllerFdo = DeviceObject;    PdoDeviceExtension->DeviceObject = Pdo;    //PdoDeviceExtension->NumberOfPorts = DeviceExtension->hcd.ECHICaps.HCSParams.PortCount;    InitializeListHead(&PdoDeviceExtension->IrpQueue);        KeInitializeSpinLock(&PdoDeviceExtension->IrpQueueLock);    KeInitializeEvent(&PdoDeviceExtension->QueueDrainedEvent, SynchronizationEvent, TRUE);    ExInitializeFastMutex(&PdoDeviceExtension->ListLock);    Pdo->Flags &= ~DO_DEVICE_INITIALIZING;    DeviceExtension->Pdo = Pdo;Done:    DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, sizeof(DEVICE_RELATIONS));    if (!DeviceRelations)    {        return STATUS_INSUFFICIENT_RESOURCES;    }    DeviceRelations->Count = 1;    DeviceRelations->Objects[0] = DeviceExtension->Pdo;    ObReferenceObject(DeviceExtension->Pdo);    *pDeviceRelations = DeviceRelations;    return STATUS_SUCCESS;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:92,


示例26: DriverEntry

/*	Main entry point into the driver, is called when the driver is loaded */NTSTATUS DriverEntry(	IN PDRIVER_OBJECT DriverObject, 	IN PUNICODE_STRING RegistryPath	){    NTSTATUS        ntStatus;    UNICODE_STRING  uszDriverString;    UNICODE_STRING  uszDeviceString;    UNICODE_STRING  uszProcessEventString;    PDEVICE_OBJECT    pDeviceObject;	PCAPTURE_PROCESS_MANAGER pProcessManager;	int i;    	/* Point uszDriverString at the driver name */    RtlInitUnicodeString(&uszDriverString, L"//Device//CaptureProcessMonitor");    /* Create and initialise Process Monitor device object */    ntStatus = IoCreateDevice(		DriverObject,        sizeof(CAPTURE_PROCESS_MANAGER),        &uszDriverString,        FILE_DEVICE_UNKNOWN,        0,        FALSE,        &pDeviceObject		);    if(!NT_SUCCESS(ntStatus)) {		DbgPrint("CaptureProcessMonitor: ERROR IoCreateDevice ->  //Device//CaptureProcessMonitor - %08x/n", ntStatus);         return ntStatus;	}	/* Point uszDeviceString at the device name */    RtlInitUnicodeString(&uszDeviceString, L"//DosDevices//CaptureProcessMonitor");    	/* Create symbolic link to the user-visible name */    ntStatus = IoCreateSymbolicLink(&uszDeviceString, &uszDriverString);    if(!NT_SUCCESS(ntStatus))    {		DbgPrint("CaptureProcessMonitor: ERROR IoCreateSymbolicLink ->  //DosDevices//CaptureProcessMonitor - %08x/n", ntStatus);         IoDeleteDevice(pDeviceObject);        return ntStatus;    }	/* Set global device object to newly created object */	gpDeviceObject = pDeviceObject;	/* Get the process manager from the extension of the device */	pProcessManager = gpDeviceObject->DeviceExtension;    /* Assign global pointer to the device object for use by the callback functions */    pProcessManager->pDeviceObject = pDeviceObject;	ExInitializeFastMutex(&pProcessManager->mProcessWaitingSpinLock);	/* Create event for user-mode processes to monitor */    RtlInitUnicodeString(&uszProcessEventString, L"//BaseNamedObjects//CaptureProcDrvProcessEvent");    pProcessManager->eNewProcessEvent = IoCreateNotificationEvent (&uszProcessEventString, &pProcessManager->hNewProcessEvent);	KeClearEvent(pProcessManager->eNewProcessEvent);    /* Load structure to point to IRP handlers */    DriverObject->DriverUnload                         = UnloadDriver;    DriverObject->MajorFunction[IRP_MJ_CREATE]         = KDispatchCreateClose;    DriverObject->MajorFunction[IRP_MJ_CLOSE]          = KDispatchCreateClose;    DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = KDispatchIoctl;	pProcessManager->pCurrentProcessEvent = NULL;    /* Register process callback function */	ntStatus = PsSetCreateProcessNotifyRoutine(ProcessCallback, FALSE);	if(!NT_SUCCESS(ntStatus))	{		DbgPrint("CaptureProcessMonitor: ERROR PsSetCreateProcessNotifyRoutine - %08x/n", ntStatus); 		return ntStatus;	}	/* Process Manager is ready to receive processes */	pProcessManager->bReady = TRUE;    	DbgPrint("CaptureProcessMonitor: Successfully Loaded/n"); 		/* Return success */    return STATUS_SUCCESS;}
开发者ID:ISergey256,项目名称:capture-hpc,代码行数:83,



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


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