Commit graph

368 commits

Author SHA1 Message Date
Pierre Schweitzer 00e843b1ed
[FASTFAT] Reduce the number of local declaration. 2018-04-29 12:33:53 +02:00
Pierre Schweitzer fd8197645f
[FASTFAT] Use KdRosRegisterCliCallback() to register in KDBG. 2018-04-29 12:23:18 +02:00
Pierre Schweitzer c5a35ecd37 [FASTFAT] Introduce a KDBG extension.
This is a PoC of what it's possible to realize thanks to an
already existing hack in ntoskrnl :-).
With this extension, on the kdb:> prompt, you're able to type
in commands that will be handled by the FastFAT driver and not
by the kernel, allowing internal debug, not possible otherwise.

So far, three commands exist:
- ?fat.vols: lists all the mounted volumes by FastFAT
- ?fat.files: lists all the files on a specific volume (with their attributes)
- ?fat.setdbgfile: allows watching on specifics files lifetime

This is obviously only the begin and could be greatly improved.

For instance, this is what allowed to debug CORE-14557
2018-04-29 12:15:11 +02:00
Pierre Schweitzer 94ead99e0c [FASTFAT] Don't leak directories FILE_OBJECT, FCB and cache entries.
Once a directory is crossed (opened or a child is opened), associated
FCB structure is created in FastFAT, but also a stream FO for caching.
Up to now, due to an extra reference taken by the stream file object,
even when the directory was no longer used, the directory was kept in
memory: the FCB was never deleted, the file object was never dereferenced,
and the cache never released.

The immediate effect of this bug is that our FAT driver was leaking every
directory that was used affecting the whole OS situation. In case of
directories intensive operation (like extraction the ReactOS source code
in ReactOS ;-)), we were just killin the whole OS RAM without any way to
release it and recover.

The other side effects: IOs were faster as half of the FS was always
permanant in RAM.

This commit fixes the issue by forcing the FSD to release the FO,
and the cache when a directory is no longer used, leading to its
destruction in RAM.
Downside: on IO intensive operation, expect slowdowns, obviously,
there's less caching now. But more efficient!

CORE-14557
2018-04-28 18:33:14 +02:00
Pierre Schweitzer 315f9a13d4
[FASTFAT] When allocating a FCB, set its node type code.
We set the same value as MS FastFAT driver for consistency.
2018-04-27 18:56:31 +02:00
Pierre Schweitzer c7bba39afc
[NTFS] When reading $I30 attribute fails, stop the rename operation.
This makes the function return the error instead of continuing and
performing use-after-frees operations.
This is likely to be a forgotten return!

CID 1434254, 1434268
2018-04-14 11:43:57 +02:00
Pierre Schweitzer 1986049a38
[CDFS_NEW] Sync with HEAD.
CORE-14315
2018-02-25 10:14:27 +01:00
Pierre Schweitzer 69f51d1533
[FASTFAT] Drop read ahead locking routines in favor of lazy writer routines.
This avoids code duplication while being consistent with MS FastFAT.
2018-02-17 13:49:15 +01:00
Pierre Schweitzer a5e89014dc
[CDFS_NEW] Fix a bug in Microsoft CDFS implementation where the top level IRP
is set before locking is actually attempted for Cc worker thread (lazy write/read ahead).
So in case locking fails, the top level IRP is set and never unset, and latter
call will hit the assert where it expects the top level IRP to be NULL.

Should be reported upstream (tm).

CORE-14315
2018-02-12 20:47:32 +01:00
Serge Gautherie d6fab4158e [FASTFAT] Improve code style in addition to 8294118174. 2018-01-07 19:29:23 +01:00
Pierre Schweitzer f0a1a5c773
[FASTFAT] Notify on file size change in FileAllocationInformation/FileEndOfFileInformation 2018-01-07 15:29:33 +01:00
Pierre Schweitzer 8294118174
[FASTFAT] Add a wrapper around FsRtlNotifyFullReportChange 2018-01-07 14:16:31 +01:00
Pierre Schweitzer 2a36b632ef
[FASTFAT] When a file gets overwritten, notify about the changes 2018-01-07 11:44:25 +01:00
Pierre Schweitzer ffeb3f070b
[FASTFAT] When overwriting a file, also update its write time 2018-01-07 11:34:41 +01:00
Pierre Schweitzer 0eacb0b1ef
[FASTFAT] When dealing with attributes on IRP_MJ_CREATE, filter user input to ensure we have only attributes we can handle.
This applies to files newly created, or for files overwritten where attributes are reset/modified.
2018-01-06 22:02:10 +01:00
Pierre Schweitzer 7bea4ec07e
[NTFS] Apply fix from 52f0726: allow partial info copy on dir enumeration on first entry return.
This is assorted with misc fixes to make this code closer to what we currently have in FastFAT.
This also allows fixing a memory leak in case of single entry return.

CORE-13367
2018-01-06 21:39:25 +01:00
Pierre Schweitzer 2b4d5c5cff
[FASTFAT] When overwriting a file with FILE_OVERWRITE*, don't erase previous file attributes, only update them.
Keep erasing them in case the file gets overwritten with FILE_SUPERSEDE.

CORE-14158
2018-01-01 14:29:15 +01:00
Pierre Schweitzer f3fecf92c1
[FASTFAT] On file overwrite, deny it if file as HIDDEN/SYSTEM flag and caller doesn't set them.
CORE-14158
2018-01-01 12:13:46 +01:00
Pierre Schweitzer d2a5322576
[NTFS] Start using different tags for allocations.
They all be Ntf? as for the Windows NTFS driver
2017-12-31 23:11:57 +01:00
Pierre Schweitzer 2d3d74151b
[NTFS] Fix a memory leak on error
CID 1427053
2017-12-31 14:18:02 +01:00
Pierre Schweitzer 216a2cae73
[NTFS] Use LookasideList allocations for FILE_RECORD_HEADER.
TODO: use a specific tag

