Commit graph

646 commits

Author SHA1 Message Date
Pierre Schweitzer 229c947271 [NTFS]
Complete a bit more the information dumped from attributes

svn path=/trunk/; revision=65590
2014-12-08 18:44:29 +00:00
Pierre Schweitzer f9e8e07d32 [NTFS]
Do not forget to set IRP status block information in case of reparse point.

svn path=/trunk/; revision=65588
2014-12-08 07:35:45 +00:00
Pierre Schweitzer ebf69b050b [NTFS]
- Implement NtfsReadFCBAttribute() which is responsible for reading an attribute from a file which is referenced by its FCB. It will first read the file record in the MFT and then read the attribute, if found.
- Use NtfsReadFCBAttribute() to implement support for reparse point in NtfsCreateFile(). Once a reparse point is found, we attempt to open its data. Given their layout, we directly hand them to the Io manager. Just make sure that we return something consistent on disk. Only handle IO_REPARSE_TAG_MOUNT_POINT so far.
Next question to answer is: what to do when a reparse point is encountered during path traversal?

svn path=/trunk/; revision=65586
2014-12-07 20:59:45 +00:00
Pierre Schweitzer 5296d62877 [NTFS]
Implement NtfsFsdDeviceControl()


svn path=/trunk/; revision=65581
2014-12-07 14:16:13 +00:00
Pierre Schweitzer 14863b54d6 [NTFS]
Allow direct opening of a reparse point, but don't handle yet reparse itself

svn path=/trunk/; revision=65580
2014-12-07 14:05:47 +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
Hervé Poussineau 85c6a329ba [NTFS] Fix CcInitializeCacheMap call
svn path=/trunk/; revision=65530
2014-11-29 21:43:57 +00:00
Pierre Schweitzer e85718fec8 [FASTFAT]
- Add a flag to enable (or disable depends on your reading ;-)) the VPB swapout process for volume umount.
- By default, disable it for MSVC builds.

This *might* lolfix the MSVC builds.

Just for the record, we also have a bug in the GCC builds but it doesn't seem to show up. 
The main issue is that after formatting, we close handle to the volume, and IRP_MJ_CLEANUP is properly received and initiates a bit of dismount.
But then, the IRP_MJ_CLOSE is never received (why????) and thus, dismount cannot properly end.
This is a real & serious issue.

svn path=/trunk/; revision=65527
2014-11-29 20:26:07 +00:00
Pierre Schweitzer 8d5e230523 [FASTFAT]
Fix a FIXME in fastfat:
- Implement support for device buffers flush in VfatFlushVolume().

Unlike Windows SDK, we don't divert the current IRP to pass it to storage device. Here, we allocate a new IRP and call the device so that it flushes buffers.

svn path=/trunk/; revision=65526
2014-11-29 20:15:44 +00:00
Pierre Schweitzer fa9b68d4bb [FASTFAT]
If you decrease handles count on cleanup, don't forget to increase it on create.

This fixes sharing violation on ReactOS installation with IopParseDevice hack disabled. 

svn path=/trunk/; revision=65525
2014-11-29 20:09:44 +00:00
Pierre Schweitzer 3c6889480c [FASTFAT]
Properly handle shared accesses on volume open.
No need to add the support for this in cleanup, it was already there.

svn path=/trunk/; revision=65508
2014-11-27 20:28:50 +00:00
Pierre Schweitzer 267881ff71 [FASTFAT]
Set clean shutdown bit on dismount

svn path=/trunk/; revision=65501
2014-11-27 06:16:21 +00:00
Pierre Schweitzer fb11517f41 [NTFS]
Make the bound check more consistent and more accurate

svn path=/trunk/; revision=65486
2014-11-25 21:03:17 +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 f2e863d929 [NTFS]
Warn about unimplemented sub-node browsing while looking into a MFT directory stream.
Might likely explain why we cannnot enumerate all the files on a Win7 volume.

svn path=/trunk/; revision=65474
2014-11-24 20:01:34 +00:00
Pierre Schweitzer d23756ccb7 [NTFS]
ASSERT -> NT_VERIFY

Spotted by Thomas. Thanks :-)

svn path=/trunk/; revision=65473
2014-11-24 19:54:22 +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 4a61f5ee5b [NTFS]
- Implement NtfsGetPositionInformation(), NtfsGetBasicInformation()
- Add a fixme in NtfsGetStandardInformation() regarding the number of links

