Commit graph

80220 commits

Author SHA1 Message Date
Doug Lyons c7954134d0
[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 5de8339cd1

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
2021-06-19 18:25:03 +02:00
Joachim Henze 514147776a [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.
2021-06-19 17:41:49 +02:00
Mark Jansen 560fdd150a [SDK] Add script to check includes with modified struct packing 2021-06-19 16:30:21 +02:00
Timo Kreuzer b627352815 [NTOS][SETUP] Add x64 SMP kernel and make SMP the default boot mode on x64 2021-06-19 12:17:18 +02:00
Timo Kreuzer 400af0cfc5 [HAL] Add smp component and build x64 smp hal
Like the up component it contains the spinlock code and now also the HalpBuildType variable.
2021-06-19 12:17:18 +02:00
Timo Kreuzer 396167bc7e [NTOS:MM] Improve an ASSERT 2021-06-19 12:17:18 +02:00
Timo Kreuzer 33949028fb [NTOS:MM] Fix PFN lock usage 2021-06-19 12:17:18 +02:00
Timo Kreuzer f4d47faeb7 [NTOS:KE] Fix usage of KTHREAD::SwapBusy 2021-06-19 12:17:18 +02:00
Timo Kreuzer a011d19ed2 [NTOS:KE] Fix some locking issues 2021-06-19 12:17:18 +02:00
Timo Kreuzer 62f62da8ba [NTOS:KE] Fix KxReleaseSpinLock for 64 bit SMP builds 2021-06-19 12:17:18 +02:00
Timo Kreuzer 2ed56fa794 [NTOS] Fix build with CONFIG_SMP 2021-06-19 12:17:18 +02:00
Timo Kreuzer a0fb02f7f3 [HAL] Fix build with CONFIG_SMP 2021-06-19 12:17:18 +02:00
Timo Kreuzer d0f6d2cf6e [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).
2021-06-19 12:01:24 +02:00
Timo Kreuzer e6fa62a8d2 [NTOS:MM/x64] Fix Interlocked(Compare)ExchangePte and PAGE_FROM_SSE for x64
This fixes using PFNs with more than 20 bits.
2021-06-19 12:01:24 +02:00
George Bișoc 5912c11650
[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)
2021-06-18 18:38:12 +02:00
Timo Kreuzer 5ee09256de [HAL] Add APIC hals to setup and livecd 2021-06-17 23:27:44 +02:00
Timo Kreuzer 64e52088d1 [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.
2021-06-17 23:27:44 +02:00
Timo Kreuzer 235d7472ba [HAL:APIC] Remove obsolete hacks
These hacks were used to work around broken VBox. VBox works fine without the hacks these days.
2021-06-17 23:27:44 +02:00
Timo Kreuzer b7a149fcec [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
2021-06-17 23:27:44 +02:00
Timo Kreuzer ee514e954b [MINIHAL] Compile less stuff 2021-06-17 23:27:44 +02:00
Timo Kreuzer 7243503916 [HAL] Rename apic.h to apicp.h and move it back to the apic folder 2021-06-17 23:27:44 +02:00
Hermès Bélusca-Maïto 4864c874a2
[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.
2021-06-17 00:35:22 +02:00
Hermès Bélusca-Maïto f2645e48b9
[NTOS:IO] Comment out (and explain why it is there) an unused LdrEntry assignment in IopInitializeBootDrivers(). CID 1237114 2021-06-17 00:35:22 +02:00
Hermès Bélusca-Maïto fe416b67dc
[NTOS:IO] Revert part of commit a82ff90b2: don't do direct ULONG data access: it might be unaligned.
Requested by Victor.
2021-06-17 00:35:21 +02:00
Hermès Bélusca-Maïto 32a82eb123
[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.
2021-06-16 22:18:02 +02:00
Hermès Bélusca-Maïto e09d1dec7a
[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.
2021-06-16 22:18:02 +02:00
Hermès Bélusca-Maïto 0d28f27156
[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.
2021-06-16 22:14:01 +02:00
Hermès Bélusca-Maïto a82ff90b21
[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).
2021-06-16 22:14:01 +02:00
Joachim Henze d042f51838 [LDR] Restore Logging when images overlap CORE-17635
This reverts
0.4.13-dev-284-g 74be88ac47

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!
2021-06-16 13:38:51 +02:00
Victor Perevertkin 3f601122bc [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
2021-06-16 12:14:27 +02:00
Joachim Henze a3cadf630a [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 887764e607
(CORE-17062)
2021-06-16 11:41:56 +02:00
Joachim Henze d5265b07bb [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 864e20b881 (CORE-14432)
and we are also better than Wines
0dd0d879a1
2021-06-13 15:30:49 +02:00
Victor Perevertkin 05fb0f1c39
[GITIGNORE] Add compile_commands.json and .cache folder for clangd cache 2021-06-13 01:55:52 +03:00
Adam Słaboń 9764fde2d9 [WIN32K] Add x64/arm exports
Checked against Windows XP x64 and Windows 8 ARM.
2021-06-12 14:11:14 +02:00
Victor Perevertkin 34593d933b
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Hermès Bélusca-Maïto 4b4ffa92f5
[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.
2021-06-11 02:21:48 +02:00
Hermès Bélusca-Maïto fdd74eb97e
[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.)
2021-06-11 02:21:47 +02:00
Hermès Bélusca-Maïto 99078646c3
[NTOS:IO] Avoid hardcoding variable types in sizeofs when possible. 2021-06-11 02:21:47 +02:00
Hermès Bélusca-Maïto 6e65e6b28d
[NTOS:IO] Minor code style fixes (typos; improve comments/DPRINT; IN vs. OUT parameter). 2021-06-11 02:21:47 +02:00
Katayama Hirofumi MZ afd349a93e
[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
2021-06-11 08:09:18 +09:00
Serge Gautherie c2317d773e [CMAKE] host-tools: Define ROS_SAVED_* for MSVC_IDE only
Addendum to 18e95f5.
ROSBE-174
2021-06-11 02:08:12 +03:00
Oleg Dubinskiy 6e29107f31 [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
2021-06-11 02:06:11 +03:00
Mark Jansen 675edad96f
[RAPPS] Fix double free when closing rapps 2021-06-10 21:25:34 +02:00
Timo Kreuzer 9229e73f03 [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.
2021-06-10 08:52:22 +02:00
Hermès Bélusca-Maïto 2dbbfe86ab
[MORE] Use positional elements to build the MORE prompt, whose state is controlled by flags. 2021-06-10 04:10:55 +02:00
Hermès Bélusca-Maïto 558908e709
[MORE] Update and complete MORE's help usage.
And add french translation.
2021-06-10 02:36:12 +02:00
Jérôme Gardou e70df4c633 [WIN32K:ENG] In EngLockDriverObj, properly return NULL when locking failed
CORE-15958
2021-06-09 18:27:12 +02:00
Katayama Hirofumi MZ b552901df5
[MORE][CONUTILS] Implement missing features of the MORE command (#3658)
Implement missing features of the MORE command. Special thanks to @HBelusca. CORE-4019
2021-06-09 23:30:30 +09:00
Jérôme Gardou afc27ab1aa [NTOS:MM] Handle PT references for page table faults in MmAccessFault
Idea from Timo Kreuzer
2021-06-09 11:27:18 +02:00
Jérôme Gardou c7e09061ca [NTOS:MM] Get rid of MiQueryPageTableReferences 2021-06-09 11:27:18 +02:00