Commit graph

649 commits

Author SHA1 Message Date
Thomas Faber 8530ae9950
[HDAUDBUS] Handle responses in a DPC instead of the ISR. 2019-02-28 10:06:18 +01:00
Thomas Faber a7431880bd
[HDAUDBUS] Fix a DPRINT. 2019-02-28 10:05:53 +01:00
Thomas Faber 1f76fb738a
[HDAUDBUS] Prevent overflow of the AudioGroups array. CORE-14153 CORE-15465
This protects against crashing in case of faulty/malicious hardware,
but also works around a bug in HDA_SendVerbs that causes it to return
invalid data, thereby suggesting more groups than are actually present.
2019-02-27 11:04:23 +01:00
Thomas Faber a8414f665b
[HDAUDBUS] Implement HDA_Unload. Stub HDA_Power and HDA_SystemControl. 2019-02-26 09:58:53 +01:00
Thomas Faber 25b22131ca
[HDAUDBUS] Correctly mask register values.
See https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/drivers/audio/hda/hda_controller.cpp
and https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/drivers/audio/hda/driver.h#L118-L140

This fixes various device reset failures and probably other issues.
2019-02-26 09:51:48 +01:00
Thomas Faber 584baf79d9
[HDAUDBUS] Implement PDO removal. CORE-14617 2019-02-26 09:51:38 +01:00
Thomas Faber c8c0fc8d64
[HDAUDBUS] Implement FDO removal. CORE-14617 2019-02-26 09:51:21 +01:00
Thomas Faber b05e5b0340
[HDAUDBUS] Use IoForwardIrpSynchronously instead of HDA_SyncForwardIrp. 2019-02-26 09:50:50 +01:00
Thomas Faber 789cfd3ddc
[HDAUDBUS] Forward FDO requests instead of completing them. 2019-02-26 09:20:47 +01:00
Thomas Faber ce6960b3f5
[HDAUDBUS] Use a switch for minor function codes. 2019-02-26 09:20:43 +01:00
Thomas Faber 9c7c2deff9
[HDAUDBUS] Split FDO/PDO PNP handling into separate functions. 2019-02-26 09:20:37 +01:00
Thomas Faber b65ec6ffba
[HDAUDBUS] Minor fixes:
* Add some forward-declarations
* Add some annotations
* Improve a DPRINT
2019-02-26 09:18:41 +01:00
Pierre Schweitzer 86483d6e22
[AFD] Don't allow caller to set broken values to window sizes
This will avoid 0-sized allocations, or -1-sized allocations.
So far, it's maxed by hard value stored in TCPIP.sys. I believe
this is not right and would deserve a true fix
2019-02-25 22:34:28 +01:00
Pierre Schweitzer bb9eec7537
[AFD] Add default window sizes on socket creation 2019-02-25 22:34:28 +01:00
Thomas Faber 9d53c935f2
[ACPI] Update ACPICA library to version 20190215. 2019-02-17 09:51:20 +01:00
Pierre Schweitzer 24b2d59ab6
[E1000] Remove useless null check
CID 512827
2019-02-16 10:02:29 +01:00
Pierre Schweitzer e1f4d2864a
[E1000] Don't attempt to free uninitialized pointer
CID 1442660
2019-02-16 10:02:28 +01:00
Pierre Schweitzer f36cbf75e3
[FASTFAT] On volume open, update share access if volume was already open
It was never updated afterwards, leading to a totally loss of share
access information amongst callers.
2019-02-14 10:48:32 +01:00
Andrew Cook 99ec8ff00c [RAMDISK] Fix unterminated query table 2019-02-13 09:33:10 +01:00
Hermès Bélusca-Maïto 38be848f68
[USBSTOR][USBSTOR_NEW] Fix a comparison made for assigning the ScsiInquiryData->RemovableMedia flag.
Now removable drives are really reported as such.