This, and previous commit, should speed up a bit the driver until caching gets implemented
2017-12-31 14:14:24 +01:00
Pierre Schweitzer 3ddf44ff10
[NTFS] Use LookasideList allocations for NTFS_ATTR_CONTEXT.
TODO: use a specific tag
2017-12-31 12:15:17 +01:00
Pierre Schweitzer 849fa7fbae
[NTFS] Rewrite ReleaseAttributeContext() so that its null checks are consistent
CID 1427067
2017-12-31 10:38:58 +01:00
Pierre Schweitzer 007d3d382a
[NTFS] Don't dereference NULL IRP
CID 1427057
2017-12-31 10:38:58 +01:00
Pierre Schweitzer 7a88e3bfd4
[NTFS] Don't leak memory in case of failure while creating a directory
CID 1427065
2017-12-31 10:38:58 +01:00
Pierre Schweitzer 9d9cce2838
[NTFS] Don't leak attributes contextes in the btree management functions
CID 1427030, 1427062
2017-12-31 10:38:58 +01:00
Pierre Schweitzer 391056ba22
[NTFS] Don't leak memory when reading or writing non-resident attributes
CID 1427048, 1427070
2017-12-31 10:38:58 +01:00
Pierre Schweitzer 453e42beb5
[FASTFAT] Revert bd1e7bf: our VPB swapout implementation in FastFAT is buggy and
leaves volumes in half-(dis)mounted state and thus they get remounted while not
completely dismounted.
This can lead to major breakage and data corruption.
This requires deeper fixes (let's just drop that driver!).

CORE-14124
CORE-14126
CORE-14133
2017-12-25 11:24:13 +01:00
Pierre Schweitzer 5a650f6ba5
[FS] During 1st stage, disable any FS we don't support install to in order to let RawFS these volumes.
This avoids bloated setup and avoids potential bugs in 3rd party drivers.

This is following 806cd1.
2017-12-18 08:46:24 +01:00
Pierre Schweitzer bd1e7bf85e
[FASFAT] Enable FAT volume dismount using VPB swapout 2017-12-17 23:29:33 +01:00
Pierre Schweitzer 806cd16328
[SETUP] Remove FSDs which have broken dismount implementation.
This avoids issues when these partitions are formatted to FAT for setup.

For now, this commit doesn't change anything, but once IopParseDevice hack
gets removed, this will make a difference!

CORE-6305
2017-12-17 23:16:01 +01:00
Pierre Schweitzer dcd95c1a85
[FASTFAT] Add a comment (and an ASSERT) in VfatCreateFile() that shows that my stats code is broken... 2017-12-17 18:25:43 +01:00
Pierre Schweitzer 64bc96558e
[FASTFAT] While closing FCBs on dismount, release from tail to head and not the contrary.
It fixes assertion failure in vfatDestroyFCB() where we would have release parent before child.
This is still not perfect, but less bug prone...

With this commits (and ENABLE_SWAPOUT defined), ReactOS seems to unmount FAT volumes quite nice! :-)
(Tried with fsutil volume dismount X:)
2017-12-17 18:24:01 +01:00
Pierre Schweitzer de03686148
[FASTFAT] Fix a handle count leak on volume close. This can prevent locking a volume! 2017-12-17 18:24:01 +01:00
Pierre Schweitzer 27773dbb3f
[FASTFAT] When not able to lock a volume due to open handles, print open handles 2017-12-17 18:24:01 +01:00
Thomas Faber 03be7587eb
Merge branch 'ntfs_rebase' 2017-12-10 12:46:33 +01:00
Pierre Schweitzer b5555650a8
[NTFS] Fix the FileNamesInformation/FileNameInformation class confusion that was spotted on FastFAT.
What should also be fixed is the partial return of data on first entry enumeration.
2017-12-10 11:25:48 +01:00
Trevor Thompson 1ac7128da0 [NTFS] - Respect NTFS' file ordering when enumerating a directory. Split off part of BrowseIndexEntries() into a separate function to simplify the code.
AddNewMftEntry() - Zero the (larger) buffer for the bitmap prior to reading the bitmap.
BrowseIndexEntries() - Check sub-nodes before checking an index entry. Read and use the index bitmap when checking sub-nodes.
+BrowseSubNodeIndexEntries() - Called for sub-nodes of an index when browsing index entries.
+NtfsDumpData() - Diagnostic function which allows for visualizing a series of bytes.

svn path=/branches/GSoC_2016/NTFS/; revision=75817
2017-12-10 11:15:26 +01:00
Trevor Thompson a40ba448d4 [NTFS] - Fix some errors that break building in C89 mode, and remove an extraneous "ninja livecd" that got inserted in a comment. Thanks to Doug Lyons for spotting these errors.
SplitBTree() - comment-out redundant code for finding the median key and improve comments.

svn path=/branches/GSoC_2016/NTFS/; revision=75727
2017-12-10 11:15:25 +01:00
Trevor Thompson 52c30fdf37 [NTFS] - Add some helper functions for new features. Add some fixes. Add support for creating an index allocation, splitting a b-tree node, or "demoting" the index root. This allows for file creation without functional limitations.
+AddBitmap() - adds a $BITMAP attribute to a file record.
+AddIndexAllocation() - adds an $INDEX_ALLOCATION attribute to a file record.
+CountBTreeKeys() - Counts the number of linked B-Tree keys.
CreateIndexBufferFromBTreeNode() - Set INDEX_NODE_LARGE if the node has sub-nodes.
CreateIndexRootFromBTree() - Simplify the usage and math of MaxIndexSize; make it only account for the cumulative size of the index entries.
+DemoteBTreeRoot() - Replaces the contents of an index root with a dummy key, and puts those contents in a new node, which is made a child of the dummy key. This is done when an index root grows too large.
+GetIndexEntryVCN() - Retrieves the VCN from an index entry.
NtfsAddFilenameToDirectory() - Fix math for MaxIndexRootSize.
NtfsInsertKey() - Add support for splitting a B-Tree node. Don't check size of index root (that will be handled later).
+SplitBTreeNode() - Called when a B-Tree node grows too large.
UpdateIndexAllocation() - Create an $I30 index allocation attribute and bitmap attribute if needed.
UpdateIndexNode() - Update children before updating the current node. Store VCN of child nodes in the index entries of their respective keys.

svn path=/branches/GSoC_2016/NTFS/; revision=75707
2017-12-10 11:15:23 +01:00
Trevor Thompson 5e7c11842a [NTFS] - Fix increasing the mft size, to keep chkdsk happy.
IncreaseMftSize() - Add some fixes. Write blank records to newly-allocated mft entries, and update $MFTMirr when finished; these changes are needed for chkdsk.  Increase size by 64 records instead of 8.
+UpdateMftMirror() - Backs up the first ~4 master file table entries to the $MFTMirr file.

svn path=/branches/GSoC_2016/NTFS/; revision=75694
2017-12-10 11:15:21 +01:00
Trevor Thompson 9a91a51f17 [NTFS] - Fix for C89 compliance.
svn path=/branches/GSoC_2016/NTFS/; revision=75693
2017-12-10 11:15:19 +01:00
Trevor Thompson b033f00f58 [NTFS] - Add support for directory creation. Add some helper functions, some comments, and some fixes.
+AddIndexRoot() - Creates an $INDEX_ROOT attribute and adds it to a file record.
AddNewMftEntry() - Make sure the buffer used by RtlInitializeBitmap() is ULONG-aligned, and a ULONG-multiple in size, per MSDN.
AllocateIndexNode() - Calculate BytesNeeded correctly. Read $BITMAP attribute before increasing its length, in anticipation of a future commit that will check for a free bit before assigning a new index record to the end of the allocation. Use appropriate Set*AttributeDataLength() function, as $BITMAP can be resident or non-resident.
B_TREE_FILENAME_NODE - Give two members more accurate names: change "ExistsOnDisk" member to "HasValidVCN" and rename "NodeNumber" member "VCN."
+CreateEmptyBTree() - Creates a B-Tree to represent an empty directory (for AddIndexRoot).
+NtfsCreateEmptyFileRecord() - Creates an empty file record in memory, with no attributes.
CreateIndexRootFromBTree() - Fix TotalSizeOfEntries calculation.
+NtfsCreateDirectory() - Creates a file record for an empty directory and adds it to the mft.

