681{
682#if 0
684
686
687 USHORT ExtendedAttributes;
688
690 ULONG UserBufferLength;
691
694
698
701
703
707
713#endif
714
716
719
720#if 0
721
722
723
724
725
726
727
728
729
731
735 DebugTrace( 0,
Dbg,
" ->SystemBuffer = %p\n",
Irp->AssociatedIrp.SystemBuffer );
737
739 Irp->IoStatus.Information = 0;
740
741
742
743
744
745
746 {
748
754
756
758
760 "FatCommonSetEa -> %08lx\n",
762
764 }
765 }
766
767
768
769
770
772
775 "FatCommonSetEa -> %08lx\n",
778 }
779
780
781
782
783
785
786
787
788
789
790
791
792
794
795
796
797
798
799
800
801
803 UserBufferLength,
805
807
810 "FatCommonSetEa -> %08lx\n",
813 }
814
815
816
817
818
819
820
821
822
823
824
825
826
828
829 DebugTrace(0,
Dbg,
"FatCommonSetEa: Set Ea must be waitable\n", 0);
830
832
834
836 }
837
838
839
840
841
843
845
846 try {
847
848 ULONG PackedEasLength;
850 ULONG AllocationLength;
851 ULONG BytesPerCluster;
853
855
856
857
858
859
860 FatAcquireSharedVcb( IrpContext,
Fcb->
Vcb );
862 FatAcquireExclusiveFcb( IrpContext,
Fcb );
864
866
868
870 AcquiredParentDcb =
TRUE;
871 }
872
874 AcquiredRootDcb =
TRUE;
875 }
876
877
878
879
880
881 FatVerifyFcb( IrpContext,
Fcb );
882
883
884
885
886
887 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
888
893
894
895
896
897
898
899
900
901 ExtendedAttributes =
Dirent->ExtendedAttributes;
902
904
905 if (ExtendedAttributes == 0) {
906
908
910 "FatCommonSetEa: File has no current Eas\n", 0 );
911
912 } else {
913
915
916 DebugTrace(0,
Dbg,
"FatCommonSetEa: File has previous Eas\n", 0 );
917
918 FatGetEaFile( IrpContext,
924
925 AcquiredEaFcb =
TRUE;
926
927
928
929
930
931
932 if (
Vcb->VirtualEaFile ==
NULL) {
933
936 }
937 }
938
940
942
943
944
945
946
947
948 if (PreviousEas) {
949
950
951
952
953
956 ExtendedAttributes,
960
962
963
964
965
966
967
968
969 PackedEasLength =
GetcbList( PrevEaSetHeader ) - 4;
970
971
972
973
974
975 } else {
976
977 PackedEasLength = 0;
978 }
979
980 BytesPerCluster = 1 <<
Vcb->AllocationSupport.LogOfBytesPerCluster;
981
982 AllocationLength = (PackedEasLength
984 + BytesPerCluster - 1)
985 & ~(BytesPerCluster - 1);
986
988 AllocationLength,
990
991
992
993
994
995 if (PreviousEas) {
996
997 RtlCopyMemory( EaSetHeader, PrevEaSetHeader, AllocationLength );
998
1000
1001 } else {
1002
1004
1008 }
1009
1010
1012
1013 DebugTrace(0,
Dbg,
"FatCommonSetEa: Initial Ea set -> %p\n",
1014 EaSetHeader);
1015
1016
1017
1018
1019
1020
1021
1022
1026 &
Buffer[UserBufferLength] :
1027 (
PUCHAR) FullEa + FullEa->NextEntryOffset)) {
1028
1031
1032 EaName.MaximumLength = EaName.Length = FullEa->EaNameLength;
1033 EaName.Buffer = &FullEa->EaName[0];
1034
1036 &EaName);
1037
1038
1039
1040
1041
1043
1047 }
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058 if (FullEa->Flags != 0
1060
1063 }
1064
1065
1066
1067
1068
1071 PackedEasLength,
1072 &EaName,
1074
1076
1077
1078
1079
1080
1081
1082
1084 EaSetHeader,
1085 &PackedEasLength,
1087 }
1088
1089 if (FullEa->EaValueLength != 0) {
1090
1092 &EaSetHeader,
1093 &PackedEasLength,
1094 &AllocationLength,
1095 FullEa,
1096 BytesPerCluster );
1097 }
1098 }
1099
1100
1101
1102
1103
1104
1105 if (PackedEasLength != 0) {
1106
1108
1110
1111
1112
1113
1114
1115
1117
1118 DebugTrace( 0,
Dbg,
"Ea length is greater than maximum\n", 0 );
1119
1121 }
1122
1123
1124
1125
1126
1128
1129 FatGetEaFile( IrpContext,
1135
1136 AcquiredEaFcb =
TRUE;
1137 }
1138
1139 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
1140
1142
1143 FatAddEaSet( IrpContext,
1150
1152
1153 DebugTrace(0,
Dbg,
"FatCommonSetEa: Adding an ea set\n", 0);
1154
1155
1156
1157
1158
1159
1160 PackedEasLength += 4;
1161
1163
1164
1165
1166
1167
1168
1169
1173
1176
1178
1179 } else {
1180
1181 FatGetDirentFromFcbOrDcb( IrpContext,
Fcb, &
Dirent, &
Bcb );
1182
1184 }
1185
1186
1187
1188
1189
1190 if (PreviousEas) {
1191
1192 FatDeleteEaSet( IrpContext,
1196 ExtendedAttributes,
1198
1200 }
1201
1202 if (PackedEasLength != 0 ) {
1203
1205 }
1206
1207
1208
1209
1210
1212
1213 FatSetDirtyBcb( IrpContext,
Bcb,
Vcb,
TRUE );
1214
1215
1216
1217
1218
1219
1225
1226 Irp->IoStatus.Information = 0;
1228
1230
1231
1232
1233
1234
1237
1239
1240 } finally {
1241
1243
1244
1245
1246
1247
1248
1250
1251
1252
1253
1254
1257
1259 }
1260
1261
1262
1263
1264
1265 if (AcquiredEaFcb) {
1267 }
1268
1269 if (AcquiredFcb) {
1271 }
1272
1273 if (AcquiredParentDcb) {
1275 }
1276
1277 if (AcquiredRootDcb) {
1279 }
1280
1281 if (AcquiredVcb) {
1283 }
1284
1285
1286
1287
1288
1289 if (EaSetHeader !=
NULL) {
1290
1292 }
1293
1294
1295
1296
1297
1299
1301 }
1302
1304 }
1305
1306
1307
1308
1309
1311#endif
1312}
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
#define NT_SUCCESS(StatCode)
#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 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)
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)
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
PVOID FatBufferUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp, IN ULONG BufferLength)
#define FatNotifyReportChange(I, V, F, FL, A)
IN PVCB IN PUCHAR IN ULONG IN POEM_STRING OUT PUSHORT EaHandle
#define FatReleaseVcb(IRPCONTEXT, Vcb)
#define CopyU4char(Dst, Src)
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
_In_ ULONG _In_ ULONG Offset
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
NTSTATUS NTAPI IoCheckEaBufferValidity(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
#define STATUS_INVALID_EA_NAME
#define STATUS_EA_TOO_LARGE
struct _IO_STACK_LOCATION::@3980::@3992 SetEa
#define RtlCopyMemory(Destination, Source, Length)
#define FILE_ACTION_MODIFIED
#define FILE_NOTIFY_CHANGE_EA