See https://github.com/reactos/reactos/pull/308/files#r163224294
for more details.
2019-02-10 22:40:59 +01:00
Hermès Bélusca-Maïto a56a2e95a2
[DISK.SYS] Add a HACK so that we can use NT5+ NTOS functions with this NT4 driver for removable devices.
This is needed in order to avoid an infinite recursive loop between
disk!UpdateRemovableGeometry() and ntos!IoReadPartitionTable().
This does not happen with NT5+ disk_new.sys because it doesn't call
IoReadPartitionTable() in that situation.
2019-02-10 22:39:12 +01:00
Pierre Schweitzer 6295cc506e
[OOPS] That was not meant to be pushed/commited 2019-02-10 20:52:55 +01:00
Pierre Schweitzer d2c71d761e
[CRYPTEX] Add French translation 2019-02-10 20:43:14 +01:00
Serge Gautherie 17af7f0c27 [UDFS] Correctly check SeSinglePrivilegeCheck() return value
SeSinglePrivilegeCheck() returns a BOOLEAN, not a NTSTATUS.

CORE-14271
2019-02-10 10:16:55 +01:00
Victor Perevertkin d9c4d28e59 [E1000] Finished an implementation of the driver.
Added PIDs for whole Intel 8254x family.
Note: this driver uses legacy interfaces for either receive and transmit descriptors.
CORE-14675
2019-02-07 19:48:54 +01:00
Mark Jansen 1b2ca28107 [NDIS] Improve debug output 2019-02-07 19:48:54 +01:00
Mark Jansen 3606404b2e [E1000] Initial send implementation.
CORE-14675
2019-02-07 19:48:54 +01:00
Mark Jansen ebad64bcfe [E1000] Implement basic sending.
Implement some interrupt recognition

CORE-14675
2019-02-07 19:48:54 +01:00
Mark Jansen d9b0601ceb [E1000] Basic initialization of the card
Initialize some registers, allocate basic resources

CORE-14675
2019-02-07 19:48:54 +01:00
Mark Jansen 4561998a45 [E1000] Create an initial driver skeleton
Based on the rtl8139 driver written by Cameron Gutman

CORE-14675
2019-02-07 19:48:54 +01:00
Alexandr A. Telyatnikov 0c7e9684bd [UNIATA] Add AHCI revision 1.3.1
Also explicitly print current AHCI revision in debug log. CORE-15643
2019-02-02 15:47:39 +01:00
Hermès Bélusca-Maïto b6c49bdff2
[MOUNTMGR] Fix MSVC build after commit 53abbb06. 2019-01-27 16:09:54 +01:00
Hermès Bélusca-Maïto 53abbb06b5
[MOUNTMGR][MUP] Use global definition of INIT_FUNCTION/INIT_SECTION (Addendum to 71fefa32). 2019-01-27 02:40:11 +01:00
Joachim Henze 3463b2db9f [CDFS] Addendum to last commit CORE-15659
#endif placed wrong.
Thx Pierre Schweitzer, Thomas Faber, Serge Gautherie
2019-01-22 19:20:47 +01:00
Joachim Henze bccad87f3c [CDFS] Make windows gcc release build compile, regression CORE-15659 2019-01-22 18:49:51 +01:00
Pierre Schweitzer 20ddde0a97
[MOUNTMGR] Misc. fixes to QueryDeviceInformation:
- Simplify failure path for DeviceName query failure
- Don't make stable query failure fail the whole function call

Based on a patch by Vadim Galiant

CORE-15550
2019-01-20 17:38:29 +01:00
Thomas Faber 363f5f26b1
[ACPICA] Update to version 20190108. CORE-15593 2019-01-12 16:27:54 +01:00
Thomas Faber ecbd6353cc
[ACPICA] Update to version 20181213. CORE-15593 2019-01-12 16:27:42 +01:00
Thomas Faber bc002f1708
[FASTFAT] Avoid a use after free in VfatCloseFile. 2019-01-12 16:27:37 +01:00
Thomas Faber bc8307205b
[FASTFAT] Avoid a use after free in VfatCheckForDismount. 2019-01-12 16:27:30 +01:00
Pierre Schweitzer d84ab9ec7c
[MOUNTMGR] Fix buffer length checking
Found by Vadim Galiant.