svn path=/branches/GSoC_2016/NTFS/; revision=75692
2017-12-10 11:15:17 +01:00
Trevor Thompson c63e7e54b5 [NTFS] - When creating files:
-Don't add a preceding backslash when creating files on root.
-Use NTFS_FILE_NAME_POSIX name type if CaseSensitive option is specified.
-Don't try to create a file when a folder is requested (folder creation is still TODO).

svn path=/branches/GSoC_2016/NTFS/; revision=75671
2017-12-10 11:15:16 +01:00
Trevor Thompson 88a7c3d14b [NTFS] - Allow for creating a file when the index root gets too large and needs to be moved into an index record. Add some helper functions.
+AllocateIndexNode() - Allocates a new index record in an index allocation.
+CreateDummyKey() - Creates the final B_TREE_KEY for a B_TREE_FILENAME_NODE. Also creates the associated index entry.
GetSizeOfIndexEntries() - Sums the size of each index entry in every key in a B-Tree node.
+SetIndexEntryVCN() - Sets the VCN of a given IndexEntry.
NtfsInsertKey() - Handle instance when the index root grows too large. If it does, add its contents to a new sub-node, and replace contents with a dummy-key whose child is the new node.
UpdateIndexAllocation() - Update index entry if a key has just been assigned a child allocation.
UpdateIndexNode() - Make sure the node exists on disk, and allocate an index record for it if it doesn't.

svn path=/branches/GSoC_2016/NTFS/; revision=75557
2017-12-10 11:15:14 +01:00
Trevor Thompson d484d91eba [NTFS] - Allow for resizing an attribute in the middle of a file record. Add a helper function and minor improvements:
AddRun() - Allow for resizing the size of the data runs when the attribute isn't the last in the file record. Fix some comments.
CreateIndexBufferFromBTreeNode(), CreateIndexRootFromBTree - Fix math of IndexSize when checking if the index buffer is too large.
InternalSetResidentAttributeLength() - Allow changing the length of an attribute in the middle of a file record. Adjust the position of every attribute after the one being resized.
+MoveAttributes() - Moves a block of attributes to a new location in the file Record.
PrintAllVCNs() - Add consideration for an index allocation with a size of 0.
WriteAttribute() - Add optional parameter for a pointer to the file record being written to. If passed a file record, WriteAttribute() will skip reading the file record from disk, and will update the file record in memory before returning. This helps callers that use the file record after writing an attribute to stay in-sync with what's on disk.

svn path=/branches/GSoC_2016/NTFS/; revision=75554
2017-12-10 11:15:13 +01:00
Trevor Thompson 4dfcd1d582 [NTFS] - Refactor to allow the copy of the attribute stored in NTFS_ATTR_CONTEXT to have a dynamic length; change Record member from an NTFS_ATTR_RECORD to a PNTFS_ATTR_RECORD. Rename it pRecord to reinforce the change. Fix some bugs related to the record size changing.
-PrepareAttributeContext() - update to allocate memory for pRecord. Don't assume allocations are succeeding.
-ReleaseAttributeContext() - update to free memory for pRecord.
-InternalSetResidentAttributeLength() - Increase size of AttrContext->pRecord as needed. Update to return an NTSTATUS.
-SetResidentAttributeDataLength() - Fix bug that could occur when migrating resident attributes to non-resident if AttrContext->pRecord is too small for the new attribute.
-AddRun() - Fix a bug by reallocating AttrContext->pRecord if the record needs to be enlarged.

svn path=/branches/GSoC_2016/NTFS/; revision=75493
2017-12-10 11:15:11 +01:00
Trevor Thompson f2e47474f0 [NTFS] - Fix index entries storing the wrong allocated file size when the file is resident. Fix a typo in a DPRINT.
svn path=/branches/GSoC_2016/NTFS/; revision=75479
2017-12-10 11:15:09 +01:00
Trevor Thompson 92d1f92a61 [NTFS] - Add some improvements to B-Tree support. Add preliminary support for trees of arbitrary depth. Add support for creating files in directories which have an index allocation, provided there aren't too many files and the node doesn't need to be split.
-CreateBTreeFromIndex() - Fix memory allocation; allocate sizeof(B_TREE_KEY) bytes for the key, not the size of the pointer. Add support for child nodes. Update parameter list.
-CreateIndexRootFromBTree() - Update Header->Flags if any of index root's keys have sub-nodes.
+CreateIndexBufferFromBTreeNode() - Converts a B-Tree node to an index buffer to be written to the index allocation.
+UpdateIndexAllocation() - Updates all of the stale nodes in an index allocation based on a PB_TREE.
+UpdateIndexNode() - Writes a B-Tree node into the index allocation.
+CreateBTreeKeyFromFilename() - Creates a PB_TREE_KEY based on a FILENAME_ATTRIBUTE.
-DestroyBTreeKey() - Destroy a child node, if present.
-DumpBTreeKey() - Dump a child node, if present.
-DumpBTreeNode() - Include Node->KeyCount in output.
-NtfsAddFilenameToDirectory() - Call UpdateIndexAllocation() prior to CreateIndexRootFromBTree().
-Update B_TREE_FILENAME_NODE with members to keep track of its existence on disk.

