VOID NTAPI NpInitializeVcb(VOID) { PAGED_CODE(); RtlZeroMemory(NpVcb, sizeof(*NpVcb)); NpVcb->NodeType = NPFS_NTC_VCB; RtlInitializeUnicodePrefix(&NpVcb->PrefixTable); ExInitializeResourceLite(&NpVcb->Lock); RtlInitializeGenericTable(&NpVcb->EventTable, NpEventTableCompareRoutine, NpEventTableAllocate, NpEventTableDeallocate, 0); NpInitializeWaitQueue(&NpVcb->WaitQueue); }
VOID MsInitializeVcb ( IN PVCB Vcb ) /*++ Routine Description: This routine initializes new Vcb record. The Vcb record "hangs" off the end of the Msfs device object and must be allocated by our caller. Arguments: Vcb - Supplies the address of the Vcb record being initialized. Return Value: None. --*/ { PAGED_CODE(); DebugTrace(+1, Dbg, "MsInitializeVcb, Vcb = %08lx\n", (ULONG)Vcb); // // We start by first zeroing out all of the VCB, this will guarantee // that any stale data is wiped clean. // RtlZeroMemory( Vcb, sizeof(VCB) ); // // Set the node type code, node byte size, and reference count. // Vcb->Header.NodeTypeCode = MSFS_NTC_VCB; Vcb->Header.NodeByteSize = sizeof(VCB); Vcb->Header.ReferenceCount = 1; Vcb->Header.NodeState = NodeStateActive; // // Initialize the Volume name // Vcb->FileSystemName.Buffer = MSFS_NAME_STRING; Vcb->FileSystemName.Length = sizeof( MSFS_NAME_STRING ) - sizeof( WCHAR ); Vcb->FileSystemName.MaximumLength = sizeof( MSFS_NAME_STRING ); // // Initialize the Prefix table // RtlInitializeUnicodePrefix( &Vcb->PrefixTable ); // // Initialize the resource variable for the VCB. // ExInitializeResource( &Vcb->Resource ); // // Return to the caller. // DebugTrace(-1, Dbg, "MsInitializeVcb -> VOID\n", 0); return; }