Commit graph

434 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto b77824a375 [FASTFAT] Improvements for volume dismount + minor bugfixing.
- Cache the RootFcb so that its cleanup can be handled separately
  during dismounting.

- Force volume dismount at cleanup if the VCB_DISMOUNT_PENDING flag
  is set.

- Actually dismount a volume if its VCB has been flagged as not good,
  or if we force dismounting.

NOTE: In their *CheckForDismount() function, our 3rd-party FS drivers
as well as MS' fastfat, perform a comparison check of the current VCB's
VPB ReferenceCount with some sort of "dangling"/"residual" open count.
It seems to be related to the fact that the volume root directory as
well as auxiliary data stream(s) are still opened, and only these are
allowed to be opened at that moment. After analysis it appears that for
the ReactOS' fastfat, this number is equal to "3".

- On dismounting, cleanup and destroy the RootFcb, VolumeFcb and the
  FATFileObject. Then cleanup the SpareVPB or the IoVPB members, and
  finish by removing the dismounted volume from the VolumeListEntry
  and cleaning up the notify synchronization object and the resources.

- During dismounting, and on shutdown, flush the volume before
  resetting its dirty bit.

- On shutdown, after volume flushing, try to unmount it without forcing.

- Release the VCB resources only when we actually dismount the volume
  in VfatCheckForDismount().

- Initialize first the notify list and the synchronization object,
  before sending the FSRTL_VOLUME_MOUNT notification.

- If we failed at mounting a volume but its VCB's FATFileObject was
  already initialized, first call CcUninitializeCacheMap() on it
  before dereferencing it.

- Send FSRTL_VOLUME_LOCK, FSRTL_VOLUME_LOCK_FAILED and
  FSRTL_VOLUME_UNLOCK notifications during volume locking (and failure)
  and volume unlocking.

- Flush the volume before locking it, and clean its dirty bit if needed.

NOTE: In addition to checking for VCB_CLEAR_DIRTY, we also check for the
presence of the VCB_IS_DIRTY flag before cleaning up the dirty bit: this
allows us to not re-clean the bit if it has been previously cleaned.
This is needed for instance in this scenario:
- The volume is locked (it gets flushed and the dirty bit is possibly cleared);
- The volume then gets formatted with a completely different FS, that
  possibly clears up the first sector (e.g. BTRFS ignores 1st sector);
- The volume is then dismounted: if we didn't check whether VCB_IS_DIRTY
  was set prior to resetting it, we could attempt clearing it again! But
  now that the volume's filesystem has been completely changed, we would
  then try to modify the dirty bit on an erroneous position on disk!
  That's why it should not be touched in this case during dismounting.
- The volume is unlocked (same comment as above), and later can be
  detected as being BTRFS.
2018-11-25 09:00:40 +01:00
Pierre Schweitzer 0ec92100bc
[TCPIP] Properly display local information for established connections 2018-11-24 22:26:06 +01:00
Pierre Schweitzer 13de7f08af
[TCPIP] Implement enumerating UDP connections with owner PID 2018-11-24 21:41:10 +01:00
Pierre Schweitzer 411504b5f4
[TCPIP] Implement enumerating TCP connections with owner PID 2018-11-24 21:41:09 +01:00
Pierre Schweitzer 935978ee57
[TCPIP] Store creator PID in ADDRESS_FILE 2018-11-24 21:41:09 +01:00
Pierre Schweitzer 91b013d387
[TCPIP] When enumerating sockets, retrieve their state and return it
This fixes netstat not having any state when enumerating connections.
Basically, now, our netstat produces stuff like:
https://twitter.com/HeisSpiter/status/1065871999266955264
2018-11-23 22:51:35 +01:00
Pierre Schweitzer 500a5151ea
[TCPIP] Fix returned IP address when querying TCP connections
This gives something like that now: https://twitter.com/HeisSpiter/status/1065706156331606017 :-)