svn path=/branches/GSoC_2016/NTFS/; revision=75428
2017-12-10 11:15:08 +01:00
Trevor Thompson b1eab36f6b [NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out of the last commit.
svn path=/branches/GSoC_2016/NTFS/; revision=75425
2017-12-10 11:15:06 +01:00
Trevor Thompson 5579428b4f [NTFS] - Add some utility functions and improve some comments. Improve NtfsAddFilenameToDirectory().
+PrintAllVCNs() - Diagnostic function which prints VCN of every node in an index allocation.
+GetAllocationOffsetFromVCN() - Calculates location of an index buffer from the node's VCN.
+GetInfoClassName() - Gets a string representation of an info class enumeration, to speed up development of unimplemented classes.
-NtfsSetInformation() & NtfsQueryInformation() - Use GetInfoClassName to report unhandled information classes.
-CompareTreeKeys() - Add a comment and clarify some comments.
-NtfsAddFilenameToDirectory() - Don't try to update the size of Index Root on disk if the attribute length hasn't changed.

svn path=/branches/GSoC_2016/NTFS/; revision=75424
2017-12-10 11:15:04 +01:00
Trevor Thompson 9cef425464 [NTFS] - After creating a new file, update creation disposition before calling NtfsCreateFile() recursively. This fixes creating a file via right-clicking in a folder.
svn path=/branches/GSoC_2016/NTFS/; revision=75423
2017-12-10 11:15:03 +01:00
Trevor Thompson 935fcd1b35 [NTFS] - Fix some more issues, including remaining issues marked as "unresolved" from CR-123:
-Add define for indexed flag for resident attributes, RA_INDEXED.
-CreateBTreeFromIndex() - Don't try to read index entries beyond attribute length.
-Move NtfsAddFileNameToDirectory() from dirctl.c to mft.c (no changes to function).
-SetResidentAttributeDataLength() - Don't try to free AttribData if it hasn't been allocated. Cast IndexRecord to PUCHAR for WriteAttribute(), and cast BitmapData to PCHAR for ReadAttribute() (make gcc happy).
-Replace magic number 16 with a define, NTFS_FILE_FIRST_USER_FILE.

svn path=/branches/GSoC_2016/NTFS/; revision=75371
2017-12-10 11:15:01 +01:00
Trevor Thompson 430ce0a9e3 [NTFS] - Fix some formatting / style issues, per CR-123.
svn path=/branches/GSoC_2016/NTFS/; revision=75290
2017-12-10 11:15:00 +01:00
Trevor Thompson 5ab24a5aae [NTFS] - Add a few fixes and improvements, most from CR-123:
-Add ATTR_RECORD_ALIGNMENT define to replace magic value of 8 when we need to adjust an attribute's beginning or length.
-Don't use int's.
-GetPackedByteCount() - Remove unused "bytes" variable.

svn path=/branches/GSoC_2016/NTFS/; revision=75288
2017-12-10 11:14:58 +01:00
Trevor Thompson 68a48b2758 [NTFS] - Add some fixes and improvements to mft.c from CR-123:
FindAttribute() - Use * sizeof(WCHAR) in place bit-shifting wizardry.
IncreaseMftSize() - Remove two useless casts. Return error code if WriteAttribute() fails.
SetNonResidentAttributeDataLength() - Assert that AttrContext parameter describes a NonResident attribute. When migrating a resident attribute to non-resident, don't leak memory if FsRtlInitializeLargeMcb() throws an exception, and don't mark the attribute as non-resident until after the Mcb is initialized.
InternalSetResidentAttributeLength() and SetResidentAttributeLength() - Assert that AttrContext parameter describes a resident attribute.
AddNewMftEntry() - Simplify math of backing up and restoring reserved bits by changing BitmapData to PUCHAR type. Don't attempt to modify a volume with more than 2^32 clusters.
AddFixupArray() - Use ULONG in place of int.

svn path=/branches/GSoC_2016/NTFS/; revision=75284
2017-12-10 11:14:56 +01:00
Trevor Thompson 34696e49fc [NTFS] - Add some fixes and improvements to finfo.c from CR-123:
NtfsSetEndOfFile() - Make fileNameAttribute and filename variables uppercase. Don't leak FileRecord if we can't truncate the file. Don't leak memory if there's no FileName attribute.

svn path=/branches/GSoC_2016/NTFS/; revision=75283
2017-12-10 11:14:55 +01:00
Trevor Thompson 39a06fae0d [NTFS] - Add some fixes and improvements to create.c, dirctl.c and fcb.c from CR-123:
-NtfsOpenFile() - Replace an ExFreePool() with ExFreePoolWithTag().
-NtfsCreateFile() - Fix broken cast with BooleanFlagOn() macro.
-NtfsAddFilenameToDirectory() - Remove an extra cast. Return an error if we fail to allocate I30IndexRoot. 
-NtfsGetNextPathElement(), NtfsWSubString(), NtfsGetFCBForFile() - Use PCWSTR in place of const PWCHAR or PWCHAR  where it makes sense.

svn path=/branches/GSoC_2016/NTFS/; revision=75281
2017-12-10 11:14:53 +01:00
Trevor Thompson 7e9acb7dda [NTFS] - Add some fixes and improvements to btree.c from CR-123:
-CompareTreeKeys() - Assert that the first key isn't the dummy key.
-CreateIndexRootFromBTree() - Assert that CurrentKey->IndexEntry->Length isn't 0.
-DumpBTreeKey() - Use sizeof(WCHAR) in place of magic 2.
-NtfsInsertKey() - Check for allocation failure of NewKey.

svn path=/branches/GSoC_2016/NTFS/; revision=75280
2017-12-10 11:14:51 +01:00
Trevor Thompson e5cc846555 [NTFS] - Add some fixes and improvements to attribute.c from CR-123:
-AddFileName() - Don't use dedicated buffer for FileNameNoPath, just point into FileObject->FileName's buffer. Don't use RtlCopyUnicodeString(), just update pointers.
-AddRun() - Fix an SEH2_YIELD with missing return statement.
-FreeClusters() - Use ULONG_MAX in place of 0xffffffff.
-NtfsDumpIndexRootAttribute() - Use consistent UpperCase naming convention. Use BooleanFlagOn() macro where appropriate. Replace magic 8 with sizeof(ULONGLONG).
-GetFileNameAttributeLength() - Add documentation.

svn path=/branches/GSoC_2016/NTFS/; revision=75279
2017-12-10 11:14:50 +01:00
Trevor Thompson f5b7f90f23 [NTFS] - Fix UpdateFileNameRecord() when the file being updated resides in $INDEX_ROOT. Also, don't attempt to read beyond size of index root attribute, and check return value after reading.
svn path=/branches/GSoC_2016/NTFS/; revision=75278
2017-12-10 11:14:48 +01:00
Trevor Thompson 612facc28f [NTFS] - Fix AddFileName() when the file path is two or more directories deep.
svn path=/branches/GSoC_2016/NTFS/; revision=75277
2017-12-10 11:14:47 +01:00
Trevor Thompson 16204ed3a7 [NTFS] - Fix gcc build. Fix CompareTreeKeys(): Don't consider Key1 a possible dummy key. Don't assume filenames are the same length.
svn path=/branches/GSoC_2016/NTFS/; revision=75228
2017-12-10 11:14:45 +01:00
Trevor Thompson 2dc4938549 [NTFS] - Fix a couple of issues spotted by Thomas: Maintain alphabetical ordering of CMakeLists.txt, fix casts to BOOLEAN with BooleanFlagOn macro.
svn path=/branches/GSoC_2016/NTFS/; revision=75224
2017-12-10 11:14:43 +01:00
Trevor Thompson 54f5c3b6ec [NTFS] - Begin to implement B-Trees. Allow for creating several new files in a directory.
NtfsAddFilenameToDirectory() - Add CaseSensitive parameter. Update to use new B-Tree code: First, the index is read and converted to a B-Tree in memory. Next, a key for the new file is inserted into the tree. Finally, the tree is converted back to an index root attribute which is written to disk.
+btree.c - Includes functions related to B-Trees (AKA B*Trees).
ntfs.h - Added several structures for representing B-Trees in memory.
Known limitations: For simplicity, only trees with a depth of one are currently supported (i.e. an ordered list of filenames). Directories that have or will require an index allocation to store all their filenames are still TODO. As a consequence, the user will only be able to create about 6 files in a directory.

svn path=/branches/GSoC_2016/NTFS/; revision=75223
2017-12-10 11:14:42 +01:00
Trevor Thompson 38c947b7ab [NTFS] - Add some minor fixes and improvements:
Improve, add, or fix some DPRINTs. In particular, ULONG's should use %lu, not %u. Also, don't be silent about filesystem corruption.
NtfsFindMftRecord() - move CaseSensitive parameter before output parameter in parameter list.

svn path=/branches/GSoC_2016/NTFS/; revision=75199
2017-12-10 11:14:40 +01:00
Trevor Thompson e4aab26781 [NTFS] - Fix creation of files with long filenames.
svn path=/branches/GSoC_2016/NTFS/; revision=75193
2017-12-10 11:14:39 +01:00
Trevor Thompson 8bb62e20d3 [NTFS] - In the NtfsAddFilenameToDirectory() function, rename DirectoryContext parameter to the more descriptive, and accurate, IndexRootContext (to simplify the next commit).
svn path=/branches/GSoC_2016/NTFS/; revision=75192
2017-12-10 11:14:37 +01:00
Trevor Thompson 948e91907a [NTFS] - Fix a mistake with AddFileName() from my last commit. Also, move CaseSensitive parameter before output parameters in the parameter list of several functions.
svn path=/branches/GSoC_2016/NTFS/; revision=75191
2017-12-10 11:14:35 +01:00
Trevor Thompson 032be02954 [NTFS] - Fix POSIX rules. Fix accessing long filenames created in Windows when 8dot3 name creation is disabled.
Whether or not a filename should be interpreted as case-sensitive is dependent on a flag passed to the driver when a file is created (opened); it's separate from the namespace associated with the file being accessed.

svn path=/branches/GSoC_2016/NTFS/; revision=75178
2017-12-10 11:14:34 +01:00
Trevor Thompson 98ddf610bc [NTFS] - Fix IncreaseMftSize(); check IrpContext to see if waiting for exclusive access to the MFT is allowed. As pointed out by Pierre.
svn path=/branches/GSoC_2016/NTFS/; revision=75170
2017-12-10 11:14:32 +01:00
Trevor Thompson 9ab86116a9 [NTFS] - Add support for expanding the master file table. Fix a bug with BrowseIndexEntries(). Improve diagnostic output.
-AddNewMftEntry() - Increase size of MFT as needed. Fix math for bitmap length. Don't assign file records to MFT indices 0x10 - 0x17; In Windows, these records aren't used unless they have to be, even though they are marked as unused in the bitmap.
+IncreaseMftSize() - Adds room for additional file records in the master file table.
-BrowseIndexEntries() - allow for the rare situation when a non-system file has an MFT index of 0x10.

svn path=/branches/GSoC_2016/NTFS/; revision=75056
2017-12-10 11:14:30 +01:00
Trevor Thompson 1417f286e0 [NTFS] - Restructure some code in preparation for the next commit:
-SetAttributeDataLength() has been split into two functions, SetNonResidentAttributeDataLength() and SetResidentAttributeDataLength(). This should improve code readibility and allows for resizing an attribute when there's no FileObject associated with it.
-Added "MftDataOffset" member to DEVICE_EXTENSION, which stores the offset of the Mft's $DATA attribute. (I'm starting to think it's better to add a member for offset to NTFS_ATTR_CONTEXT directly, but I'll save that level of restructuring for a future commit.)

