16#pragma alloc_text(PAGE, Ext2QueryEa)
17#pragma alloc_text(PAGE, Ext2SetEa)
18#pragma alloc_text(PAGE, Ext2IsEaNameValid)
49 ULONG EaEntrySize = 4 + 1 + 1 + 2 +
item->name_len + 1 +
item->data_size;
109 ULONG UserEaListLength;
124 ULONG UserBufferLength = 0;
125 ULONG RemainingUserBufferLength = 0;
142 Irp->IoStatus.Information = 0;
153 RemainingUserBufferLength = UserBufferLength;
173 MainResourceAcquired =
TRUE;
177 DbgPrint(
"ext4_fs_get_xattr_ref() failed!\n");
183 XattrRefAcquired =
TRUE;
185 if (RemainingUserBufferLength)
188 if (UserEaList !=
NULL) {
232 if (EaEntrySize > RemainingUserBufferLength) {
270 ((
PCHAR)FullEa + EaEntrySize);
271 RemainingUserBufferLength -= EaEntrySize;
274 }
else if (IndexSpecified) {
352 if (XattrRefAcquired) {
361 if (MainResourceAcquired) {
400 if (
Name.Length == 0)
406 if (
Name.Length > 255)
458 ULONG UserBufferLength;
475 Irp->IoStatus.Information = 0;
481 UserBuffer =
Irp->UserBuffer;
491 FcbLockAcquired =
TRUE;
505 MainResourceAcquired =
TRUE;
509 DbgPrint(
"ext4_fs_get_xattr_ref() failed!\n");
513 XattrRefAcquired =
TRUE;
526 &UserBuffer[UserBufferLength] :
531 EaName.MaximumLength = EaName.Length = FullEa->EaNameLength;
532 EaName.Buffer = &FullEa->EaName[0];
536 Irp->IoStatus.Information = (
PCHAR)FullEa - UserBuffer;
546 &UserBuffer[UserBufferLength] :
552 EaName.MaximumLength = EaName.Length = FullEa->EaNameLength;
553 EaName.Buffer = &FullEa->EaName[0];
560 &FullEa->EaName[0] + FullEa->EaNameLength + 1,
561 FullEa->EaValueLength));
568 if (XattrRefAcquired) {
576 if (FcbLockAcquired) {
578 FcbLockAcquired =
FALSE;
581 if (MainResourceAcquired) {
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define IRP_CONTEXT_FLAG_WAIT
#define NT_SUCCESS(StatCode)
NTSTATUS Ext2QueryEa(IN PEXT2_IRP_CONTEXT IrpContext)
static int Ext2IterateAllEa(struct ext4_xattr_ref *xattr_ref, struct ext4_xattr_item *item, BOOL is_last)
BOOLEAN Ext2IsEaNameValid(IN OEM_STRING Name)
NTSTATUS Ext2SetEa(IN PEXT2_IRP_CONTEXT IrpContext)
#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR)
_In_ PIO_STACK_LOCATION IrpSp
#define ExAcquireResourceExclusiveLite(res, wait)
NTSTATUS Ext2WinntError(int rc)
NTSTATUS Ext2QueueRequest(IN PEXT2_IRP_CONTEXT IrpContext)
PVOID Ext2GetUserBuffer(IN PIRP Irp)
VOID Ext2NotifyReportChange(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONG Filter, IN ULONG Action)
struct _EXT2_VCB * PEXT2_VCB
#define BooleanFlagOn(F, SF)
NTSTATUS Ext2CompleteIrpContext(IN PEXT2_IRP_CONTEXT IrpContext, IN NTSTATUS Status)
Extended Attribute manipulation.
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
_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 FsRtlIsAnsiCharacterLegalFat(C, WILD)
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 EXT4_XATTR_ITERATE_STOP
int ext4_fs_get_xattr(struct ext4_xattr_ref *ref, __u8 name_index, const char *name, size_t name_len, void *buf, size_t buf_size, size_t *data_size)
int ext4_fs_set_xattr_ordered(struct ext4_xattr_ref *ref, __u8 name_index, const char *name, size_t name_len, const void *data, size_t data_size)
#define EXT4_XATTR_ITERATE_CONT
void ext4_fs_xattr_iterate(struct ext4_xattr_ref *ref, int(*iter)(struct ext4_xattr_ref *ref, struct ext4_xattr_item *item, BOOL is_last))
void ext4_xattr_purge_items(struct ext4_xattr_ref *xattr_ref)
#define EXT4_XATTR_INDEX_USER
int ext4_fs_put_xattr_ref(struct ext4_xattr_ref *ref)
int ext4_fs_get_xattr_ref(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB fs, PEXT2_MCB inode_ref, struct ext4_xattr_ref *ref)
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
NTSTATUS NTAPI IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
#define STATUS_OBJECTID_NOT_FOUND
#define STATUS_INVALID_EA_NAME
#define _SEH2_AbnormalTermination()
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
PFILE_FULL_EA_INFORMATION FullEa
ULONG RemainingUserBufferLength
PFILE_FULL_EA_INFORMATION LastFullEa
BOOLEAN ReturnSingleEntry
NTFSIDENTIFIER Identifier
struct _IO_STACK_LOCATION::@3979::@3990 QueryEa
union _IO_STACK_LOCATION::@1580 Parameters
struct _IO_STACK_LOCATION::@3979::@3991 SetEa
PDEVICE_OBJECT DeviceObject
PEXT2_IRP_CONTEXT IrpContext
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
#define ALIGN_UP(size, type)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
#define SL_INDEX_SPECIFIED
#define FILE_ACTION_MODIFIED
#define SL_RETURN_SINGLE_ENTRY
#define FILE_NOTIFY_CHANGE_EA