CORE-15363
2018-11-22 21:52:11 +01:00
Pierre Schweitzer f29016dabe
[TCPIP] Properly handle listening sockets
We first check if a socket is listening before
checking whether it has connections. This allows
properly returning listening address.
Furthermore, if it's listening, properly return
status so that it displays nice in netstat.

Result: https://twitter.com/HeisSpiter/status/1064245622323200000 :-)
2018-11-18 20:51:54 +01:00
Pierre Schweitzer 007f43dd56
[TCPIP] Implement returning UDP connections
CORE-5401
2018-11-18 16:30:45 +01:00
Pierre Schweitzer 77d5f04f22
[TCPIP] Implement returning TCP connections
CORE-5401
2018-11-18 16:30:45 +01:00
Pierre Schweitzer 4b4c0aabcd
[FASTFAT] Properly return failure in vfatFindDirSpace()
CID 1441394
2018-11-16 22:07:07 +01:00
Mark Harmstone 5729380349
[BTRFS] Import BTRFS upstream commit e43183a0 "open_file: set granted_access when creating file".
Better solution for the original problem described at:
https://github.com/maharmstone/btrfs/pull/123
2018-11-11 21:47:29 +01:00
Pierre Schweitzer f39f25ca17 [FLTMGR] Remove duplicated export 2018-10-29 23:56:39 +01:00
Ged Murphy fa46f362ea [FLTMGR] Add a bit more basic code layout for filter registration
Needs implementing
2018-10-29 23:56:39 +01:00
Pierre Schweitzer 97066b792c [FLTMGR] Remove duplicated export 2018-10-29 23:56:39 +01:00
Ged Murphy c73c1825e2 [FLTMGR] Callers must have registered an unload routine to be allowed to unload 2018-10-29 23:56:39 +01:00
Ged Murphy 4d603e689e [FLTMGR] Delete unused file 2018-10-29 23:56:39 +01:00
Pierre Schweitzer f21a2a6cfb [FLTMGR] Stub FltReleaseFileNameInformation() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer c6b9ee5649 [FLTMGR] Stub FltGetDestinationFileNameInformation() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 08c4954007 [FLTMGR] Stub FltAttachVolume() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer b67887df10 [FLTMGR] Export FltCreateCommunicationPort() and FltCloseCommunicationPort() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 1c5cc0ff08 [FLTMGR] Stub FltGetFileNameInformation() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer c5a314b0f2 [FLTMGR] Implement FltGetVolumeName() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 21fcbcb37f [FLTMGR] Stub FltDetachVolume() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer a7423ee45b [FLTMGR] Implement FltCreateFile() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 5fc37876d8 [FLTMGR] Stub FltCreateFileEx() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer b9c6debe30 [FLTMGR] Export FltCloseClientPort() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 4c1d7026f6 [FLTMGR] Stub FltGetFileNameInformationUnsafe() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 92dca37278 [FLTMGR] Implement FltEnumerateVolumes() 2018-10-29 23:56:39 +01:00
Pierre Schweitzer 5bdd806fb9 [FLTMGR] Export FltObjectDereference() and FltSendMessage() 2018-10-29 23:56:39 +01:00
Thomas Faber b062d28bc6
[ACPICA] Update to version 20181003. CORE-15222 2018-10-28 15:28:37 +01:00
Thomas Faber 6847cc3ae0
[ACPICA] Update to version 20180531. CORE-15222 2018-10-28 15:28:34 +01:00
Thomas Faber 2deb69c1f8
[ACPICA] Update to version 20180105. CORE-15222 2018-10-28 15:28:32 +01:00
Thomas Faber ec55f0eb7f
[ACPICA] Update to version 20171215. CORE-15222 2018-10-28 15:28:29 +01:00
Hermès Bélusca-Maïto 8c0c90112e
[FASTFAT] Don't mess my debug log when partition SysType is printed! (when invalid chars are printed) 2018-10-13 19:57:24 +02:00
Thomas Faber c7af85b64b
[BTRFS] Fix IRP leak.
This leaked at least one IRP for every write, making it the largest leak when
running with BTRFS as the system volume.
Thanks to Victor Perevertkin.