CORE-15549
2019-01-03 23:12:16 +01:00
Eric Kohl 8be4a871b1 Addendum to 60f018ae: Remove obsolete DPRINTs and fix a DPRINT. 2019-01-03 21:32:33 +01:00
Eric Kohl 60f018aea6 [ACPI] Add code to retrieve packet type data from ACPI methods. This will enable the cmbatt driver to retrieve _BIF (battery information) or _BST (battery status) data. Also fix the buffer size calculation for integer and string data. 2019-01-02 23:29:12 +01:00
Pierre Schweitzer 9d0eb9b7b8
[TCPIP] Don't trust the TEB
And trust the Russian hackers to exploit that.
2019-01-02 23:02:44 +01:00
Eric Kohl 34b0516ec4 [BATTC] Fixed an oops! 2019-01-01 13:48:43 +01:00
Eric Kohl 397fa2844e [BATTC] Some tiny fixes
- Add missing parameter to a DPRINT.
- Print pointers using %p instead of %x.
- Move all executable code behind a functions initial DPRINT.
- Do not use non-trivial initializers.
- Check for NULL instead of using !.
- Add missing parentheses.
2019-01-01 13:20:41 +01:00
Eric Kohl 04524fef3b [BATTC] Fix indentation. No code changes! 2019-01-01 13:20:39 +01:00
Pierre Schweitzer f76a097a25
[TCPIP] Check buffer before dereferencing it
CID 716664
2019-01-01 10:45:48 +01:00
Pierre Schweitzer 89a4cde14a
[TCPIP] Don't assume the TEB is always defined
Fixes the crash in kmtest:TcpIpConnect test.
2018-12-31 14:00:34 +01:00
Pierre Schweitzer 96985e0746
[TCPIP] Return the SubProcessTag when enumerating connections with owner class 2018-12-31 11:19:36 +01:00
Pierre Schweitzer d98001de17
[TCPIP] Save the SubProcessTag when an ADDRESS_FILE is created 2018-12-31 11:19:35 +01:00
Hermès Bélusca-Maïto f488102c86
[CDFS] Addendum to 5429771b, 6c733856 and 3c64b4cb (r75579): When the CDFS driver is used as a fixed disk FS,
the type of device it should return must not be FILE_DEVICE_CD_ROM, but must be the actual underlying one!

This fixes recognizing *removable* USB keys as disks and not CD-ROMs.

CORE-13184
2018-12-30 15:26:43 +01:00
Timo Kreuzer 71fefa32db
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
2018-12-30 12:19:11 +01:00
Pierre Schweitzer e6cd48809a
[BTRFS] Reduce diff with upstream
CORE-15452
2018-12-25 13:50:41 +01:00
Hermès Bélusca-Maïto cd52bbdf03
[BTRFS] Fix MSVC build. 2018-12-16 17:38:09 +01:00
Pierre Schweitzer 65ff430c2b
[BTRFS] Fix link with modern MSVC compilers
CORE-15452
2018-12-16 14:38:49 +01:00
Pierre Schweitzer eb7fbc253f
[BTRFS] Upgrade to 1.1
CORE-15452
2018-12-16 12:06:46 +01:00
Pierre Schweitzer e2277b1f02
[FLOPPY_NEW] Import the floppy driver from MS GitHub repository
Do not enable it yet, as it doesn't work in ROS for the moment :-(.
Its place in tree is not optimal (it should be with disk/class/etc.),
but I prefer keeping it close to actual driver for now.