svn path=/trunk/; revision=65468
2014-11-23 19:53:16 +00:00
Pierre Schweitzer d010ffc7df [NTFS]
- In NtfsQueryDirectory(), don't upcase name in dir search pattern, it can conflict with POSIX names.
- In CompareFileName(), handle the fact that for Win32 & DOS we do case insensitive comparisons by upcasing name before match. Don't do it for POSIX names!

This fixes name completion in cmd for POSIX. And doesn't break it for Win32 :-).

svn path=/trunk/; revision=65462
2014-11-23 15:49:24 +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 0440330ea6 [FASTFAT]
- Implement VPB swapout in our FAT driver for dismout (see VfatCheckForDismount)
- Dereference volume handles on close (not on cleanup)
- Keep track of the VDO in our VCB
- Let VfatCheckForDismount() do the actual dismount, instead of VfatDismountVolume() which just initiates it

CORE-8732 #comment Can you retry?

svn path=/trunk/; revision=65372
2014-11-10 22:11:36 +00:00
Pierre Schweitzer f00ed8906d [FASTFAT]
- Store IO VPB in our VCB for later use
- Prepare a spare VPB in our VCB for dismount swapout

svn path=/trunk/; revision=65361
2014-11-10 17:42:51 +00:00
Pierre Schweitzer da318dabea [FASTFAT]
Properly flush volume on dismount

svn path=/trunk/; revision=65353
2014-11-10 10:18:29 +00:00
Pierre Schweitzer 0ca2bff44e [FASTFAT]
Properly check for volume open on lock request

svn path=/trunk/; revision=65309
2014-11-07 15:38:31 +00:00
Pierre Schweitzer fad60e6ee8 [NTFS]
MagicValues--;

svn path=/trunk/; revision=65302
2014-11-06 21:12:54 +00:00
Pierre Schweitzer c24acbfdc2 [NTFS]
Add a sanity check in NtfsFindMftRecord()

svn path=/trunk/; revision=65301
2014-11-06 20:54:27 +00:00
Thomas Faber 453e370737 [FASTFAT]
- Fix failure case handling in vfatUpdateFCB
- NULL output parameters on failure in vfatGetFCBForFile
- Fix a few typos

svn path=/trunk/; revision=65278
2014-11-06 00:07:01 +00:00
Thomas Faber 0e9ce28f2c [FASTFAT]
- Fix incorrect referencing in VfatCreateFile. vfatGetFCBForFile expects a reference on ParentFcb (and may release it), and also returns a referenced parent FCB.
CORE-8756 #resolve

svn path=/trunk/; revision=65276
2014-11-05 23:23:52 +00:00
Thomas Faber a66700e316 [FASTFAT]
- Assert that we never reference or dereference an FCB with RefCount 0
CORE-8733

svn path=/trunk/; revision=65270
2014-11-05 19:06:19 +00:00
Thomas Faber b708ab01e9 [FASTFAT]
- VfatCleanupFile: do not dereference the FCB when closing the volume file object. ObDereferenceObject already causes an IRP_MJ_CLOSE request to be sent, which dereferences the FCB.
CORE-8733 #resolve

svn path=/trunk/; revision=65269
2014-11-05 18:52:11 +00:00
Pierre Schweitzer 71606f1035 [NTFS]
Actually, we know how to read non resident attributes, so read a non resident attribute list if found.

svn path=/trunk/; revision=65257
2014-11-04 21:16:14 +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 217a030519 [NTFS]
Try to read the names from the biggest name space to the smallest.
Only at the end assert we have to have a name.

This fixes name enumeration on Windows 7 NTFS volumes.

svn path=/trunk/; revision=65239
2014-11-04 07:52:14 +00:00
Hervé Poussineau 3fc8b084e5 [NTFS] Implement IRP_MJ_QUERY_INFORMATION/FileNetworkOpenInformation:
We are now able to execute some binaries on a NTFS partition.

svn path=/trunk/; revision=65204
2014-11-02 22:56:53 +00:00
Hervé Poussineau 68487164df [NTFS] Fix IRP_MJ_QUERY_INFORMATION/FileNameInformation, which should handle buffers not big enough
svn path=/trunk/; revision=65203
2014-11-02 22:56:47 +00:00
Hervé Poussineau bdbbb217d5 [NTFS] Update headers
svn path=/trunk/; revision=65202
2014-11-02 22:56:38 +00:00
Pierre Schweitzer f2cbb4ac21 [NTFS]
Update headers.
Hervé, feel free to copy :-P

