reactos.git
23 months ago[NTFS] - Fix some errors that break building in C89 mode, and remove an extraneous...
Trevor Thompson [Fri, 1 Sep 2017 00:27:34 +0000 (00:27 +0000)]
[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

23 months ago[NTFS] - Add some helper functions for new features. Add some fixes. Add support...
Trevor Thompson [Tue, 29 Aug 2017 15:51:14 +0000 (15:51 +0000)]
[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

23 months ago[NTFS] - Fix increasing the mft size, to keep chkdsk happy.
Trevor Thompson [Mon, 28 Aug 2017 03:11:38 +0000 (03:11 +0000)]
[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

23 months ago[NTFS] - Fix for C89 compliance.
Trevor Thompson [Sun, 27 Aug 2017 14:43:35 +0000 (14:43 +0000)]
[NTFS] - Fix for C89 compliance.

svn path=/branches/GSoC_2016/NTFS/; revision=75693

23 months ago[NTFS] - Add support for directory creation. Add some helper functions, some comments...
Trevor Thompson [Sun, 27 Aug 2017 14:37:17 +0000 (14:37 +0000)]
[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

23 months ago[NTFS] - When creating files:
Trevor Thompson [Fri, 25 Aug 2017 17:16:04 +0000 (17:16 +0000)]
[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

23 months ago[NTFS] - Allow for creating a file when the index root gets too large and needs to...
Trevor Thompson [Tue, 15 Aug 2017 19:57:55 +0000 (19:57 +0000)]
[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

23 months ago[NTFS] - Allow for resizing an attribute in the middle of a file record. Add a helper...
Trevor Thompson [Tue, 15 Aug 2017 19:32:20 +0000 (19:32 +0000)]
[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

23 months ago[NTFS] - Refactor to allow the copy of the attribute stored in NTFS_ATTR_CONTEXT...
Trevor Thompson [Sun, 6 Aug 2017 02:54:15 +0000 (02:54 +0000)]
[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

23 months ago[NTFS] - Fix index entries storing the wrong allocated file size when the file is...
Trevor Thompson [Fri, 4 Aug 2017 17:58:06 +0000 (17:58 +0000)]
[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

23 months ago[NTFS] - Add some improvements to B-Tree support. Add preliminary support for trees...
Trevor Thompson [Thu, 27 Jul 2017 19:52:33 +0000 (19:52 +0000)]
[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

23 months ago[NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out...
Trevor Thompson [Thu, 27 Jul 2017 18:34:23 +0000 (18:34 +0000)]
[NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out of the last commit.

svn path=/branches/GSoC_2016/NTFS/; revision=75425

23 months ago[NTFS] - Add some utility functions and improve some comments. Improve NtfsAddFilenam...
Trevor Thompson [Thu, 27 Jul 2017 18:22:24 +0000 (18:22 +0000)]
[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

23 months ago[NTFS] - After creating a new file, update creation disposition before calling NtfsCr...
Trevor Thompson [Thu, 27 Jul 2017 11:35:50 +0000 (11:35 +0000)]
[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

23 months ago[NTFS] - Fix some more issues, including remaining issues marked as "unresolved"...
Trevor Thompson [Tue, 18 Jul 2017 19:59:36 +0000 (19:59 +0000)]
[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

23 months ago[NTFS] - Fix some formatting / style issues, per CR-123.
Trevor Thompson [Wed, 5 Jul 2017 22:10:22 +0000 (22:10 +0000)]
[NTFS] - Fix some formatting / style issues, per CR-123.

svn path=/branches/GSoC_2016/NTFS/; revision=75290

23 months ago[NTFS] - Add a few fixes and improvements, most from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 16:29:16 +0000 (16:29 +0000)]
[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

23 months ago[NTFS] - Add some fixes and improvements to mft.c from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 05:09:51 +0000 (05:09 +0000)]
[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

23 months ago[NTFS] - Add some fixes and improvements to finfo.c from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 03:11:13 +0000 (03:11 +0000)]
[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

23 months ago[NTFS] - Add some fixes and improvements to create.c, dirctl.c and fcb.c from CR...
Trevor Thompson [Tue, 4 Jul 2017 22:34:17 +0000 (22:34 +0000)]
[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

23 months ago[NTFS] - Add some fixes and improvements to btree.c from CR-123:
Trevor Thompson [Tue, 4 Jul 2017 21:47:43 +0000 (21:47 +0000)]
[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

23 months ago[NTFS] - Add some fixes and improvements to attribute.c from CR-123:
Trevor Thompson [Tue, 4 Jul 2017 21:40:02 +0000 (21:40 +0000)]
[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

23 months ago[NTFS] - Fix UpdateFileNameRecord() when the file being updated resides in $INDEX_ROO...
Trevor Thompson [Tue, 4 Jul 2017 21:16:46 +0000 (21:16 +0000)]
[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

23 months ago[NTFS] - Fix AddFileName() when the file path is two or more directories deep.
Trevor Thompson [Tue, 4 Jul 2017 20:47:06 +0000 (20:47 +0000)]
[NTFS] - Fix AddFileName() when the file path is two or more directories deep.

svn path=/branches/GSoC_2016/NTFS/; revision=75277

23 months ago[NTFS] - Fix gcc build. Fix CompareTreeKeys(): Don't consider Key1 a possible dummy...
Trevor Thompson [Thu, 29 Jun 2017 02:36:00 +0000 (02:36 +0000)]
[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

23 months ago[NTFS] - Fix a couple of issues spotted by Thomas: Maintain alphabetical ordering...
Trevor Thompson [Wed, 28 Jun 2017 18:22:42 +0000 (18:22 +0000)]
[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

23 months ago[NTFS] - Begin to implement B-Trees. Allow for creating several new files in a directory.
Trevor Thompson [Wed, 28 Jun 2017 03:45:52 +0000 (03:45 +0000)]
[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

23 months ago[NTFS] - Add some minor fixes and improvements:
Trevor Thompson [Mon, 26 Jun 2017 05:17:08 +0000 (05:17 +0000)]
[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

23 months ago[NTFS] - Fix creation of files with long filenames.
Trevor Thompson [Sun, 25 Jun 2017 04:29:04 +0000 (04:29 +0000)]
[NTFS] - Fix creation of files with long filenames.

svn path=/branches/GSoC_2016/NTFS/; revision=75193

23 months ago[NTFS] - In the NtfsAddFilenameToDirectory() function, rename DirectoryContext parame...
Trevor Thompson [Sun, 25 Jun 2017 02:56:40 +0000 (02:56 +0000)]
[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

23 months ago[NTFS] - Fix a mistake with AddFileName() from my last commit. Also, move CaseSensiti...
Trevor Thompson [Sun, 25 Jun 2017 02:38:15 +0000 (02:38 +0000)]
[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

23 months ago[NTFS] - Fix POSIX rules. Fix accessing long filenames created in Windows when 8dot3...
Trevor Thompson [Sat, 24 Jun 2017 04:36:28 +0000 (04:36 +0000)]
[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

23 months ago[NTFS] - Fix IncreaseMftSize(); check IrpContext to see if waiting for exclusive...
Trevor Thompson [Fri, 23 Jun 2017 17:30:13 +0000 (17:30 +0000)]
[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

23 months ago[NTFS] - Add support for expanding the master file table. Fix a bug with BrowseIndexE...
Trevor Thompson [Fri, 16 Jun 2017 06:00:09 +0000 (06:00 +0000)]
[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

23 months ago[NTFS] - Restructure some code in preparation for the next commit:
Trevor Thompson [Fri, 16 Jun 2017 05:43:52 +0000 (05:43 +0000)]
[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

23 months ago[NTFS] - Add some improvements to the previous commit, as suggested by Thomas.
Trevor Thompson [Fri, 16 Jun 2017 05:42:01 +0000 (05:42 +0000)]
[NTFS] - Add some improvements to the previous commit, as suggested by Thomas.

svn path=/branches/GSoC_2016/NTFS/; revision=75054

23 months ago[NTFS] - Add the most basic support for file creation. Expand diagnostic output,...
Trevor Thompson [Fri, 9 Jun 2017 03:14:30 +0000 (03:14 +0000)]
[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

23 months ago[NTFS] - Decrease debug spam
Trevor Thompson [Sun, 28 May 2017 20:51:31 +0000 (20:51 +0000)]
[NTFS] - Decrease debug spam

svn path=/branches/GSoC_2016/NTFS/; revision=74694

23 months ago[NTFS] - Disable write support by default. Enable it via the registry.
Trevor Thompson [Sat, 27 May 2017 19:32:43 +0000 (19:32 +0000)]
[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

23 months ago[NTFS] - Add support for changing a file's size via SetEndOfFile():
Trevor Thompson [Sat, 27 May 2017 03:20:31 +0000 (03:20 +0000)]
[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

23 months ago[NTFS] - Fix a bug with last commit, as spotted by Pierre.
Trevor Thompson [Sat, 13 May 2017 09:17:06 +0000 (09:17 +0000)]
[NTFS] - Fix a bug with last commit, as spotted by Pierre.

svn path=/branches/GSoC_2016/NTFS/; revision=74525

23 months ago[NTFS] - Expand support for resizing resident attributes and fix NtfsAllocateClusters().
Trevor Thompson [Sat, 13 May 2017 08:56:54 +0000 (08:56 +0000)]
[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

23 months ago[NTFS] - Commit early results of a small restructuring effort:
Trevor Thompson [Fri, 12 May 2017 22:16:20 +0000 (22:16 +0000)]
[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

23 months ago[NTFS] Add support for creating new MFT entries:
Trevor Thompson [Sun, 16 Apr 2017 00:17:07 +0000 (00:17 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Mon, 22 Aug 2016 11:08:22 +0000 (11:08 +0000)]
[NTFS]
+NtfsDumpFileRecord() - Provides diagnostic information about a file record.

svn path=/branches/GSoC_2016/NTFS/; revision=72424

23 months ago[NTFS]
Trevor Thompson [Mon, 22 Aug 2016 08:27:35 +0000 (08:27 +0000)]
[NTFS]
*UpdateFileRecord() - Fix a DPRINT

svn path=/branches/GSoC_2016/NTFS/; revision=72423

23 months ago[NTFS]
Trevor Thompson [Mon, 22 Aug 2016 08:11:12 +0000 (08:11 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Tue, 19 Jul 2016 15:31:22 +0000 (15:31 +0000)]
[NTFS]
+FreeClusters(). Fix a DPRINT.

svn path=/branches/GSoC_2016/NTFS/; revision=71968

23 months ago[NTFS]
Trevor Thompson [Sun, 17 Jul 2016 14:04:01 +0000 (14:04 +0000)]
[NTFS]
Address some minor issues with attrib.c: Fix gcc build. Fix formatting.

svn path=/branches/GSoC_2016/NTFS/; revision=71957

23 months ago[NTFS]
Trevor Thompson [Fri, 15 Jul 2016 15:27:04 +0000 (15:27 +0000)]
[NTFS]
*AddRun() - Don't leak RunBuffer when encountering errors.
Handle exception from FsRtlAddLargeMcbEntry().

svn path=/branches/GSoC_2016/NTFS/; revision=71945

23 months ago[NTFS]
Trevor Thompson [Thu, 14 Jul 2016 15:20:48 +0000 (15:20 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Wed, 13 Jul 2016 14:49:46 +0000 (14:49 +0000)]
[NTFS]
Various minor changes to fix GCC build.

svn path=/branches/GSoC_2016/NTFS/; revision=71922

23 months ago[NTFS]
Trevor Thompson [Wed, 13 Jul 2016 11:51:16 +0000 (11:51 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Wed, 13 Jul 2016 09:26:04 +0000 (09:26 +0000)]
[NTFS]
UpdateFileRecord() - Remove fixup array before returning.

svn path=/branches/GSoC_2016/NTFS/; revision=71920

23 months ago[NTFS]
Trevor Thompson [Tue, 12 Jul 2016 09:57:16 +0000 (09:57 +0000)]
[NTFS]
Add error-checking to InternalGetNextAttribute(); don't crash if CurrAttr->Length is invalid.

svn path=/branches/GSoC_2016/NTFS/; revision=71897

23 months ago[NTFS]
Trevor Thompson [Fri, 8 Jul 2016 12:05:19 +0000 (12:05 +0000)]
[NTFS]
Fix broken check for free disk space in NtfsAllocateClusters().

svn path=/branches/GSoC_2016/NTFS/; revision=71858

23 months ago[NTFS]
Trevor Thompson [Fri, 8 Jul 2016 11:59:25 +0000 (11:59 +0000)]
[NTFS]
Simplify GetLastClusterInDataRun() and clean up NtfsAllocateClusters(). No functional changes.

svn path=/branches/GSoC_2016/NTFS/; revision=71857

23 months ago[NTFS]
Trevor Thompson [Thu, 7 Jul 2016 08:17:07 +0000 (08:17 +0000)]
[NTFS]
Simplify and optimize InternalSetResidentAttributeLength(), as suggested by Pierre.

svn path=/branches/GSoC_2016/NTFS/; revision=71837

23 months ago[NTFS]
Trevor Thompson [Wed, 6 Jul 2016 07:57:57 +0000 (07:57 +0000)]
[NTFS]
Fix copy-paste error in SetAttributeDataLength()

svn path=/branches/GSoC_2016/NTFS/; revision=71832

23 months ago[NTFS]
Trevor Thompson [Tue, 5 Jul 2016 07:00:43 +0000 (07:00 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Wed, 29 Jun 2016 17:49:36 +0000 (17:49 +0000)]
[NTFS]
Fix typo in NtfsAllocateClusters(), spotted by ThFabba.

svn path=/branches/GSoC_2016/NTFS/; revision=71697

23 months ago[NTFS]
Trevor Thompson [Wed, 29 Jun 2016 16:35:36 +0000 (16:35 +0000)]
[NTFS]
Lay some groundwork for extending allocation size.
+AddRun() - Unimplemented
+GetLastClusterInDataRun()
+NtfsAllocateClusters()

svn path=/branches/GSoC_2016/NTFS/; revision=71696

23 months ago[NTFS]
Trevor Thompson [Sun, 26 Jun 2016 21:06:02 +0000 (21:06 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Sun, 26 Jun 2016 17:03:31 +0000 (17:03 +0000)]
[NTFS]
Remove unused parameter from SetAttributeDataLength.

svn path=/branches/GSoC_2016/NTFS/; revision=71677

23 months ago[NTFS]
Trevor Thompson [Thu, 23 Jun 2016 18:02:03 +0000 (18:02 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Thu, 23 Jun 2016 15:37:19 +0000 (15:37 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Wed, 22 Jun 2016 21:20:50 +0000 (21:20 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Sun, 12 Jun 2016 04:02:52 +0000 (04:02 +0000)]
[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

23 months ago[NTFS]
Trevor Thompson [Sun, 1 May 2016 16:21:53 +0000 (16:21 +0000)]
[NTFS]
Added minimal write support from CORE-10998 along with updates as suggested by CR-90.

svn path=/branches/GSoC_2016/NTFS/; revision=71224

2 years agoFix remaining text file line endings in the tree. (#18)
Colin Finck [Fri, 6 Oct 2017 13:00:36 +0000 (15:00 +0200)]
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.

2 years ago[INCLUDE]: ntddrdsk.h: Fix "__cplusplus" and the ramdisk GUID definitions.
Hermès Bélusca-Maïto [Thu, 5 Oct 2017 23:07:54 +0000 (01:07 +0200)]
[INCLUDE]: ntddrdsk.h: Fix "__cplusplus" and the ramdisk GUID definitions.

2 years ago[INCLUDE]: ntddrdsk.h: align defs on multiple of 4-space tab.
Hermès Bélusca-Maïto [Thu, 5 Oct 2017 23:06:32 +0000 (01:06 +0200)]
[INCLUDE]: ntddrdsk.h: align defs on multiple of 4-space tab.

2 years ago[NTUSER] Fix rogue CR in a LF-only file.
gigaherz [Thu, 5 Oct 2017 22:04:29 +0000 (00:04 +0200)]
[NTUSER] Fix rogue CR in a LF-only file.

2 years ago[KERNEL32]: w2k3ify GetDriveTypeA()
Pierre Schweitzer [Thu, 5 Oct 2017 21:43:10 +0000 (23:43 +0200)]
[KERNEL32]: w2k3ify GetDriveTypeA()

2 years ago[KERNEL32]: Reimplement GetDriveTypeW(). This allows providing a quick path for DOS...
Pierre Schweitzer [Thu, 5 Oct 2017 21:41:26 +0000 (23:41 +0200)]
[KERNEL32]: Reimplement GetDriveTypeW(). This allows providing a quick path for DOS drives and fixes a few detection cases. It allows brings in support for mount points.

2 years ago[KERNEL32]: Finally get rid of no longer used function InternalOpenDirW()
Pierre Schweitzer [Wed, 4 Oct 2017 21:03:07 +0000 (23:03 +0200)]
[KERNEL32]: Finally get rid of no longer used function InternalOpenDirW()

2 years ago[KERNEL32]: Reimplement GetDiskFreeSpaceExA() to make it w2k3 compliant
Pierre Schweitzer [Wed, 4 Oct 2017 21:02:22 +0000 (23:02 +0200)]
[KERNEL32]: Reimplement GetDiskFreeSpaceExA() to make it w2k3 compliant

2 years ago[KERNEL32]: Refactor a bit GetDiskFreeSpaceExW(), no ground breaking changes
Pierre Schweitzer [Wed, 4 Oct 2017 21:00:12 +0000 (23:00 +0200)]
[KERNEL32]: Refactor a bit GetDiskFreeSpaceExW(), no ground breaking changes

2 years ago[KERNEL32]: Reimplement GetDiskFreeSpaceA() to make it w2k3 compliant
Pierre Schweitzer [Wed, 4 Oct 2017 20:30:18 +0000 (22:30 +0200)]
[KERNEL32]: Reimplement GetDiskFreeSpaceA() to make it w2k3 compliant

2 years ago[KERNEL32]: Reimplement GetDiskFreeSpaceW() to fix various issues in it. It also...
Pierre Schweitzer [Wed, 4 Oct 2017 20:27:14 +0000 (22:27 +0200)]
[KERNEL32]: Reimplement GetDiskFreeSpaceW() to fix various issues in it. It also brings support for appcompat

2 years ago[FREELDR] Properly check for end-of-memory-map entries when skipping ranges smaller...
Serge Gautherie [Wed, 4 Oct 2017 16:04:35 +0000 (18:04 +0200)]
[FREELDR] Properly check for end-of-memory-map entries when skipping ranges smaller than page size.
CORE-12881

Signed-off-by: Timo Kreuzer <timo.kreuzer@reactos.org>
2 years ago[FREELDR] Add 64 bit alignment macros (ULONGLONG_ALIGN_UP/DOWN_BY) for aligning physi...
Serge Gautherie [Tue, 3 Oct 2017 07:16:26 +0000 (09:16 +0200)]
[FREELDR] Add 64 bit alignment macros (ULONGLONG_ALIGN_UP/DOWN_BY) for aligning physical addresses that can be larger than 4GB and the default macros truncate to ULONG_PTR.
CORE-12881

Signed-off-by: Timo Kreuzer <timo.kreuzer@reactos.org>
2 years ago[FREELDR] Improve trace prints in pcmem.c, no logical changes
Serge Gautherie [Tue, 3 Oct 2017 07:00:03 +0000 (09:00 +0200)]
[FREELDR] Improve trace prints in pcmem.c, no logical changes
CORE-12881

Signed-off-by: Timo Kreuzer <timo.kreuzer@reactos.org>
2 years ago[WIN32K] Add a comment regarding UserEnterExclusive() in UserGetDesktopDC()
Timo Kreuzer [Thu, 5 Oct 2017 16:40:33 +0000 (18:40 +0200)]
[WIN32K] Add a comment regarding UserEnterExclusive() in UserGetDesktopDC()
This is a test-commit using GitHubs SVN interface.

2 years ago[CLASS2]: Fix status code on too small as exposed by kernel32:DeviceIoControl
Pierre Schweitzer [Wed, 4 Oct 2017 19:13:25 +0000 (21:13 +0200)]
[CLASS2]: Fix status code on too small as exposed by kernel32:DeviceIoControl

2 years agoDelete README
Alexander Shaposhnikov [Wed, 4 Oct 2017 18:58:32 +0000 (21:58 +0300)]
Delete README

2 years ago[VERSION] Use --abbrev=7 for "git describe" to enforce a short hash of 7 characters...
Colin Finck [Wed, 4 Oct 2017 18:44:52 +0000 (20:44 +0200)]
[VERSION] Use --abbrev=7 for "git describe" to enforce a short hash of 7 characters no matter what the default is for your Git installation.

2 years agoAdd .gitattributes and .gitignore files and normalize line endings in the repository...
Colin Finck [Wed, 4 Oct 2017 18:37:32 +0000 (20:37 +0200)]
Add .gitattributes and .gitignore files and normalize line endings in the repository (#10)

2 years agoFix url typo in README (#9)
Goblenus [Wed, 4 Oct 2017 08:40:37 +0000 (11:40 +0300)]
Fix url typo in README (#9)

2 years agoDelete "ghost" old(*) files that have been mysteriously added back during the SVN...
Hermès Bélusca-Maïto [Wed, 4 Oct 2017 01:05:47 +0000 (03:05 +0200)]
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.

2 years agoAdd .keep guard files in order to restore lost but empty directories we had with...
Hermès Bélusca-Maïto [Wed, 4 Oct 2017 00:19:57 +0000 (02:19 +0200)]
Add .keep guard files in order to restore lost but empty directories we had with SVN.
Note that when you start populating these directories, you can remove the associated .keep guard file(s)!

2 years agoRemove unwanted .gitignore files.
Hermès Bélusca-Maïto [Tue, 3 Oct 2017 23:39:34 +0000 (01:39 +0200)]
Remove unwanted .gitignore files.

2 years ago[NTOBJSHEX] Fix typo.
Sergei Abramov [Tue, 3 Oct 2017 10:35:31 +0000 (12:35 +0200)]
[NTOBJSHEX] Fix typo.
Patch by Sergei Abramov.
CORE-13863

2 years agoReadme Markdown Page (#2)
Alexander Shaposhnikov [Wed, 4 Oct 2017 05:28:08 +0000 (08:28 +0300)]
Readme Markdown Page (#2)

Create README.md

2 years ago[CLASS2]: Cosmetic fixes by Thomas
Pierre Schweitzer [Tue, 3 Oct 2017 19:21:09 +0000 (21:21 +0200)]
[CLASS2]: Cosmetic fixes by Thomas

2 years ago[CLASS2]: - In ScsiClassCreateDeviceObject() don't drop received object name and...
Pierre Schweitzer [Tue, 3 Oct 2017 18:57:50 +0000 (20:57 +0200)]
[CLASS2]: - In ScsiClassCreateDeviceObject() don't drop received object name and store it in the device extension
- Implement support for the IOCTL_MOUNTDEV_QUERY_DEVICE_NAME IOCTL; return the store device name

2 years ago[REGEDIT] Support editing REG_FULL_RESOURCE_DESCRIPTOR values
tkreuzer [Tue, 3 Oct 2017 11:54:42 +0000 (13:54 +0200)]
[REGEDIT] Support editing REG_FULL_RESOURCE_DESCRIPTOR values

2 years agoBuild rosapps, rostests, wallpapers when their CMake variables are set instead of...
Colin Finck [Tue, 3 Oct 2017 14:36:59 +0000 (16:36 +0200)]
Build rosapps, rostests, wallpapers when their CMake variables are set instead of checking for directory existence.

By default, ReactOS will now build without any of these modules.
You can enable them using e.g. "configure -DENABLE_ROSTESTS=1".

2 years agoSupply the source directory as working directory when launching Git commands. Should...
Colin Finck [Tue, 3 Oct 2017 13:29:13 +0000 (15:29 +0200)]
Supply the source directory as working directory when launching Git commands. Should fix retrieving the Git hash on the build machines.

2 years agoMake ReactOS report the Git revision as output by "git describe".
Colin Finck [Tue, 3 Oct 2017 10:55:38 +0000 (12:55 +0200)]
Make ReactOS report the Git revision as output by "git describe".

- REVISION is now something like "0.4.7-dev-53-g1304b53" instead of "r12345".
- Change WINDOWS_NT_BANNER to better represent the ReactOS version and the reported NT version.
- Introduce REACTOS_COMMIT_HASH which contains the full 40-character commit hash (for comparing revisions, e.g. in rosautotest/testman).