svn path=/branches/GSoC_2016/NTFS/; revision=75055
2017-12-10 11:14:29 +01:00
Trevor Thompson 9dce6f4db1 [NTFS] - Add some improvements to the previous commit, as suggested by Thomas.
svn path=/branches/GSoC_2016/NTFS/; revision=75054
2017-12-10 11:14:27 +01:00
Trevor Thompson e0048b1362 [NTFS] - Add the most basic support for file creation. Expand diagnostic output, especially in NtfsDumpIndexRootAttribute(). Replace an ExFreePool() with ExFreePoolWithTag().
AddFileName() - Add a parameter to receive the Mft index of the parent directory. Fix so the name of the file will be stored in the attribute, not the name of the directory.
NtfsCreateFile() - Open a file that was successfully created, instead of assuming failure.
NtfsCreateFileRecord() - Add the filename attribute of the created file to the parent directory's index.
+NtfsAddFilenameToDirectory() - Adds a $FILE_NAME attribute to a given directory index. Presently, a file can be created in an empty directory only.
AddNewMftEntry() - Add a parameter to receive the mft index where the new entry was stored.

svn path=/branches/GSoC_2016/NTFS/; revision=74970
2017-12-10 11:14:26 +01:00
Trevor Thompson 4ca9151300 [NTFS] - Decrease debug spam
svn path=/branches/GSoC_2016/NTFS/; revision=74694
2017-12-10 11:14:24 +01:00
Trevor Thompson 037d88201d [NTFS] - Disable write support by default. Enable it via the registry.
[BOOTDATA] - Add a commented-out section to hivesys.inf which can add the required key to enable NTFS write support.

svn path=/branches/GSoC_2016/NTFS/; revision=74685
2017-12-10 11:14:22 +01:00
Trevor Thompson 7f762aac01 [NTFS] - Add support for changing a file's size via SetEndOfFile():
-Handle IRP_MJ_SET_INFORMATION IRP requests.
+NtfsSetEndOfFile() - Sets the end of file (file size) for a given file.
+NtfsSetInformation() - Sets the specified file information. At this point, only FileEndOfFileInformation is fully implemented. FileAllocationInformation is handled the same way and not truly implemented, but this works well enough for SetEndOfFile().
Overwriting a file in NTFS should now work in the majority of use cases.

svn path=/branches/GSoC_2016/NTFS/; revision=74675
2017-12-10 11:14:21 +01:00
Trevor Thompson 58402b6730 [NTFS] - Fix a bug with last commit, as spotted by Pierre.
svn path=/branches/GSoC_2016/NTFS/; revision=74525
2017-12-10 11:14:19 +01:00
Trevor Thompson c25b9747a1 [NTFS] - Expand support for resizing resident attributes and fix NtfsAllocateClusters().
-Modify SetAttributeDataLength() to allow a resident attribute to migrate to non-resident if the attribute grows too large to remain resident.
-Fix values returned by NtfsAllocateClusters() in case of error; return error codes, not 0.

svn path=/branches/GSoC_2016/NTFS/; revision=74524
2017-12-10 11:14:18 +01:00
Trevor Thompson 52b9f46776 [NTFS] - Commit early results of a small restructuring effort:
-Add a new member to the NTFS_ATTR_CONTEXT struct, a LARGE_MCB. This allows an attribute context to describe the cluster mapping of a non-resident file while allowing that mapping to change dynamically, without the context itself needing to be resized. This fixes problems which sometimes arose from resizing files.
-Remove hacky code from NtfsWriteFile() for dealing with "stale" contexts. This fixes that issue.
-Update SetDataAttributeLength(), PrepareAttributeContext(), ReleaseAttributeContext(), FreeClusters(), and AddRun() for the new member.
-Update ReadAttribute() and WriteAttribute() to work with the changed structure. A very-soon-to-come commit will overhaul these functions so they'll operate directly on the LARGE_MCB, instead of converting to and from a packed list of data runs. (Sparse files are broken until then.)
-Rename "RunBufferOffset" to "RunBufferSize" in several places where appropriate.
-Fix, improve, and add some comments.

