3 months ago[TCPIP] Fix bugcheck when using fragmented datagrams
Hervé Poussineau [Sun, 27 Jun 2021 12:44:54 +0000 (14:44 +0200)]
[TCPIP] Fix bugcheck when using fragmented datagrams

Memory was allocated from paged pool, and freed at DISPATCH_LEVEL,
leading to the following bugcheck:

*** Fatal System Error: 0x000000c2

Entered debugger on embedded INT3 at 0x0008:0x8058324B.
kdb:> bt
<ntoskrnl.exe:18324c (sdk/lib/rtl/i386/debug_asm.S:56 (RtlpBreakWithStatusInstruction))>
<ntoskrnl.exe:89b21 (ntoskrnl/ke/bug.c:1066 (KeBugCheckWithTf))>
<ntoskrnl.exe:8a08b (ntoskrnl/ke/bug.c:1413 (KeBugCheckEx))>
<ntoskrnl.exe:abb1d (ntoskrnl/mm/ARM3/expool.c:431 (ExFreePoolWithTag))>
<tcpip.sys:13e42 (sdk/lib/drivers/ip/network/receive.c:114 (FreeIPDR))>
<tcpip.sys:14e09 (sdk/include/ddk/wdm.h:11462 (IPDatagramReassemblyTimeout))>
<tcpip.sys:11604 (sdk/lib/drivers/ip/network/ip.c:135 (IPTimeoutDpcFn))>
<ntoskrnl.exe:8b7d0 (ntoskrnl/ke/dpc.c:282 (KiTimerExpiration))>
<ntoskrnl.exe:8c2c8 (ntoskrnl/ke/dpc.c:592 (KiRetireDpcList))>
<ntoskrnl.exe:1420b2 (ntoskrnl/ke/i386/thrdini.c:294 (KiIdleLoop))>
<ntoskrnl.exe:23a54a (ntoskrnl/ke/i386/kiinit.c:687 (KiSystemStartupBootStack))>

