Commit graph

463 commits

Author SHA1 Message Date
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