Commit graph

358 commits

Author SHA1 Message Date
Joachim Henze 5b062078b3 [0.4.9][AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread (#4972)
fix CORE-18328 'FileZilla 3.8 unable to list content of a remote directory due to undue ECONNRESET'
I tested to list the contents of ftp.heise.de and downloaded some files from its pub.

by porting back:
0.4.15-dev-5870-g 9f9b81e396 [AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread CORE-18328 (#4972)
2023-06-14 23:43:03 +02:00
Joachim Henze aecdd2eee7 [0.4.9][BLUE] Optimize ScrIoControl for speed (#5185)
Optimize IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE and IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER for speed by using cache.
a part of CORE-18838
It is faster because it minimizes the amount of pointer dereferences within the for-loops.

fix picked from 0.4.15-dev-5881-g 3526ffc094
---------
also partially pick unrelated cleanup from:
0.4.14-dev-439-g 75f188c200 (only the change in blue.c)
---------
and take back with me some whitespace-tweaks to bring the file closer to todays releases/0.4.14
2023-06-06 23:43:40 +02:00
Joachim Henze 19f220bf51 [0.4.9][CDFS_NEW] -> [CDFS]
port back:
0.4.10-dev-615-g 45fd48bd0f [CDFS_NEW] -> [CDFS] No old driver, thus no new driver
0.4.10-dev-614-g 5795254933 [CDFS] Delete the old CDFS driver.

The new MS PL licensed one worked for several years fine for us now
even in the older releases.
So no need to keep our old unfinished one any longer within
the release-branches. They are no mausoleum.
This does *not* change, which driver is actually in use.
We do continue to use 1:1 the state of current releases/0.4.10
2023-03-23 22:09:06 +01:00
Joachim Henze c13c6e1713 [0.4.9][REACTOS] Backport "http://www.reactos" -> "https://reactos" and readme.txt
by porting back:
0.4.15-dev-5669-g 09dde2cff9 [REACTOS] "http://www.reactos" -> "https://reactos" (#5043)
0.4.15-dev-3250-g da4d0545eb [BOOTDATA] readme.txt: Trivial correction Seven->7 (#4014)
0.4.15-dev-2940-g a559d830b5 [BOOTDATA] Update readme.txt
0.4.14-dev-1550-g b7503df6ed [BOOTDATA] readme.txt: Update now-redirected 'www.reactos.org' URLs (#2633)
2023-03-19 12:41:27 +01:00
Joachim Henze 9764a5e2e2 [0.4.9][NTFS] PrintAllVCNs(): Fix a typo in an ASSERT() (#4682), DPRINT1->DPRINT, EOL-WS
First part with the typo in the assert was introduced by 5579428b4f
which was merged into ros by a merge-task during 0.4.8-dev'ing.
releases/0.4.7 didn't have that code yet.
fix picked from 0.4.15-dev-5035-g f308c6a2bc
----------
[NTFS] Do not print debug message for every function call by default
That 2nd part was picked from 0.4.13-dev-450-g 1552434940
----------
And for all the files that I had to touch for the 2nd part in the older branches,
I ported back also some EOL-whitespace-fixes within like they were done during 0.4.15-dev'ing.
2022-10-16 23:33:43 +02:00
Joachim Henze 3673724b61 [0.4.9][CMBATT] Fix 1 MSVC2010SP1 x86 dbg warning C4146 CORE-18104
can be observed with MSVC 2010SP1 (16.0.40219.1) x86 target in dbg configuation:
C:\047rls\reactos\drivers\bus\acpi\cmbatt\cmbatt.c(983) : warning C4146: unary minus operator applied to unsigned type, result still unsigned

partial pick of 0.4.13-dev-713-g 08c6d21e1f
2022-03-29 00:44:29 +02:00
Joachim Henze 192194eaa5 [0.4.9][UNIATA] Workaround random crashes on Virtual PC (#3377) CORE-12441 CORE-17371
I am not sure why this line in id_queue.cpp was added.
I don't know how I could improve that case.
Then, disable it, for the time being.

It regressed by 4b9cf2e339 (r71252). CORE-12441 CORE-17371

fix picked from 0.4.15-dev-2740-g ba77a09c04

While touching uniata do also PARTIALLY port back some bm_devs.h changes:
0.4.15-dev-1522-g 88d36c93a2 (Properly mark ReactOS diff from upstream)
2021-11-16 22:32:23 +01:00
Joachim Henze 94db51a700 [0.4.9][UDFS] Fix crash on boot in release builds with UDFS removable media inserted (#4061) CORE-17598
Changes to specific files and their effects are as follows:
create.cpp - Allows booting past second stage with UDFS media inserted without BSOD
close.cpp - Allows shutdown without hang
dircntrl.cpp - Allows New Hardware Wizard not to hang on initial third phase install

It began to crash with the introduction of the UDFS driver in SVN r74901 == git 3a104c8f20

Fix picked from 0.4.15-dev-3326-g a91f5e8e4d
2021-11-14 21:21:59 +01:00
Joachim Henze dec08c83a5 [0.4.9][CDFS_NEW] Fix a macro-copy-paste and shrink the binary size CORE-17405
picked from 0.4.15-dev-1456-g 889eab7
2021-07-03 20:47:57 +02:00
Joachim Henze de9a7b0dc7 [0.4.9][EXT2] Fix filesystem corruption regressions CORE-17572 CORE-17195
It regressed when we upgraded Ext2Fsd to version 0.69 from version 0.68
via CORE-13980 in 0.4.8-dev-117-g a1d7e9936d

The fix is a partial revert of that.
Thanks to the patches author Doug Lyons.

VBox https://reactos.org/testman/compare.php?ids=77904,77908 LGTM
KVM https://reactos.org/testman/compare.php?ids=77903,77907 LGTM

fix picked from 0.4.15-dev-2792-g cb408102cc
2021-07-02 13:45:36 +02:00
Joachim Henze cbd0b79f8a [0.4.9][CDFS_NEW][SDK] Replace intermediate workarounds with proper fix CORE-14067
Historically we did hit assertions and exceptions in MS CDFS driver
when special characters 'äöüßÄÖÜ' were used in a valid filesystem.

We did already apply varying workarounds for those issues
into CDFS_NEW for 0.4.8, 0.4.9, 0.4.10
while we were in the learning curve still.

Later we found the root cause to be our faulty XDK
FsRtlIsAnsiCharacter* macros.

By fixing the macros we can replace the varying historic workarounds
and sync to the final 0.4.11-dev master state.

We did not ever observe new issues with any other filesystems that do
also use those macros during the last years. So we can sync now.
2020-12-31 15:15:43 +01:00
Joachim Henze 9ff6310cdc [0.4.9][FFS] Silence some only-informative KdPrints.
picked from 0.4.13-dev-924-g 4016225269
2020-12-21 07:54:37 +01:00
Joachim Henze 2b20379851 [0.4.9][CDFS_NEW] Make windows gcc release build compile CORE-15659
This fixes a regression introduced by 0.4.8-dev-164-g
ec6b3ecbe4
when the new driver was activated for compiling.

Many thanks to Thomas Faber, Pierre Schweitzer, Serge Gautherie

The fix is squashed backport of commit 0.4.12-dev-431-g
bccad87f3c
and commit 0.4.12-dev-432-g
3463b2db9f
2020-10-03 19:33:17 +02:00
Pierre Schweitzer ea76ef8477 [0.4.9] cherry-pick [FASTFAT] Properly check for buffer size on dir enumeration.
This avoids improper returns when multiple entries are requested
and, in rare circumstances, entries not being seen by umode.

CORE-14699

(cherry picked from commit 01e2877161)
2018-06-07 20:57:47 +02:00
Pierre Schweitzer 98e87bcafd [0.4.9] cherry-pick [FASTFAT] Lock DirResource on flush in case we're updating entry
CORE-14660

(cherry picked from commit 9f3169b295)
2018-05-28 19:44:27 +02:00
Pierre Schweitzer 367cb1fff3 [0.4.9] cherry-pick [FASTFAT] Lock DirResource when modifying an entry on disk.
Likely not optimal, but fixes some races conditions where
the directory is uninit in the middle of the write.

(cherry picked from commit fc788cf2fd)
2018-05-27 12:58:00 +02:00
Pierre Schweitzer c71d198fd8 [0.4.9] cherry-pick [FASTFAT] Initialize cache if neded for changing volume label.
CORE-14654

(cherry picked from commit 47b9db9d02)
2018-05-26 14:13:17 +02:00
Pierre Schweitzer bf2d787a94 [0.4.9] cherry-pick [FASTFAT] Properly handle IRPs that can wait and these that cannot.
CORE-14634

(cherry picked from commit b4363068d1)
2018-05-26 14:12:36 +02:00
Pierre Schweitzer 07a13ca67c [0.4.9] cherry-pick [FASTFAT] Properly queue pending write IRPs.
Addendum to 30b836b

(cherry picked from commit e9e14be661)
2018-05-26 14:12:29 +02:00
Pierre Schweitzer 4af12f40ca [0.4.9] cherry-pick [FASTFAT] When extending a file, also lock the DirResource.
This avoids race conditions under high IOs and thus corruption on
the FS, or assertions failures in the kernel.
Easily triggered by building ReactOS on ReactOS ;-).

(cherry picked from commit 30b836bf3f)
2018-05-26 14:12:22 +02:00
Joachim Henze 6ce8028f87 [0.4.9] [AFD] Apply unfinished patch to avoid BSODs CORE-14048 & CORE-12520
Fixes BSODs when starting Deluge Torrent 1.3.12.1 & QBitTorrent 3.2.0
due to running "Out of NP Expansion Pool"

This patch is still WIP of ThFabba.

like in 0.4.8 before

(cherry picked from commit 6b8b704e6f)
2018-05-20 22:48:46 +02:00
Joachim Henze 7f96f90110 [0.4.9] [CDFS_NEW] Mute continuable assertion to avoid CORE-14067
like in 0.4.8 before

(cherry picked from commit 51f9494d48)
2018-05-20 22:46:42 +02:00
Pierre Schweitzer a10f6c7a0c
[FASTFAT] Fail if allocating the stream FO fails. 2018-05-20 13:53:43 +02:00
Pierre Schweitzer 7283f3cfd9
[FASTFAT] Addendum to d69f318 2018-05-19 13:46:34 +02:00
Pierre Schweitzer d69f31848e
[FASTFAT] Misc. fixes spotted by Thomas. 2018-05-19 10:07:14 +02:00
Pierre Schweitzer 7c01587680
[FASTFAT] Completely rewrite support for dirty volumes.
Until now, our support for dirty volumes was totally broken
to a point where, on FAT32 volume, the dirty couldn't even
be written nor read from the disk.

This commit totally rewrites its handling, for both FAT16 and FAT32
so that it's now fully functionnal. Furthermore, it also gets
totally compatible with our vfatlib, and thus, autochk.
Now, on mount, FastFAT will check if the volume is dirty or not, and
autochk will be able to ask for a repair if dirty. vfatlib will
repair the volume and remove the dirty bit. So that, on next
reboot, the volume will be mounted clean.

As a reminder, the dirty bit is set immediately after mounting
the volume, so that, if you crash or have a powercut, autochk
will always attempt to repair your volume (with more or less,
that's FAT!).

If you want to experience without breaking your FAT volume,
just boot, open a cmd prompt and type: fsutil dirty set c:
and reboot!

CORE-13758
CORE-13760
CORE-13759
2018-05-18 23:05:05 +02:00
Pierre Schweitzer efa75dd5b2
[FASTFAT] Allow locking system volume on boot.
This is a hack, and totally not the default behavior.
But it will allow autochk locking the boot volume in
order to verify it on boot, in case it would have
been improperly dismounted.

CORE-13759
2018-05-18 23:05:05 +02:00
Pierre Schweitzer a837694518
[FASTFAT] Uninit directory cache on last handle close.
CORE-14629
CORE-14557
2018-05-18 14:51:24 +02:00
Pierre Schweitzer 3c3ebe3320
[FASTFAT] Only initialize directory cache on use.
This avoids initializing cache directly on directory
open/create.
The advantage is we reduce the load on cache manager
and on memory manager by avoiding creating everytime
a stream file object, and initializing cache for it.

This will avoid initializing cache for started
applications 'current directory' which is just opened
for having a valid handle but no read/write is performed
in it, by default.

This is a step forward for autochk.

CORE-14629
2018-05-18 14:09:30 +02:00
Pierre Schweitzer 5d743b7bd7
[FASTFAT] When attaching our FCB to a FO, also set the VPB.
Spotted by Alex.
2018-05-18 10:30:52 +02:00
Peter Wathall ae9cc6bb52 Fixed typo 2018-05-17 16:15:25 +01:00
Peter Wathall 6412253d44 Fixed typo 2018-05-17 16:15:25 +01:00
Peter Wathall 3a3a4f7970 Fixed typo 2018-05-17 16:15:25 +01:00
Pierre Schweitzer d37280efaa
[FASTFAT] Deny dismounting system volume or a volume with a pagefile 2018-05-16 21:45:35 +02:00
Thomas Faber ccaf7b24c3
[NDIS] Fix parameter order when calling ResetHandler. CORE-14624 2018-05-14 18:17:52 +02:00
Pierre Schweitzer 38078335b9
[FASTFAT] Implement support for stack overflow in read operations.
Before performing a read operation, FastFAT driver will
attempt to compute whether it would run out of stack
during the operation. If so, instead of attempting the
operation in the current thread, it will post the read
request to the overflow thread.

This should help with the regressions brought in by
94ead99e0c.

CORE-14601
2018-05-12 12:03:18 +02:00
Thomas Faber 0ce31759d0
[USBPORT] Fix x64 build. 2018-05-12 10:11:21 +02:00
Vadim Galyant c89a190ea6
[USBPORT][USBOHCI_NEW] Avoid using pointers for physical addresses. 2018-05-11 15:46:25 +02:00
Thomas Faber 837411e292
[USBOHCI_NEW] Fix build. 2018-05-11 15:44:19 +02:00
Serge Gautherie b893124a20 [NTFS] Fix 2 Clang-Cl warnings about CurrentKey->IndexEntry->Flags
"warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]"

CORE-14306
2018-05-04 08:08:45 +02:00
Pierre Schweitzer 2a7d16727a
[FASTFAT] Implement write IOs defering.
Before any write operation that would involve caching, ask
the cache controler whether writing would make it exceed its memory
consumption. If so, queue the write operation for later execution.

In case the write operation can wait, then, the FSD operation will be
halted until the write is allowed.

I could test it successfully by copying huge files from a FAT volume to
another. The write is halted until some portions of the file is written
to the disk.
I could also properly install Qt (SDK) on ReactOS with this and less than 1GB RAM:
- https://www.heisspiter.net/~Pierre/rostests/Qt_OS.png
- https://www.heisspiter.net/~Pierre/rostests/Qt_OS2.png

CORE-12081
CORE-14582
CORE-14313
2018-04-29 20:42:53 +02:00
Pierre Schweitzer 00e843b1ed
[FASTFAT] Reduce the number of local declaration. 2018-04-29 12:33:53 +02:00
Pierre Schweitzer fd8197645f
[FASTFAT] Use KdRosRegisterCliCallback() to register in KDBG. 2018-04-29 12:23:18 +02:00
Pierre Schweitzer c5a35ecd37 [FASTFAT] Introduce a KDBG extension.
This is a PoC of what it's possible to realize thanks to an
already existing hack in ntoskrnl :-).
With this extension, on the kdb:> prompt, you're able to type
in commands that will be handled by the FastFAT driver and not
by the kernel, allowing internal debug, not possible otherwise.

So far, three commands exist:
- ?fat.vols: lists all the mounted volumes by FastFAT
- ?fat.files: lists all the files on a specific volume (with their attributes)
- ?fat.setdbgfile: allows watching on specifics files lifetime

This is obviously only the begin and could be greatly improved.

For instance, this is what allowed to debug CORE-14557
2018-04-29 12:15:11 +02:00
Pierre Schweitzer 94ead99e0c [FASTFAT] Don't leak directories FILE_OBJECT, FCB and cache entries.
Once a directory is crossed (opened or a child is opened), associated
FCB structure is created in FastFAT, but also a stream FO for caching.
Up to now, due to an extra reference taken by the stream file object,
even when the directory was no longer used, the directory was kept in
memory: the FCB was never deleted, the file object was never dereferenced,
and the cache never released.

The immediate effect of this bug is that our FAT driver was leaking every
directory that was used affecting the whole OS situation. In case of
directories intensive operation (like extraction the ReactOS source code
in ReactOS ;-)), we were just killin the whole OS RAM without any way to
release it and recover.

The other side effects: IOs were faster as half of the FS was always
permanant in RAM.

This commit fixes the issue by forcing the FSD to release the FO,
and the cache when a directory is no longer used, leading to its
destruction in RAM.
Downside: on IO intensive operation, expect slowdowns, obviously,
there's less caching now. But more efficient!

CORE-14557
2018-04-28 18:33:14 +02:00
Pierre Schweitzer 315f9a13d4
[FASTFAT] When allocating a FCB, set its node type code.
We set the same value as MS FastFAT driver for consistency.
2018-04-27 18:56:31 +02:00
Peter Wathall 9e2dd8676a Removed unreachable line (#517)
The break statement was unnecessary because the goto on the line before it returns from the routine so it can never be reached
2018-04-24 21:35:23 +01:00
Hermès Bélusca-Maïto da5dcdcbf2
[NULL] Additions for the Null driver.
- Allow the driver to be unloaded, as on Windows.
- Use a static fast IO dispatch table, instead of allocating one and
  risking any potential memory allocation failure.
- Update the file header.
2018-04-22 22:23:54 +02:00
Hermès Bélusca-Maïto 2183e65c17
[ACPI] Fix the format of the (default hardcoded) "unique" instance ID. 2018-04-22 16:52:42 +02:00
Pierre Schweitzer c7bba39afc
[NTFS] When reading $I30 attribute fails, stop the rename operation.
This makes the function return the error instead of continuing and
performing use-after-frees operations.
This is likely to be a forgotten return!

CID 1434254, 1434268
2018-04-14 11:43:57 +02:00