ReactOS  0.4.14-dev-77-gd9e7c48
ea.c
Go to the documentation of this file.
1 /*
2 * COPYRIGHT: See COPYRIGHT.TXT
3 * PROJECT: Ext2 File System Driver for Windows >= NT
4 * FILE: ea.c
5 * PROGRAMMER: Matt Wu <mattwu@163.com> Kaho Ng <ngkaho1234@gmail.com>
6 * HOMEPAGE: http://www.ext2fsd.com
7 * UPDATE HISTORY:
8 */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include "ext2fs.h"
13 #include <linux/ext4_xattr.h>
14 
15 #ifdef ALLOC_PRAGMA
16 #pragma alloc_text(PAGE, Ext2QueryEa)
17 #pragma alloc_text(PAGE, Ext2SetEa)
18 #pragma alloc_text(PAGE, Ext2IsEaNameValid)
19 #endif
20 
21 // Ea iterator
22 struct EaIterator {
23  // Return only an entry
25 
26  // Is the buffer overflowing?
28 
29  // FILE_FULL_EA_INFORMATION output buffer
32 
33  // UserBuffer's size
35 
36  // Remaining UserBuffer's size
38 
39  // Start scanning from this EA
41 
42  // Next EA index returned by Ext2IterateAllEa
44 };
45 
46 static int Ext2IterateAllEa(struct ext4_xattr_ref *xattr_ref, struct ext4_xattr_item *item, BOOL is_last)
47 {
48  struct EaIterator *pEaIterator = xattr_ref->iter_arg;
49  ULONG EaEntrySize = 4 + 1 + 1 + 2 + item->name_len + 1 + item->data_size;
50  ASSERT(pEaIterator);
51  if (!is_last && !pEaIterator->ReturnSingleEntry)
52  EaEntrySize = ALIGN_UP(EaEntrySize, ULONG);
53 
54  // Start iteration from index specified
55  if (pEaIterator->EaIndexCounter < pEaIterator->EaIndex) {
56  pEaIterator->EaIndexCounter++;
58  }
59  pEaIterator->EaIndexCounter++;
60 
61  if (EaEntrySize > pEaIterator->RemainingUserBufferLength) {
62  pEaIterator->OverFlow = TRUE;
64  }
65  pEaIterator->FullEa->NextEntryOffset = 0;
66  pEaIterator->FullEa->Flags = 0;
67  pEaIterator->FullEa->EaNameLength = (UCHAR)item->name_len;
68  pEaIterator->FullEa->EaValueLength = (USHORT)item->data_size;
69  RtlCopyMemory(&pEaIterator->FullEa->EaName[0],
70  item->name,
71  item->name_len);
72  RtlCopyMemory(&pEaIterator->FullEa->EaName[0] + item->name_len + 1,
73  item->data,
74  item->data_size);
75 
76  // Link FullEa and LastFullEa together
77  if (pEaIterator->LastFullEa) {
78  pEaIterator->LastFullEa->NextEntryOffset = (ULONG)
79  ((PCHAR)pEaIterator->FullEa - (PCHAR)pEaIterator->LastFullEa);
80  }
81 
82  pEaIterator->LastFullEa = pEaIterator->FullEa;
83  pEaIterator->FullEa = (PFILE_FULL_EA_INFORMATION)
84  ((PCHAR)pEaIterator->FullEa + EaEntrySize);
85  pEaIterator->RemainingUserBufferLength -= EaEntrySize;
86 
87  if (pEaIterator->ReturnSingleEntry)
89 
91 }
92 
95  IN PEXT2_IRP_CONTEXT IrpContext
96 )
97 {
98  PIRP Irp = NULL;
100 
102 
103  PEXT2_VCB Vcb = NULL;
104  PEXT2_FCB Fcb = NULL;
105  PEXT2_CCB Ccb = NULL;
106  PEXT2_MCB Mcb = NULL;
107 
108  PUCHAR UserEaList;
109  ULONG UserEaListLength;
110  ULONG UserEaIndex;
111 
114  BOOLEAN IndexSpecified;
115 
116  BOOLEAN MainResourceAcquired = FALSE;
117  BOOLEAN XattrRefAcquired = FALSE;
118 
120 
121  struct ext4_xattr_ref xattr_ref;
122  PCHAR UserBuffer;
123 
124  ULONG UserBufferLength = 0;
125  ULONG RemainingUserBufferLength = 0;
126 
127  PFILE_FULL_EA_INFORMATION FullEa, LastFullEa = NULL;
128 
129  _SEH2_TRY {
130 
131  Ccb = IrpContext->Ccb;
132  ASSERT(Ccb != NULL);
133  ASSERT((Ccb->Identifier.Type == EXT2CCB) &&
134  (Ccb->Identifier.Size == sizeof(EXT2_CCB)));
137  Fcb = IrpContext->Fcb;
138  Mcb = Fcb->Mcb;
139  Irp = IrpContext->Irp;
141 
142  Irp->IoStatus.Information = 0;
143 
144  //
145  // Receive input parameter from caller
146  //
147  UserBuffer = Ext2GetUserBuffer(Irp);
148  if (!UserBuffer) {
150  _SEH2_LEAVE;
151  }
152  UserBufferLength = IrpSp->Parameters.QueryEa.Length;
153  RemainingUserBufferLength = UserBufferLength;
154  UserEaList = IrpSp->Parameters.QueryEa.EaList;
155  UserEaListLength = IrpSp->Parameters.QueryEa.EaListLength;
156  UserEaIndex = IrpSp->Parameters.QueryEa.EaIndex;
159  IndexSpecified = BooleanFlagOn(IrpSp->Flags, SL_INDEX_SPECIFIED);
160 
161  if (!Mcb)
162  _SEH2_LEAVE;
163 
164  //
165  // We do not allow multiple instance gaining EA access to the same file
166  //
168  &Fcb->MainResource,
171  _SEH2_LEAVE;
172  }
173  MainResourceAcquired = TRUE;
174 
176  if (!NT_SUCCESS(Status)) {
177  DbgPrint("ext4_fs_get_xattr_ref() failed!\n");
178  _SEH2_LEAVE;
179  }
180 
181  FullEa = (PFILE_FULL_EA_INFORMATION)UserBuffer;
182 
183  XattrRefAcquired = TRUE;
184 
185  if (RemainingUserBufferLength)
186  RtlZeroMemory(FullEa, RemainingUserBufferLength);
187 
188  if (UserEaList != NULL) {
189  int i = 0;
191  for (GetEa = (PFILE_GET_EA_INFORMATION)&UserEaList[0];
192  GetEa < (PFILE_GET_EA_INFORMATION)((PUCHAR)UserEaList
193  + UserEaListLength);
194  GetEa = (GetEa->NextEntryOffset == 0
197  + GetEa->NextEntryOffset))) {
198 
199  size_t ItemSize;
200  OEM_STRING Str;
201  ULONG EaEntrySize;
202  BOOL is_last = !GetEa->NextEntryOffset;
203 
204  Str.MaximumLength = Str.Length = GetEa->EaNameLength;
205  Str.Buffer = &GetEa->EaName[0];
206 
207  //
208  // At the moment we only need to know whether the item exists
209  // and its size.
210  //
213  Str.Buffer,
214  Str.Length,
215  NULL,
216  0,
217  &ItemSize));
218  if (!NT_SUCCESS(Status))
219  continue;
220 
221  //
222  // We were not able to locate the name therefore we must
223  // dummy up a entry for the query. The needed Ea size is
224  // the size of the name + 4 (next entry offset) + 1 (flags)
225  // + 1 (name length) + 2 (value length) + the name length +
226  // 1 (null byte) + Data Size.
227  //
228  EaEntrySize = 4 + 1 + 1 + 2 + GetEa->EaNameLength + 1 + ItemSize;
229  if (!is_last)
230  EaEntrySize = ALIGN_UP(EaEntrySize, ULONG);
231 
232  if (EaEntrySize > RemainingUserBufferLength) {
233 
235  _SEH2_LEAVE;
236  }
237  FullEa->NextEntryOffset = 0;
238  FullEa->Flags = 0;
239  FullEa->EaNameLength = GetEa->EaNameLength;
240  FullEa->EaValueLength = (USHORT)ItemSize;
241  RtlCopyMemory(&FullEa->EaName[0],
242  &GetEa->EaName[0],
243  GetEa->EaNameLength);
244 
245  //
246  // This query must succeed, or is guarenteed to succeed
247  // since we are only looking up
248  // an EA entry in a in-memory tree structure.
249  // Otherwise that means someone might be operating on
250  // the xattr_ref without acquiring Inode lock.
251  //
253  ext4_fs_get_xattr(&xattr_ref,
255  Str.Buffer,
256  Str.Length,
257  &FullEa->EaName[0] + FullEa->EaNameLength + 1,
258  ItemSize,
259  &ItemSize
260  ))));
261  FullEa->EaValueLength = (USHORT)ItemSize;
262 
263  // Link FullEa and LastFullEa together
264  if (LastFullEa)
265  LastFullEa->NextEntryOffset = (ULONG)((PCHAR)FullEa -
266  (PCHAR)LastFullEa);
267 
268  LastFullEa = FullEa;
269  FullEa = (PFILE_FULL_EA_INFORMATION)
270  ((PCHAR)FullEa + EaEntrySize);
271  RemainingUserBufferLength -= EaEntrySize;
272  i++;
273  }
274  } else if (IndexSpecified) {
275  struct EaIterator EaIterator;
276  //
277  // The user supplied an index into the Ea list.
278  //
281 
284  // In this case, return only an entry.
289  EaIterator.EaIndex = UserEaIndex;
291 
292  xattr_ref.iter_arg = &EaIterator;
294 
296 
298 
299  // It seems that the item isn't found
302 
303  if (EaIterator.OverFlow) {
306  else
308  }
309 
310  } else {
311  struct EaIterator EaIterator;
312  //
313  // Else perform a simple scan, taking into account the restart
314  // flag and the position of the next Ea stored in the Ccb.
315  //
316  if (RestartScan)
317  Ccb->EaIndex = 1;
318 
321 
328  EaIterator.EaIndex = Ccb->EaIndex;
330 
331  xattr_ref.iter_arg = &EaIterator;
333 
335 
336  if (Ccb->EaIndex < EaIterator.EaIndexCounter)
337  Ccb->EaIndex = EaIterator.EaIndexCounter;
338 
340 
341  if (EaIterator.OverFlow) {
344  else
346  }
347 
348  }
349  }
350  _SEH2_FINALLY {
351 
352  if (XattrRefAcquired) {
353  if (!NT_SUCCESS(Status)) {
354  xattr_ref.dirty = FALSE;
355  ext4_fs_put_xattr_ref(&xattr_ref);
356  }
357  else
359  }
360 
361  if (MainResourceAcquired) {
363  }
364 
365  if (NT_SUCCESS(Status)) {
367  IrpContext,
368  Vcb,
369  Mcb,
372  Irp->IoStatus.Information = UserBufferLength - RemainingUserBufferLength;
373  }
374 
375  if (!_SEH2_AbnormalTermination()) {
377  Status = Ext2QueueRequest(IrpContext);
378  }
379  else {
380  Ext2CompleteIrpContext(IrpContext, Status);
381  }
382  }
383  } _SEH2_END;
384 
385  return Status;
386 }
387 
388 BOOLEAN
391 )
392 {
393  ULONG Index;
394  UCHAR Char;
395 
396  //
397  // Empty names are not valid
398  //
399 
400  if (Name.Length == 0)
401  return FALSE;
402 
403  //
404  // Do not allow EA name longer than 255 bytes
405  //
406  if (Name.Length > 255)
407  return FALSE;
408 
409  for (Index = 0; Index < (ULONG)Name.Length; Index += 1) {
410 
411  Char = Name.Buffer[Index];
412 
413  //
414  // Skip over and Dbcs chacters
415  //
417 
418  ASSERT(Index != (ULONG)(Name.Length - 1));
419  Index += 1;
420  continue;
421  }
422 
423  //
424  // Make sure this character is legal, and if a wild card, that
425  // wild cards are permissible.
426  //
428  return FALSE;
429 
430  }
431 
432  return TRUE;
433 }
434 
435 NTSTATUS
437  IN PEXT2_IRP_CONTEXT IrpContext
438 )
439 {
440  PIRP Irp = NULL;
442 
444 
445  PEXT2_VCB Vcb = NULL;
446  PEXT2_FCB Fcb = NULL;
447  PEXT2_CCB Ccb = NULL;
448  PEXT2_MCB Mcb = NULL;
449 
450  BOOLEAN MainResourceAcquired = FALSE;
451  BOOLEAN FcbLockAcquired = FALSE;
452  BOOLEAN XattrRefAcquired = FALSE;
453 
455 
456  struct ext4_xattr_ref xattr_ref;
457  PCHAR UserBuffer;
458  ULONG UserBufferLength;
459 
461 
462  _SEH2_TRY {
463 
464  Ccb = IrpContext->Ccb;
465  ASSERT(Ccb != NULL);
466  ASSERT((Ccb->Identifier.Type == EXT2CCB) &&
467  (Ccb->Identifier.Size == sizeof(EXT2_CCB)));
470  Fcb = IrpContext->Fcb;
471  Mcb = Fcb->Mcb;
472  Irp = IrpContext->Irp;
474 
475  Irp->IoStatus.Information = 0;
476 
477  //
478  // Receive input parameter from caller
479  //
480  UserBufferLength = IrpSp->Parameters.SetEa.Length;
481  UserBuffer = Irp->UserBuffer;
482 
483  // Check if the EA buffer provided is valid
485  UserBufferLength,
486  (PULONG)&Irp->IoStatus.Information);
487  if (!NT_SUCCESS(Status))
488  _SEH2_LEAVE;
489 
491  FcbLockAcquired = TRUE;
492 
493  if (!Mcb)
494  _SEH2_LEAVE;
495 
496  //
497  // We do not allow multiple instance gaining EA access to the same file
498  //
500  &Fcb->MainResource,
503  _SEH2_LEAVE;
504  }
505  MainResourceAcquired = TRUE;
506 
508  if (!NT_SUCCESS(Status)) {
509  DbgPrint("ext4_fs_get_xattr_ref() failed!\n");
510  _SEH2_LEAVE;
511  }
512 
513  XattrRefAcquired = TRUE;
514 
515  //
516  // Remove all existing EA entries.
517  //
518  ext4_xattr_purge_items(&xattr_ref);
519  xattr_ref.dirty = TRUE;
521 
522  // Iterate the whole EA buffer to do inspection
523  for (FullEa = (PFILE_FULL_EA_INFORMATION)UserBuffer;
524  FullEa < (PFILE_FULL_EA_INFORMATION)&UserBuffer[UserBufferLength];
525  FullEa = (PFILE_FULL_EA_INFORMATION)(FullEa->NextEntryOffset == 0 ?
526  &UserBuffer[UserBufferLength] :
527  (PCHAR)FullEa + FullEa->NextEntryOffset)) {
528 
529  OEM_STRING EaName;
530 
531  EaName.MaximumLength = EaName.Length = FullEa->EaNameLength;
532  EaName.Buffer = &FullEa->EaName[0];
533 
534  // Check if EA's name is valid
535  if (!Ext2IsEaNameValid(EaName)) {
536  Irp->IoStatus.Information = (PCHAR)FullEa - UserBuffer;
538  _SEH2_LEAVE;
539  }
540  }
541 
542  // Now add EA entries to the inode
543  for (FullEa = (PFILE_FULL_EA_INFORMATION)UserBuffer;
544  FullEa < (PFILE_FULL_EA_INFORMATION)&UserBuffer[UserBufferLength];
545  FullEa = (PFILE_FULL_EA_INFORMATION)(FullEa->NextEntryOffset == 0 ?
546  &UserBuffer[UserBufferLength] :
547  (PCHAR)FullEa + FullEa->NextEntryOffset)) {
548 
549  int ret;
550  OEM_STRING EaName;
551 
552  EaName.MaximumLength = EaName.Length = FullEa->EaNameLength;
553  EaName.Buffer = &FullEa->EaName[0];
554 
556  ext4_fs_set_xattr_ordered(&xattr_ref,
558  EaName.Buffer,
559  EaName.Length,
560  &FullEa->EaName[0] + FullEa->EaNameLength + 1,
561  FullEa->EaValueLength));
562  if (!NT_SUCCESS(Status))
563  _SEH2_LEAVE;
564 
565  }
566  } _SEH2_FINALLY {
567 
568  if (XattrRefAcquired) {
569  if (!NT_SUCCESS(Status)) {
570  xattr_ref.dirty = FALSE;
571  ext4_fs_put_xattr_ref(&xattr_ref);
572  } else
574  }
575 
576  if (FcbLockAcquired) {
577  ExReleaseResourceLite(&Vcb->FcbLock);
578  FcbLockAcquired = FALSE;
579  }
580 
581  if (MainResourceAcquired) {
583  }
584 
585  if (NT_SUCCESS(Status)) {
587  IrpContext,
588  Vcb,
589  Mcb,
592  }
593 
594  if (!_SEH2_AbnormalTermination()) {
597  }
598  else {
600  }
601  }
602  } _SEH2_END;
603  return Status;
604 }
NTSTATUS Ext2WinntError(int rc)
Definition: misc.c:410
signed char * PCHAR
Definition: retypes.h:7
BOOL OverFlow
Definition: ea.c:27
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define IRP_CONTEXT_FLAG_WAIT
Definition: cdstruc.h:1221
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STATUS_OBJECTID_NOT_FOUND
Definition: ntstatus.h:846
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN _In_ ULONG _In_opt_ PULONG _In_ BOOLEAN RestartScan
Definition: fltkernel.h:2298
PFILE_FULL_EA_INFORMATION LastFullEa
Definition: ea.c:31
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
#define SL_INDEX_SPECIFIED
Definition: iotypes.h:1794
#define DbgPrint
Definition: loader.c:25
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
_In_ PIRP Irp
Definition: csq.h:116
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
Extended Attribute manipulation.
PDEVICE_OBJECT DeviceObject
Definition: ext2fs.h:1051
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
struct _FILE_GET_EA_INFORMATION * PFILE_GET_EA_INFORMATION
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ BOOLEAN ReturnSingleEntry
Definition: fltkernel.h:2295
PIRP Irp
Definition: ext2fs.h:1041
PEXT2_IRP_CONTEXT IrpContext
Definition: ext4_xattr.h:141
NTSTATUS Ext2SetEa(IN PEXT2_IRP_CONTEXT IrpContext)
Definition: ea.c:436
ULONG Flags
Definition: ext2fs.h:1044
STRING OEM_STRING
Definition: umtypes.h:203
ULONG RemainingUserBufferLength
Definition: ea.c:37
ULONG EaIndexCounter
Definition: ea.c:43
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
PEXT2_CCB Ccb
Definition: ext2fs.h:1060
_SEH2_TRY
Definition: create.c:4250
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
BOOLEAN ReturnSingleEntry
Definition: ea.c:24
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
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
Definition: glfuncs.h:248
NTSTATUS Ext2QueueRequest(IN PEXT2_IRP_CONTEXT IrpContext)
Definition: dispatch.c:150
unsigned int BOOL
Definition: ntddk_ex.h:94
char Char
Definition: bzip2.c:161
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
#define EXT4_XATTR_INDEX_USER
Definition: ext4_xattr.h:52
#define FILE_ACTION_MODIFIED
VOID Ext2NotifyReportChange(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONG Filter, IN ULONG Action)
Definition: dirctl.c:1209
PVOID DeviceExtension
Definition: env_spec_w32.h:418
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: util.c:191
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:13
#define MAXUINT_PTR
Definition: basetsd.h:100
int ext4_fs_get_xattr_ref(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB fs, PEXT2_MCB inode_ref, struct ext4_xattr_ref *ref)
Definition: ext4_xattr.c:1105
#define PCHAR
Definition: match.c:90
int ext4_fs_put_xattr_ref(struct ext4_xattr_ref *ref)
Definition: ext4_xattr.c:1176
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
#define Vcb
Definition: cdprocs.h:1425
static const UCHAR Index[8]
Definition: usbohci.c:18
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))
Definition: ext4_xattr.c:978
PFILE_FULL_EA_INFORMATION FullEa
Definition: ea.c:30
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CD_MCB Mcb
Definition: cdstruc.h:1022
unsigned char UCHAR
Definition: xmlstorage.h:181
int ret
#define EXT4_XATTR_ITERATE_STOP
Definition: ext4_xattr.h:163
#define FsRtlIsAnsiCharacterLegalFat(C, WILD)
Definition: fsrtlfuncs.h:1611
NTSTATUS Ext2CompleteIrpContext(IN PEXT2_IRP_CONTEXT IrpContext, IN NTSTATUS Status)
Definition: read.c:32
ULONG Type
Definition: ntfs.h:95
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:593
PEXT2_FCB Fcb
Definition: ext2fs.h:1059
#define STATUS_INVALID_EA_NAME
Definition: ntstatus.h:187
static UCHAR ItemSize[4]
Definition: parser.c:16
ERESOURCE MainResource
Definition: ntfs.h:524
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
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)
Definition: ext4_xattr.c:1078
#define SL_RETURN_SINGLE_ENTRY
Definition: iotypes.h:1793
_SEH2_END
Definition: create.c:4424
ULONG EaIndex
Definition: ea.c:40
static ATOM item
Definition: dde.c:856
Definition: ea.c:22
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
#define EXT4_XATTR_ITERATE_CONT
Definition: ext4_xattr.h:162
#define FILE_NOTIFY_CHANGE_EA
unsigned short USHORT
Definition: pedump.c:61
static int Ext2IterateAllEa(struct ext4_xattr_ref *xattr_ref, struct ext4_xattr_item *item, BOOL is_last)
Definition: ea.c:46
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:334
_SEH2_FINALLY
Definition: create.c:4395
void * iter_arg
Definition: ext4_xattr.h:155
unsigned int * PULONG
Definition: retypes.h:1
#define SL_RESTART_SCAN
Definition: iotypes.h:1792
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)
Definition: ext4_xattr.c:1055
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
struct _EXT2_VCB * PEXT2_VCB
ULONG UserBufferLength
Definition: ea.c:34
#define _SEH2_LEAVE
Definition: filesup.c:20
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR)
Definition: init.c:417
ULONG Size
Definition: ntfs.h:96
PVOID Ext2GetUserBuffer(IN PIRP Irp)
Definition: block.c:134
void ext4_xattr_purge_items(struct ext4_xattr_ref *xattr_ref)
Definition: ext4_xattr.c:736
NTSTATUS Ext2QueryEa(IN PEXT2_IRP_CONTEXT IrpContext)
Definition: ea.c:94
#define STATUS_CANT_WAIT
Definition: ntstatus.h:438
BOOLEAN Ext2IsEaNameValid(IN OEM_STRING Name)
Definition: ea.c:389