svn path=/trunk/; revision=65198
2014-11-02 21:50:40 +00:00
Hervé Poussineau 6a520d8fbe [NTFS] Hack fix duplicate directory entries for files having a short name and a long name
svn path=/trunk/; revision=65196
2014-11-02 20:18:34 +00:00
Hervé Poussineau c554032df9 [NTFS] Optimize directory search initialization
svn path=/trunk/; revision=65195
2014-11-02 20:18:27 +00:00
Pierre Schweitzer ffa40006ae [NTFS]
Quickly implement NtfsReadFile().

By quickly, I mean that it works but is under optimal in many ways, and also doesn't support any caching. So, don't expect breaking performances.

BUUUUUUT... This implements reading a file on a NTFS volume on ReactOS! And it works!
Here is a picture of all the achievements of ReactOS with NTFS lately: http://www.heisspiter.net/~Pierre/rostests/NTFS_all.png
-> Volume information
-> Displaying files in explorer
-> Moving across directories
-> Reading a file (with more here)

That's all folks! (for now ;-))

svn path=/trunk/; revision=65192
2014-11-02 19:55:22 +00:00
Pierre Schweitzer 6ea5fe3e43 [NTFS]
Don't attempt to uninitialize cache map with a spin lock held.

svn path=/trunk/; revision=65191
2014-11-02 19:27:58 +00:00
Hervé Poussineau 82f99f5e41 [NTFS] Fix directory listing with search pattern
This fixes name completion in command prompt.

svn path=/trunk/; revision=65190
2014-11-02 18:58:16 +00:00
Pierre Schweitzer b304d6f14a [NTFS]
Fix a really nasty bug in NTFS: it was possible to perform a buffer overflow when reading the bitmap data.

svn path=/trunk/; revision=65186
2014-11-02 17:53:18 +00:00
Timo Kreuzer a841fadcaa [HAMMERTIMESTFU]
Silence "a few" DPRINTs

svn path=/trunk/; revision=65181
2014-11-02 11:30:14 +00:00
Pierre Schweitzer c1bbc436cb [FASTFAT]
Implement some kind of volume dismount in FastFAT (ie, implement VfatDismountVolume())

This is not fully perfect situation, but it does most of the job (+ leaking a few things). So far, this is not dramatic as its main use is for 1st stage. This will have to be improved later on.

CORE-8732 #comment Can you retest please?

svn path=/trunk/; revision=65173
2014-11-01 20:19:52 +00:00
Thomas Faber 6f9a074461 [FASTFAT]
- The volume FCB is not reference counted, so don't dereference it on close.

svn path=/trunk/; revision=65171
2014-11-01 18:00:15 +00:00
Pierre Schweitzer 7fbedc7a2a [NTFS]
Simplify buffer size management in GetNtfsFileRecord(). As tests shown, Windows doesn't care about the real size of the file record and expects the caller to pass the complete size of the record and returns it fully.

CORE-8725

svn path=/trunk/; revision=65166
2014-11-01 10:02:08 +00:00
Pierre Schweitzer c9d1d86d84 [NTFS]
- Move FSCTL_GET_NTFS_VOLUME_DATA implementation in its own function GetNfsVolumeData(), so remove it from NtfsUserFsRequest()
- Add support for FSCTL_GET_NTFS_FILE_RECORD in NtfsUserFsRequest()
- Implement GetNtfsFileRecord() which returns a file record. Not fully sure about its implementation, this is to be checked.

This does not really improve the nfi situation in any kind yet...

CORE-8725

svn path=/trunk/; revision=65145
2014-10-31 14:21:35 +00:00
Jérôme Gardou 3d37281ca2 [FASTFAT]
- Fix renaming files in case the target file already exists.
 - Plug a few reference count leaks on FCBs.
CORE-8660 #comment fixed in r65140 #resolve
CORE-8633 #comment fixed in r65140 #resolve
CORE-4758 #comment fixed in r65140 #resolve

svn path=/trunk/; revision=65140
2014-10-31 11:04:12 +00:00
Pierre Schweitzer ab38eafc21 [FASTFAT]
On the road for getting rid of IopParseDevice() hack....

- Add support for FSCTL_LOCK_VOLUME, FSCTL_UNLOCK_VOLUME, FSCTL_DISMOUNT_VOLUME in VfatFileSystemControl()
- Implement VfatLockOrUnlockVolume(). This brings some kind of volume locking to FastFAT FSD. It's likely not fully accurate and welcome to race conditions. But, its main purpose is to be used in usetup. So, this is fine for now.
- Stubplement VfatDismountVolume(). This will be implemented later on, but should be relatively straightforward as it requires volume to be locked (so, we're the last ones on it :-)).

svn path=/trunk/; revision=65129
2014-10-30 20:56:40 +00:00