Commit graph

46 commits

Author SHA1 Message Date
Pierre Schweitzer
5296d62877 [NTFS]
Implement NtfsFsdDeviceControl()


svn path=/trunk/; revision=65581
2014-12-07 14:16:13 +00:00
Pierre Schweitzer
ce76daabd9 [NTFS]
Implement NtfsFCBIsReparsePoint() which returns true in case current FCB is a reparse point

svn path=/trunk/; revision=65579
2014-12-07 13:30:13 +00:00
Pierre Schweitzer
10d2eaf33b [NTFS]
Add the reparse point attribute definition

svn path=/trunk/; revision=65475
2014-11-24 20:02:40 +00:00
Pierre Schweitzer
1dc01e0746 [NTFS]
- Fix $FILENAME_ATTRIBUTE definition to allow reading reparse points tag
- Add missing file attribute (reparse point)

svn path=/trunk/; revision=65470
2014-11-23 20:52:59 +00:00
Pierre Schweitzer
950747c6d1 [NTFS]
- 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
2014-11-23 14:07:08 +00:00
Pierre Schweitzer
fad60e6ee8 [NTFS]
MagicValues--;

svn path=/trunk/; revision=65302
2014-11-06 21:12:54 +00:00
Pierre Schweitzer
099910fd83 [NTFS]
- 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
2014-11-04 07:56:20 +00:00
Pierre Schweitzer
d22dd7da46 [NTFS]
Addendum to r65112

svn path=/trunk/; revision=65113
2014-10-29 22:40:16 +00:00
Pierre Schweitzer
d6fa9e7094 [NTFS]
ReleaseAttributeContext() is to be used out of mft.c
I believe that at some point, we're leaking memory...

svn path=/trunk/; revision=65068
2014-10-28 10:26:47 +00:00
Hervé Poussineau
beb81cc389 [NTFS] Prefer long file name when naming objects
We now always see the long file name of an object when browsing NTFS partitions.

svn path=/trunk/; revision=65027
2014-10-26 19:10:17 +00:00
Pierre Schweitzer
3b8b4734d6 [NTFS]
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
2014-10-19 19:48:52 +00:00
Pierre Schweitzer
60d3d2c399 [NTFS]
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
2014-10-17 22:17:59 +00:00
Pierre Schweitzer
104149a180 [NTFS]
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
2014-10-16 21:37:27 +00:00
Pierre Schweitzer
682e176eca [NTFS]
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
2014-10-16 20:05:36 +00:00
Pierre Schweitzer
560d00e49b [NTFS]
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
2014-10-15 20:36:30 +00:00
Pierre Schweitzer
d71653b9cb [NTFS]
Implement NtfsDateTimeToFileTime() which convert epoch time (1970) to Windows time (1601) 

svn path=/trunk/; revision=64752
2014-10-15 20:23:47 +00:00
Pierre Schweitzer
4102165fea [NTFS]
Also return the index of the entry which was found

svn path=/trunk/; revision=64744
2014-10-14 20:34:38 +00:00
Pierre Schweitzer
1042f3d24d [NTFS]
- 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
2014-10-14 19:11:49 +00:00
Pierre Schweitzer
0892e523ce [NTFS]
Forgot that file...

svn path=/trunk/; revision=64693
2014-10-12 11:50:08 +00:00
Pierre Schweitzer
e679240501 [NTFS]
- Add missing defines about file attributes
- Implement NtfsFCBIsDirectory()

Source: http://bos.asmhackers.net/docs/filesystems/ntfs/filename.html

svn path=/trunk/; revision=64618
2014-10-08 19:45:33 +00:00
Pierre Schweitzer
011e52835b [NTFS]
- 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
2014-10-08 19:32:21 +00:00
Pierre Schweitzer
df3a6889ba [NTFS]
- 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
2014-10-08 19:12:48 +00:00
Pierre Schweitzer
85b85921b8 [NTFS]
- Divert NtfsLookupFile() as NtfsLookupFileAt() to allow opening relatives to a current MFT record.
- Reimplement NtfsLookupFile() using NtfsLookupFileAt()

svn path=/trunk/; revision=64316
2014-09-26 18:12:24 +00:00
Pierre Schweitzer
1dfcfeb0f7 [NTFS]
Also store the MFT index in the FCB

