834{
841
844
847
850
852#ifndef __REACTOS__
854#endif
857
860
865 BOOLEAN NoIntermediateBuffering;
874
878
880
883
885
888
894
895
897
899
902
904
906
910
914
917
919
921
924
927 }
928
933 }
934
936
937 if (ParentMcb) {
941 goto McbExisting;
942 } else {
946 }
947 }
948
953 );
954
956 DEBUG(
DL_ERR, (
"Ex2CreateFile: failed to allocate FileName.\n"));
959 }
960
962
965
969 }
970
974
976
980
981
982
983
984
988
991 }
992 }
993
997 }
998
999 DEBUG(
DL_INF, (
"Ext2CreateFile: %wZ Paging=%d Option: %xh:"
1000 "Dir=%d NonDir=%d OpenTarget=%d NC=%d DeleteOnClose=%d\n",
1004
1005 DEBUG(
DL_RES, (
"Ext2CreateFile: Lookup 1st: %wZ at %S\n",
1008 IrpContext,
1011 ParentMcb,
1013 0
1014 );
1015McbExisting:
1016
1018
1022
1023#ifndef __REACTOS__
1025#endif
1026
1029
1030
1034 }
1035
1036 while (PathName.
Length > 0 &&
1041 }
1042
1043 if (!ParentMcb) {
1044 if (PathName.
Buffer[0] !=
L'\\') {
1047 } else {
1048 ParentMcb =
Vcb->McbTree;
1050 }
1051 }
1052
1053Dissecting:
1054
1056
1057 if (((RemainName.
Length != 0) && (RemainName.
Buffer[0] ==
L'\\')) ||
1061 }
1062
1063 if (RemainName.
Length != 0) {
1064
1066
1067 DEBUG(
DL_RES, (
"Ext2CreateFile: Lookup 2nd: %wZ\\%wZ\n",
1069
1071 IrpContext,
1073 &RealName,
1074 ParentMcb,
1075 &RetMcb,
1076 0);
1077
1078
1083 }
1085 }
1086
1087
1089
1090
1091 ParentMcb = RetMcb;
1092 PathName = RemainName;
1093
1094
1098 ParentMcb = ParentMcb->
Target;
1100 }
1101
1102 goto Dissecting;
1103 }
1104
1105
1110 }
1111
1112 if (!bFcbLockAcquired) {
1114 bFcbLockAcquired =
TRUE;
1115 }
1116
1117
1124 }
1125 bParentFcbCreated =
TRUE;
1126 }
1128
1129 if (bFcbLockAcquired) {
1131 bFcbLockAcquired =
FALSE;
1132 }
1133
1134
1139
1143 }
1144
1148 }
1149
1152 Vcb->Vpb->RealDevice );
1155 }
1156
1158 if (TemporaryFile) {
1162 }
1163 }
1164
1168 }
1169
1170
1172 IrpContext,
1177 &RealName
1178 );
1179
1183 }
1184
1186 DEBUG(
DL_RES, (
"Ext2CreateFile: Confirm creation: %wZ\\%wZ\n",
1188
1191 IrpContext,
1193 &RealName,
1194 ParentMcb,
1196 0);
1199 }
1200
1201 } else if (OpenTargetDirectory) {
1202
1206 }
1207
1211 }
1212
1216
1220
1224
1227
1228 } else {
1229
1232 }
1233
1234 } else {
1235
1236
1237 if (OpenTargetDirectory) {
1238
1241
1245 }
1247 while (
i > 0 && RealName.
Buffer[
i - 1] !=
L'\\')
1249
1254 }
1255
1258
1264
1265
1269
1270 goto Openit;
1271 }
1272
1273
1279 }
1280
1281
1283
1286
1290 }
1291
1292 if (NonDirectoryFile) {
1296 }
1297
1299
1300 if (OpenTargetDirectory) {
1305 }
1306 }
1307
1308 } else {
1309
1314 }
1315 }
1316
1318 }
1319
1320Openit:
1321
1322 if (!bFcbLockAcquired) {
1324 bFcbLockAcquired =
TRUE;
1325 }
1326
1327
1329
1331
1332
1334
1335 if (OpenReparsePoint) {
1336
1344 } else {
1349 }
1350 }
1351
1352
1357 }
1366 }
1367 }
1368
1371
1372
1375 bFcbAllocated =
TRUE;
1376 } else {
1378 }
1379 } else {
1380 if (IsPagingFile) {
1383 }
1384 }
1385
1386
1388 }
1389
1391
1392
1394 }
1395
1397 bFcbLockAcquired =
FALSE;
1398
1400
1402 bMainResourceAcquired =
TRUE;
1403
1404
1408 }
1409
1410
1412
1413
1417 }
1418
1423 }
1424 }
1425
1426
1428
1429
1431
1433
1434
1437 IrpContext,
1440
1445 }
1446 }
1447 }
1448
1449 if (bCreated) {
1450
1451
1452
1453
1454
1459 }
1460
1462
1467 }
1468
1469 } else {
1470
1476 }
1477
1478
1479#if 0
1481 Irp->Overlay.AllocationSize.QuadPart;
1482
1483 if (
Fcb->
Header.AllocationSize.QuadPart > 0) {
1488 );
1491 Fcb->
Header.AllocationSize.QuadPart = 0;
1495 }
1496 }
1497#endif
1498 }
1499
1500 } else {
1501
1502
1503
1504
1505
1507
1511 }
1512
1515
1517 Vcb->Vpb->RealDevice );
1518
1520
1522 }
1523
1524 } else {
1525
1526
1527
1528
1529
1533
1534 if (
Fcb->SectionObject.DataSectionObject !=
NULL) {
1535
1537
1541 }
1542
1545 0,
1547 }
1548 }
1549 }
1550 }
1551 }
1552
1554
1562 }
1563 }
1564
1565 if (!bFcbAllocated) {
1566
1567
1568
1569
1570
1573 IrpContext,
1576
1581 }
1582 }
1583 }
1584
1586
1587
1595 }
1596
1597 } else {
1598
1599
1604 }
1605
1611 }
1612
1615
1616 if (SymLink)
1617 Ccb->filp.f_dentry = SymLink->
de;
1618 else
1620
1621 Ccb->filp.f_version =
Fcb->
Mcb->Inode.i_version;
1624
1626 if (NoIntermediateBuffering) {
1627 Fcb->NonCachedOpenCount++;
1629 } else {
1631 }
1632 }
1633
1636
1641
1642 DEBUG(
DL_INF, (
"Ext2CreateFile: %wZ OpenCount=%u ReferCount=%u NonCachedCount=%u\n",
1644
1646
1647 if (bCreated) {
1648
1651 IrpContext,
1656 } else {
1658 IrpContext,
1663 }
1664
1666
1672 MmFlushForWrite )) {
1673
1677 }
1678 }
1679
1683
1687 }
1688
1689 if (SymLink !=
NULL) {
1693 }
1694
1698 }
1699
1701
1703 Vcb->Vpb->RealDevice );
1706 }
1707
1709 IrpContext,
1713 &
Irp->Overlay.AllocationSize,
1715
1719 }
1720
1722 IrpContext,
1729
1730
1733 } else {
1735 }
1736 }
1737 }
1738
1739 } else {
1742 }
1743
1745
1746 if (bFcbLockAcquired) {
1748 }
1749
1750 if (ParentMcb) {
1752 }
1753
1754
1756
1758
1760
1763
1764 DEBUG(
DL_ERR, (
"Ext2CreateFile: failed to create %wZ status = %xh\n",
1766
1769
1771 if (NoIntermediateBuffering) {
1772 Fcb->NonCachedOpenCount--;
1773 } else {
1775 }
1776 }
1777
1780
1782
1787
1789 }
1790
1792
1802 }
1803
1804 if (bCreated) {
1806 }
1807 }
1808 }
1809
1810 if (bMainResourceAcquired) {
1812 }
1813
1814
1818 }
1819
1820
1823 }
1826 }
1827
1828
1829
1830 if (SymLink) {
1832 }
1834
1836}
#define FILE_DIRECTORY_FILE
#define FILE_NON_DIRECTORY_FILE
#define FILE_DELETE_ON_CLOSE
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define NT_SUCCESS(StatCode)
NTSTATUS Ext2CreateInode(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_FCB Parent, ULONG Type, ULONG FileAttr, PUNICODE_STRING FileName)
NTSTATUS Ext2OverwriteEa(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_FCB Fcb, PIO_STATUS_BLOCK Iosb)
NTSTATUS Ext2SupersedeOrOverWriteFile(IN PEXT2_IRP_CONTEXT IrpContext, IN PFILE_OBJECT FileObject, IN PEXT2_VCB Vcb, IN PEXT2_FCB Fcb, IN PLARGE_INTEGER AllocationSize, IN ULONG Disposition)
BOOLEAN Ext2IsNameValid(PUNICODE_STRING FileName)
NTSTATUS Ext2AddDotEntries(struct ext2_icb *icb, struct inode *dir, struct inode *inode)
NTSTATUS Ext2LookupFile(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PUNICODE_STRING FullName, IN PEXT2_MCB Parent, OUT PEXT2_MCB *Ext2Mcb, IN ULONG Linkdep)
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN _In_ BOOLEAN DeleteOnClose
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN NoEaKnowledge
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
VOID Ext2FreePool(IN PVOID P, IN ULONG Tag)
#define ClearFlag(_F, _SF)
#define IsMcbSymLink(Mcb)
NTSTATUS Ext2IsFileRemovable(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_FCB Fcb, IN PEXT2_CCB Ccb)
#define VCB_WRITE_PROTECTED
VOID Ext2OplockComplete(IN PVOID Context, IN PIRP Irp)
VOID Ext2ReleaseFcb(IN PEXT2_FCB Fcb)
#define Ext2RaiseStatus(IRPCONTEXT, STATUS)
static ext3_fsblk_t ext3_free_blocks_count(struct ext3_super_block *es)
PVOID Ext2AllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
#define IsVcbReadOnly(Vcb)
#define IsFileDeleted(Mcb)
NTSTATUS Ext2TruncateFile(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_MCB Mcb, PLARGE_INTEGER AllocationSize)
NTSTATUS Ext2DeleteFile(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_FCB Fcb, PEXT2_MCB Mcb)
#define CCB_OPEN_REPARSE_POINT
#define DEC_MEM_COUNT(_i, _p, _s)
#define SetLongFlag(_F, _SF)
#define FCB_FILE_MODIFIED
#define ClearLongFlag(_F, _SF)
#define Ext2DerefMcb(Mcb)
VOID Ext2NotifyReportChange(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb, IN ULONG Filter, IN ULONG Action)
#define IsMcbDirectory(Mcb)
#define FCB_ALLOC_IN_CREATE
PEXT2_CCB Ext2AllocateCcb(ULONG Flags, PEXT2_MCB SymLink)
VOID Ext2LockIrp(IN PVOID Context, IN PIRP Irp)
#define CCB_DELETE_ON_CLOSE
#define BooleanFlagOn(F, SF)
NTSTATUS Ext2ExpandFile(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb, PEXT2_MCB Mcb, PLARGE_INTEGER Size)
VOID Ext2FreeCcb(IN PEXT2_VCB Vcb, IN PEXT2_CCB Ccb)
struct _EXT2_FCB * PEXT2_FCB
#define Ext2ReferMcb(Mcb)
#define INC_MEM_COUNT(_i, _p, _s)
PEXT2_FCB Ext2AllocateFcb(IN PEXT2_VCB Vcb, IN PEXT2_MCB Mcb)
ULONG Ext2TotalBlocks(PEXT2_VCB Vcb, PLARGE_INTEGER Size, PULONG pMeta)
int Ext2CheckFileAccess(PEXT2_VCB Vcb, PEXT2_MCB Mcb, int attempt)
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
struct _FileName FileName
#define FILE_OPEN_BY_FILE_ID
#define FILE_OVERWRITE_IF
#define FILE_OPEN_REPARSE_POINT
#define FILE_NO_EA_KNOWLEDGE
#define FILE_NO_INTERMEDIATE_BUFFERING
#define FILE_SEQUENTIAL_ONLY
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
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 FILE_DOES_NOT_EXIST
#define FILE_DELETE_CHILD
#define FILE_WRITE_ATTRIBUTES
#define FILE_ADD_SUBDIRECTORY
#define FILE_GENERIC_READ
#define FILE_ATTRIBUTE_TEMPORARY
BOOLEAN NTAPI FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
VOID NTAPI FsRtlDissectName(IN UNICODE_STRING Name, OUT PUNICODE_STRING FirstPart, OUT PUNICODE_STRING RemainingPart)
VOID NTAPI IoSetShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, OUT PSHARE_ACCESS ShareAccess)
NTSTATUS NTAPI IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess, IN BOOLEAN Update)
VOID NTAPI IoRemoveShareAccess(IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess)
VOID NTAPI IoSetHardErrorOrVerifyDevice(IN PIRP Irp, IN PDEVICE_OBJECT DeviceObject)
#define STATUS_NOT_IMPLEMENTED
#define STATUS_OPLOCK_BREAK_IN_PROGRESS
BOOLEAN NTAPI FsRtlCurrentBatchOplock(IN POPLOCK Oplock)
NTSTATUS NTAPI FsRtlCheckOplock(IN POPLOCK Oplock, IN PIRP Irp, IN PVOID Context, IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL, IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL)
BOOLEAN NTAPI MmFlushImageSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN MMFLUSH_TYPE FlushType)
#define STATUS_CANNOT_DELETE
ERESOURCE PagingIoResource
FSRTL_ADVANCED_FCB_HEADER Header
struct _IO_STACK_LOCATION::@3974::@3975 Create
union _IO_STACK_LOCATION::@1575 Parameters
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_FILE_IS_A_DIRECTORY
#define STATUS_NOT_A_DIRECTORY
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_OBJECT_PATH_NOT_FOUND
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_NO_SUCH_FILE
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_FILE_DELETED
#define STATUS_SHARING_VIOLATION
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
#define FILE_OPBATCH_BREAK_UNDERWAY
#define SL_OPEN_PAGING_FILE
#define FILE_NOTIFY_CHANGE_SIZE
#define FILE_ACTION_MODIFIED
#define FILE_NOTIFY_CHANGE_ATTRIBUTES
#define FILE_NOTIFY_CHANGE_FILE_NAME
#define FO_NO_INTERMEDIATE_BUFFERING
#define FO_CACHE_SUPPORTED
#define FILE_NOTIFY_CHANGE_LAST_WRITE
#define SL_OPEN_TARGET_DIRECTORY
#define FILE_ACTION_ADDED
#define FILE_NOTIFY_CHANGE_DIR_NAME
#define SL_CASE_SENSITIVE