svn path=/branches/GSoC_2016/NTFS/; revision=74523
2017-12-10 11:14:16 +01:00
Trevor Thompson 0409b3161e [NTFS] Add support for creating new MFT entries:
+AddStandardInformation(), +AddData(), +AddFileName() - Add attributes to a file record
+NtfsCreateFileRecord() - Creates a new file record and saves it to the MFT.
+AddNewMftEntry() - Adds a file record to the MFT.
NtfsCreateFile() - Modified to create a file record on a file-creation request (file creation is still unsupported; the created file needs to be added to the parent's directory index).
+SetFileRecordEnd() - Establishes a new file record size
UpdateFileRecord() - Improved documentation
InternalSetResidentAttributeLength() - Updated to use SetFileRecordEnd().

svn path=/branches/GSoC_2016/NTFS/; revision=74321
2017-12-10 11:14:14 +01:00
Trevor Thompson 7643831d56 [NTFS]
+NtfsDumpFileRecord() - Provides diagnostic information about a file record.

svn path=/branches/GSoC_2016/NTFS/; revision=72424
2017-12-10 11:14:13 +01:00
Trevor Thompson 6ab3072098 [NTFS]
*UpdateFileRecord() - Fix a DPRINT

svn path=/branches/GSoC_2016/NTFS/; revision=72423
2017-12-10 11:14:11 +01:00
Trevor Thompson 8b893c8e30 [NTFS]
Add some fixes to attrib.c, as suggested by Pierre Schweitzer:
*ConvertLargeMCBToDataRuns() - Use MS portable type, ULONG, for variable i.
*FreeClusters(), AddRun() - Check for invalid parameter before allocating memory, and confirm the memory is allocated.
*ConvertDataRunsToLargeMCB(), AddRun() - Avoid code duplication by using ExRaiseStatus() in try block, and return accurate status via _SEH2_GetExceptionCode().

svn path=/branches/GSoC_2016/NTFS/; revision=72422
2017-12-10 11:14:10 +01:00
Trevor Thompson 920e2f0216 [NTFS]
+FreeClusters(). Fix a DPRINT.

svn path=/branches/GSoC_2016/NTFS/; revision=71968
2017-12-10 11:14:08 +01:00
Trevor Thompson ed1b4bf9bc [NTFS]
Address some minor issues with attrib.c: Fix gcc build. Fix formatting.

svn path=/branches/GSoC_2016/NTFS/; revision=71957
2017-12-10 11:14:07 +01:00
Trevor Thompson d09e1398f8 [NTFS]
*AddRun() - Don't leak RunBuffer when encountering errors.
Handle exception from FsRtlAddLargeMcbEntry().

svn path=/branches/GSoC_2016/NTFS/; revision=71945
2017-12-10 11:14:05 +01:00
Trevor Thompson afe40eb054 [NTFS]
Implement AddRun(). Add support functions and documentation.
+ConvertDataRunsToLargeMCB()
+ConvertLargeMCBToDataRuns()
*SetAttributeDataLength(), *NtfsWriteFile() - Update for AddRun() implementation. Add hack to SetAttributeDataLength() to allow notepad.exe to save files until freeing clusters is implemented.

svn path=/branches/GSoC_2016/NTFS/; revision=71942
2017-12-10 11:14:03 +01:00
Trevor Thompson a135ef5864 [NTFS]
Various minor changes to fix GCC build.

svn path=/branches/GSoC_2016/NTFS/; revision=71922
2017-12-10 11:14:02 +01:00
Trevor Thompson 63e83c7ffc [NTFS]
Add support functions, fix warning from previous commit.
+NtfsDumpDataRuns(), +NtfsDumpDataRunData() - Provide diagnostic output.
+GetPackedByteCount() - Used to encode data runs.

svn path=/branches/GSoC_2016/NTFS/; revision=71921
2017-12-10 11:14:00 +01:00
Trevor Thompson 268a139e63 [NTFS]
UpdateFileRecord() - Remove fixup array before returning.

svn path=/branches/GSoC_2016/NTFS/; revision=71920
2017-12-10 11:13:58 +01:00
Trevor Thompson 7c576a836f [NTFS]
Add error-checking to InternalGetNextAttribute(); don't crash if CurrAttr->Length is invalid.

svn path=/branches/GSoC_2016/NTFS/; revision=71897
2017-12-10 11:13:57 +01:00
Trevor Thompson de5cff4b37 [NTFS]
Fix broken check for free disk space in NtfsAllocateClusters().

svn path=/branches/GSoC_2016/NTFS/; revision=71858
2017-12-10 11:13:55 +01:00
Trevor Thompson 7a6e9bcdf6 [NTFS]
Simplify GetLastClusterInDataRun() and clean up NtfsAllocateClusters(). No functional changes.

svn path=/branches/GSoC_2016/NTFS/; revision=71857
2017-12-10 11:13:54 +01:00
Trevor Thompson c08d37d182 [NTFS]
Simplify and optimize InternalSetResidentAttributeLength(), as suggested by Pierre.

svn path=/branches/GSoC_2016/NTFS/; revision=71837
2017-12-10 11:13:52 +01:00
Trevor Thompson 7eb1264f5f [NTFS]
Fix copy-paste error in SetAttributeDataLength()

svn path=/branches/GSoC_2016/NTFS/; revision=71832
2017-12-10 11:13:50 +01:00
Trevor Thompson 760cdfb5aa [NTFS]
Add ability to write to resident attributes.
SetAttributeDataLength() - Check if the file is memory mapped before truncating
+InternalSetResidentAttributeLength() - Used by SetAttributeDataLength()

svn path=/branches/GSoC_2016/NTFS/; revision=71820
2017-12-10 11:13:49 +01:00
Trevor Thompson 25fdabd8ca [NTFS]
Fix typo in NtfsAllocateClusters(), spotted by ThFabba.

svn path=/branches/GSoC_2016/NTFS/; revision=71697
2017-12-10 11:13:35 +01:00
Trevor Thompson 77fc65dc0e [NTFS]
Lay some groundwork for extending allocation size.
+AddRun() - Unimplemented
+GetLastClusterInDataRun()
+NtfsAllocateClusters()

svn path=/branches/GSoC_2016/NTFS/; revision=71696
2017-12-10 11:13:33 +01:00
Trevor Thompson 84a1280fd6 [NTFS]
Allow for an existing file to be opened with FILE_OVERWRITE, FILE_OVERWRITE_IF, or FILE_SUPERSEDE dispositions, and truncate that file. This allows for a file to be opened and saved in Notepad.exe [provided that file is non-resident and its allocation size doesn't need to change].

svn path=/branches/GSoC_2016/NTFS/; revision=71680
2017-12-10 11:13:31 +01:00
Trevor Thompson f47efca89f [NTFS]
Remove unused parameter from SetAttributeDataLength.

svn path=/branches/GSoC_2016/NTFS/; revision=71677
2017-12-10 11:13:30 +01:00
Trevor Thompson a7a2c0d734 [NTFS]
Update a file's size in the relevant $FILE_NAME attribute of the index entry in the parent directory.
+UpdateFileNameRecord() - Searches a parent directory for the proper index entry, then updates the file sizes in that entry.
+UpdateIndexEntryFileNameSize() - Recursively searches directory index and applies the size update.

svn path=/branches/GSoC_2016/NTFS/; revision=71664
2017-12-10 11:13:28 +01:00
Trevor Thompson 4f8133f44b [NTFS]
Fix Up AddFixupArray - It needs to accept a PNTFS_RECORD_HEADER for parameter 2, not a PFILE_RECORD_HEADER.

svn path=/branches/GSoC_2016/NTFS/; revision=71662
2017-12-10 11:13:26 +01:00
Trevor Thompson ba33b9faac [NTFS]
When writing to a file, increase the file size if trying to write past the end.
*FindAttribute() has been given an optional pointer to a ULONG that will receive the offset of the found attribute from the beginning of the record. This is to allow for found attributes to be written back into their file records.
+SetAttributeDataLength()
+UpdateFileRecord() - Updates a file record in the master file table at a given index.
+AddFixupArray() - Prepares a file record or directory index for writing to the disk.

svn path=/branches/GSoC_2016/NTFS/; revision=71660
2017-12-10 11:13:25 +01:00
Trevor Thompson ea6b9622c4 [NTFS]
Add fixes to WriteAttribute():
-Remove erroneous check for end of run (before writing to the last run returned)
-Properly dereference RealLengthWritten pointer, as reported in CR-90

svn path=/branches/GSoC_2016/NTFS/; revision=71616
2017-12-10 11:13:23 +01:00
Trevor Thompson 58a13831ef [NTFS]
Added minimal write support from CORE-10998 along with updates as suggested by CR-90.

svn path=/branches/GSoC_2016/NTFS/; revision=71224
2017-12-10 11:13:19 +01:00
Pierre Schweitzer 18d6584da4
[FASTFAT] Fix FastFAT not returning short name for FAT volumes in FileBothDirectoryInformation case
This is likely due to a copy paste error where long name was copied twice and short never.
Fun fact: this was not affecting FATX volumes
Fun fact2: this was defeating a buffer overflow check and thus was allowing buffer overflow!

CORE-14088
2017-12-09 21:22:55 +01:00
Pierre Schweitzer bddb0db469
[FASTFAT] Finally drop the FileNameInformation class for directories.
It makes no sense for them and shouldn't be implemented.
It's an addendum to 9f3c801.
2017-12-09 14:37:07 +01:00
Pierre Schweitzer 28343c6c0c
[FASTFAT] Fix size checking in VfatGetFileNameInformation() 2017-12-09 12:45:16 +01:00
Pierre Schweitzer 9f3c80193e
[FASTFAT] Don't mix FileNameInformation and FileNamesInformation (and support the later).
This commit fixes weird behavior in our FastFAT implementation. It was mixing two classes:
FileNameInformation and FileNamesInformation. It was handling FileNameInformation like
FileNamesInformation and was filling buffer with FILE_NAMES_INFORMATION structure instead
of FILE_NAME_INFORMATION structure (how many things did that break?!).
Also, it wasn't implementing the FileNamesInformation class at all. This is required by
ntdll_winetest:directory which doesn't expect it to fail and thus, attempts to read
never filled in memory.

This commit fixes the winetest crash, and may fix other weird FS behavior.

CORE-13367
2017-12-09 12:37:34 +01:00
Pierre Schweitzer e95751ab78
[FASTFAT] Calculate more accurately buffer length in VfatGetAllInformation(). 2017-12-09 10:59:37 +01:00
Pierre Schweitzer 52f0726817
[FASTFAT] Allow partial returns on directory info query for first entry.
This mimics what MS FastFAT does and fixes (a bit) ntdll_winetest:directory.
It still crashes, but go farther.

CORE-13367
2017-12-09 10:58:19 +01:00
Amine Khaldi 00124d1b1a [CMAKE/CLANG-CL] Silence some clang-cl warnings in consistency with our gcc build. 2017-12-07 21:53:45 +01:00
Pierre Schweitzer 9d67a24799
[CDFS_NEW] Fix broken cast.
Spotted by Thomas
2017-11-25 20:15:28 +01:00
David Quintana 67a7e45e35 [CDFS_NEW] Address review comments:
- Don't define-out volatile.
- Cleanup the ros-specific hdd-backed device object on shutdown.
- Fix hdd-backed use. Required a rather ugly hack.
- Update README.FSD
2017-11-25 13:36:47 +01:00
David Quintana 6a3bbf24e0 Revert "[CDFS_NEW] Use CdAcquireForCreateSection from the old driver in place of the newer CdFilterCallbackAcquireForCreateSection."
This reverts commit 8410d03275.
2017-11-25 13:36:47 +01:00
David Quintana ec26cde4a1 [CDFS_NEW] Accept STATUS_NOT_IMPLEMENTED for IOCTL_CDROM_READ_TOC_EX fallback to IOCTL_CDROM_READ_TOC. 2017-11-25 13:36:47 +01:00
David Quintana bc2378a356 [CDFS_NEW] Use CdAcquireForCreateSection from the old driver in place of the newer CdFilterCallbackAcquireForCreateSection. 2017-11-25 13:36:47 +01:00
David Quintana 5429771b99 [CDFS_NEW] Re-apply many of the reactos-specific changes and fix build.
- Also, get rid of the old diff file.
2017-11-25 13:36:47 +01:00
David Quintana fd34548263 [CDFS_NEW] Replace old driver with a Ms-PL licensed version straight out of the driver samples github repository. 2017-11-25 13:36:47 +01:00
Pierre Schweitzer 3013e153b0
[FASTFAT_NEW] Fix build with FASTFATDBG set 2017-11-24 12:00:10 +01:00
Pierre Schweitzer 0daa5547d9
[FASTFAT_NEW] Import again FastFAT from MS. This time from GitHub for license reasons.
This implies that a sample for W10.
It has been backported to NT5.2; not sure how it would work on a W2K3 (feel free to test!)
2017-11-23 23:27:51 +01:00
Pierre Schweitzer a913501626
[FASTFAT_NEW] This is not permitted by WDK license.
We should rather import from MS GitHub and backport to NT5.2.
2017-11-23 15:04:05 +01:00
Pierre Schweitzer f15769d958
[FASTFAT_NEW] Fix build with FASTFATDBG set 2017-11-23 14:18:50 +01:00
Amine Khaldi 09c06a2f45 [CLANG-CL] Initial commit that allows us to compile ReactOS with clang-cl. 2017-11-23 14:09:57 +01:00
Pierre Schweitzer aeadcaf515
[FASTFAT] Import the MS FastFAT sample from WXP.
Modified it so that it builds in trunk (with GCC, though).
Not to be switched for now, as it doesn't work in ReactOS (yet?).
2017-11-23 12:35:51 +01:00
Pierre Schweitzer 8503842309
[FASTFAT] More FS statistics 2017-11-21 22:18:11 +01:00
Amine Khaldi b3172ae098 [EXT2FS] For some reason we get error: conflicting types for 'do_split' when compiling with clang-cl so work around this with FIXMEs. CORE-11799 (#94) 2017-11-19 15:42:03 +01:00
Amine Khaldi 06b0cc74c5 [REISERFS] Do not take this code path when compiling with clang. CORE-11799 (#94) 2017-11-19 15:24:49 +01:00
Pierre Schweitzer ec6b3ecbe4
[CDFS] Attempt to a switch to the MS CDFS driver.
To be reverted if it brings in too many regressions, even though I tried to do my best to address them.

Leaving the old driver in place, for now; if no regressions are reported regarding CDFS in 0.4.8, then old driver could be dropped for 0.4.9.
2017-11-18 18:32:36 +01:00
Pierre Schweitzer f723d230a0
[CDFS_NEW] _SEH2_FINALLY implement SEH support for real instead of its current stub.
This notably fixes BSOD on media change
2017-11-17 22:20:13 +01:00
Pierre Schweitzer faee3753ea
[CDFS_NEW] Now NtWriteFile is fixed, revert 5f25582, ie remove FastIO hack from the driver
CORE-14003
2017-11-12 22:39:40 +01:00
Pierre Schweitzer 5f255827d3
[CDFS_NEW] Following 1bef487, add a hack and stub FastIO write routine to avoid bugchecks on write attempts.
This allows booting the ReactOS LiveCD as HDD image in Qemu without issues :-)
2017-11-12 21:16:31 +01:00
Pierre Schweitzer cbf0430b56
[CDFS_NEW] Bugfix for f88fe43: don't delete devices twice on shutdown.
With that bugfix, I can install ROS from ISO on HDD without troubles :-)
CORE-13184
2017-11-12 18:58:43 +01:00
Pierre Schweitzer 6c73385625
[CDFS_NEW]
Restore the ability to restore installing from disk image.
CORE-13184
2017-11-12 18:39:40 +01:00
Pierre Schweitzer a1d7e9936d
[EXT2] Upgrade to 0.69
CORE-13980
2017-11-12 10:48:17 +01:00
Pierre Schweitzer 94298313c0
[CDFS_NEW] Fix diff 2017-11-07 07:54:50 +01:00
Pierre Schweitzer e88eeb21af
[NTOSKRNL] Make the CcWaitForCurrentLazyWriterActivity() stub return success instead of hacking FSDs.
Suggested by Thomas
2017-11-06 21:45:55 +01:00
Pierre Schweitzer 03d5be6437
[CDFS_NEW] Add a hack that allows locking a volume and thus, unmounting it. All that work, just to be able to do this... 2017-11-06 20:09:23 +01:00
Pierre Schweitzer fa1c60db50
[CDFS_NEW] You know... RBuild has been gone for ages! 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 8b2fd60829
[CDFS_NEW] Add a CMakeFile and a registry file. When using both, you get a driver that builds and works in ROS. Could install ROS with it! :-) 2017-11-06 20:02:16 +01:00
Pierre Schweitzer e4da7ecc50
[CDFS_NEW] Remove a broken change (lol?!) that prevented the driver to properly work in ROS... Dropping SEH doesn't mean dropping code! 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 7b19676e2b
[CDFS_NEW] Force calling convention to allow build 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 3d4b8783fd
[CDFS_NEW] Force calling convention to allow build 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 818025ecc8
[CDFS_NEW] Remove a no longer required build hack 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 2639dd6736
[CDFS_NEW] Remove a no longer required build hack 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 755bdb5d0b
[CDFS_NEW] Remove a no longer required build hack 2017-11-06 20:02:16 +01:00
Pierre Schweitzer 3cbcb1bade
[CDFS_NEW] Fix headers inclusion so that it can work on a *nix platform 2017-11-06 20:02:16 +01:00
Pierre Schweitzer f65b294f21
[CDFS] Set the FO_CLEANUP_COMPLETE on cleanup 2017-11-05 13:57:41 +01:00
Pierre Schweitzer 244b4f99b3
[CDFS] Don't allow FS opening when volume is locked 2017-11-05 13:57:41 +01:00
Pierre Schweitzer a2ed758a20
[CDFS] Addendum to 03a9d8c: check for volume state (locked?) before opening a file
CORE-13957
2017-11-04 21:31:35 +01:00
Pierre Schweitzer 03a9d8c7ca
[CDFS] Implement volume un/locking.
CORE-13957
2017-11-04 21:29:51 +01:00
Pierre Schweitzer b30670ba43
[CDFS] Don't use uninit var. Fixes MSVC build (good boy :-)) 2017-11-04 21:23:11 +01:00
Pierre Schweitzer 95447d2fd1
[CDFS] Implement open handle count 2017-11-04 21:14:50 +01:00
Pierre Schweitzer fa0327d6c5
[CDFS] Remove the VPB field from the VCB. Not only it was never set, but the only times it was used was broken! 2017-11-04 19:46:52 +01:00
Amine Khaldi 5bf1fbec49 [UDFS] Do not take some of the msvc codepaths when compiling with clang-cl due to issues such as inline assembly support. CORE-11799 (#94) 2017-10-28 13:52:44 +01:00
Pierre Schweitzer 361664d57f [FFS] Don't leak on failure
CID 1363596
2017-10-23 10:35:21 +02:00
Pierre Schweitzer 34d74fbd17 [FFS] Don't leak memory on volume mount
CID 1363583
2017-10-23 10:35:21 +02:00
Pierre Schweitzer 19bf484a5b [FFS] Don't allocate (and leak :-)) an unused event
CID 1363607
2017-10-23 10:35:21 +02:00
Pierre Schweitzer 5c5d20e50c [REISERFS] Don't leak on failure
CID 1363597
2017-10-22 22:51:02 +02:00
Pierre Schweitzer 2df125472b [REISERFS] Don't leak on failure
CID 1363593
2017-10-22 22:40:21 +02:00
Pierre Schweitzer 05f00fe63b [REISERFS] Don't allocate (and leak :-)) an unused event
CID 1363603
2017-10-22 22:30:22 +02:00
Timo Kreuzer 6073359086 [REACTOS] Fix x64 build
- SIZE_T -> ULONG in KsecGatherEntropyData
- Add missing ZwQueryInformationProcess() prototype for x64 build of btrfs
- Fix ml.exe path for VS 2017 Community Edition
- Add missing Handle32ToHandle to basetsd.h
2017-10-22 16:49:04 +02:00
Pierre Schweitzer 4672b2ba5e [BTRFS] Upgrade to BtrFS 1.0.1
CID 1419459, 1419378

CORE-13896
2017-10-16 20:29:55 +02:00
Colin Finck 950c86fb4c Fix remaining text file line endings in the tree. (#18)
Based on https://stackoverflow.com/a/1511273

Also enforce CRLF for all *.xml files in our tree, because they are distributed with ReactOS.
2017-10-06 15:00:36 +02:00
Hermès Bélusca-Maïto f9b6429468 Delete "ghost" old(*) files that have been mysteriously added back during the SVN-to-Git transition.
To check that these changes are correct, checkout in a directory (let's call it "ros_svn") the /trunk/reactos/ of our read-only SVN repo r76032 and in /trunk/reactos/modules/, the rosapps, rostests and wallpapers.
In a second directory (let's call it "ros_git"), clone the corresponding Git-converted ReactOS directory.
Before applying this patch (and the previous one that added back the empty directories), you should see additional files in ros_git that are not in ros_svn, corresponding to these files I'm deleting here (plus some .gitignore files),
and you should also see additional files in ros_svn that do not appear in ros_git: these are the empty directories I've restored in my previous patch.

Now, after the application of both the previous patch that restores the empty directories (and deletes the .gitignore files), and this patch that removes the ghost files, you should only see that the only differences
between ros_git and ros_svn are the extra .keep files in the empty directories, and that's all!

Command-line for the tests:
diff --strip-trailing-cr -r ros_svn ros_git > diff_svn2git.txt

"-r" means recursive, and "--strip-trailing-cr" ignores the CR-LF vs. LF (or CR) EOLs.

(*): by "ghost" old(*) files I understand files that existed previously in the far past, that then were deleted long ago in SVN, and that popped out back during the Git migration.
2017-10-04 10:28:36 +02:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00