svn path=/trunk/; revision=64315
2014-09-26 17:49:05 +00:00
Pierre Schweitzer
32afa0efb3 [NTFS]
- 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
2014-09-26 13:57:29 +00:00
Pierre Schweitzer
a9a99db331 [NTFS]
- Divert NtfsReadSectors() into NtfsReadDisk()
- Reimplement NtfsReadSectors() using NtfsReadDisk()

svn path=/trunk/; revision=64294
2014-09-26 06:41:51 +00:00
Pierre Schweitzer
17b30a2024 [NTFS]
- Create the volume FCB and save it in VCB.
- Fix a memory leak

svn path=/trunk/; revision=64288
2014-09-25 20:15:00 +00:00
Pierre Schweitzer
6feab772ca [NTFS]
Compute index record size on mount and save it.

svn path=/trunk/; revision=64265
2014-09-25 06:36:14 +00:00
Pierre Schweitzer
cff39969d6 [NTFS]
Also add missing defines about index size and index header for INDEX_ROOT attribute.
Implemented their support in NtfsDumpFileAttributes().

svn path=/trunk/; revision=64233
2014-09-22 20:26:21 +00:00
Pierre Schweitzer
d907725b5d [NTFS]
Add missing defines about INDEX_ROOT attributes and collation rules.
Implemented their support in NtfsDumpFileAttributes().

Sources: http://ftp.kolibrios.org/users/Asper/docs/NTFS/ntfsdoc.html#attribute_index_root and Linux kernel.

svn path=/trunk/; revision=64232
2014-09-22 19:59:45 +00:00
Amine Khaldi
ce6694437c [NTFS]
* Remove one time inclusions from the main header and put them back where they belong.
CORE-7716

svn path=/trunk/; revision=61869
2014-01-28 21:21:04 +00:00
Eric Kohl
78a3d923b6 [NTFS]
Fix indentation and coding style. No code changes!!!

svn path=/trunk/; revision=59229
2013-06-16 12:15:06 +00:00
Stefan Ginsberg
ea23cd10c2 - Start deprecating TAG()
- Fix inverted tags in prntfont.h, stdunk.h and win32k/objects/font.c

svn path=/trunk/; revision=42915
2009-08-24 17:12:25 +00:00
Stefan Ginsberg
35edb19a3c - CDFS and NTFS: Don't include a unused, deprecated header
svn path=/trunk/; revision=35913
2008-09-03 16:52:08 +00:00
Pierre Schweitzer
b22a7f63e8 Miscellaneous NTFS patch:
- 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
2008-06-20 18:40:57 +00:00
Pierre Schweitzer
1498b141eb - Renamed all control block structures to (P)NTFS_xCB
- Added an identifier field to those structures (not yet used)

svn path=/trunk/; revision=32691
2008-03-15 08:51:47 +00:00
Pierre Schweitzer
c5caa4ae89 Added stubs for CC R/W functions (fixes TODO from r32610)
svn path=/trunk/; revision=32611
2008-03-08 13:17:48 +00:00
Aleksey Bragin
9948ff11e8 - Remove ros-specific Cc functions usage.
- 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
2008-03-08 12:14:41 +00:00
Pierre Schweitzer
a68d895e4d - Added more checks when mounting a volume (based on: 8cc5891d-bf8e-4164-862d-dac5418c59481033.mspx)
- Removed some useless debug
Thanks to Hervé

svn path=/trunk/; revision=32462
2008-02-24 10:06:37 +00:00
Pierre Schweitzer
47b892354b NTFS driver improvments :
- 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
2008-02-10 11:20:29 +00:00
Christoph von Wittich
e23f06ce53 -use ExAllocatePoolWithTag instead of ExAllocatePool
-add missing critical region acquiring to the NtfsCreate routine.

svn path=/trunk/; revision=31753
2008-01-13 11:36:54 +00:00
Pierre Schweitzer
8d54c16b65 Rewritten NTFS driver entry :
- 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
2008-01-12 20:54:41 +00:00
Pierre Schweitzer
2df4726732 Updated NTFS header :
- 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
2008-01-01 19:26:26 +00:00
Pierre Schweitzer
df28dbd1ee Reorganized NTFS driver header :
- 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
2007-12-28 21:56:19 +00:00
Christoph von Wittich
e7df482753 fix some format strings
svn path=/trunk/; revision=30637
2007-11-21 17:08:21 +00:00
Maarten Bosma
3c1bd00d5d Rename fs into filesystems
svn path=/trunk/; revision=21066
2006-02-17 12:29:35 +00:00
Renamed from reactos/drivers/fs/ntfs/ntfs.h (Browse further)