All the work has been done so that it compiles and links with ReactOS
SDK though.
2018-12-15 20:04:00 +01:00
Timo Kreuzer 1e28d4d92b
[TCPIP] Implement InfoTdiQueryGetATInfo
This implements a case for InfoTdiQueryInformationEx. It's based on wild guesses, but it helps to make Windows 2003 lsass not fail.
2018-12-09 20:54:41 +01:00
Pierre Schweitzer f4d29a74aa
[NTFS] Don't perform overzealous checks on bitmap while reading a directory
This avoids partial direactory reads where we believe they are corrupted
while they are not.
2018-12-01 21:52:55 +01:00
Pierre Schweitzer 73c06d09ff
[IPHLPAPI_APITEST] CurrPorts seems to confirm that timestamp is really a timestamp 2018-11-28 08:28:37 +01:00
Pierre Schweitzer f718b1d719
[TCPIP] Stubplement returning module information for TCP and UDP connections 2018-11-27 23:12:56 +01:00
Pierre Schweitzer 3028831867
[TCPIP] Save the date when an ADDRESS_FILE is created 2018-11-27 21:36:47 +01:00
Pierre Schweitzer 655e66bdbd
[TCPIP] Define a enum to select which information to return 2018-11-27 21:36:41 +01:00
Pierre Schweitzer ce7f9211a0
[TCPIP] In InfoTdiQueryGetConnectionTcpTable(), only return if there's a connection 2018-11-25 09:32:30 +01:00
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
Pierre Schweitzer c15c61275c
Addendum to 45fd48b 2018-08-21 12:41:50 +02:00
Pierre Schweitzer 45fd48bd0f
[CDFS_NEW] -> [CDFS] No old driver, thus no new driver 2018-08-21 12:32:15 +02:00
Pierre Schweitzer 5795254933
[CDFS] Delete the old CDFS driver.
You served us well!
2018-08-21 12:27:35 +02:00
Pierre Schweitzer b5aa79a66d
[FASTFAT] Drop an useless #ifdef, we have this cast in all other FSDs 2018-08-21 08:50:29 +02:00
Pierre Schweitzer 4bb1baa860
[FASTFAT] Finally drop the TAG_VFAT allocation tag 2018-08-21 08:36:51 +02:00
Mark Jansen 6c75215bb3 [BTRFS] Fix booting with runtime checks 2018-08-21 07:05:40 +02:00
Pierre Schweitzer 53985bf64d
[FASTFAT] Disable delayed close
It brings too many regressions for too little gain.

CORE-14938
CORE-14917
CORE-14826
2018-08-20 19:43:43 +02:00
Victor Perevertkin 0e61b570e7 [BTRFS] Applied upstream pull-requests before they are merged 2018-08-20 08:26:56 +02:00
Victor Perevertkin 07bc92f740 [USETUP][SETUPLIB] Added support for formatting partition in BTRFS and installing ReactOS on it.
Removed code related to EXT2 boot sector for now.
CORE-13769
2018-08-20 08:26:56 +02:00
Pierre Schweitzer c1ac347825
[CDROM] Set proper status on disk verify
This avoids an assert under certain conditions in CDFS.
Check cdrom_new for reference.

CORE-14873
2018-08-19 11:11:21 +02:00
Pierre Schweitzer 901c47ed14
[FASTFAT] Don't delay any other close once shutdown has started 2018-08-19 09:56:12 +02:00
Pierre Schweitzer 4fe7aafe10
[FASTFAT] Magic values-- 2018-08-19 09:56:12 +02:00
Pierre Schweitzer 047479e0a2
[FASTFAT] Don't leak statistics on dismount 2018-08-18 19:03:30 +02:00
Pierre Schweitzer 639e6d635f
[FASTFAT] Reduce the usage of the generic allocation tag
And use tag compatible with MS FastFAT, to use debug with WinDBG
2018-08-18 19:03:30 +02:00
Pierre Schweitzer 50b00f0fcc
[FASTFAT] Implement delayed close
When we're about to close a file (ie, forget everything about it
and release any associated structure), actually delay it.
This allows keep data fresh in memory for faster reuse in case
it would be required. The effective closing will only happen after some time.

For specific operations, this will produce a real speed up in ReactOS.
For instance, with that patch, Winamp starts within seconds, instead of dozen
of minutes.
In most cases, it will bring ReactOS to performances it had before fixing
the huge leak in FastFAT (commit 94ead99) without leaking the whole FS.

For now, due to regressions, this is only activated for files and not
for directories. Once it gets fixed, it will be enabled for both.

