reactos.git
2 years 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.

2 years 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.

2 years 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)

CORE-17544

2 years 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

CORE-17544

2 years 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

2 years 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)

2 years 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

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

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.
See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
https://stackoverflow.com/questions/13746033/how-to-repair-warning-missing-braces-around-initializer

2 years 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.

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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

CORE-17527

2 years 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

2 years 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

2 years 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

CORE-6473

2 years 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.

CORE-6473

2 years 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

2 years 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)

2 years 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

2 years 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

2 years 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

2 years 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

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

2 years 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.

2 years 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"

2 years 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.

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

2 years 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.

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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.

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

2 years 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

2 years 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.

CORE-17034

2 years 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.

CORE-17034

2 years 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.

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

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

2 years 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.

2 years 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

2 years 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).

2 years 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

2 years 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

2 years 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 (6.0.156.0)

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

Fixes CORE-17636.

2 years 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: https://reactos.org/testman/compare.php?ids=77304,77308 LGTM
VBox: https://reactos.org/testman/compare.php?ids=77305,77309 LGTM

2 years 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.

2 years 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

2 years 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

2 years 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.

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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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).

2 years 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.

2 years 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)

2 years 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

2 years 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.

2 years 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.

2 years 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
* Use READ/WRITE_REGISTER macros
* Add some symbolic names

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

2 years 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

2 years ago[NTOS:IOPNP] Both PNP_PROPERTY_REMOVAL_POLICY_OVERRIDE and PNP_PROPERTY_LOCATION_PATH...
Hermès Bélusca-Maïto [Fri, 11 Jun 2021 00:00:23 +0000 (02:00 +0200)]
[NTOS:IOPNP] Both PNP_PROPERTY_REMOVAL_POLICY_OVERRIDE and PNP_PROPERTY_LOCATION_PATHS are unimplemented, return such status.

Fixes CID 1441387: Uninitialized scalar variable (UNINIT),
in the case of PNP_PROPERTY_LOCATION_PATHS.

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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).

2 years 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!

2 years 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

2 years 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
(CORE-17062)

2 years 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
https://source.winehq.org/git/wine.git/commit/0dd0d879a1c487dcefedd44762d4ea0fcebd98fe

2 years 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

2 years 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.

2 years 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

2 years 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.

2 years 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.)

2 years 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.

2 years 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).

2 years 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

2 years 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.
ROSBE-174

2 years 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.
CORE-15868

2 years ago[RAPPS] Fix double free when closing rapps
Mark Jansen [Wed, 9 Jun 2021 20:56:53 +0000 (22:56 +0200)]
[RAPPS] Fix double free when closing rapps

2 years ago[HIDPARSER] Don't include pshpack1.h before including other headers
Timo Kreuzer [Wed, 9 Jun 2021 08:54:05 +0000 (10:54 +0200)]
[HIDPARSER] Don't include pshpack1.h before including other headers

NEVER DO THIS! It is guaranteed to be wrong. Instead always individually pack single structures that need packing.
This fixes USB mouse on 64 bit builds.

2 years ago[MORE] Use positional elements to build the MORE prompt, whose state is controlled...
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 02:10:55 +0000 (04:10 +0200)]
[MORE] Use positional elements to build the MORE prompt, whose state is controlled by flags.

2 years ago[MORE] Update and complete MORE's help usage.
Hermès Bélusca-Maïto [Thu, 10 Jun 2021 00:34:23 +0000 (02:34 +0200)]
[MORE] Update and complete MORE's help usage.

And add french translation.

2 years ago[WIN32K:ENG] In EngLockDriverObj, properly return NULL when locking failed
Jérôme Gardou [Wed, 9 Jun 2021 16:27:12 +0000 (18:27 +0200)]
[WIN32K:ENG] In EngLockDriverObj, properly return NULL when locking failed

CORE-15958