3 months ago[EXT2] Fix filesystem corruption regressions CORE-17572 CORE-17195
Joachim Henze [Sun, 27 Jun 2021 14:21:32 +0000 (16:21 +0200)]
[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 a1d7e9936d8e58bc07ff2cc73a937ce845c7d542

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

VBox,77908 LGTM
KVM,77907 LGTM

3 months ago[HAL:APIC] Improve code
Timo Kreuzer [Tue, 22 Jun 2021 10:53:23 +0000 (12:53 +0200)]
[HAL:APIC] Improve code

- Use an enum for the APIC registers
- Add support routine for SMP.

3 months ago[CSRSS] Fix MSVC AMD64 build
George Bișoc [Fri, 25 Jun 2021 10:42:02 +0000 (12:42 +0200)]
[CSRSS] Fix MSVC AMD64 build

3 months ago[CSRSS] Enable compilation of raise hard error function call code
George Bișoc [Fri, 25 Jun 2021 09:55:35 +0000 (11:55 +0200)]
[CSRSS] Enable compilation of raise hard error function call code

With introduction of 74e527ba330b56 and subsequently 2791ecd ReactOS can now properly set IOPL (I/O privilege level) for user mode trusted processes. With that said, enable the compilation of raise hard error function call code back.

3 months ago[CSRSS] Do not give IOPL to the Client/Server native process if ran on a AMD64 system 3756/head
George Bișoc [Sun, 20 Jun 2021 13:49:55 +0000 (15:49 +0200)]
[CSRSS] Do not give IOPL to the Client/Server native process if ran on a AMD64 system

ProcessUserModeIOPL is strictly implemented for 32-bit architecture so it doesn't make any sense for CSRSS to gather user mode I/O privilege when that won't work anyway.

3 months ago[NTOS:PS] Fix several issues within info classes in AMD64 build
George Bișoc [Sun, 20 Jun 2021 13:46:58 +0000 (15:46 +0200)]
[NTOS:PS] Fix several issues within info classes in AMD64 build

ProcessUserModeIOPL, ProcessWow64Information and ThreadZeroTlsCell classes fail on AMD64 build because of wrong IQS values assigned to them. Also explicitly tell the compiler that ProcessUserModeIOPL is strictly for x86 as user mode I/O privilege level is 32-bit stuff.
In addition to that, implement IQS_NO_TYPE_LENGTH macro which it'll be used for classes such as ProcessUserModeIOPL where type length is not required and that it should be 0. With that said, we indirectly fix a size length mismatch issue with ProcessUserModeIOPL on 32-bit of ReactOS as well.

3 months ago[NTOS:MM] Implement MmFlushImageSection(MmFlushForDelete)
Jérôme Gardou [Mon, 7 Jun 2021 17:31:24 +0000 (19:31 +0200)]
[NTOS:MM] Implement MmFlushImageSection(MmFlushForDelete)


3 months ago[NTOS:MM] Simplify refcounting when adding/deleting a page in a shared segment
Jérôme Gardou [Mon, 7 Jun 2021 17:28:51 +0000 (19:28 +0200)]
[NTOS:MM] Simplify refcounting when adding/deleting a page in a shared segment


3 months ago[NTOS:MM] Do not call ExAllocatePool* with PFN lock acquired
Jérôme Gardou [Fri, 21 May 2021 13:11:50 +0000 (15:11 +0200)]
[NTOS:MM] Do not call ExAllocatePool* with PFN lock acquired

Unsurprisingly, it actually might acquire it

3 months ago[ATL] Close m_hKey in CRegKey destructor and when attaching to a new key (#3764)
He Yang [Thu, 24 Jun 2021 21:50:01 +0000 (03:20 +0530)]
[ATL] Close m_hKey in CRegKey destructor and when attaching to a new key (#3764)

3 months ago[NTOSKRNL] Enforce -fno-common on GCC & CLang builds
Jérôme Gardou [Thu, 24 Jun 2021 15:07:26 +0000 (17:07 +0200)]
[NTOSKRNL] Enforce -fno-common on GCC & CLang builds

3 months ago[NTOSKRNL] Deduplicate some symbols
Jérôme Gardou [Thu, 24 Jun 2021 15:06:57 +0000 (17:06 +0200)]
[NTOSKRNL] Deduplicate some symbols

3 months ago[NTOS:MM] Fix-up call site of traced PFNs when serving a page fault
Jérôme Gardou [Thu, 24 Jun 2021 15:01:38 +0000 (17:01 +0200)]
[NTOS:MM] Fix-up call site of traced PFNs when serving a page fault

3 months ago[NTOS:MM] Save caller address when tracing PFNs
Jérôme Gardou [Thu, 24 Jun 2021 14:35:00 +0000 (16:35 +0200)]
[NTOS:MM] Save caller address when tracing PFNs

3 months ago[CMD] Do not use an intermediate buffer when reading lines from batch files
Jérôme Gardou [Wed, 23 Jun 2021 14:26:50 +0000 (16:26 +0200)]
[CMD] Do not use an intermediate buffer when reading lines from batch files

This is easier on the heap and improves cmd:batch winetest nicely

3 months ago[CMD] Improve performance a bit
Jérôme Gardou [Tue, 22 Jun 2021 10:44:56 +0000 (12:44 +0200)]
[CMD] Improve performance a bit

Do not use custom alloc/free functions by default.
Do not free resources at process exit.
 - You're doing it brick by brick while the OS  & CRT do that with a bulldozer better than you do.

3 months ago[WIN32K] CreateDIBPalette addendum to #3758 CORE-17626
Joachim Henze [Wed, 23 Jun 2021 19:37:53 +0000 (21:37 +0200)]
[WIN32K] CreateDIBPalette addendum to #3758 CORE-17626

Fix compilation on older GCC4.7.2 toolchain
to not warn about universal zero initializer.

3 months ago[WIN32K] CreateDIBPalette SEH Simplification #3758 CORE-17626
Joachim Henze [Wed, 23 Jun 2021 17:59:42 +0000 (19:59 +0200)]
[WIN32K] CreateDIBPalette SEH Simplification #3758 CORE-17626

Enter an SEH2_TRY one time and do all testing within it instead of entering the SEH_TRY multiple times.

The commit is an addendum to 0.4.15-dev-2734-g 514147776a7e70636911033ab6c89779b2c8ee1e

Thanks to patches author Doug-Lyons

This is 1:1 the final approved content of #3758, but I committed
by hand and closed the PR to avoid squash+rebase.

3 months ago[NTOS:MM] Fix one occurrence of MiDeletePte instead of MiDeletePde
Jérôme Gardou [Tue, 22 Jun 2021 10:04:25 +0000 (12:04 +0200)]
[NTOS:MM] Fix one occurrence of MiDeletePte instead of MiDeletePde

3 months ago[NTOS:CC] CcRosFlushVacb(): Fix Iosb annotation
Serge Gautherie [Mon, 24 May 2021 06:56:17 +0000 (08:56 +0200)]
[NTOS:CC] CcRosFlushVacb(): Fix Iosb annotation

Addendum to 2ba1926.

3 months ago[NTOS:MM] MmFlushSegment(): Fix Iosb annotation
Serge Gautherie [Mon, 24 May 2021 06:56:17 +0000 (08:56 +0200)]
[NTOS:MM] MmFlushSegment(): Fix Iosb annotation

Addendum to 90c6a65.

3 months ago[XBOX][FREELDR] Initialize PCI-AGP bridge BAR values
Stanislav Motylkov [Tue, 25 May 2021 17:32:42 +0000 (20:32 +0300)]
[XBOX][FREELDR] Initialize PCI-AGP bridge BAR values

This fixes problem with Xbox GPU not being detected as a children device.

CORE-17600 CORE-16216

3 months ago[UMPNPMGR] PNP_GetDeviceStatus: Add status checks as documented in MS-PNPR
Eric Kohl [Mon, 21 Jun 2021 22:02:56 +0000 (00:02 +0200)]
[UMPNPMGR] PNP_GetDeviceStatus: Add status checks as documented in MS-PNPR


3 months ago[SAMSRV] Fix call to SamrCloseHandle in SamrGetDomainPasswordInformation
Eric Kohl [Mon, 21 Jun 2021 19:38:42 +0000 (21:38 +0200)]
[SAMSRV] Fix call to SamrCloseHandle in SamrGetDomainPasswordInformation

3 months ago[UMPNPMGR] Add missing parameter checks to PNP_GetDeviceStatus
Eric Kohl [Mon, 21 Jun 2021 19:33:24 +0000 (21:33 +0200)]
[UMPNPMGR] Add missing parameter checks to PNP_GetDeviceStatus

3 months ago[NTOS:KE] Do not allow waiting at IRQL >= DISPATCH_LEVEL when providing a timeout...
Jérôme Gardou [Fri, 21 May 2021 07:41:27 +0000 (09:41 +0200)]
[NTOS:KE] Do not allow waiting at IRQL >= DISPATCH_LEVEL when providing a timeout in KeWaitForMultipleObjects


3 months ago[TCPIP][IP] Use an ERESOURCE as mutex for address files & connection end points
Jérôme Gardou [Fri, 21 May 2021 07:36:27 +0000 (09:36 +0200)]
[TCPIP][IP] Use an ERESOURCE as mutex for address files & connection end points

Spinlocks are not reentrant (and this is done a lot), using them forces us to have
an horrible hack in the kernel, which unschedules threads which are at DISPATCH_LEVEL
thus allowing another thread to take ownership of the spinlock while the unscheduled
thread should already hold it.


3 months ago[USETUP] Update de-DE
Joachim Henze [Mon, 21 Jun 2021 05:37:58 +0000 (07:37 +0200)]
[USETUP] Update de-DE

Translate the Copying-bootloader status bar text
that was added during 0.4.15-dev'ing

3 months ago[NE2000] Add description for Realtek RTL8019AS (emulated by 86Box)
Stanislav Motylkov [Sun, 20 Jun 2021 17:20:16 +0000 (20:20 +0300)]
[NE2000] Add description for Realtek RTL8019AS (emulated by 86Box)

3 months ago[NE2000] Combine two INF files into one for ISA and PCI cards
Stanislav Motylkov [Sun, 20 Jun 2021 17:16:33 +0000 (20:16 +0300)]
[NE2000] Combine two INF files into one for ISA and PCI cards

4 months ago[INF] machine.inf: Improve Russian translation
Stanislav Motylkov [Tue, 27 Apr 2021 21:08:16 +0000 (00:08 +0300)]
[INF] machine.inf: Improve Russian translation

4 months ago[INF] machine.inf: Minor whitespace fixes
Stanislav Motylkov [Tue, 27 Apr 2021 21:02:17 +0000 (00:02 +0300)]
[INF] machine.inf: Minor whitespace fixes

4 months ago[ISAPNP] Start the driver early in the boot 3467/head
Dmitry Borisov [Tue, 11 May 2021 18:11:48 +0000 (00:11 +0600)]
[ISAPNP] Start the driver early in the boot

Because our child devices can have boot-start drivers

4 months ago[ISAPNP] Implement device configuration
Dmitry Borisov [Sat, 20 Mar 2021 14:53:54 +0000 (20:53 +0600)]
[ISAPNP] Implement device configuration

4 months ago[ISAPNP] Disable bus scan on unsupported platforms
Dmitry Borisov [Sat, 20 Mar 2021 14:53:32 +0000 (20:53 +0600)]
[ISAPNP] Disable bus scan on unsupported platforms

This speeds up boot a bit and also decreases binary size.

- Introduce a new CMake define ISAPNP_ENABLE that defined only in x86 platform
  when ISA PnP is supported.

4 months ago[ISAPNP] Disable I/O range check before activation
Dmitry Borisov [Sat, 20 Mar 2021 14:53:06 +0000 (20:53 +0600)]
[ISAPNP] Disable I/O range check before activation

See Table A-2 of "Plug and Play ISA Specification 1.0a"

4 months ago[ISAPNP] Map configuration states to PnP states
Dmitry Borisov [Sat, 20 Mar 2021 14:52:40 +0000 (20:52 +0600)]
[ISAPNP] Map configuration states to PnP states

Rework the hardware support code to avoid unneeded transitions
between configuration states.
- Only call WaitForKey when needed.
- Each PnP state transition causes the bus to move to WaitForKey state.

Besides, deactivate logical device during processing remove request.

4 months ago[ISAPNP] Reduce software delay
Dmitry Borisov [Sat, 20 Mar 2021 14:52:04 +0000 (20:52 +0600)]
[ISAPNP] Reduce software delay

4 months ago[ISAPNP] Fix descriptors and support alternative configurations
Dmitry Borisov [Sat, 20 Mar 2021 14:51:29 +0000 (20:51 +0600)]
[ISAPNP] Fix descriptors and support alternative configurations

- Fix empty resource descriptors being created.
- Properly support IRQ descriptors.
- Introduce four helpers made to help search descriptors
  in the logical device's requirements.
- Implement support for memory descriptors and alternative configurations.
- DMA descriptors are always DMA_8.

4 months ago[ISAPNP] Read all resources when detecting devices
Dmitry Borisov [Sat, 20 Mar 2021 14:51:05 +0000 (20:51 +0600)]
[ISAPNP] Read all resources when detecting devices

4 months ago[ISAPNP] Rewrite the tag parser
Dmitry Borisov [Sat, 20 Mar 2021 14:50:34 +0000 (20:50 +0600)]
[ISAPNP] Rewrite the tag parser

- Support all resource descriptors.
- Optimize card identification.
- Detect cards that is no longer present on the bus.
- Deactivate cards after the identification phase; they will be activated
  by start device IRP.
- Provide a device description and compatible IDs to the device manager.
- Prevent duplicate IDs across multiple logical devices.
- Suppress warning about the usage of literals in port addresses.

4 months ago[ISAPNP] Use the correct types for helper functions
Dmitry Borisov [Sat, 20 Mar 2021 14:49:57 +0000 (20:49 +0600)]
[ISAPNP] Use the correct types for helper functions

4 months ago[ISAPNP] Implement the Read Port resource management
Dmitry Borisov [Sun, 28 Mar 2021 17:29:02 +0000 (23:29 +0600)]
[ISAPNP] Implement the Read Port resource management

Currently disabled until the kernel is ready

4 months ago[ISAPNP] Fixes and improvements for IRP handling
Dmitry Borisov [Thu, 4 Mar 2021 12:48:43 +0000 (18:48 +0600)]
[ISAPNP] Fixes and improvements for IRP handling

- Implement device removal.
- Finish the Read Port special handling
  introduced in 21514e473f5.
- Gracefully handle low memory situations.
- Implement IRQ translator.
- Correctly stub power IRP handling.
- Remove unneeded dispatch routines; implement WMI IRP handling.
- Do not handle requests like WRITE_CONFIG.
- Add a signature member to device extensions to make checks clearer.

4 months ago[ISAPNP] Implement querying bus information
Dmitry Borisov [Thu, 4 Mar 2021 12:47:34 +0000 (18:47 +0600)]
[ISAPNP] Implement querying bus information

4 months ago[ISAPNP] Properly count descriptors
Dmitry Borisov [Thu, 4 Mar 2021 12:47:16 +0000 (18:47 +0600)]
[ISAPNP] Properly count descriptors

Fixes random pool corruptions

4 months ago[ISAPNP] Fix device capabilities
Dmitry Borisov [Thu, 4 Mar 2021 12:46:50 +0000 (18:46 +0600)]
[ISAPNP] Fix device capabilities

- The bus does not supply an address.
- Read Port ID is always unique.

This reverts commit fc0a0b9f84e1f284914b4576305cbf11c9015ad6.
See also commit 21514e473f5.


4 months ago[ISAPNP] Make Read Data Port PDO unique
Dmitry Borisov [Thu, 4 Mar 2021 12:45:38 +0000 (18:45 +0600)]
[ISAPNP] Make Read Data Port PDO unique

This PDO is created only once during start of first FDO.
Other buses will remain in an inactive state until
the first FDO receives a remove request.


4 months ago[ISAPNP] Refactor string handling
Dmitry Borisov [Thu, 4 Mar 2021 12:44:20 +0000 (18:44 +0600)]
[ISAPNP] Refactor string handling

- Don't allocate string buffers twice.

4 months ago[ISAPNP] Make the driver pageable
Dmitry Borisov [Thu, 4 Mar 2021 12:43:44 +0000 (18:43 +0600)]
[ISAPNP] Make the driver pageable

4 months ago[ISAPNP] Use pool tagging
Dmitry Borisov [Thu, 4 Mar 2021 12:43:19 +0000 (18:43 +0600)]
[ISAPNP] Use pool tagging

4 months ago[ISAPNP] Code formatting
Dmitry Borisov [Thu, 4 Mar 2021 12:42:42 +0000 (18:42 +0600)]
[ISAPNP] Code formatting

- Add SAL2 annotations.
- Use RTL_NUMBER_OF macro in kernel mode.
- Use better function/member names.
- Less hardcoded values.
- Add license information. See commit
  d9face83c693cb5e3fad155df8609d9c13316061 for details.

No functional changes.

4 months ago[UNIATA] Workaround random crashes on Virtual PC (#3377) pr3377
Serge Gautherie [Thu, 12 Nov 2020 00:22:46 +0000 (01:22 +0100)]
[UNIATA] Workaround random crashes on Virtual PC (#3377)

I am not sure why this line was added.
I don't know how I could improve that case.
Then, disable it, for the time being.

Addendum to 4b9cf2e (r71252). CORE-12441 CORE-17371

4 months ago[UNIATA] BusMasterAdapters[]: 8086:7111 is really PIIX4, not PIIX3
Serge Gautherie [Thu, 12 Nov 2020 00:22:46 +0000 (01:22 +0100)]
[UNIATA] BusMasterAdapters[]: 8086:7111 is really PIIX4, not PIIX3

Reverts a part of deaba45 (r57265).

4 months ago[SAMLIB] Check the server name in the binding routine
Eric Kohl [Sat, 19 Jun 2021 19:51:06 +0000 (21:51 +0200)]
[SAMLIB] Check the server name in the binding routine

4 months ago[SAMLIB] SamConnect: Pass a zero-terminated server name to SamrConnect
Eric Kohl [Sat, 19 Jun 2021 18:28:54 +0000 (20:28 +0200)]
[SAMLIB] SamConnect: Pass a zero-terminated server name to SamrConnect

4 months ago[PCI] Filter out devices with null vendor and device ID 3750/head
Stanislav Motylkov [Thu, 17 Jun 2021 14:04:09 +0000 (17:04 +0300)]
[PCI] Filter out devices with null vendor and device ID

Some virtual machines errorneously expose null PCI device function
on PIIX4 chipset where an USB controller should normally reside.

Windows pci.sys driver does not enumerate these devices.

Affected virtual machines:
- Connectix Virtual PC 5.1.370
- Connectix Virtual PC 5.2.418
- Microsoft Virtual PC 2004 SP1 (5.3.582.27)
- Microsoft Virtual PC 2007 SP1 (

Non-affected virtual machines:
- Connectix Virtual PC 4.0
- Microsoft Hyper-V

Fixes CORE-17636.

4 months ago[WIN32K] Revert incorrect part of R50928 for RealizePalette. (#3678)
Doug Lyons [Sat, 19 Jun 2021 16:25:03 +0000 (11:25 -0500)]
[WIN32K] Revert incorrect part of R50928 for RealizePalette. (#3678)

Revert incorrect code for Realize Palette
Revert part of SVN R50928 that causes Durak card suites to have wrong colors.
SVN r50928 == git 5de8339cd196e2bc01ac631e677010a939b2d083

JIRA issue: CORE-13748 <= Durak Example
JIRA issue: CORE-16510 <= GDIProg Example

The patch also fixes 2 crashes on each bot, although
it was not targeted for that explicitly:
KVM:,77308 LGTM
VBox:,77309 LGTM

4 months ago[NTGDI] Fix potential BSOD 0x1E CORE-17626
Joachim Henze [Sat, 19 Jun 2021 15:41:49 +0000 (17:41 +0200)]
[NTGDI] Fix potential BSOD 0x1E CORE-17626

in CreateDIBPalette() when passing invalid arguments to CreateDIBSection.
This could be triggered by using the broken test-application "GDIProg".

After this patch not only the BSOD is fixed but also the app does
properly start up, like it is the case on 2k3sp2.

Thanks to the patches author Doug Lyons.

4 months ago[SDK] Add script to check includes with modified struct packing
Mark Jansen [Thu, 10 Jun 2021 20:05:25 +0000 (22:05 +0200)]
[SDK] Add script to check includes with modified struct packing

4 months ago[NTOS][SETUP] Add x64 SMP kernel and make SMP the default boot mode on x64
Timo Kreuzer [Sat, 12 Jun 2021 12:25:48 +0000 (14:25 +0200)]
[NTOS][SETUP] Add x64 SMP kernel and make SMP the default boot mode on x64

4 months ago[HAL] Add smp component and build x64 smp hal
Timo Kreuzer [Sun, 6 Jun 2021 12:19:00 +0000 (14:19 +0200)]
[HAL] Add smp component and build x64 smp hal

Like the up component it contains the spinlock code and now also the HalpBuildType variable.

4 months ago[NTOS:MM] Improve an ASSERT
Timo Kreuzer [Thu, 10 Jun 2021 06:38:13 +0000 (08:38 +0200)]
[NTOS:MM] Improve an ASSERT

4 months ago[NTOS:MM] Fix PFN lock usage
Timo Kreuzer [Mon, 7 Jun 2021 08:40:20 +0000 (10:40 +0200)]
[NTOS:MM] Fix PFN lock usage

4 months ago[NTOS:KE] Fix usage of KTHREAD::SwapBusy
Timo Kreuzer [Mon, 7 Jun 2021 11:57:32 +0000 (13:57 +0200)]
[NTOS:KE] Fix usage of KTHREAD::SwapBusy

4 months ago[NTOS:KE] Fix some locking issues
Timo Kreuzer [Mon, 7 Jun 2021 08:23:01 +0000 (10:23 +0200)]
[NTOS:KE] Fix some locking issues

4 months ago[NTOS:KE] Fix KxReleaseSpinLock for 64 bit SMP builds
Timo Kreuzer [Sun, 6 Jun 2021 12:46:38 +0000 (14:46 +0200)]
[NTOS:KE] Fix KxReleaseSpinLock for 64 bit SMP builds

4 months ago[NTOS] Fix build with CONFIG_SMP
Timo Kreuzer [Wed, 9 Jun 2021 20:15:12 +0000 (22:15 +0200)]
[NTOS] Fix build with CONFIG_SMP

4 months ago[HAL] Fix build with CONFIG_SMP
Timo Kreuzer [Sun, 6 Jun 2021 13:37:47 +0000 (15:37 +0200)]
[HAL] Fix build with CONFIG_SMP

4 months ago[FREELDR/x64] Allow using memory above 4GB on x64
Timo Kreuzer [Sun, 13 Jun 2021 09:26:06 +0000 (11:26 +0200)]
[FREELDR/x64] Allow using memory above 4GB on x64

This splits MM_MAX_PAGE into the maximum addressable PFN (which is 2^20-1 on x86, 2^26-1 on x86PAE and 2^36-1 on x64) and the maximum mapped/accessible virtual memory MM_MAX_PAGE_LOADER (which is 4 GB on x86, since paging is disabled, but only 1 GB on x64, since only that much is identity-mapped).

4 months ago[NTOS:MM/x64] Fix Interlocked(Compare)ExchangePte and PAGE_FROM_SSE for x64
Timo Kreuzer [Sun, 13 Jun 2021 09:12:57 +0000 (11:12 +0200)]
[NTOS:MM/x64] Fix Interlocked(Compare)ExchangePte and PAGE_FROM_SSE for x64

This fixes using PFNs with more than 20 bits.

4 months ago[NTOS:SE] Minor refactor on NtOpenThreadTokenEx
George Bișoc [Fri, 18 Jun 2021 16:38:12 +0000 (18:38 +0200)]
[NTOS:SE] Minor refactor on NtOpenThreadTokenEx

- Remove a redundant call of ObReferenceObjectByHandle. Not only it didn't make much sense (we reference the object from thread handle and the new thread object referencing the same handle!), specifying a request access of THREAD_ALL_ACCESS for the thread object is kind of suspicious and all of these access rights are unwanted.
- Add some failure checks involving the CopyOnOpen code paths
- Add some DPRINT1 debug prints (concerning the CopyOnOpen code paths as usual)

4 months ago[HAL] Add APIC hals to setup and livecd
Timo Kreuzer [Thu, 3 Jun 2021 09:53:07 +0000 (11:53 +0200)]
[HAL] Add APIC hals to setup and livecd

4 months ago[HAL:APIC] Fix interrupt assignment
Timo Kreuzer [Sat, 5 Jun 2021 13:41:49 +0000 (15:41 +0200)]
[HAL:APIC] Fix interrupt assignment

This is probably not how it is supposed to work, but the results are somewhat similar to what Windows has.

4 months ago[HAL:APIC] Remove obsolete hacks
Timo Kreuzer [Thu, 3 Jun 2021 17:29:25 +0000 (19:29 +0200)]
[HAL:APIC] Remove obsolete hacks

These hacks were used to work around broken VBox. VBox works fine without the hacks these days.

4 months ago[HAL:APIC] Code fixes
Timo Kreuzer [Sat, 5 Jun 2021 13:39:22 +0000 (15:39 +0200)]
[HAL:APIC] Code fixes

* Fix some broken code
* Add some ASSERTs
* Use ApicWriteIORedirectionEntry where appropriate
* Use KeQueryInterruptHandler/KeRegisterInterruptHandler to save/restore the old handler instead of saving the KIDTENTRY
* Move HalpProfileInterruptHandler to apictimer.c and implement it
* Add some symbolic names

4 months ago[MINIHAL] Compile less stuff
Timo Kreuzer [Thu, 3 Jun 2021 09:19:30 +0000 (11:19 +0200)]
[MINIHAL] Compile less stuff

4 months ago[HAL] Rename apic.h to apicp.h and move it back to the apic folder
Timo Kreuzer [Mon, 24 May 2021 09:27:12 +0000 (11:27 +0200)]
[HAL] Rename apic.h to apicp.h and move it back to the apic folder

Hermès Bélusca-Maïto [Fri, 11 Jun 2021 00:00:23 +0000 (02:00 +0200)]

Fixes CID 1441387: Uninitialized scalar variable (UNINIT),

4 months ago[NTOS:IO] Comment out (and explain why it is there) an unused LdrEntry assignment...
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 23:46:50 +0000 (01:46 +0200)]
[NTOS:IO] Comment out (and explain why it is there) an unused LdrEntry assignment in IopInitializeBootDrivers(). CID 1237114

4 months ago[NTOS:IO] Revert part of commit a82ff90b2: don't do direct ULONG data access: it...
Hermès Bélusca-Maïto [Wed, 16 Jun 2021 22:29:58 +0000 (00:29 +0200)]
[NTOS:IO] Revert part of commit a82ff90b2: don't do direct ULONG data access: it might be unaligned.

Requested by Victor.

4 months ago[NTOS:IO] Fix driverName.Buffer leak in some failure paths in IopGetDriverNames().
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 21:11:27 +0000 (23:11 +0200)]
[NTOS:IO] Fix driverName.Buffer leak in some failure paths in IopGetDriverNames().

driverName.Buffer leaked when the "(!NT_SUCCESS(status) || ServiceName != NULL)"
case is taken because ServiceName != NULL, and some of the functions fail.

4 months ago[NTOS:IO] Fix basicInfo handling in IopGetDriverNames().
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 20:31:45 +0000 (22:31 +0200)]
[NTOS:IO] Fix basicInfo handling in IopGetDriverNames().

- Fix CID 1477246: Uninitialized pointer read (UNINIT) (happens in
  the last ExFreePoolWithTag(basicInfo, TAG_IO) call when the
  "(!NT_SUCCESS(status) || ServiceName != NULL)" case is not taken).

- Centralize all the ExFreePoolWithTag(basicInfo, TAG_IO) cleanups
  at the end of the function.

- Both cases "(driverName.Buffer == NULL)" and "(ServiceName != NULL)"
  can only be taken when basicInfo != NULL, so assert on this fact.

4 months ago[NTOS:IO] Fix similar bugs in IopGetDriverNames(), IopInitializeBuiltinDriver() and...
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 19:20:17 +0000 (21:20 +0200)]
[NTOS:IO] Fix similar bugs in IopGetDriverNames(), IopInitializeBuiltinDriver() and IopLoadDriver().

- As they are initialized, some registry string values must be NULL-terminated.
- When retrieving REG_DWORD registry values, validate their length.

4 months ago[NTOS:IO] Minor code style changes...
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 19:16:27 +0000 (21:16 +0200)]
[NTOS:IO] Minor code style changes...

- Fix/add comments;
- Reduce indentation level;
- Direct copy for registry integer values;
- Use for-loops for linked lists;
- Use ULONG when the API uses it (sizes for Ob, or REG_DWORD data in registry).

4 months ago[LDR] Restore Logging when images overlap CORE-17635
Joachim Henze [Wed, 16 Jun 2021 11:38:51 +0000 (13:38 +0200)]
[LDR] Restore Logging when images overlap CORE-17635

This reverts
0.4.13-dev-284-g 74be88ac473425fc99e9a363ba8cd604702262bf

The logging is helpful to alert us when we should really
recalculate the base addresses for performance reasons.
Spams a bit sometimes, sure, but it's worth it!

4 months ago[NTOS:MM] Fix placing entries into MmNonPagedPoolFreeListHead
Victor Perevertkin [Mon, 14 Jun 2021 01:50:01 +0000 (04:50 +0300)]
[NTOS:MM] Fix placing entries into MmNonPagedPoolFreeListHead

When freeing pages, free page entries with pages num == 3 were
incorrectly treated as entries with pages num >= 4 and thus
their re-insertion was not triggered. That lead to non paged pool
fragmentation (can be triggered by kmtest:ExPools, for example)

Also, altered the index acquisition code for MmNonPagedPoolFreeList
entries so it looks more clear

4 months ago[COMCTL32] Strip EOL whitespace within ifdef __REACTOS__ section
Joachim Henze [Wed, 16 Jun 2021 09:41:56 +0000 (11:41 +0200)]
[COMCTL32] Strip EOL whitespace within ifdef __REACTOS__ section

no functional change.
Make that look beautiful before porting it back further.

Addendum to 0.4.15-dev-534-g 887764e6075fdde7fb81d2a54d5255164c046511

4 months ago[MSI] Enumerate only type DRIVE_FIXED CORE-17623 (& CORE-14432)
Joachim Henze [Sun, 13 Jun 2021 13:30:49 +0000 (15:30 +0200)]
[MSI] Enumerate only type DRIVE_FIXED CORE-17623 (& CORE-14432)

MSI on 2k3sp2 hides empty CD-ROM, and hides CD-ROM with iso mounted.
MSI on 2k3sp2 hides VBox shares, both: writable and read-only-ones.
MSI on 2k3sp2 hides floppy drives with a floppy img mounted.
MSI on XPSP3 hides a mounted writable USB stick.

Thanks to the patches author Doug Lyons.

This patch supersedes
0.4.15-dev-2651-g 864e20b881130cbc9668b8e253a31b8c325e9b99 (CORE-14432)
and we are also better than Wines

4 months ago[GITIGNORE] Add compile_commands.json and .cache folder for clangd cache
Victor Perevertkin [Sat, 12 Jun 2021 22:55:52 +0000 (01:55 +0300)]
[GITIGNORE] Add compile_commands.json and .cache folder for clangd cache

4 months ago[WIN32K] Add x64/arm exports
Adam Słaboń [Sat, 5 Jun 2021 18:42:41 +0000 (20:42 +0200)]
[WIN32K] Add x64/arm exports

Checked against Windows XP x64 and Windows 8 ARM.

4 months ago[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 3742/head
Victor Perevertkin [Fri, 11 Jun 2021 12:29:21 +0000 (15:29 +0300)]
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces

4 months ago[NTOS:IO] Modify when 'PartitionBuffer' and how 'DriveLayout' are freed in IopCreateA...
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 17:44:59 +0000 (19:44 +0200)]
[NTOS:IO] Modify when 'PartitionBuffer' and how 'DriveLayout' are freed in IopCreateArcNamesDisk().

- Manage the lifetime of the temporary 'PartitionBuffer' buffer where
  it is locally used only, and free it as soon as possible, just after
  calculating the sector checksum. No need to then free it outside of
  the main for-loop.

- When the 'DriveLayout' buffer is freed, ensure the pointer is NULL-ed
  (and assert this at the top of the main for-loop), since it can also
  be freed at cleanup outside this for-loop, and in this case a NULL
  check is performed.
  This will avoid the scenario of possibly double-freeing a pointer,
  in the case the 'DriveLayout' was previously freed (when e.g. reading
  the sector for checksum calculation failed), then the for-loop goes to
  the next disk and stops early.

4 months ago[NTOS:IO/FSTUB] Fix the determination of 'SingleDisk' in IoGetBootDiskInformation().
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 17:31:43 +0000 (19:31 +0200)]
[NTOS:IO/FSTUB] Fix the determination of 'SingleDisk' in IoGetBootDiskInformation().

The purpose of 'SingleDisk' is the same as in the IopCreateArcNames()
function. It is an optimization for that when looking up the
firmware-recognized ARC disks list, in order to match one of these with
the current NT disk being analysed (see e.g. also in IopCreateArcNamesDisk()),
we avoid a possible IopVerifyDiskSignature() call and directly build a
corresponding ARC name NT symbolic link for it.

'SingleDisk' will actually be TRUE, whether the DiskSignatureListHead
list is empty or contains only one element: Indeed in only both these
cases, 'DiskSignatureListHead.Flink->Flink' will refer to the list head.
(If the list is empty but 'SingleDisk' is TRUE, this does not matter,
because the DiskSignatureListHead looking-up loop never starts.)

4 months ago[NTOS:IO] Avoid hardcoding variable types in sizeofs when possible.
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 17:30:45 +0000 (19:30 +0200)]
[NTOS:IO] Avoid hardcoding variable types in sizeofs when possible.

4 months ago[NTOS:IO] Minor code style fixes (typos; improve comments/DPRINT; IN vs. OUT parameter).
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 17:24:04 +0000 (19:24 +0200)]
[NTOS:IO] Minor code style fixes (typos; improve comments/DPRINT; IN vs. OUT parameter).

4 months ago[SHELL32_APITEST] Improve ShellExecCmdLine testcase more (#3736)
Katayama Hirofumi MZ [Thu, 10 Jun 2021 23:09:18 +0000 (08:09 +0900)]
[SHELL32_APITEST] Improve ShellExecCmdLine testcase more (#3736)

- Simplify code.
- Loose the condition of success.
- Add some missing tests.
- Close newly opened windows gracefully.
CORE-17351, CORE-16898, CORE-17612

4 months ago[CMAKE] host-tools: Define ROS_SAVED_* for MSVC_IDE only
Serge Gautherie [Mon, 24 May 2021 06:56:17 +0000 (08:56 +0200)]
[CMAKE] host-tools: Define ROS_SAVED_* for MSVC_IDE only

Addendum to 18e95f5.

4 months ago[SOUNDS] Add new Recycle Bin system sound
Oleg Dubinskiy [Fri, 4 Jun 2021 14:32:07 +0000 (17:32 +0300)]
[SOUNDS] Add new Recycle Bin system sound
Add new sound for Recycle Bin sound event.
Since this sound event is now working properly after some fixes in shell32 code, it's now possible for user to set the sound for this sound event manually.
But don't enable it by default, since it is also disabled on Windows Server 2003.