CORE-14826
CORE-14917
2018-08-18 19:03:30 +02:00
Thomas Faber 5403094339
[USBPORT] Fix 64 bit warnings. 2018-08-16 14:14:42 +02:00
Thomas Faber bd4529b717
[USBPORT] Specify the correct length for the root hub's hub descriptor. 2018-08-16 14:14:31 +02:00
Thomas Faber db54e5eb1c
[USBPORT] Remove an unnecessary check in USBPORT_AllocateBandwidthUSB2. CID 1434261 2018-08-16 14:14:23 +02:00
Thomas Faber 7ad4cf96f3
[USBPORT] Remove an unnecessary check in USB2_ConvertFrame. CID 1434244 2018-08-16 14:14:15 +02:00
Thomas Faber d1e5699e60
[USBPORT] Accept negative BusTime in USB2_MoveTtEndpoint. CID 1434226 2018-08-16 14:14:04 +02:00
Mike Swanson 3c7e9bb332 Remove unnecessary executable bits 2018-08-15 18:29:09 +02:00
Pierre Schweitzer c13ccc92f6
[BTRFS] Leak the root stream file object on mount.
For whatever (unknown) reason yet, this stream file object
seems to be deleted when still in use while installing
ReactOS on BtrFS partition, leading to use after free.

So, quick and dirty hack: leak it to prevent deletion.

CORE-13769
2018-08-15 16:38:56 +02:00
Pierre Schweitzer 80e11516b1
[BTRFS] Allow driver to start at first stage when no hive is present.
Contrary to upstream, we will ignore failure when opening registry
and will keep going.

CORE-13769
2018-08-15 16:35:05 +02:00
Serge Gautherie 7d6bda16c6
[REACTOS] Improve how some ASSERTMSG() message values are printed: enforce ending "\n".
NB: Not touching calls in "third-party" code: class and classpnp.
2018-08-08 22:03:45 +02:00
Timo Kreuzer 9e066abe2a [DRIVERS] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Timo Kreuzer f8bf0e9c3a [UNIATA] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Timo Kreuzer c1944118ca [USBPORT] Fix 64 bit issues 2018-08-04 19:19:34 +02:00
Stanislav Motylkov 0854c69a75 [I8042PRT] Move DMI/SMBIOS parsing functions into library 2018-08-02 21:29:57 +02:00
Stanislav Motylkov a9f20984cd
[I8042PRT] Dump SMBIOS tables into registry for usermode access
Reference:
https://social.msdn.microsoft.com/Forums/en-US/0bb0840e-85f4-4cdb-9710-7581f7348f2f/how-to-get-motherboard-serial-number-without-using-wmi-in-c

CORE-12105 CORE-14867
2018-08-02 21:15:28 +02:00
Timo Kreuzer 3a85d2764c [BLUE] Use ByteOffset.QuadPrt instead of ByteOffset.LowPart 2018-07-07 16:15:58 +02:00
Timo Kreuzer 741c3c0022 [BLUE] Reformat and add missing success checks + DPRINTs on failure 2018-07-07 16:15:58 +02:00
Timo Kreuzer 64f46045af [BLUE] Formatting, no code change 2018-07-07 16:15:58 +02:00
Timo Kreuzer ca9fd861aa [DRIVERS][NTOS][NDK] Use IO_STACK_LOCATION instead of EXTENDED_IO_STACK_LOCATION and remove the latter from NDK 2018-07-01 14:45:21 +02:00
Thomas Faber 05b4bd3833
[AFD] Respect the maximum receive buffer size for datagram sockets. CORE-14048 2018-06-10 13:00:37 +02:00
Pierre Schweitzer 52f0f80a83
[FASTFAT] Don't add an extra \, when renaming a file at root.
This fixes failures to rename a file where destination is
the root of a FAT volume.

CORE-10503
2018-06-09 22:17:17 +02:00
Pierre Schweitzer 6aa4beeefb
[FASTFAT] Use the FastFAT mechanism for counting clusters already implemented
This allows us having more accurate statistics regarding available clusters
count. Even though FastFAT and chkdsk still don't agree!

CORE-3877
2018-06-09 18:23:07 +02:00
Pierre Schweitzer 704baed2df
[FASTFAT] Start implementing FAT32 statistics support
Not fully perfect yet, chkdsk still complains.

