这篇教程C++ DebugUnwind函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DebugUnwind函数的典型用法代码示例。如果您正苦于以下问题:C++ DebugUnwind函数的具体用法?C++ DebugUnwind怎么用?C++ DebugUnwind使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DebugUnwind函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: FatCommonQueryVolumeInfo//.........这里部分代码省略......... (VOID) FatDecodeFileObject( IrpSp->FileObject, &Vcb, &Fcb, &Ccb ); ASSERT( Vcb != NULL ); try { // // Make sure the vcb is in a usable condition. This will raise // and error condition if the volume is unusable // // Also verify the Root Dcb since we need info from there. // FatVerifyFcb( IrpContext, Vcb->RootDcb ); // // Based on the information class we'll do different actions. Each // of the procedures that we're calling fills up the output buffer // if possible and returns true if it successfully filled the buffer // and false if it couldn't wait for any I/O to complete. // switch (FsInformationClass) { case FileFsVolumeInformation: // // This is the only routine we need the Vcb shared because of // copying the volume label. All other routines copy fields that // cannot change or are just manifest constants. // if (!FatAcquireSharedVcb( IrpContext, Vcb )) { DebugTrace(0, Dbg, "Cannot acquire Vcb/n", 0); Status = FatFsdPostRequest( IrpContext, Irp ); IrpContext = NULL; Irp = NULL; } else { WeAcquiredVcb = TRUE; Status = FatQueryFsVolumeInfo( IrpContext, Vcb, Buffer, &Length ); } break; case FileFsSizeInformation: Status = FatQueryFsSizeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsDeviceInformation: Status = FatQueryFsDeviceInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsAttributeInformation: Status = FatQueryFsAttributeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsFullSizeInformation: Status = FatQueryFsFullSizeInfo( IrpContext, Vcb, Buffer, &Length ); break; default: Status = STATUS_INVALID_PARAMETER; break; } // // Set the information field to the number of bytes actually filled in. // if (Irp != NULL) { Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length; } } finally { DebugUnwind( FatCommonQueryVolumeInfo ); if ( WeAcquiredVcb ) { FatReleaseVcb( IrpContext, Vcb ); } if (!AbnormalTermination()) { FatCompleteRequest( IrpContext, Irp, Status ); } DebugTrace(-1, Dbg, "FatCommonQueryVolumeInfo -> %08lx/n", Status); } return Status;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例2: LfsReadLogRecord//.........这里部分代码省略......... // if (Lfcb == NULL) { ExRaiseStatus( STATUS_ACCESS_DENIED ); } // // Check that the client Id is valid. // LfsValidateClientId( Lfcb, Lch ); // // Check that the given Lsn is in the legal range for this client. // ClientRecord = LfsAdd2Ptr( Lfcb->ClientArray, Lch->ClientArrayByteOffset, PLFS_CLIENT_RECORD ); if (!LfsVerifyClientLsnInRange( Lfcb, ClientRecord, FirstLsn )) { ExRaiseStatus( STATUS_DISK_CORRUPT_ERROR ); } // // We can give up the Lfcb as we know the Lsn is within the file. // LfsReleaseLch( Lch ); // // Allocate and initialize a context structure. // LfsAllocateLcb( &Lcb ); LfsInitializeLcb( Lcb, Lch->ClientId, ContextMode ); // // Find the log record indicated by the given Lsn. // LfsFindLogRecord( Lfcb, Lcb, FirstLsn, RecordType, TransactionId, UndoNextLsn, PreviousLsn, BufferLength, Buffer ); // // Update the client's arguments. // *Context = Lcb; Lcb = NULL; } finally { DebugUnwind( LfsReadLogRecord ); // // Release the log file control block if held. // LfsReleaseLch( Lch ); // // Deallocate the context block if an error occurred. // if (Lcb != NULL) { LfsDeallocateLcb( Lcb ); } LfsDebugTrace( 0, Dbg, "Context -> %08lx/n", *Context ); LfsDebugTrace( 0, Dbg, "Buffer Length -> %08lx/n", *BufferLength ); LfsDebugTrace( 0, Dbg, "Buffer -> %08lx/n", *Buffer ); LfsDebugTrace( -1, Dbg, "LfsReadLogRecord: Exit/n", 0 ); } } except (LfsExceptionFilter( GetExceptionInformation() )) { Status = GetExceptionCode(); } if (Status != STATUS_SUCCESS) { ExRaiseStatus( Status ); } return;}
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例3: LfsFindLogRecord//.........这里部分代码省略......... // // We now have the log record desired. If the Lsn in the // log record doesn't match the desired Lsn then the disk is // corrupt. // if ( Lsn.QuadPart != Lcb->RecordHeader->ThisLsn.QuadPart ) { //**** xxNeq( Lsn, Lcb->RecordHeader->ThisLsn ) ExRaiseStatus( STATUS_DISK_CORRUPT_ERROR ); } // // Check that the length field isn't greater than the total available space // in the log file. // LogRecordLength = Lcb->RecordHeader->ClientDataLength + Lfcb->RecordHeaderLength; //**** xxFromUlong( Lcb->RecordHeader->ClientDataLength + Lfcb->RecordHeaderLength ); if ( LogRecordLength >= Lfcb->TotalAvailable ) { //**** xxGeq( LogRecordLength, Lfcb->TotalAvailable ) ExRaiseStatus( STATUS_DISK_CORRUPT_ERROR ); } // // If the entire log record is on this log page, put a pointer to // the log record in the context block. // if (!FlagOn( Lcb->RecordHeader->Flags, LOG_RECORD_MULTI_PAGE )) { // // If client size indicates that we have to go beyond the end of the current // page, we raise an error. // PageOffset = LfsLsnToPageOffset( Lfcb, Lsn ); if ((PageOffset + Lcb->RecordHeader->ClientDataLength + Lfcb->RecordHeaderLength) > (ULONG)Lfcb->LogPageSize) { ExRaiseStatus( STATUS_DISK_CORRUPT_ERROR ); } Lcb->CurrentLogRecord = LfsAdd2Ptr( Lcb->RecordHeader, LFS_RECORD_HEADER_SIZE, PVOID ); Lcb->AuxilaryBuffer = FALSE; // // Else we copy the data and remember that we allocated a buffer. // } else { NewBuffer = FsRtlAllocatePool( PagedPool, Lcb->RecordHeader->ClientDataLength ); LfsCopyReadLogRecord( Lfcb, Lcb->RecordHeader, NewBuffer ); Lcb->CurrentLogRecord = NewBuffer; Lcb->AuxilaryBuffer = TRUE; NewBuffer = NULL; } // // We need to update the caller's parameters and the context block. // *RecordType = Lcb->RecordHeader->RecordType; *TransactionId = Lcb->RecordHeader->TransactionId; *UndoNextLsn = Lcb->RecordHeader->ClientUndoNextLsn; *PreviousLsn = Lcb->RecordHeader->ClientPreviousLsn; *Buffer = Lcb->CurrentLogRecord; *BufferLength = Lcb->RecordHeader->ClientDataLength; } finally { DebugUnwind( LfsFindLogRecord ); // // If an error occurred we unpin the record header and the log // We also free the buffer if allocated by us. // if (NewBuffer != NULL) { ExFreePool( NewBuffer ); } LfsDebugTrace( 0, Dbg, "Buffer Length -> %08lx/n", *BufferLength ); LfsDebugTrace( 0, Dbg, "Buffer -> %08lx/n", *Buffer ); LfsDebugTrace( -1, Dbg, "LfsFindLogRecord: Exit/n", 0 ); } return;}
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例4: FatCommonLockControl//.........这里部分代码省略......... // IrpSp = IoGetCurrentIrpStackLocation( Irp ); DebugTrace(+1, Dbg, "FatCommonLockControl/n", 0); DebugTrace( 0, Dbg, "Irp = %08lx/n", Irp); DebugTrace( 0, Dbg, "MinorFunction = %08lx/n", IrpSp->MinorFunction); // // Decode the type of file object we're being asked to process // TypeOfOpen = FatDecodeFileObject( IrpSp->FileObject, &Vcb, &Fcb, &Ccb ); // // If the file is not a user file open then we reject the request // as an invalid parameter // if (TypeOfOpen != UserFileOpen) { FatCompleteRequest( IrpContext, Irp, STATUS_INVALID_PARAMETER ); DebugTrace(-1, Dbg, "FatCommonLockControl -> STATUS_INVALID_PARAMETER/n", 0); return STATUS_INVALID_PARAMETER; } // // Acquire exclusive access to the Fcb and enqueue the Irp if we didn't // get access // if (!FatAcquireSharedFcb( IrpContext, Fcb )) { Status = FatFsdPostRequest( IrpContext, Irp ); DebugTrace(-1, Dbg, "FatCommonLockControl -> %08lx/n", Status); return Status; } try { // // We check whether we can proceed // based on the state of the file oplocks. // Status = FsRtlCheckOplock( &Fcb->Specific.Fcb.Oplock, Irp, IrpContext, FatOplockComplete, NULL ); if (Status != STATUS_SUCCESS) { OplockPostIrp = TRUE; try_return( NOTHING ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request // Status = FsRtlProcessFileLock( &Fcb->Specific.Fcb.FileLock, Irp, NULL ); // // Set the flag indicating if Fast I/O is possible // Fcb->Header.IsFastIoPossible = FatIsFastIoPossible( Fcb );try_exit: NOTHING; } finally { DebugUnwind( FatCommonLockControl ); // // Only if this is not an abnormal termination do we delete the // irp context // if (!AbnormalTermination() && !OplockPostIrp) { FatCompleteRequest( IrpContext, FatNull, 0 ); } // // Release the Fcb, and return to our caller // FatReleaseFcb( IrpContext, Fcb ); DebugTrace(-1, Dbg, "FatCommonLockControl -> %08lx/n", Status); } return Status;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例5: LfsReadNextLogRecord//.........这里部分代码省略......... // // We can give up the Lfcb as we know the Lsn is within the file. // LfsReleaseLfcb( Lfcb ); // // Cleanup the context block so we can do the next search. // Lcb->CurrentLogRecord = NULL; Lcb->AuxilaryBuffer = FALSE; // // Perform the work of getting the log record. // LfsFindLogRecord( Lfcb, Lcb, *Lsn, RecordType, TransactionId, UndoNextLsn, PreviousLsn, BufferLength, Buffer ); FoundNextLsn = TRUE; } } finally { DebugUnwind( LfsReadNextLogRecord ); // // If we exited due to an error, we have to restore the context // block. // if (UnwindRememberLcbFields) { if (AbnormalTermination()) { // // If the record header in the context block is not // the same as we started with. Then we unpin that // data. // if (Lcb->RecordHeaderBcb != NULL) { CcUnpinData( Lcb->RecordHeaderBcb ); } if (Lcb->CurrentLogRecord != NULL && Lcb->AuxilaryBuffer == TRUE) { ExFreePool( Lcb->CurrentLogRecord ); } Lcb->RecordHeaderBcb = UnwindRecordHeaderBcb; Lcb->RecordHeader = UnwindRecordHeader; Lcb->CurrentLogRecord = UnwindCurrentLogRecord; Lcb->AuxilaryBuffer = UnwindAuxilaryBuffer;
开发者ID:340211173,项目名称:hf-2011,代码行数:67,
示例6: LfsWriteLfsRestart//.........这里部分代码省略......... // // We allocate another restart area and // copy the current area into it. Attach the new area to the Lfcb. // LfsAllocateRestartArea( &NewRestart, ThisRestartSize ); // // We allocate a Lbcb structure and update the values to // reflect this restart area. // LfsAllocateLbcb( Lfcb, &NewLbcb ); SetFlag( NewLbcb->LbcbFlags, LBCB_RESTART_LBCB ); // // If this is the second page, then add a system page to the offset. // if (!Lfcb->InitialRestartArea) { NewLbcb->FileOffset = Lfcb->SystemPageSize + NewLbcb->FileOffset; } (ULONG)NewLbcb->Length = ThisRestartSize; NewLbcb->PageHeader = (PVOID) Lfcb->RestartArea; // // Lets put the current lsn in the Lbcb. // NewLbcb->LastEndLsn = NewLbcb->LastLsn = Lfcb->NextRestartLsn; Lfcb->NextRestartLsn.QuadPart = 1 + Lfcb->NextRestartLsn.QuadPart; // // Copy the existing restart area into the new area. // RtlCopyMemory( NewRestart, Lfcb->RestartArea, ThisRestartSize ); Lfcb->RestartArea = NewRestart; Lfcb->ClientArray = LfsAdd2Ptr( NewRestart, Lfcb->ClientArrayOffset, PLFS_CLIENT_RECORD ); NewRestart = NULL; // // Update the Lfcb to indicate that the other restart area // on the disk is to be used. // Lfcb->InitialRestartArea = !Lfcb->InitialRestartArea; // // Add this Lbcb to the end of the workque and flush to that point. // InsertTailList( &Lfcb->LbcbWorkque, &NewLbcb->WorkqueLinks ); // // If we don't support a packed log file then we need to make // sure that all file records written out ahead of this // restart area make it out to disk and we don't add anything // to this page. // if (!FlagOn( Lfcb->Flags, LFCB_PACK_LOG ) && !IsListEmpty( &Lfcb->LbcbActive )) { ActiveLbcb = CONTAINING_RECORD( Lfcb->LbcbActive.Flink, LBCB, ActiveLinks ); if (FlagOn( ActiveLbcb->LbcbFlags, LBCB_NOT_EMPTY )) { RemoveEntryList( &ActiveLbcb->ActiveLinks ); ClearFlag( ActiveLbcb->LbcbFlags, LBCB_ON_ACTIVE_QUEUE ); } } if (WaitForIo) { LfsFlushLbcb( Lfcb, NewLbcb ); } } __finally { DebugUnwind( LfsWriteLfsRestart ); if (NewRestart != NULL) { ExFreePool( NewRestart ); } LfsDebugTrace( -1, Dbg, "LfsWriteLfsRestart: Exit/n", 0 ); } return;}
开发者ID:conioh,项目名称:os-design,代码行数:101,
示例7: FatFastLock//.........这里部分代码省略......... Key - Supplies the key used in this operation FailImmediately - Indicates if the request should fail immediately if the lock cannot be granted. ExclusiveLock - Indicates if this is a request for an exclusive or shared lock IoStatus - Receives the Status if this operation is successfulReturn Value: BOOLEAN - TRUE if this operation completed and FALSE if caller needs to take the long route.--*/{ BOOLEAN Results; PVCB Vcb; PFCB Fcb; PCCB Ccb; DebugTrace(+1, Dbg, "FatFastLock/n", 0); // // Decode the type of file object we're being asked to process and make // sure it is only a user file open. // if (FatDecodeFileObject( FileObject, &Vcb, &Fcb, &Ccb ) != UserFileOpen) { IoStatus->Status = STATUS_INVALID_PARAMETER; IoStatus->Information = 0; DebugTrace(-1, Dbg, "FatFastLock -> TRUE (STATUS_INVALID_PARAMETER)/n", 0); return TRUE; } // // Acquire exclusive access to the Fcb this operation can always wait // FsRtlEnterFileSystem(); try { // // We check whether we can proceed // based on the state of the file oplocks. // if (!FsRtlOplockIsFastIoPossible( &(Fcb)->Specific.Fcb.Oplock )) { try_return( Results = FALSE ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request // if (Results = FsRtlFastLock( &Fcb->Specific.Fcb.FileLock, FileObject, FileOffset, Length, ProcessId, Key, FailImmediately, ExclusiveLock, IoStatus, NULL, FALSE )) { // // Set the flag indicating if Fast I/O is possible // Fcb->Header.IsFastIoPossible = FatIsFastIoPossible( Fcb ); }try_exit: NOTHING; } finally { DebugUnwind( FatFastLock ); // // Release the Fcb, and return to our caller // FsRtlExitFileSystem(); DebugTrace(-1, Dbg, "FatFastLock -> %08lx/n", Results); } return Results;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例8: LfsFindNextLsn//.........这里部分代码省略......... LfsTruncateOffsetToLogPage( Lfcb, EndOfLogRecord, &LogHeaderOffset ); // // Remember the sequence number for this page. // SequenceNumber = LfsLsnToSeqNumber( Lfcb, RecordHeader->ThisLsn ); // // Remember if we wrapped. // if ( EndOfLogRecord <= LsnOffset ) { //**** xxLeq( EndOfLogRecord, LsnOffset ) SequenceNumber = SequenceNumber + 1; //**** xxAdd( SequenceNumber, LfsLi1 ); } // // Pin the log page header for this page. // LfsPinOrMapData( Lfcb, LogHeaderOffset, (ULONG)Lfcb->LogPageSize, FALSE, FALSE, FALSE, &UsaError, (PVOID *)&LogRecordPage, &LogRecordPageBcb ); // // If the Lsn we were given was not the last Lsn on this page, then // the starting offset for the next Lsn is on a quad word boundary // following the last file offset for the current Lsn. Otherwise // the file offset is the start of the data on the next page. // if ( RecordHeader->ThisLsn.QuadPart == LogRecordPage->Copy.LastLsn.QuadPart ) { //**** xxEql( RecordHeader->ThisLsn, LogRecordPage->Copy.LastLsn ) BOOLEAN Wrapped; LfsNextLogPageOffset( Lfcb, LogHeaderOffset, &LogHeaderOffset, &Wrapped ); LsnOffset = LogHeaderOffset + Lfcb->LogPageDataOffset; //**** xxAdd( LogHeaderOffset, Lfcb->LogPageDataOffset ); // // If we wrapped, we need to increment the sequence number. // if (Wrapped) { SequenceNumber = SequenceNumber + 1; //**** xxAdd( SequenceNumber, LfsLi1 ); } } else { LiQuadAlign( EndOfLogRecord, &LsnOffset ); } // // Compute the Lsn based on the file offset and the sequence count. // Lsn->QuadPart = LfsFileOffsetToLsn( Lfcb, LsnOffset, SequenceNumber ); // // If this Lsn is within the legal range for the file, we return TRUE. // Otherwise FALSE indicates that there are no more Lsn's. // if (LfsIsLsnInFile( Lfcb, *Lsn )) { FoundNextLsn = TRUE; } } finally { DebugUnwind( LfsFindNextLsn ); // // Unpin the log page header if held. // if (LogRecordPageBcb != NULL) { CcUnpinData( LogRecordPageBcb ); } DebugTrace( 0, Dbg, "Lsn (Low) -> %08lx/n", Lsn->LowPart ); DebugTrace( 0, Dbg, "Lsn (High) -> %08lx/n", Lsn->HighPart ); DebugTrace( -1, Dbg, "LfsFindNextLsn: Exit -> %08x/n", FoundNextLsn ); } return FoundNextLsn;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例9: NtfsFastUnlockSingle//.........这里部分代码省略......... // make sure that is is only a user file open. // if ((Scb = NtfsFastDecodeUserFileOpen( FileObject )) == NULL) { IoStatus->Status = STATUS_INVALID_PARAMETER; DebugTrace( -1, Dbg, ("NtfsFastUnlockSingle -> TRUE (STATUS_INVALID_PARAMETER)/n") ); return TRUE; } Fcb = Scb->Fcb; // // Acquire exclusive access to the Fcb this operation can always wait // FsRtlEnterFileSystem(); if (Scb->ScbType.Data.FileLock == NULL) { (VOID) ExAcquireResourceExclusive( Fcb->Resource, TRUE ); ResourceAcquired = TRUE; } else { //(VOID) ExAcquireResourceShared( Fcb->Resource, TRUE ); } try { // // We check whether we can proceed based on the state of the file oplocks. // if ((Scb->ScbType.Data.Oplock != NULL) && !FsRtlOplockIsFastIoPossible( &Scb->ScbType.Data.Oplock )) { try_return( Results = FALSE ); } // // If we don't have a file lock, then get one now. // if (Scb->ScbType.Data.FileLock == NULL && !NtfsCreateFileLock( Scb, FALSE )) { try_return( Results = FALSE ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request. The call will always succeed. // Results = TRUE; IoStatus->Status = FsRtlFastUnlockSingle( Scb->ScbType.Data.FileLock, FileObject, FileOffset, Length, ProcessId, Key, NULL, FALSE ); // // Set the flag indicating if Fast I/O is possible. We are // only concerned if there are no longer any filelocks on this // file. // if (!FsRtlAreThereCurrentFileLocks( Scb->ScbType.Data.FileLock ) && (Scb->Header.IsFastIoPossible != FastIoIsPossible)) { NtfsAcquireFsrtlHeader( Scb ); Scb->Header.IsFastIoPossible = NtfsIsFastIoPossible( Scb ); NtfsReleaseFsrtlHeader( Scb ); } try_exit: NOTHING; } finally { DebugUnwind( NtfsFastUnlockSingle ); // // Release the Fcb, and return to our caller // if (ResourceAcquired) { ExReleaseResource( Fcb->Resource ); } FsRtlExitFileSystem(); DebugTrace( -1, Dbg, ("NtfsFastUnlockSingle -> %08lx/n", Results) ); } return Results;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例10: FatCommonLockControl//.........这里部分代码省略......... DebugTrace(-1, Dbg, "FatCommonLockControl -> STATUS_INVALID_PARAMETER/n", 0); return STATUS_INVALID_PARAMETER; } // // Acquire exclusive access to the Fcb and enqueue the Irp if we didn't // get access // if (!FatAcquireSharedFcb( IrpContext, Fcb )) { Status = FatFsdPostRequest( IrpContext, Irp ); DebugTrace(-1, Dbg, "FatCommonLockControl -> %08lx/n", Status); return Status; } try { // // We check whether we can proceed // based on the state of the file oplocks. //#if (NTDDI_VERSION >= NTDDI_WIN8) if (((IRP_MN_LOCK == IrpSp->MinorFunction) && ((ULONGLONG)IrpSp->Parameters.LockControl.ByteOffset.QuadPart < (ULONGLONG)Fcb->Header.AllocationSize.QuadPart)) || ((IRP_MN_LOCK != IrpSp->MinorFunction) && FsRtlAreThereWaitingFileLocks( &Fcb->Specific.Fcb.FileLock ))) { // // Check whether we can proceed based on the state of file oplocks if doing // an operation that interferes with oplocks. Those operations are: // // 1. Lock a range within the file's AllocationSize. // 2. Unlock a range when there are waiting locks on the file. This one // is not guaranteed to interfere with oplocks, but it could, as // unlocking this range might cause a waiting lock to be granted // within AllocationSize! //#endif Status = FsRtlCheckOplock( FatGetFcbOplock(Fcb), Irp, IrpContext, FatOplockComplete, NULL );#if (NTDDI_VERSION >= NTDDI_WIN8) }#endif if (Status != STATUS_SUCCESS) { OplockPostIrp = TRUE; try_return( NOTHING ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request // Status = FsRtlProcessFileLock( &Fcb->Specific.Fcb.FileLock, Irp, NULL ); // // Set the flag indicating if Fast I/O is possible // Fcb->Header.IsFastIoPossible = FatIsFastIoPossible( Fcb ); try_exit: NOTHING; } finally { DebugUnwind( FatCommonLockControl ); // // Only if this is not an abnormal termination do we delete the // irp context // if (!AbnormalTermination() && !OplockPostIrp) { FatCompleteRequest( IrpContext, FatNull, 0 ); } // // Release the Fcb, and return to our caller // FatReleaseFcb( IrpContext, Fcb ); DebugTrace(-1, Dbg, "FatCommonLockControl -> %08lx/n", Status); } return Status;}
开发者ID:Realhram,项目名称:wdk81,代码行数:101,
示例11: FatPrepareWriteDirectoryFile//.........这里部分代码省略......... if (ByteCount > ClusterSize) { BytesToPin = ClusterSize; } else { BytesToPin = ByteCount; } ASSERT( (Vbo.QuadPart / ClusterSize) == (Vbo.QuadPart + BytesToPin - 1)/ClusterSize ); if (!CcPinRead( Dcb->Specific.Dcb.DirectoryFile, &Vbo, BytesToPin, BooleanFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT), Bcb, &LocalBuffer )) { // // Could not read the data without waiting (cache miss). // FatRaiseStatus( IrpContext, STATUS_CANT_WAIT ); } // // Update our caller with the beginning of their request. // if (*Buffer == NULL) { *Buffer = LocalBuffer; } DbgDoit( IrpContext->PinCount += 1 ) if (Zero) { // // We set this guy dirty right now so that we can raise CANT_WAIT when // it needs to be done. It'd be beautiful if we could noop the read IO // since we know we don't care about it. // RtlZeroMemory( LocalBuffer, BytesToPin ); CcSetDirtyPinnedData( *Bcb, NULL ); } ByteCount -= BytesToPin; Vbo.QuadPart += BytesToPin; if (ByteCount > 0) { FatUnpinBcb( IrpContext, *Bcb ); } } // // This lets us get the data pinned until we complete the request // and writes the dirty bit through to the disk. // FatSetDirtyBcb( IrpContext, *Bcb, Dcb->Vcb, Reversible ); *Status = STATUS_SUCCESS; } finally { DebugUnwind( FatPrepareWriteDirectoryFile ); if (AbnormalTermination()) { // // These steps are carefully arranged - FatTruncateFileAllocation can raise. // Make sure we unpin the buffer. If FTFA raises, the effect should be benign. // FatUnpinBcb(IrpContext, *Bcb); if (UnwindWeAllocatedDiskSpace == TRUE) { // // Inform the cache manager of the change. // FatTruncateFileAllocation( IrpContext, Dcb, InitialAllocation ); Dcb->Header.FileSize.LowPart = Dcb->Header.AllocationSize.LowPart; CcSetFileSizes( Dcb->Specific.Dcb.DirectoryFile, (PCC_FILE_SIZES)&Dcb->Header.AllocationSize ); } } DebugTrace(-1, Dbg, "FatPrepareWriteDirectoryFile -> (VOID), *Bcb = %08lx/n", *Bcb); } return;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例12: LfsGetLbcb//.........这里部分代码省略......... if (Int64ShllMod32( Lfcb->SeqNumber, Lfcb->FileDataBits ) == 0) { LfsDebugTrace( 0, Dbg, "Log sequence number about to wrap: Lfcb -> %08lx/n", Lfcb ); KeBugCheck( FILE_SYSTEM ); } // // If this number is greater or equal to the wrap sequence number in // the Lfcb, set the wrap flag in the Lbcb. // if (!FlagOn( Lfcb->Flags, LFCB_LOG_WRAPPED ) && ( Lfcb->SeqNumber >= Lfcb->SeqNumberForWrap )) { SetFlag( Lbcb->LbcbFlags, LBCB_LOG_WRAPPED ); SetFlag( Lfcb->Flags, LFCB_LOG_WRAPPED ); } } // // Now initialize the rest of the Lbcb fields. // Lbcb->FileOffset = Lfcb->NextLogPage; Lbcb->SeqNumber = Lfcb->SeqNumber; Lbcb->BufferOffset = Lfcb->LogPageDataOffset; // // Store the next page in the Lfcb. // LfsNextLogPageOffset( Lfcb, Lfcb->NextLogPage, &Lfcb->NextLogPage, &WrappedOrUsaError ); Lbcb->Length = Lfcb->LogPageSize; Lbcb->PageHeader = PageHeader; Lbcb->LogPageBcb = PageHeaderBcb; Lbcb->ResourceThread = ExGetCurrentResourceThread(); // // If we are reusing a previous page then set a flag in // the Lbcb to indicate that we should flush a copy // first. // if (FlagOn( Lfcb->Flags, LFCB_REUSE_TAIL )) { SetFlag( Lbcb->LbcbFlags, LBCB_FLUSH_COPY ); ClearFlag( Lfcb->Flags, LFCB_REUSE_TAIL ); (ULONG)Lbcb->BufferOffset = Lfcb->ReusePageOffset; Lbcb->Flags = ((PLFS_RECORD_PAGE_HEADER) PageHeader)->Flags; Lbcb->LastLsn = ((PLFS_RECORD_PAGE_HEADER) PageHeader)->Copy.LastLsn; Lbcb->LastEndLsn = ((PLFS_RECORD_PAGE_HEADER) PageHeader)->Header.Packed.LastEndLsn; } // // Put the Lbcb on the active queue // InsertTailList( &Lfcb->LbcbActive, &Lbcb->ActiveLinks ); SetFlag( Lbcb->LbcbFlags, LBCB_ON_ACTIVE_QUEUE ); } finally { DebugUnwind( LfsGetLbcb ); // // If an error occurred, we need to clean up any blocks which // have not been added to the active queue. // if (AbnormalTermination()) { if (Lbcb != NULL) { LfsDeallocateLbcb( Lfcb, Lbcb ); Lbcb = NULL; } // // Unpin the system page if pinned. // if (PageHeaderBcb != NULL) { CcUnpinData( PageHeaderBcb ); } } LfsDebugTrace( -1, Dbg, "LfsGetLbcb: Exit/n", 0 ); } return Lbcb;}
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例13: FatSetFsLabelInfo//.........这里部分代码省略......... // FatSetDirtyBcb( IrpContext, DirentBcb, Vcb, TRUE ); } // // Now reconstruct the volume label dirent. // FatConstructLabelDirent( IrpContext, Dirent, &OemLabel ); // // Unpin the Bcb here so that we will get any IO errors // here before changing the VPB label. // FatUnpinBcb( IrpContext, DirentBcb ); FatUnpinRepinnedBcbs( IrpContext ); // // Now set the upcased label in the VPB // RtlCopyMemory( &Vcb->Vpb->VolumeLabel[0], &UpcasedLabel.Buffer[0], UpcasedLabel.Length ); Vcb->Vpb->VolumeLabelLength = UpcasedLabel.Length; } else { // // Otherwise we're trying to delete the label // Locate the current volume label if there already is one // FatLocateVolumeLabel( IrpContext, Vcb, &Dirent, &DirentBcb, &ByteOffset ); // // Check that we really got one // if (Dirent == NULL) { try_return( Status = STATUS_SUCCESS ); } // // Now delete the current label. // Dirent->FileName[0] = FAT_DIRENT_DELETED; ASSERT( (Vcb->RootDcb->Specific.Dcb.UnusedDirentVbo == 0xffffffff) || RtlAreBitsSet( &Vcb->RootDcb->Specific.Dcb.FreeDirentBitmap, ByteOffset / sizeof(DIRENT), 1 ) ); RtlClearBits( &Vcb->RootDcb->Specific.Dcb.FreeDirentBitmap, ByteOffset / sizeof(DIRENT), 1 ); FatSetDirtyBcb( IrpContext, DirentBcb, Vcb, TRUE ); // // Unpin the Bcb here so that we will get any IO errors // here before changing the VPB label. // FatUnpinBcb( IrpContext, DirentBcb ); FatUnpinRepinnedBcbs( IrpContext ); // // Now set the label in the VPB // Vcb->Vpb->VolumeLabelLength = 0; } Status = STATUS_SUCCESS; FatSortDirectory(IrpContext, Vcb->RootDcb); try_exit: NOTHING; } finally { DebugUnwind( FatSetFsALabelInfo ); FatUnpinBcb( IrpContext, DirentBcb ); DebugTrace(-1, Dbg, "FatSetFsALabelInfo -> STATUS_SUCCESS/n", 0); } return Status;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例14: FatCommonSetVolumeInfo//.........这里部分代码省略......... // // Get the current stack location // IrpSp = IoGetCurrentIrpStackLocation( Irp ); DebugTrace(+1, Dbg, "FatCommonSetVolumeInfo.../n", 0); DebugTrace( 0, Dbg, "Irp = %08lx/n", Irp ); DebugTrace( 0, Dbg, "->Length = %08lx/n", IrpSp->Parameters.SetVolume.Length); DebugTrace( 0, Dbg, "->FsInformationClass = %08lx/n", IrpSp->Parameters.SetVolume.FsInformationClass); DebugTrace( 0, Dbg, "->Buffer = %08lx/n", Irp->AssociatedIrp.SystemBuffer); // // Reference our input parameters to make things easier // Length = IrpSp->Parameters.SetVolume.Length; FsInformationClass = IrpSp->Parameters.SetVolume.FsInformationClass; Buffer = Irp->AssociatedIrp.SystemBuffer; // // Decode the file object to get the Vcb // TypeOfOpen = FatDecodeFileObject( IrpSp->FileObject, &Vcb, &Fcb, &Ccb ); if (TypeOfOpen != UserVolumeOpen) { FatCompleteRequest( IrpContext, Irp, STATUS_ACCESS_DENIED ); DebugTrace(-1, Dbg, "FatCommonSetVolumeInfo -> STATUS_ACCESS_DENIED/n", 0); return STATUS_ACCESS_DENIED; } // // Acquire exclusive access to the Vcb and enqueue the Irp if we didn't // get access // if (!FatAcquireExclusiveVcb( IrpContext, Vcb )) { DebugTrace(0, Dbg, "Cannot acquire Vcb/n", 0); Status = FatFsdPostRequest( IrpContext, Irp ); DebugTrace(-1, Dbg, "FatCommonSetVolumeInfo -> %08lx/n", Status ); return Status; } try { // // Make sure the vcb is in a usable condition. This will raise // and error condition if the volume is unusable // // Also verify the Root Dcb since we need info from there. // FatVerifyFcb( IrpContext, Vcb->RootDcb ); // // Based on the information class we'll do different actions. Each // of the procedures that we're calling performs the action if // possible and returns true if it successful and false if it couldn't // wait for any I/O to complete. // switch (FsInformationClass) { case FileFsLabelInformation: Status = FatSetFsLabelInfo( IrpContext, Vcb, Buffer ); break; default: Status = STATUS_INVALID_PARAMETER; break; } FatUnpinRepinnedBcbs( IrpContext ); } finally { DebugUnwind( FatCommonSetVolumeInfo ); FatReleaseVcb( IrpContext, Vcb ); if (!AbnormalTermination()) { FatCompleteRequest( IrpContext, Irp, Status ); } DebugTrace(-1, Dbg, "FatCommonSetVolumeInfo -> %08lx/n", Status); } return Status;}
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例15: UdfLoadSparingTables//.........这里部分代码省略......... TRUE )) { DebugTrace(( 0, Dbg, "UdfLoadSparingTables, sparing table %u didn't verify destag!/n", SparingTable )); break; } if (!UdfUdfIdentifierContained( &Header->RegID, &UdfSparingTableIdentifier, UDF_VERSION_150, UDF_VERSION_RECOGNIZED, OSCLASS_INVALID, OSIDENTIFIER_INVALID)) { DebugTrace(( 0, Dbg, "UdfLoadSparingTables, sparing table %u didn't verify regid!/n", SparingTable )); break; } // // Calculate the total number bytes this map spans and check it against what // we were told the sparing table sizes are. // DebugTrace(( 0, Dbg, "UdfLoadSparingTables, Sparing table %u has %u entries/n", SparingTable, Header->TableEntries )); TotalBytes = sizeof(SPARING_TABLE_HEADER) + Header->TableEntries * sizeof(SPARING_TABLE_ENTRY); if (Map->TableSize < TotalBytes) { DebugTrace(( 0, Dbg, "UdfLoadSparingTables, sparing table #ents %u overflows allocation!/n", Header->TableEntries )); break; } // // So far so good, advance past the header. // ByteOffset = sizeof(SPARING_TABLE_HEADER); Entry = Add2Ptr( SectorBuffer, sizeof(SPARING_TABLE_HEADER), PSPARING_TABLE_ENTRY ); } else { // // Pick up in the new sector. // Entry = (PSPARING_TABLE_ENTRY) SectorBuffer; } RemainingBytes = Min( SectorSize( Vcb ), TotalBytes - ByteOffset ); } // // Add the mapping. Since sparing tables are an Lbn->Psn mapping, // very odd, and I want to simplify things by putting the sparing // in right at IO dispatch, translate this to a Psn->Psn mapping. // if (Entry->Original != UDF_SPARING_AVALIABLE && Entry->Original != UDF_SPARING_DEFECTIVE) { Psn = Partition->Physical.Start + SectorsFromBlocks( Vcb, Entry->Original ); DebugTrace(( 0, Dbg, "UdfLoadSparingTables, mapping from Psn %x (Lbn %x) -> Psn %x/n", Psn, Entry->Original, Entry->Mapped )); FsRtlAddLargeMcbEntry( Pcb->SparingMcb, Psn, Entry->Mapped, UDF_SPARING_PACKET_LENGTH ); } // // Advance to the next, and drop out if we've hit the end. // ByteOffset += sizeof(SPARING_TABLE_ENTRY); RemainingBytes -= sizeof(SPARING_TABLE_ENTRY); Entry++; } while ( ByteOffset < TotalBytes ); } } finally { DebugUnwind( UdfLoadSparingTables ); UdfFreePool( &SectorBuffer ); } DebugTrace(( -1, Dbg, "UdfLoadSparingTables -> STATUS_SUCCESS/n" )); return STATUS_SUCCESS;}
开发者ID:conioh,项目名称:os-design,代码行数:101,
示例16: NtfsFastUnlockAllByKey//.........这里部分代码省略......... PCCB Ccb; UNREFERENCED_PARAMETER( DeviceObject ); PAGED_CODE(); DebugTrace( +1, Dbg, ("NtfsFastUnlockAllByKey/n") ); IoStatus->Information = 0; // // Decode the type of file object we're being asked to process and // make sure that is is only a user file open. // TypeOfOpen = NtfsDecodeFileObject( &IrpContext, FileObject, &Vcb, &Fcb, &Scb, &Ccb, FALSE ); if (TypeOfOpen != UserFileOpen) { IoStatus->Status = STATUS_INVALID_PARAMETER; IoStatus->Information = 0; DebugTrace( -1, Dbg, ("NtfsFastUnlockAllByKey -> TRUE (STATUS_INVALID_PARAMETER)/n") ); return TRUE; } // // Acquire exclusive access to the Fcb this operation can always wait // FsRtlEnterFileSystem(); if (Scb->ScbType.Data.FileLock == NULL) { (VOID) ExAcquireResourceExclusive( Fcb->Resource, TRUE ); } else { (VOID) ExAcquireResourceShared( Fcb->Resource, TRUE ); } try { // // We check whether we can proceed based on the state of the file oplocks. // if (!FsRtlOplockIsFastIoPossible( &Scb->ScbType.Data.Oplock )) { try_return( Results = FALSE ); } // // If we don't have a file lock, then get one now. // if (Scb->ScbType.Data.FileLock == NULL && !NtfsCreateFileLock( Scb, FALSE )) { try_return( Results = FALSE ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request. The call will always succeed. // Results = TRUE; IoStatus->Status = FsRtlFastUnlockAllByKey( Scb->ScbType.Data.FileLock, FileObject, ProcessId, Key, NULL ); // // Set the flag indicating if Fast I/O is possible // NtfsAcquireFsrtlHeader( Scb ); Scb->Header.IsFastIoPossible = NtfsIsFastIoPossible( Scb ); NtfsReleaseFsrtlHeader( Scb ); try_exit: NOTHING; } finally { DebugUnwind( NtfsFastUnlockAllByKey ); // // Release the Fcb, and return to our caller // ExReleaseResource( Fcb->Resource ); FsRtlExitFileSystem(); DebugTrace( -1, Dbg, ("NtfsFastUnlockAllByKey -> %08lx/n", Results) ); } return Results;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例17: FatCommonClose//.........这里部分代码省略......... ObDereferenceObject( DirectoryFileObject ); // // Now, if the ObDereferenceObject() caused the final close // to come in, then blow away the Fcb and continue up, // otherwise wait for Mm to to dereference its file objects // and stop here.. // if ( ParentDcb->Specific.Dcb.DirectoryFileOpenCount == 0) { PDCB CurrentDcb; CurrentDcb = ParentDcb; ParentDcb = CurrentDcb->ParentDcb; SetFlag( Vcb->VcbState, VCB_STATE_FLAG_DELETED_FCB ); FatDeleteFcb( &IrpContext, &CurrentDcb ); } else { break; } } } Status = STATUS_SUCCESS; try_exit: NOTHING; } finally { DebugUnwind( FatCommonClose );#if __NDAS_FAT_SECONDARY__ if (secondaryRequest) DereferenceSecondaryRequest( secondaryRequest ); if (volDoSessionResourceAcquired) { SecondaryReleaseResourceLite( &IrpContext, &volDo->SessionResource ); } if (volDoResourceAcquired) { ASSERT( ExIsResourceAcquiredSharedLite(&volDo->Resource) ); SecondaryReleaseResourceLite( NULL, &volDo->Resource ); }#endif // // We are done processing the close. If we are the top of the close // chain, see if the VCB can go away. We have biased the open count by // one, so we need to take that into account. // if (!RecursiveClose) { // // See if there is only one open left. If so, it is ours. We only want // to check for a dismount if a dismount is not already in progress. // We also only do this if the caller can handle the VCB going away. // This is determined by whether they passed in the VcbDeleted argument.
开发者ID:JanD1943,项目名称:ndas4windows,代码行数:67,
示例18: NtfsCommonLockControl//.........这里部分代码省略......... // // If the file is not a user file open then we reject the request // as an invalid parameter // if (TypeOfOpen != UserFileOpen) { NtfsCompleteRequest( &IrpContext, &Irp, STATUS_INVALID_PARAMETER ); DebugTrace( -1, Dbg, ("NtfsCommonLockControl -> STATUS_INVALID_PARAMETER/n") ); return STATUS_INVALID_PARAMETER; } // // Acquire exclusive access to the Fcb // if (Scb->ScbType.Data.FileLock == NULL) { NtfsAcquireExclusiveFcb( IrpContext, Fcb, Scb, FALSE, FALSE ); FcbAcquired = TRUE; } else { //NtfsAcquireSharedFcb( IrpContext, Fcb, Scb ); } OplockPostIrp = FALSE; try { // // We check whether we can proceed based on the state of the file oplocks. // This call might post the irp for us. // Status = FsRtlCheckOplock( &Scb->ScbType.Data.Oplock, Irp, IrpContext, NtfsOplockComplete, NULL ); if (Status != STATUS_SUCCESS) { OplockPostIrp = TRUE; try_return( NOTHING ); } // // If we don't have a file lock, then get one now. // if (Scb->ScbType.Data.FileLock == NULL) { NtfsCreateFileLock( Scb, TRUE ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request // Status = FsRtlProcessFileLock( Scb->ScbType.Data.FileLock, Irp, NULL ); // // Set the flag indicating if Fast I/O is possible // NtfsAcquireFsrtlHeader( Scb ); Scb->Header.IsFastIoPossible = NtfsIsFastIoPossible( Scb ); NtfsReleaseFsrtlHeader( Scb ); try_exit: NOTHING; } finally { DebugUnwind( NtfsCommonLockControl ); // // Release the Fcb, and return to our caller // if (FcbAcquired) { NtfsReleaseFcb( IrpContext, Fcb ); } // // Only if this is not an abnormal termination and we did not post the irp // do we delete the irp context // if (!AbnormalTermination() && !OplockPostIrp) { NtfsCompleteRequest( &IrpContext, NULL, 0 ); } DebugTrace( -1, Dbg, ("NtfsCommonLockControl -> %08lx/n", Status) ); } return Status;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例19: NdFatCommonFlushBuffers//.........这里部分代码省略......... // // The volume is now clean, note it. // if (!FlagOn(Vcb->VcbState, VCB_STATE_FLAG_MOUNTED_DIRTY)) { FatMarkVolume( IrpContext, Vcb, VolumeClean ); ClearFlag( Vcb->VcbState, VCB_STATE_FLAG_VOLUME_DIRTY ); } // // Unlock the volume if it is removable. // if (FlagOn(Vcb->VcbState, VCB_STATE_FLAG_REMOVABLE_MEDIA) && !FlagOn(Vcb->VcbState, VCB_STATE_FLAG_BOOT_OR_PAGING_FILE)) { FatToggleMediaEjectDisable( IrpContext, Vcb, FALSE ); } } break; default: FatBugCheck( TypeOfOpen, 0, 0 ); } FatUnpinBcb( IrpContext, DirentBcb ); FatUnpinRepinnedBcbs( IrpContext ); } finally { DebugUnwind( FatCommonFlushBuffers ); if (secondaryRequest) DereferenceSecondaryRequest( secondaryRequest ); if (secondarySessionResourceAcquired) { SecondaryReleaseResourceLite( IrpContext, &volDo->Secondary->SessionResource ); } FatUnpinBcb( IrpContext, DirentBcb ); if (VcbAcquired) { FatReleaseSecondaryVcb( IrpContext, Vcb ); } if (FcbAcquired) { FatReleaseFcb( IrpContext, Fcb ); } // // If this is a normal termination then pass the request on // to the target device object. // if (!AbnormalTermination()) { NTSTATUS DriverStatus; PIO_STACK_LOCATION NextIrpSp; // // Get the next stack location, and copy over the stack location // NextIrpSp = IoGetNextIrpStackLocation( Irp ); *NextIrpSp = *IrpSp; // // Set up the completion routine // IoSetCompletionRoutine( Irp, FatFlushCompletionRoutine, ULongToPtr( Status ), TRUE, TRUE, TRUE ); // // Send the request. // DriverStatus = IoCallDriver(Vcb->TargetDeviceObject, Irp); Status = (DriverStatus == STATUS_INVALID_DEVICE_REQUEST) ? Status : DriverStatus; // // Free the IrpContext and return to the caller. // FatCompleteRequest( IrpContext, FatNull, STATUS_SUCCESS ); } DebugTrace(-1, Dbg, "FatCommonFlushBuffers -> %08lx/n", Status); } return Status;}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:101,
示例20: NtfsCommonQueryVolumeInfo//.........这里部分代码省略......... Irp->IoStatus.Information = 0; Status = STATUS_VOLUME_DISMOUNTED; leave; }#ifdef __ND_NTFS_SECONDARY__ if(IoGetCurrentIrpStackLocation(Irp)->FileObject == NULL) { DebugTrace( 0, DEBUG_TRACE_ALL, ("IrpSp->FileObject is NULL, IrpSp->MajorFunction = %x, IrpSp->MinorFunction = %x/n", IrpSp->MajorFunction, IrpSp->MinorFunction) ); } if (IS_SECONDARY_FILEOBJECT(IoGetCurrentIrpStackLocation(Irp)->FileObject)) { Status = NdNtfsSecondaryCommonQueryVolumeInfo( IrpContext, Irp ); leave; }#endif // // Based on the information class we'll do different actions. Each // of the procedures that we're calling fills up the output buffer // if possible and returns true if it successfully filled the buffer // and false if it couldn't wait for any I/O to complete. // switch (FsInformationClass) { case FileFsVolumeInformation: Status = NtfsQueryFsVolumeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsSizeInformation: Status = NtfsQueryFsSizeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsDeviceInformation: Status = NtfsQueryFsDeviceInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsAttributeInformation: Status = NtfsQueryFsAttributeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsControlInformation: Status = NtfsQueryFsControlInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsFullSizeInformation: Status = NtfsQueryFsFullSizeInfo( IrpContext, Vcb, Buffer, &Length ); break; case FileFsObjectIdInformation: Status = NtfsQueryFsVolumeObjectIdInfo( IrpContext, Vcb, Buffer, &Length ); break; default: Status = STATUS_INVALID_PARAMETER; break; } // // Set the information field to the number of bytes actually filled in // Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length; // // Abort transaction on error by raising. // NtfsCleanupTransaction( IrpContext, Status, FALSE ); } finally { DebugUnwind( NtfsCommonQueryVolumeInfo ); if (AcquiredVcb) { NtfsReleaseVcb( IrpContext, Vcb ); } else { NtfsReleaseScb( IrpContext, Scb ); } DebugTrace( -1, Dbg, ("NtfsCommonQueryVolumeInfo -> %08lx/n", Status) ); } if (Status != STATUS_SUCCESS && Status != STATUS_BUFFER_OVERFLOW) DebugTrace( 0, Dbg2, ("NtfsCommonQueryVolumeInfo %x, FsInformationClass = %d Vcb = %p/n", Status, FsInformationClass, IrpContext->Vcb) ); NtfsCompleteRequest( IrpContext, Irp, Status ); return Status;}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:101,
示例21: FatFastUnlockAllByKeyBOOLEANFatFastUnlockAllByKey ( IN PFILE_OBJECT FileObject, PVOID ProcessId, ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)/*++Routine Description: This is a call back routine for doing the fast unlock all by key call.Arguments: FileObject - Supplies the file object used in this operation ProcessId - Supplies the process ID used in this operation Key - Supplies the key used in this operation Status - Receives the Status if this operation is successfulReturn Value: BOOLEAN - TRUE if this operation completed and FALSE if caller needs to take the long route.--*/{ BOOLEAN Results; PVCB Vcb; PFCB Fcb; PCCB Ccb; DebugTrace(+1, Dbg, "FatFastUnlockAllByKey/n", 0); IoStatus->Information = 0; // // Decode the type of file object we're being asked to process and make sure // it is only a user file open. // if (FatDecodeFileObject( FileObject, &Vcb, &Fcb, &Ccb ) != UserFileOpen) { IoStatus->Status = STATUS_INVALID_PARAMETER; DebugTrace(-1, Dbg, "FatFastUnlockAll -> TRUE (STATUS_INVALID_PARAMETER)/n", 0); return TRUE; } // // Acquire exclusive access to the Fcb this operation can always wait // FsRtlEnterFileSystem(); (VOID) ExAcquireResourceSharedLite( Fcb->Header.Resource, TRUE ); try { // // We check whether we can proceed based on the state of the file oplocks. // if (!FsRtlOplockIsFastIoPossible( &(Fcb)->Specific.Fcb.Oplock )) { try_return( Results = FALSE ); } // // Now call the FsRtl routine to do the actual processing of the // Lock request. The call will always succeed. // Results = TRUE; IoStatus->Status = FsRtlFastUnlockAllByKey( &Fcb->Specific.Fcb.FileLock, FileObject, ProcessId, Key, NULL ); // // Set the flag indicating if Fast I/O is possible // Fcb->Header.IsFastIoPossible = FatIsFastIoPossible( Fcb );try_exit: NOTHING; } finally { DebugUnwind( FatFastUnlockAllByKey ); ////.........这里部分代码省略.........
开发者ID:derfsubterfuge,项目名称:CSE451,代码行数:101,
示例22: NtfsCommonSetVolumeInfo//.........这里部分代码省略......... if (NtfsIsVolumeReadOnly( Vcb )) { Status = STATUS_MEDIA_WRITE_PROTECTED; NtfsCompleteRequest( IrpContext, Irp, Status ); DebugTrace( -1, Dbg, ("NtfsCommonSetVolumeInfo -> %08lx/n", Status) ); return Status; }#ifdef __ND_NTFS_SECONDARY__ if (!FlagOn( IrpContext->State, IRP_CONTEXT_STATE_WAIT )) { return NtfsPostRequest( IrpContext, Irp ); }#endif // // Acquire exclusive access to the Vcb // NtfsAcquireExclusiveVcb( IrpContext, Vcb, TRUE ); try { // // Proceed only if the volume is mounted. // if (FlagOn( Vcb->VcbState, VCB_STATE_VOLUME_MOUNTED )) {#ifdef __ND_NTFS_SECONDARY__ if(IoGetCurrentIrpStackLocation(Irp)->FileObject == NULL) { DebugTrace( 0, DEBUG_TRACE_ALL, ("IrpSp->FileObject is NULL, IrpSp->MajorFunction = %x, IrpSp->MinorFunction = %x/n", IrpSp->MajorFunction, IrpSp->MinorFunction) ); } if (IS_SECONDARY_FILEOBJECT(IoGetCurrentIrpStackLocation(Irp)->FileObject)) { Status = NdNtfsSecondaryCommonSetVolumeInfo( IrpContext, Irp ); leave; }#endif // // Based on the information class we'll do different actions. Each // of the procedures that we're calling performs the action if // possible and returns true if it successful and false if it couldn't // wait for any I/O to complete. // switch (FsInformationClass) { case FileFsLabelInformation: Status = NtfsSetFsLabelInfo( IrpContext, Vcb, Buffer ); break; case FileFsControlInformation: Status = NtfsSetFsControlInfo( IrpContext, Vcb, Buffer ); break; case FileFsObjectIdInformation: Status = NtfsSetFsVolumeObjectIdInfo( IrpContext, Vcb, Buffer ); DebugTrace( 0, Dbg2, ("NtfsCommonSetVolumeInfo %x, FileFsObjectIdInformation Vcb = %p/n", Status, IrpContext->Vcb) ); break; default: Status = STATUS_INVALID_PARAMETER; break; } } else { Status = STATUS_FILE_INVALID; } // // Abort transaction on error by raising. // NtfsCleanupTransaction( IrpContext, Status, FALSE ); } finally { DebugUnwind( NtfsCommonSetVolumeInfo ); NtfsReleaseVcb( IrpContext, Vcb ); DebugTrace( -1, Dbg, ("NtfsCommonSetVolumeInfo -> %08lx/n", Status) ); } NtfsCompleteRequest( IrpContext, Irp, Status ); return Status;}
开发者ID:tigtigtig,项目名称:ndas4windows,代码行数:101,
示例23: LfsSearchForwardByClient//.........这里部分代码省略......... LfsDebugTrace( +1, Dbg, "LfsSearchForwardByClient: Entered/n", 0 ); LfsDebugTrace( 0, Dbg, "Lcb -> %08lx/n", Lcb ); // // The log record header is in the log context // block. We set the current Bcb to NULL so that we don't // unpin the log record in the context block until we're sure // of success. // CurrentRecordHeader = Lcb->RecordHeader; CurrentBcb = NULL; // // We use a try-finally to facilitate cleanup. // try { // // We assume we won't find another Lsn. // FoundNextLsn = FALSE; // // Loop as long as another Lsn can be found. // while (LfsFindNextLsn( Lfcb, CurrentRecordHeader, &CurrentLsn )) { BOOLEAN UsaError; // // Unpin the previous log record header. // if (CurrentBcb != NULL) { CcUnpinData( CurrentBcb ); CurrentBcb = NULL; } // // Pin the log record header for this Lsn. // LfsPinOrMapLogRecordHeader( Lfcb, CurrentLsn, FALSE, FALSE, &UsaError, &CurrentRecordHeader, &CurrentBcb ); // // If the client values match, then we update the // context block and exit. // if (LfsClientIdMatch( &CurrentRecordHeader->ClientId, &Lcb->ClientId ) && CurrentRecordHeader->RecordType == LfsClientRecord) { // // We remember this one. // Lcb->RecordHeader = CurrentRecordHeader; Lcb->RecordHeaderBcb = CurrentBcb; CurrentBcb = NULL; FoundNextLsn = TRUE; *Lsn = CurrentLsn; break; } } } finally { DebugUnwind( LfsSearchForwardByClient ); // // Unpin any log record headers still pinned for no reason. // if (CurrentBcb != NULL) { CcUnpinData( CurrentBcb ); } LfsDebugTrace( 0, Dbg, "NextLsn (Low) -> %08lx/n", Lsn->LowPart ); LfsDebugTrace( 0, Dbg, "NextLsn (High) -> %08lx/n", Lsn->HighPart ); LfsDebugTrace( -1, Dbg, "LfsSearchForwardByClient: Exit -> %08x/n", FoundNextLsn ); } return FoundNextLsn;}
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例24: FatCheckFileAccess//.........这里部分代码省略......... // // check the desired access for directory dirent // if (FlagOn(DesiredAccess, ~(DELETE | READ_CONTROL | WRITE_OWNER | WRITE_DAC | SYNCHRONIZE | ACCESS_SYSTEM_SECURITY | FILE_WRITE_DATA | FILE_READ_EA | FILE_WRITE_EA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_TRAVERSE | FILE_DELETE_CHILD | FILE_APPEND_DATA))) { DebugTrace(0, Dbg, "Cannot open directory/n", 0); try_return( Result = FALSE ); } } else { // // check the desired access for a non-directory dirent, we // blackball // FILE_LIST_DIRECTORY, FILE_ADD_FILE, FILE_TRAVERSE, // FILE_ADD_SUBDIRECTORY, and FILE_DELETE_CHILD // if (FlagOn(DesiredAccess, ~(DELETE | READ_CONTROL | WRITE_OWNER | WRITE_DAC | SYNCHRONIZE | ACCESS_SYSTEM_SECURITY | FILE_READ_DATA | FILE_WRITE_DATA | FILE_READ_EA | FILE_WRITE_EA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_EXECUTE | FILE_APPEND_DATA))) { DebugTrace(0, Dbg, "Cannot open file/n", 0); try_return( Result = FALSE ); } } // // Check for a read-only Dirent // if (FlagOn(DirentAttributes, FAT_DIRENT_ATTR_READ_ONLY)) { // // Check the desired access for a read-only dirent, we blackball // WRITE, FILE_APPEND_DATA, FILE_ADD_FILE, // FILE_ADD_SUBDIRECTORY, and FILE_DELETE_CHILD // if (FlagOn(DesiredAccess, ~(DELETE | READ_CONTROL | WRITE_OWNER | WRITE_DAC | SYNCHRONIZE | ACCESS_SYSTEM_SECURITY | FILE_READ_DATA | FILE_READ_EA | FILE_WRITE_EA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_EXECUTE | FILE_LIST_DIRECTORY | FILE_TRAVERSE))) { DebugTrace(0, Dbg, "Cannot open readonly/n", 0); try_return( Result = FALSE ); } } try_exit: NOTHING; } finally { DebugUnwind( FatCheckFileAccess ); DebugTrace(-1, Dbg, "FatCheckFileAccess -> %08lx/n", Result); } UNREFERENCED_PARAMETER( IrpContext ); return Result;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
示例25: LfsTerminateLogQueryVOIDLfsTerminateLogQuery ( IN LFS_LOG_HANDLE LogHandle, IN LFS_LOG_CONTEXT Context )/*++Routine Description: This routine is called when a client has completed his query operation and wishes to deallocate any resources acquired by the Lfs to perform the log file query.Arguments: LogHandle - Pointer to private Lfs structure used to identify this client. Context - Supplies the address to store a pointer to the Lfs created context structure.Return Value: None--*/{ PLCH Lch; PLfsLCB Lcb; PLFCB Lfcb; PAGED_CODE(); LfsDebugTrace( +1, Dbg, "LfsTerminateLogQuery: Entered/n", 0 ); LfsDebugTrace( 0, Dbg, "Log Handle -> %08lx/n", LogHandle ); LfsDebugTrace( 0, Dbg, "Context -> %08lx/n", Context ); Lch = (PLCH) LogHandle; Lcb = (PLfsLCB) Context; // // Check that the structure is a valid log handle structure. // LfsValidateLch( Lch ); // // Use a try-finally to facilitate cleanup. // try { // // Acquire the log file control block for this log file. // LfsAcquireLch( Lch ); Lfcb = Lch->Lfcb; // // If the Log file has been closed then refuse access. // if (Lfcb == NULL) { try_return( NOTHING ); } // // Check that the client Id is valid. // LfsValidateClientId( Lfcb, Lch ); // // Check that the context structure is valid. // LfsValidateLcb( Lcb, Lch ); // // Deallocate the context block. // LfsDeallocateLcb( Lcb ); try_exit: NOTHING; } finally { DebugUnwind( LfsTerminateLogQuery ); // // Release the Lfcb if acquired. // LfsReleaseLch( Lch );//.........这里部分代码省略.........
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例26: FatCheckFileAccess//.........这里部分代码省略......... // // This procedures is programmed like a string of filters each // filter checks to see if some access is allowed, if it is not allowed // the filter return FALSE to the user without further checks otherwise // it moves on to the next filter. The filter check is to check for // desired access flags that are not allowed for a particular dirent // Result = TRUE; _SEH2_TRY { // // Check for Volume ID or Device Dirents, these are not allowed user // access at all // if (FlagOn(DirentAttributes, FAT_DIRENT_ATTR_VOLUME_ID) || FlagOn(DirentAttributes, FAT_DIRENT_ATTR_DEVICE)) { DebugTrace(0, Dbg, "Cannot access volume id or device/n", 0); try_return( Result = FALSE ); } // // Check the desired access for the object - we only blackball that // we do not understand. The model of filesystems using ACLs is that // they do not type the ACL to the object the ACL is on. Permissions // are not checked for consistency vs. the object type - dir/file. // if (FlagOn(*DesiredAccess, ~(DELETE | READ_CONTROL | WRITE_OWNER | WRITE_DAC | SYNCHRONIZE | ACCESS_SYSTEM_SECURITY | FILE_WRITE_DATA | FILE_READ_EA | FILE_WRITE_EA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_TRAVERSE | FILE_DELETE_CHILD | FILE_APPEND_DATA | MAXIMUM_ALLOWED))) { DebugTrace(0, Dbg, "Cannot open object/n", 0); try_return( Result = FALSE ); } // // Check for a read-only Dirent // if (FlagOn(DirentAttributes, FAT_DIRENT_ATTR_READ_ONLY)) { // // Check the desired access for a read-only dirent. AccessMask will contain // the flags we're going to allow. // ACCESS_MASK AccessMask = DELETE | READ_CONTROL | WRITE_OWNER | WRITE_DAC | SYNCHRONIZE | ACCESS_SYSTEM_SECURITY | FILE_READ_DATA | FILE_READ_EA | FILE_WRITE_EA | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES | FILE_EXECUTE | FILE_LIST_DIRECTORY | FILE_TRAVERSE; // // If this is a subdirectory also allow add file/directory and delete. // if (FlagOn(DirentAttributes, FAT_DIRENT_ATTR_DIRECTORY)) { AccessMask |= FILE_ADD_SUBDIRECTORY | FILE_ADD_FILE | FILE_DELETE_CHILD; } if (FlagOn(*DesiredAccess, ~AccessMask)) { DebugTrace(0, Dbg, "Cannot open readonly/n", 0); try_return( Result = FALSE ); } } try_exit: NOTHING; } _SEH2_FINALLY { DebugUnwind( FatCheckFileAccess ); DebugTrace(-1, Dbg, "FatCheckFileAccess -> %08lx/n", Result); } _SEH2_END; UNREFERENCED_PARAMETER( IrpContext ); return Result;}
开发者ID:Moteesh,项目名称:reactos,代码行数:101,
示例27: LfsQueryLastLsnLSNLfsQueryLastLsn ( IN LFS_LOG_HANDLE LogHandle )/*++Routine Description: This routine will return the most recent Lsn for this log record.Arguments: LogHandle - Pointer to private Lfs structure used to identify this client.Return Value: LSN - This is the last Lsn assigned in this log file.--*/{ PLCH Lch; PLFCB Lfcb; LSN LastLsn; PAGED_CODE(); LfsDebugTrace( +1, Dbg, "LfsQueryLastLsn: Entered/n", 0 ); LfsDebugTrace( 0, Dbg, "Log Handle -> %08lx/n", LogHandle ); Lch = (PLCH) LogHandle; // // Check that the structure is a valid log handle structure. // LfsValidateLch( Lch ); // // Use a try-finally to facilitate cleanup. // try { // // Acquire the log file control block for this log file. // LfsAcquireLch( Lch ); Lfcb = Lch->Lfcb; // // If the Log file has been closed then refuse access. // if (Lfcb == NULL) { ExRaiseStatus( STATUS_ACCESS_DENIED ); } // // Check that the client Id is valid. // LfsValidateClientId( Lfcb, Lch ); // // Copy the last Lsn out of the Lfcb. If the last Lsn is // does not correspond to a log record, we will return the // zero Lsn. // if (FlagOn( Lfcb->Flags, LFCB_NO_LAST_LSN )) { LastLsn = LfsZeroLsn; } else { LastLsn = Lfcb->RestartArea->CurrentLsn; } } finally { DebugUnwind( LfsQueryLastLsn ); // // Release the Lfcb if acquired. // LfsReleaseLch( Lch ); LfsDebugTrace( 0, Dbg, "Last Lsn (Low) -> %08lx/n", LastLsn.LowPart ); LfsDebugTrace( 0, Dbg, "Last Lsn (High) -> %08lx/n", LastLsn.HighPart ); LfsDebugTrace( -1, Dbg, "LfsQueryLastLsn: Exit/n", 0 ); }//.........这里部分代码省略.........
开发者ID:340211173,项目名称:hf-2011,代码行数:101,
示例28: UdfLookupPsnOfExtent//.........这里部分代码省略......... switch (Pcb->Partition[Reference].Type) { case Physical: // // Check that the input extent lies inside the partition. Calculate the // Lbn of the last block and see that it is interior. // if (SectorsFromBlocks( Vcb, Lbn ) + SectorsFromBytes( Vcb, Len ) > Pcb->Partition[Reference].Physical.Length) { goto NoGood; } Psn = Pcb->Partition[Reference].Physical.Start + SectorsFromBlocks( Vcb, Lbn ); DebugTrace(( -1, Dbg, "UdfLookupPsnOfExtent -> %08x/n", Psn )); return Psn; case Virtual: // // Bounds check. Per UDF 2.00 2.3.10 and implied in UDF 1.50, virtual // extent lengths cannot be greater than one block in size. // if (Lbn + BlocksFromBytes( Vcb, Len ) > Pcb->Partition[Reference].Virtual.Length || Len > BlockSize( Vcb )) { goto NoGood; } try { // // Calculate the location of the mapping element in the VAT // and retrieve. // Offset.QuadPart = Lbn * sizeof(ULONG); CcMapData( Vcb->VatFcb->FileObject, &Offset, sizeof(ULONG), TRUE, &Bcb, &MappedLbn ); // // Now rewrite the inputs in terms of the virtual mapping. We // will reloop to perform the logical -> physical mapping. // DebugTrace(( 0, Dbg, "UdfLookupPsnOfExtent, Mapping V %04x/%08x -> L %04x/%08x/n", Reference, Lbn, Pcb->Partition[Reference].Virtual.RelatedReference, *MappedLbn )); Lbn = *MappedLbn; Reference = Pcb->Partition[Reference].Virtual.RelatedReference; } finally { DebugUnwind( UdfLookupPsnOfExtent ); UdfUnpinData( IrpContext, &Bcb ); } // // An Lbn of ~0 in the VAT is defined to indicate that the sector is unused, // so we should never see such a thing. // if (Lbn == ~0) { goto NoGood; } break; default: ASSERT(FALSE); break; } } } NoGood: // // Some people have misinterpreted a partition number to equal a // partition reference, or perhaps this is just corrupt media. // UdfRaiseStatus( IrpContext, STATUS_FILE_CORRUPT_ERROR );}
开发者ID:conioh,项目名称:os-design,代码行数:101,
示例29: FatCommonClose//.........这里部分代码省略......... ObDereferenceObject( DirectoryFileObject ); // // Now, if the ObDereferenceObject() caused the final close // to come in, then blow away the Fcb and continue up, // otherwise wait for Mm to to dereference its file objects // and stop here.. // if ( ParentDcb->Specific.Dcb.DirectoryFileOpenCount == 0) { PDCB CurrentDcb; CurrentDcb = ParentDcb; ParentDcb = CurrentDcb->ParentDcb; SetFlag( Vcb->VcbState, VCB_STATE_FLAG_DELETED_FCB ); FatDeleteFcb( &IrpContext, &CurrentDcb ); } else { break; } } } Status = STATUS_SUCCESS; try_exit: NOTHING; } finally { DebugUnwind( FatCommonClose ); // // We are done processing the close. If we are the top of the close // chain, see if the VCB can go away. We have biased the open count by // one, so we need to take that into account. // if (!RecursiveClose) { // // See if there is only one open left. If so, it is ours. We only want // to check for a dismount if a dismount is not already in progress. // We also only do this if the Vcb condition is not VcbGood and the // caller can handle the VCB going away. This is determined by whether // they passed in the VcbDeleted argument. This request also needs // to be top level. // if (Vcb->OpenFileCount == 1 && Vcb->VcbCondition != VcbGood && !FlagOn( Vcb->VcbState, VCB_STATE_FLAG_DISMOUNT_IN_PROGRESS ) && ARGUMENT_PRESENT( VcbDeleted ) && TopLevel) { // // We need the global lock, which must be acquired before the // VCB. Since we already have the VCB, we have to drop and // reaquire here. Note that we always want to wait from this // point on. Note that the VCB cannot go away, since we have // biased the open file count. //
开发者ID:Realhram,项目名称:wdk81,代码行数:66,
示例30: NtfsCommonSetSecurityInfo//.........这里部分代码省略.........#endif // _CAIRO_ Status = NtfsModifySecurity( IrpContext, Fcb, &IrpSp->Parameters.SetSecurity.SecurityInformation, IrpSp->Parameters.SetSecurity.SecurityDescriptor ); if (NT_SUCCESS( Status )) {#ifdef _CAIRO_ // // Make sure the new security descriptor Id is written out. // NtfsUpdateStandardInformation( IrpContext, Fcb );#endif } // // Abort transaction on error by raising. // NtfsCleanupTransaction( IrpContext, Status, FALSE ); // // Set the flag in the Ccb to indicate this change occurred. // SetFlag( Ccb->Flags, CCB_FLAG_UPDATE_LAST_CHANGE | CCB_FLAG_SET_ARCHIVE ); } finally { DebugUnwind( NtfsCommonSetSecurityInfo );#ifdef _CAIRO_ if (AbnormalTermination()) { // // The request failed. Restore the owner and // QuotaControl are restored. // if (Fcb->QuotaControl != OldQuotaControl && Fcb->QuotaControl != NULL) { // // A new quota control block was assigned. // Dereference it. // NtfsDereferenceQuotaControlBlock( Fcb->Vcb, &Fcb->QuotaControl ); } Fcb->QuotaControl = OldQuotaControl; Fcb->OwnerId = OldOwnerId; if (LargeStdInfo == 0) { // // The standard information has be returned to // its orginal size. // ClearFlag( Fcb->FcbState, FCB_STATE_LARGE_STD_INFO ); } } else { // // The request succeed. If the quota control block was // changed then derefence the old block. // if (Fcb->QuotaControl != OldQuotaControl && OldQuotaControl != NULL) { NtfsDereferenceQuotaControlBlock( Fcb->Vcb, &OldQuotaControl); } }#endif // _CAIRO_ NtfsReleaseFcb( IrpContext, Fcb ); } } // // Now complete the request and return to our caller // NtfsCompleteRequest( &IrpContext, &Irp, Status ); DebugTrace( -1, Dbg, ("NtfsCommonSetSecurityInfo -> %08lx", Status) ); return Status;}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:101,
注:本文中的DebugUnwind函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Debugger函数代码示例 C++ DebugTrace函数代码示例 |