23#define Dbg (DEBUG_TRACE_EA)
74#pragma alloc_text(PAGE, FatCommonQueryEa)
75#pragma alloc_text(PAGE, FatCommonSetEa)
76#pragma alloc_text(PAGE, FatFsdQueryEa)
77#pragma alloc_text(PAGE, FatFsdSetEa)
79#pragma alloc_text(PAGE, FatIsDuplicateEaName)
80#pragma alloc_text(PAGE, FatQueryEaIndexSpecified)
81#pragma alloc_text(PAGE, FatQueryEaSimpleScan)
82#pragma alloc_text(PAGE, FatQueryEaUserEaList)
279 ULONG UserBufferLength;
282 ULONG UserEaListLength;
302 USHORT ExtendedAttributes;
320 DebugTrace( 0,
Dbg,
" ->SystemBuffer = %p\n",
Irp->AssociatedIrp.SystemBuffer );
330 Irp->IoStatus.Information = 0;
352 "FatCommonQueryEa -> %08lx\n",
367 "FatCommonQueryEa -> %08lx\n",
379 DebugTrace(0,
Dbg,
"FatCommonQueryEa: Thread can't wait\n", 0);
388 FatAcquireSharedFcb( IrpContext,
Fcb );
417 ULONG PackedEasLength;
425 FatVerifyFcb( IrpContext,
Fcb );
431 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
441 if (UserEaList ==
NULL
442 &&
Ccb->OffsetOfNextEaToReturn != 0
448 "FatCommonQueryEa: Ea file in unknown state\n", 0);
467 ExtendedAttributes =
Dirent->ExtendedAttributes;
471 if (ExtendedAttributes == 0) {
474 "FatCommonQueryEa: Zero handle, no Ea's for this file\n", 0);
488 FatGetEaFile( IrpContext,
503 if (
Vcb->VirtualEaFile ==
NULL) {
506 "FatCommonQueryEa: No Ea file found when expected\n", 0);
533 PackedEasLength =
GetcbList( EaSetHeader ) - 4;
560 if (UserEaList !=
NULL) {
576 }
else if (IndexSpecified) {
603 :
Ccb->OffsetOfNextEaToReturn );
614 Irp->IoStatus.Information = 0;
687 USHORT ExtendedAttributes;
690 ULONG UserBufferLength;
735 DebugTrace( 0,
Dbg,
" ->SystemBuffer = %p\n",
Irp->AssociatedIrp.SystemBuffer );
739 Irp->IoStatus.Information = 0;
760 "FatCommonSetEa -> %08lx\n",
775 "FatCommonSetEa -> %08lx\n",
810 "FatCommonSetEa -> %08lx\n",
829 DebugTrace(0,
Dbg,
"FatCommonSetEa: Set Ea must be waitable\n", 0);
848 ULONG PackedEasLength;
850 ULONG AllocationLength;
851 ULONG BytesPerCluster;
860 FatAcquireSharedVcb( IrpContext,
Fcb->
Vcb );
862 FatAcquireExclusiveFcb( IrpContext,
Fcb );
870 AcquiredParentDcb =
TRUE;
874 AcquiredRootDcb =
TRUE;
881 FatVerifyFcb( IrpContext,
Fcb );
887 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
901 ExtendedAttributes =
Dirent->ExtendedAttributes;
905 if (ExtendedAttributes == 0) {
910 "FatCommonSetEa: File has no current Eas\n", 0 );
916 DebugTrace(0,
Dbg,
"FatCommonSetEa: File has previous Eas\n", 0 );
918 FatGetEaFile( IrpContext,
925 AcquiredEaFcb =
TRUE;
932 if (
Vcb->VirtualEaFile ==
NULL) {
969 PackedEasLength =
GetcbList( PrevEaSetHeader ) - 4;
980 BytesPerCluster = 1 <<
Vcb->AllocationSupport.LogOfBytesPerCluster;
982 AllocationLength = (PackedEasLength
984 + BytesPerCluster - 1)
985 & ~(BytesPerCluster - 1);
997 RtlCopyMemory( EaSetHeader, PrevEaSetHeader, AllocationLength );
1013 DebugTrace(0,
Dbg,
"FatCommonSetEa: Initial Ea set -> %p\n",
1026 &
Buffer[UserBufferLength] :
1032 EaName.MaximumLength = EaName.Length = FullEa->
EaNameLength;
1033 EaName.Buffer = &FullEa->
EaName[0];
1058 if (FullEa->
Flags != 0
1105 if (PackedEasLength != 0) {
1118 DebugTrace( 0,
Dbg,
"Ea length is greater than maximum\n", 0 );
1129 FatGetEaFile( IrpContext,
1136 AcquiredEaFcb =
TRUE;
1139 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
1143 FatAddEaSet( IrpContext,
1153 DebugTrace(0,
Dbg,
"FatCommonSetEa: Adding an ea set\n", 0);
1160 PackedEasLength += 4;
1181 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
1192 FatDeleteEaSet( IrpContext,
1202 if (PackedEasLength != 0 ) {
1213 FatSetDirtyBcb( IrpContext,
Bcb,
Vcb,
TRUE );
1226 Irp->IoStatus.Information = 0;
1265 if (AcquiredEaFcb) {
1273 if (AcquiredParentDcb) {
1277 if (AcquiredRootDcb) {
1289 if (EaSetHeader !=
NULL) {
1368 ULONG RemainingUserBufferLength;
1374 ULONG LastFullEaSize;
1385 RemainingUserBufferLength = UserBufferLength;
1391 + UserEaListLength);
1392 GetEa = (GetEa->NextEntryOffset == 0
1395 + GetEa->NextEntryOffset))) {
1403 DebugTrace(0,
Dbg,
"RemainingUserBufferLength = %08lx\n", RemainingUserBufferLength);
1410 Str.MaximumLength =
Str.Length = GetEa->EaNameLength;
1411 Str.Buffer = &GetEa->EaName[0];
1420 "FatQueryEaUserEaList: Invalid Ea Name -> %Z\n",
1423 Iosb.Information = (
PUCHAR)GetEa - UserEaList;
1434 DebugTrace(0,
Dbg,
"FatQueryEaUserEaList: Duplicate name\n", 0);
1456 if ((
ULONG)(4+1+1+2+GetEa->EaNameLength+1)
1457 > RemainingUserBufferLength) {
1469 NextFullEa->
Flags = 0;
1474 GetEa->EaNameLength );
1480 OutputEaName.MaximumLength = OutputEaName.Length =
Str.Length;
1481 OutputEaName.Buffer = NextFullEa->
EaName;
1485 NextFullEa->
EaName[GetEa->EaNameLength] = 0;
1507 if (PackedEaSize + 4 > RemainingUserBufferLength) {
1531 if (LastFullEa !=
NULL) {
1543 LastFullEa = NextFullEa;
1545 RemainingUserBufferLength -= LastFullEaSize;
1579 Iosb.Information = 0;
1592 Iosb.Information = ((
PUCHAR) LastFullEa - UserBuffer)
1598 DebugTrace(-1,
Dbg,
"FatQueryEaUserEaList -> Iosb.Status = %08lx\n",
1663 Iosb.Information = 0;
1670 if (UserEaIndex == 0
1671 || PackedEasLength == 0) {
1673 DebugTrace( -1,
Dbg,
"FatQueryEaIndexSpecified: Non-existant entry\n", 0 );
1685 (
i < UserEaIndex) && (
Offset < PackedEasLength);
1688 PackedEasLength,
Offset )) {
1698 if (
Offset >= PackedEasLength) {
1705 if (
i == UserEaIndex) {
1792 ULONG RemainingUserBufferLength;
1798 ULONG LastFullEaSize;
1809 Iosb.Information = 0;
1813 RemainingUserBufferLength = UserBufferLength;
1815 while (StartOffset < PackedEasLength) {
1817 DebugTrace(0,
Dbg,
"Top of loop, Offset = %08lx\n", StartOffset);
1820 DebugTrace(0,
Dbg,
"RemainingUserBufferLength = %08lx\n", RemainingUserBufferLength);
1838 if (PackedEaSize + 4 > RemainingUserBufferLength) {
1840 BufferOverflow =
TRUE;
1854 if (LastFullEa !=
NULL) {
1866 LastFullEa = NextFullEa;
1868 RemainingUserBufferLength -= LastFullEaSize;
1882 Ccb->OffsetOfNextEaToReturn = StartOffset;
1901 if (LastFullEa ==
NULL) {
1903 Iosb.Information = 0;
1912 if (PackedEasLength == 0) {
1916 }
else if (StartOffset >= PackedEasLength) {
1935 Iosb.Information = ((
PUCHAR) LastFullEa - UserBuffer)
1943 if (BufferOverflow) {
1953 DebugTrace(-1,
Dbg,
"FatQueryEaSimpleScan -> Iosb.Status = %08lx\n",
2002 EaString.MaximumLength = EaString.Length = GetEa->EaNameLength;
2003 EaString.Buffer = &GetEa->EaName[0];
2007 DuplicateFound =
FALSE;
2017 DebugTrace(0,
Dbg,
"Top of loop, ThisGetEa = %p\n", ThisGetEa);
2031 DebugTrace(0,
Dbg,
"FatIsDuplicateEaName: Duplicate found\n", 0);
2032 DuplicateFound =
TRUE;
2037 DebugTrace(-1,
Dbg,
"FatIsDuplicateEaName: Exit -> %04x\n", DuplicateFound);
2039 return DuplicateFound;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT _Inout_ PDIRENT Dirent
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define IRP_CONTEXT_FLAG_WAIT
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
IO_STATUS_BLOCK FatQueryEaIndexSpecified(IN PIRP_CONTEXT IrpContext, OUT PCCB Ccb, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, OUT PUCHAR UserBuffer, IN ULONG UserBufferLength, IN ULONG UserEaIndex, IN BOOLEAN ReturnSingleEntry)
NTSTATUS FatCommonQueryEa(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
IO_STATUS_BLOCK FatQueryEaSimpleScan(IN PIRP_CONTEXT IrpContext, OUT PCCB Ccb, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, OUT PUCHAR UserBuffer, IN ULONG UserBufferLength, IN BOOLEAN ReturnSingleEntry, ULONG StartOffset)
IO_STATUS_BLOCK FatQueryEaUserEaList(IN PIRP_CONTEXT IrpContext, OUT PCCB Ccb, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, OUT PUCHAR UserBuffer, IN ULONG UserBufferLength, IN PUCHAR UserEaList, IN ULONG UserEaListLength, IN BOOLEAN ReturnSingleEntry)
NTSTATUS FatCommonSetEa(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
BOOLEAN FatIsDuplicateEaName(IN PIRP_CONTEXT IrpContext, IN PFILE_GET_EA_INFORMATION GetEa, IN PUCHAR UserBuffer)
EA_SET_HEADER * PEA_SET_HEADER
#define SizeOfPackedEa(EA, SIZE)
#define SIZE_OF_EA_SET_HEADER
#define TAG_EA_SET_HEADER
VOID FatMarkEaRangeDirty(IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT EaFileObject, IN OUT PEA_RANGE EaRange)
VOID FatUnpinEaRange(IN PIRP_CONTEXT IrpContext, IN OUT PEA_RANGE EaRange)
VOID FatAppendPackedEa(IN PIRP_CONTEXT IrpContext, IN OUT PEA_SET_HEADER *EaSetHeader, IN OUT PULONG PackedEasLength, IN OUT PULONG AllocationLength, IN PFILE_FULL_EA_INFORMATION FullEa, IN ULONG BytesPerCluster)
VOID FatDeletePackedEa(IN PIRP_CONTEXT IrpContext, IN OUT PEA_SET_HEADER EaSetHeader, IN OUT PULONG PackedEasLength, IN ULONG Offset)
ULONG FatLocateNextEa(IN PIRP_CONTEXT IrpContext, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, IN ULONG PreviousOffset)
BOOLEAN FatLocateEaByName(IN PIRP_CONTEXT IrpContext, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, IN POEM_STRING EaName, OUT PULONG Offset)
BOOLEAN FatIsEaNameValid(IN PIRP_CONTEXT IrpContext, IN OEM_STRING Name)
VOID FatReadEaSet(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN USHORT EaHandle, IN POEM_STRING FileName, IN BOOLEAN ReturnEntireSet, OUT PEA_RANGE EaSetRange)
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
#define BooleanFlagOn(F, SF)
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
PVOID FatBufferUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp, IN ULONG BufferLength)
PVOID FatMapUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp)
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
#define DebugTrace(INDENT, LEVEL, X, Y)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
IN PVCB IN ULONG IN PBCB OUT PDIRENT OUT PUSHORT OUT PEA_RANGE EaSetRange
#define FatUnpinBcb(IRPCONTEXT, BCB)
NTSTATUS FatFsdPostRequest(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
TYPE_OF_OPEN FatDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Outptr_ PVCB *Vcb, _Outptr_ PFCB *FcbOrDcb, _Outptr_ PCCB *Ccb)
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
#define FatNotifyReportChange(I, V, F, FL, A)
#define FatReleaseFcb(IRPCONTEXT, Fcb)
#define FatUpcaseEaName(IRPCONTEXT, NAME, UPCASEDNAME)
IN PVCB IN PUCHAR IN ULONG IN POEM_STRING OUT PUSHORT EaHandle
#define FatAreNamesEqual(IRPCONTEXT, NAMEA, NAMEB)
IN OUT PVCB OUT PDIRENT OUT PBCB * EaBcb
#define FatReleaseVcb(IRPCONTEXT, Vcb)
IN OUT PVCB OUT PDIRENT * EaDirent
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
#define CopyU4char(Dst, Src)
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN _In_ ULONG _In_opt_ PULONG _In_ BOOLEAN RestartScan
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN ReturnSingleEntry
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
struct _FILE_GET_EA_INFORMATION * PFILE_GET_EA_INFORMATION
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
#define AbnormalTermination
DRIVER_DISPATCH(nfs41_FsdDispatch)
#define _Function_class_(n)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG Offset
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
NTSTATUS NTAPI IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
#define STATUS_NONEXISTENT_EA_ENTRY
#define STATUS_INVALID_EA_NAME
#define STATUS_EA_CORRUPT_ERROR
#define STATUS_NO_EAS_ON_FILE
#define STATUS_EAS_NOT_SUPPORTED
#define STATUS_EA_TOO_LARGE
#define STATUS_NO_MORE_EAS
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
ULONG EaModificationCount
union _FILE_NAME_NODE::@730 Name
union _IO_STACK_LOCATION::@1581 Parameters
struct _IO_STACK_LOCATION::@3980::@3991 QueryEa
struct _IO_STACK_LOCATION::@3980::@3992 SetEa
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define SL_INDEX_SPECIFIED
#define FILE_ACTION_MODIFIED
#define SL_RETURN_SINGLE_ENTRY
#define FILE_NOTIFY_CHANGE_EA