CORE-3877
2018-06-09 12:36:43 +02:00
Pierre Schweitzer 04640f9264
[FASTFAT] Save the FSINFO sector location 2018-06-09 12:11:43 +02:00
Pierre Schweitzer 01e2877161
[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
2018-06-07 19:34:47 +02:00
Serge Gautherie c1256dda20 [EXT2FS][REISERFS] VSSolution: Actually disable C4189 errors (#540)
Multiple "error C4189: '[...]': local variable is initialized but not referenced".

Thanks to Yuntian Zhang, who hinted at this in CORE-11836.

CORE-11280
2018-06-05 20:16:22 +02:00
Pierre Schweitzer 9f3169b295
[FASTFAT] Lock DirResource on flush in case we're updating entry
CORE-14660
2018-05-28 19:37:56 +02:00
Pierre Schweitzer fc788cf2fd
[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.
2018-05-26 17:13:08 +02:00
Pierre Schweitzer c7806a6b29
[BTRFS] Upgrade to 1.0.2
CORE-14655
2018-05-26 10:44:36 +02:00
Pierre Schweitzer 47b9db9d02
[FASTFAT] Initialize cache if neded for changing volume label.
CORE-14654
2018-05-26 10:12:55 +02:00
Eric Kohl f7c01906e7 [STORPORT] Enumerate attached devices
- Implement AcquireSpinlock, ReleaseSpinlock and GetExtendedFunctionTable notifications.
- Implement a bus scan routine, borrowed from scsiport.

Storport and storahci are now able to detect a disk device attached to a Virtual Box AHCI controller.
2018-05-24 11:39:47 +02:00
Pierre Schweitzer b4363068d1
[FASTFAT] Properly handle IRPs that can wait and these that cannot.
CORE-14634
2018-05-22 21:30:08 +02:00
Pierre Schweitzer e9e14be661
[FASTFAT] Properly queue pending write IRPs.
Addendum to 30b836b
2018-05-21 10:41:59 +02:00
Pierre Schweitzer 30b836bf3f
[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 ;-).
2018-05-21 10:30:14 +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
Timo Kreuzer 6b1ca75899
[REACTOS] Fix 64 bit build (#465)
* [HAL] Simplify HalpReboot() and make it portable
* [NTOS:MM] Cast constant to PVOID
* [BINPATCH] Fix 64 bit build
* [VFDDRV] Fix 64 bit build and buffer overruns
* [USBOHCI] Fix structure alignment issues
* [ATL_APITEST] Fix 64 bit build
* [XDK] Update unwind structures in winnt.h
* [NTDLL_APITEST] Fix 64 bit build
* [NTDLL_WINETEST] Fix 64 bit build
* [TFTPD] Fix x64 build
* [USBPORT] Fix a C_ASSERT
* [DSOUND] Fix x64 build
* [HAL] Remove obsolete GetPteAddress() macro
2018-04-03 15:13:17 -06:00
Colin Finck 765280bf5f Merge PR #283 "[USBPORT] Transaction Translator (TT) support bringup" 2018-03-29 23:52:22 +02:00
Thomas Faber 851a554b59
[USBHUB_NEW] Fix USBH_CheckDeviceIDUnique return value. 2018-03-27 08:59:54 +02:00
Nikita Krapivin 10645167b8 [I8042PRT] Enable keyboard clock explicitly (fixes Lenovo ACPI bug). CORE-14256 (#434) 2018-03-21 22:07:30 +01:00
Mark Jansen 8b84b1c6b3 [AFD] Mark the socket as named pipe, so NtWriteFile actually knows what to do with it.
CORE-13067
2018-03-21 19:22:13 +01:00
Mark Jansen 9168226378 [AFD] Respond to FileFsDeviceInformation.
CORE-13067
2018-03-21 19:22:13 +01:00
Bișoc George 1a951aa4e6 [BUS][ACPI] Silence DPRINT1 in the special case of IOCTL_BATTERY_QUERY_TAG (#427) 2018-03-12 15:29:14 +01:00
Eric Kohl ca22dc9bb5 [STORPORT][DDK] Add the StorPortExtendedFunction stub
- Add the StorPortExtendedFunction stub to the storport driver.
- Add the declaration of StorPortExtendedFunction to the ddk.

CORE-12695
2018-03-03 14:19:33 +01:00
Pierre Schweitzer 1986049a38
[CDFS_NEW] Sync with HEAD.
CORE-14315
2018-02-25 10:14:27 +01:00