return Status;
}
-\f
+
_Function_class_(IRP_MJ_SET_INFORMATION)
_Function_class_(DRIVER_DISPATCH)
NTSTATUS
return Status;
}
-\f
-_Requires_lock_held_(_Global_critical_region_)
+
+_Requires_lock_held_(_Global_critical_region_)
NTSTATUS
FatCommonQueryInformation (
IN PIRP_CONTEXT IrpContext,
// relies on the file system to validate its mapping information after a
// power transition.
//
-
- if (!FlagOn( Fcb->FcbState, FCB_STATE_PAGING_FILE ) ||
+
+ if (!FlagOn( Fcb->FcbState, FCB_STATE_PAGING_FILE ) ||
FlagOn(Fcb->Vcb->VcbState, VCB_STATE_FLAG_REMOVABLE_MEDIA)) {
if (!FatAcquireSharedFcb( IrpContext, Fcb )) {
return Status;
}
-\f
-_Requires_lock_held_(_Global_critical_region_)
+
+_Requires_lock_held_(_Global_critical_region_)
NTSTATUS
FatCommonSetInformation (
IN PIRP_CONTEXT IrpContext,
//
if (FlagOn( Vcb->VcbState, VCB_STATE_FLAG_CREATE_IN_PROGRESS)) {
-
+
#ifdef _MSC_VER
#pragma prefast( suppress:28159, "things are seriously wrong if we get here" )
#endif
// power transition.
//
- if (!FlagOn( Fcb->FcbState, FCB_STATE_PAGING_FILE ) ||
+ if (!FlagOn( Fcb->FcbState, FCB_STATE_PAGING_FILE ) ||
FlagOn(Fcb->Vcb->VcbState, VCB_STATE_FLAG_REMOVABLE_MEDIA)) {
if (!FatAcquireExclusiveFcb( IrpContext, Fcb )) {
Irp = NULL;
IrpContext = NULL;
}
-
+
if (!NT_SUCCESS( Status ) ||
(Status == STATUS_PENDING)) {
try_return( Status );
}
}
-
+
//
// Based on the information class we'll do different
// actions. Each of the procedures that we're calling will either
DebugUnwind( FatCommonSetInformation );
if (FcbAcquired) { FatReleaseFcb( IrpContext, Fcb ); }
-
+
if (VcbAcquired) { FatReleaseVcb( IrpContext, Vcb ); }
if (!_SEH2_AbnormalTermination()) {
return Status;
}
-\f
+
//
// Internal Support Routine
//
UNREFERENCED_PARAMETER( FileObject );
UNREFERENCED_PARAMETER( IrpContext );
-
+
DebugTrace(+1, Dbg, "FatQueryBasicInfo...\n", 0);
//
Buffer->FileAttributes = Fcb->DirentFatFlags;
-
+
//
// If the temporary flag is set, then set it in the buffer.
//
return;
}
-\f
+
//
// Internal Support Routine
//
return;
}
-\f
+
//
// Internal Support Routine
//
PAGED_CODE();
UNREFERENCED_PARAMETER( IrpContext );
-
+
DebugTrace(+1, Dbg, "FatQueryInternalInfo...\n", 0);
_SEH2_TRY {
return;
}
-\f
+
//
// Internal Support Routine
//
UNREFERENCED_PARAMETER( Fcb );
UNREFERENCED_PARAMETER( IrpContext );
-
+
DebugTrace(+1, Dbg, "FatQueryEaInfo...\n", 0);
Bcb = NULL;
} _SEH2_END;
}
-\f
+
//
// Internal Support Routine
//
return;
}
-\f
+
//
// Internal Support Routine
//
return;
}
-\f
+
//
// Internal Support Routine
//
return;
}
-\f
+
//
// Internal Support Routine
//
{
PAGED_CODE();
-
- UNREFERENCED_PARAMETER( FileObject );
+
+ UNREFERENCED_PARAMETER( FileObject );
DebugTrace(+1, Dbg, "FatQueryNetworkInfo...\n", 0);
Buffer->FileAttributes = Fcb->DirentFatFlags;
-
+
//
// If the temporary flag is set, then set it in the buffer.
//
return;
}
-\f
+
//
// Internal Support routine
//
return Status;
}
-\f
+
//
// Internal Support Routine
//
return STATUS_SUCCESS;
}
-\f
+
//
// Internal Support Routine
//
ULONG TargetDirentOffset = 0;
ULONG TargetLfnOffset = 0;
- // NewName comes from the IRP buffer or the TargetFileObject, so we can't
+ // NewName comes from the IRP buffer or the TargetFileObject, so we can't
// go around modifying it. Instead we modify NewNameCopy.
UNICODE_STRING NewName;
- // NB: these five UNICODE_STRINGS are allocated
+ // NB: these five UNICODE_STRINGS are allocated
// from one chopped up pool allocation called UnicodeBuffer.
UNICODE_STRING NewNameCopy;
UNICODE_STRING NewUpcasedName;
WCHAR UniTunneledShortNameBuffer[12];
UNICODE_STRING UniTunneledLongName;
WCHAR UniTunneledLongNameBuffer[26];
-
+
LARGE_INTEGER TunneledCreationTime;
ULONG TunneledDataSize;
BOOLEAN HaveTunneledInformation = FALSE;
UniTunneledLongName.Length = 0;
UniTunneledLongName.MaximumLength = sizeof(UniTunneledLongNameBuffer);
UniTunneledLongName.Buffer = &UniTunneledLongNameBuffer[0];
-
+
//
// Remember the name in case we have to modify the name
// value in the ea.
if (FatIsFileOplockable( TempFcb ) &&
(FsRtlCurrentBatchOplock( FatGetFcbOplock(TempFcb) )
#if (NTDDI_VERSION >= NTDDI_WIN7)
- ||
+ ||
FsRtlCurrentOplockH( FatGetFcbOplock(TempFcb) )
#endif
)) {
NewName = *((PUNICODE_STRING)&TargetFileObject->FileName);
RtlCopyUnicodeString(&NewNameCopy,&NewName);
-
+
}
-
+
//
// We will need an upcased version of the unicode name and the
// old name as well.
RenamedAcrossDirectories = TRUE;
}
-
+
//
// Upcase the name and convert it to the Oem code page.
//
DirentsRequired = 1;
-
+
}
}
ExFreePool( UnicodeBuffer );
FatUnpinBcb( IrpContext, TargetDirentBcb );
-
+
}
} _SEH2_END;
// breaks are always advisory, so we will never block/get STATUS_PENDING
// here.
//
-
+
FsRtlCheckOplockEx( FatGetFcbOplock(OldParentDcb),
IrpContext->OriginatingIrp,
OPLOCK_FLAG_PARENT_OBJECT,
// breaks are always advisory, so we will never block/get STATUS_PENDING
// here.
//
-
+
FsRtlCheckOplockEx( FatGetFcbOplock(TargetDcb),
IrpContext->OriginatingIrp,
OPLOCK_FLAG_PARENT_OBJECT,
DebugTrace(0, Dbg, "Uninitialize our parent Stream Cache Map\n", 0);
CcUninitializeCacheMap( DirectoryFileObject, NULL, NULL );
-
+
ObDereferenceObject( DirectoryFileObject );
}
return Status;
}
-\f
+
//
// Internal Support Routine
//
return STATUS_SUCCESS;
}
-\f
+
//
// Internal Support Routine
//
return Status;
}
-\f
+
//
// Internal Support Routine
//
_SEH2_TRY {
- if ( NewFileSize > Dirent->FileSize ) {
+ if ( NewFileSize > Dirent->FileSize ) {
Dirent->FileSize = NewFileSize;
-
+
FatSetDirtyBcb( IrpContext, DirentBcb, Fcb->Vcb, TRUE );
//
*CcGetFileSizePointer(FileObject) = Fcb->Header.FileSize;
}
-
+
//
// WinSE bug #307418 "Occasional data corruption when
// standby/resume while copying files to removable FAT
// we'll also try to un-roll the change to Dirent to keep
// in-memory and on-disk metadata in sync.
//
-
+
FatSetFileSizeInDirentNoRaise( IrpContext, Fcb, NULL );
}
//
// User must have manage volume privilege to explicitly tweak the VDL
//
-
+
if ((Ccb == NULL) || !FlagOn( Ccb->Flags, CCB_FLAG_MANAGE_VOLUME_ACCESS )) {
try_return( Status = STATUS_INVALID_PARAMETER );
if ((NewValidDataLength < Fcb->Header.ValidDataLength.LowPart) ||
(NewValidDataLength > Fcb->Header.FileSize.LowPart)) {
-
+
try_return( Status = STATUS_INVALID_PARAMETER );
}
return Status;
}
-\f
+
//
// Internal Support Routine
NT_ASSERT( Fcb->LfnOffsetWithinDirectory == LfnOffset );
if ( Fcb->UncleanCount != 0 ) {
-
+
#ifdef _MSC_VER
#pragma prefast( suppress:28159, "things are seriously wrong if we get here" )
#endif