- Implement GetBestFileNameFromRecord() which will select the higher subsystem name available (POSIX -> Win32 -> DOS) and return it
- Replace the hand-made implementation of it in dirctl functions relying on it (NtfsGetDirectoryInformation(), NtfsGetFullDirectoryInformation(), NtfsGetBothDirectoryInformation())
- Use it in NtfsMakeFCBFromDirEntry()
This fixes browsing POSIX volume (and opening file) in cmd. Even though, explorer doesn't seem to be happy with such change...
This doesn't fix yet the autocompletion in cmd either.
svn path=/trunk/; revision=65456
- Move the ROUND_UP & ROUND_DOWN macro definition to header
- Make NtfsReadDisk() sector size aware so that it can properly align read on the disk (and thus prevent them from failing)
- If $ATTRIBUTE_LIST is non resident, then display a message and continue, don't assert on it. This is to be implemented later on.
This fixes directory enumeration on a Windows 7 NTFS volume.
svn path=/trunk/; revision=65240
Bugfixing... Part 8/X:
- Actually, the files timestamp are already stored in the correct format on-disk... I should have listened to Thomas...
This fixes incorrect dates display when enumerating a directory contents. My apologies Thomas :-(.
Last to fix: the file size which is broken.
svn path=/trunk/; revision=64832
Bugfixing... Part 4/X:
- Fix a nasty bug in NtfsLookupFileAt() (how did it work before?). The name parsing was wrong (no progress was being made) and thus was leading to an infinite loop in directory browsing.
- Fix a lovely bug coming from a non-documented feature in NTFS. To properly read the MFT index, you've to apply a mask. Do this to properly handles MFT record. This fixes returned MFT index which allows resuse.
- Do not allow returning MFT records < 0x10 for now. Not sure whether it should be allowed, but so far, these are MFT special records, so let's forget about it. IIRC, they are available on Windows. But trying to chase another bug for the moment.
This does not fix yet directory enumeration.
svn path=/trunk/; revision=64793
Bugfixing... Part 2/X:
- Please welcome yet another structure in our NTFS driver... The INDX buffer which is used for non resident index entries. Doc (incomplete) here: http://bos.asmhackers.net/docs/filesystems/ntfs/INDX.html
- Make use of it in NtfsFindMftRecord() to replace some totally obscure code.
- Add some asserts to verify we read somehow what we expect. One of the assert is not working properly... Hum! Need to find out why.
We don't go any farther so far. Good news though: a FIXME has been replaced by another FIXME.
NB: This would deserve being ported to FreeLDR to fix the same FIXME.
svn path=/trunk/; revision=64771
Bugfixing... Part 1/X:
- FixupUpdateSequenceArray() returns a NTSTATUS, so properly handle it.
- Actually... Attributes name can be unicode in case of a file name, but it can also be ansi, for streams name... So, don't force UNICODE_STRING, it causes more troubles than it solves.
So, now, we really progress in reading directory. Instead of finding no files because we improperly read attributes, we now corrupt memory somewhere and crash ReactOS.
svn path=/trunk/; revision=64765
Implement NtfsFileFlagsToAttributes() to fix some of the attributes of the MFT to make them usable by ReactOS.
Would deserve a double-check
svn path=/trunk/; revision=64753
- Also make NtfsFindMftRecord() return the name of the record it found
- Implement support for entry enumeration (from 0 or not) in NtfsFindMftRecord()
- Experimental fix in NtfsLookupFileAt(), look for the attribute using the name of the record, and not the full path
- Implement NtfsFindFileAt() which is used to look for a file/directory using WC in a given directory
svn path=/trunk/; revision=64743
- Add a directory entry into FCB which will be a copy of the $FILE_NAME attribute of the FILE record. Though, it won't contain the name itself (in the FCB instead), so keep first char NULL and length 0.
- Implement its support (which requires opening the FILE record 5 first) for root FCB creation.
svn path=/trunk/; revision=64617
- Remove magic value usage in NtfsDumpFileAttributes()
- Implement GetFileNameFromRecord() which returns the $FILE_NAME attribute from a FILE record
- On record lookup, also return the MFT index of the found record
- Finally implement NtfsMakeFCBFromDirEntry() which allows creating a FCB from a dir entry. It is still incomplete though, it doesn't copy any data yet from the entry
svn path=/trunk/; revision=64610
- Divert NtfsLookupFile() as NtfsLookupFileAt() to allow opening relatives to a current MFT record.
- Reimplement NtfsLookupFile() using NtfsLookupFileAt()
svn path=/trunk/; revision=64316
- Import structures and defines from FreeLdr NTFS driver header
- Import lot of code from FreeLdr NTFS driver to handle MFT & attributes
- Remove code that has been overtaken by FreeLdr code
- Adapt & port code from FreeLdr (allocation, status, data structures)
- Adapt old code to the new functions defined from FreeLdr code
- Open the MFT during volume mount and keep in VCB for further use
- Implement a function to lookup a file in the MFT given its full path
svn path=/trunk/; revision=64313
Also add missing defines about index size and index header for INDEX_ROOT attribute.
Implemented their support in NtfsDumpFileAttributes().
svn path=/trunk/; revision=64233
- Filled FCB structures with more informations
- Added them to linked list
- Set mounted volume to FILE_DEVICE_DISK_FILE_SYSTEM
- Various code cleanup
svn path=/trunk/; revision=34036
- TODO: Provide callbacks for lazy writer and read ahead when calling CcInitializeCacheMap. Could be done similar to r32607 for CDFS.
svn path=/trunk/; revision=32610
- Implemented NtfsFsdDispatch to dispatch some IO requests (use it with implemented functions that need it)
- Implemented NtfsIsIrpTopLevel (From Rajeev Nagar), NtfsAllocateIrpContext
- Added more checks
- Renamed functions that are called by IO to NtfsFsd* (similar to Windows NTFS driver)
- Use NTAPI instead of STDCALL to have MSVC compatibility, thanks to Hervé
- Reorganized functions order with increasing index
- Updated files headers
svn path=/trunk/; revision=32253
- Use Hervé debug method (better), thanks to Hervé
- Use NTAPI instead of STDCALL to have MSVC compatibility, thanks to Hervé
- Moved IRP functions array to a new function, NtfsInitializeFunctionPointers
- Added more checks
- Initialize global and local data before acting with kernel
- Removeed the use of one var
That should be all....
svn path=/trunk/; revision=31747
- Separate a field into two distinct fields. One will be used when mounting volume
- Added comment to unusedX fields that are used anyway when mounting volume
svn path=/trunk/; revision=31538
- Renamed Magic (bad !) to jump, and OemName to OEMID
- Created structures for BPB and EBPB and used them in BOOT_SECTOR one
- Added a field to BOOY_SECTOR structure
This is based on Technet doc and Alex Ionescu doc
svn path=/trunk/; revision=31483