Submitted upstream thanks to Pierre:
https://github.com/maharmstone/btrfs/pull/106
2018-09-30 16:11:42 +02:00
Pierre Schweitzer 257923cad1
[NPFS] Magic--; 2018-09-30 10:55:44 +02:00
Hermès Bélusca-Maïto 0c122589d2
[BLUE] Perform size/rectangle boundary checks on read/write operations. CORE-15108 2018-09-29 21:55:00 +02:00
Bernhard Feichtinger 9d1ee2400a [RAMDISK] Implement missing IOCTLs 2018-09-16 11:46:24 +02:00
Amine Khaldi 3bf751e046 [USBEHCI_NEW] Bring-in the USB EHCI miniport driver created by Vadim Galyant. (#301) 2018-09-10 09:05:35 +02:00
Vadim Galyant 3baf43c5de
[USBHUB_NEW][USBPORT] Fix buffer size calculation for multi-sz values in IRP_MN_QUERY_ID.
Also fix some copypasta'd DPRINTs.
2018-09-09 11:24:48 +02:00
Thomas Faber e400519cb5
[USBUHCI_NEW] Add license headers. 2018-09-08 10:16:02 +02:00
Thomas Faber 855df84fb2
[USBOHCI_NEW] Add license headers. 2018-09-08 10:15:52 +02:00
Thomas Faber d6d6b329be
[USBOHCI_NEW][USBUHCI_NEW] Avoid unnecessary/incorrect status defines. 2018-09-08 08:45:18 +02:00
Thomas Faber c188e387e3
[USBOHCI_NEW] Avoid storing pointers as ULONG and physical addresses as pointers. 2018-09-01 18:23:25 +02:00
Thomas Faber 0dfa7356c8
[USBHUB_NEW] Fix x64 warnings. 2018-09-01 18:23:14 +02:00
Amine Khaldi a1a65e940a [USBUHCI_NEW] Bring-in the USB UHCI miniport driver created by Vadim Galyant. (#245) 2018-09-01 17:45:45 +02:00
Katayama Hirofumi MZ 33fc7bf316 [STORAHCI] Fix MSVC "uninitialized local variable" error (C4700) (#828)
See also PR #821.
2018-08-30 00:50:06 +02:00
Pierre Schweitzer 6d7ec8c7ec
[CDFS] Revert 9d0596a
The appropriate fix was the previous one, where the macro
for checking legal chars have been fixed.

Thanks to MS for their review :-).

CORE-14067
2018-08-29 08:34:30 +02:00
Pierre Schweitzer 9d0596afe1
[CDFS] Properly check for legal names in CdIsLegalName()
Up to now, it was working by chance. Indeed, due to the invalid
ASCII check performed before calling FsRtlIsAnsiCharacterLegalHpfs(), the
macro is improperly called and overruns the FsRtlLegalAnsiCharacterArray
buffer. Fortunately, up to now, right after that buffer in kernel binary
there are strings which are more or less consistent with the flags that
are expected by the macro, causing a decent behavior of
FsRtlIsAnsiCharacterLegalHpfs() even for extended ASCII characters
(whereas FsRtlIsAnsiCharacterLegalHpfs() is only designed for ASCII
characters). But this is a totally out of control and wrong behavior.
A single change in the way the kernel was built could have caused the
CDFS driver not to work as previously.

I have made the choice to allow any extended ASCII character as done
for the unicode characters. This is a good compromise to avoid drastic
regressions for users having extended ASCII characters in their CD
file names.

This imports proposed upstream commit 1b6b625641dffb49951e60398e1a9c672318ea71
See pull request https://github.com/Microsoft/Windows-driver-samples/pull/278

CORE-14067
2018-08-28 07:50:58 +02:00