Victor Perevertkin [Wed, 25 May 2022 23:03:50 +0000 (02:03 +0300)]
[CMAKE] Do not use USE_CLANG_CL variable in CMake scripts
Victor Perevertkin [Wed, 25 May 2022 22:37:23 +0000 (01:37 +0300)]
[CMAKE] Elimitate the use of GCC and CLANG variables
Dmitry Borisov [Thu, 26 May 2022 13:40:17 +0000 (19:40 +0600)]
[HALX86] Print the correct size of the BAR in HalpDebugPciDumpBus()
Reference: https://wiki.osdev.org/PCI#Address_and_size_of_the_BAR
To determine the amount of address space needed by a PCI device,
you must save the original value of the BAR, write a value
of all 1's to the register, then read it back.
Note: 64-bit BARs are not supported yet.
Mark Jansen [Thu, 21 Apr 2022 23:15:40 +0000 (01:15 +0200)]
[ASM x64] Fix UNIMPLEMENTED macro for MSVC
Mark Jansen [Thu, 7 Apr 2022 22:22:54 +0000 (00:22 +0200)]
[KERNEL32] Fix reading SafeDllSearchMode
Stanislav Motylkov [Wed, 25 May 2022 15:38:41 +0000 (18:38 +0300)]
[GITHUB] Add MSVC ARM64 builder
This builds only some applications for now.
CORE-17518
Justin Miller [Wed, 25 May 2022 14:06:32 +0000 (07:06 -0700)]
[REACTOS] Finally get some ARM64 applications building (#4517)
- Add some missing ARM64 exports to ntdll, kernel32 and user32
- Create mmtypes header file based on WoA debug symbols
- Get the remaining headers in order, so we can build ARM64 apps
- Adjust subsystem version for binaries so they can run on WoA host
- Get calc, notepad and more base apps to build for ARM64 platform
CORE-17518
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
William Kent [Fri, 13 May 2022 22:33:14 +0000 (18:33 -0400)]
[CMAKE] Search the PATH for the compilers and cache the results
We are deliberately using a macro here instead of REQUIRED parameter
because it is available only in CMake 3.18+, so it won't work with
CMake version that is being shipped with RosBE.
On my dev box the RosBE tools are only in the PATH when needed.
Since my IDE inherits the PATH from the system and not from my shell,
I needed to be able to run configure.sh with the tools in my PATH
and then be able to successfully reconfigure when building
from a "regular" command prompt.
William Kent [Fri, 13 May 2022 20:33:31 +0000 (16:33 -0400)]
[DBGHELP] Fix rsym runtime crash on ARM64 host
CORE-17518
William Kent [Fri, 13 May 2022 16:58:25 +0000 (12:58 -0400)]
[MKISOFS] Add ARM64 processor support
Also changed a "shouldn't-ever-happen" deliberate syntax error into a proper #error.
CORE-17518
George Bișoc [Tue, 25 Jan 2022 12:20:05 +0000 (13:20 +0100)]
[NTOS:KE] Write a basic kernel mode test for FPU Save/Restore mechanism
George Bișoc [Tue, 25 Jan 2022 12:19:06 +0000 (13:19 +0100)]
[NTOS:KE] Fully implement FPU Save/Restore mechanism
This commit fully implements the inner logic of KeSaveFloatingPointState and KeRestoreFloatingPointState routines. On ReactOS we're currently simply doing a FNSAVE operation whereas on Windows it is a lot more than that.
On Windows Server 2003 the logic more or less goes like this. In order to save the FPU state the NPX state of the current thread has to be checked first, that is, if NPX is loaded and currently charged for the current thread then the system will acquire the NPX registers actively present. From that point it performs either a FNSAVE or FXSAVE
if FX is actually supported. Otherwise the control word and MXCsr registers are obtained.
FXSAVE/FNSAVE operation is done solely if the FX save area is held up in a pool allocation. Pool allocation occurs if it's been found out that the NPX IRQL of the thread is not the same as the current thread which from where it determines if the interrupt level is APC then allocate some pool memory and hold the save area there, otherwise
the save area in question is grabbed from the current processor control region. If NPX is not loaded for the current thread then the FPU state is obtained from the NPX frame.
In our case we'll be doing something way simpler. Only do a FXSAVE/FNSAVE directly of the FPU state registers, in this way we are simplifying the code and the actual logic of Save/Restore mechanism.
George Bișoc [Tue, 25 Jan 2022 12:17:49 +0000 (13:17 +0100)]
[NTOS:KE] Implement the internal FPU state context structure
This is needed to store FPU state information when saving or restoring the floating point state of a system due to a call to KeSaveFloatingPointState or KeRestoreFloatingPointState.
George Bișoc [Tue, 25 Jan 2022 12:16:41 +0000 (13:16 +0100)]
[NTOS:KE] Move related FPU instrunctions to internal intrinsic file
George Bișoc [Tue, 25 Jan 2022 12:15:58 +0000 (13:15 +0100)]
[NTOSKRNL] Add FPU pool tags
George Bișoc [Tue, 25 Jan 2022 12:14:09 +0000 (13:14 +0100)]
[MC] Add INVALID_FLOATING_POINT_STATE bugcheck code
This kind of code will be used for FPU Save/Restore related code.
Wilson Simanjuntak [Tue, 24 May 2022 16:14:41 +0000 (23:14 +0700)]
[TRANSLATION] Improve Indonesian (id-ID) translation [part 1] (#4500)
[CALC] [DRWTSN32] [DXDIAG] Add Indonesian translation
[REACTOS] [USETUP] [EXPLORER] Improve Indonesian translation
Signed-off-by: Wilson Simanjuntak <wilsontulus5@gmail.com>
Reviewed-by: Mas Ahmad Muhammad <m.charly81@gmail.com>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Thamatip Chitpong [Tue, 24 May 2022 11:58:24 +0000 (18:58 +0700)]
[EXPLORER] Implement CDesktopThread::Destroy (#4371)
Now Explorer exits properly without using ExitProcess hack.
Signed-off-by: Thamatip Chitpong <tangaming123456@outlook.com>
Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Marcus Boillat [Tue, 24 May 2022 09:20:52 +0000 (11:20 +0200)]
[RAPPS] Improve localized display of installation date (#4498)
Parse InstallDate registry key in "YYYYMMDD" format. CORE-17422
Signed-off-by: Marcus Boillat <marcus.boillat@gmail.com>
Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
Reviewed-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Victor Perevertkin [Tue, 24 May 2022 01:57:42 +0000 (04:57 +0300)]
[NTOS:PNP] Misc IoInvalidateDeviceState fixes
- Add a check for correct PDO before doing anything
- Process the request only for started devices
- Send the request synchronously during the start sequence
This makes Windows' i8042prt.sys work on ReactOS.
Addendum to
cf0bc1c1321047b879edcd19bfbf08138ba9c988
Stanislav Motylkov [Mon, 23 May 2022 20:54:41 +0000 (23:54 +0300)]
[DESKMON] Implement GetMonitorDevInstID function
- Now our deskmon.cpl extension works on Windows XP and 2003
and does open the monitor device properties correctly.
- Also "Properties" button should be disabled
when no Device Instance ID found for the monitor.
Stanislav Motylkov [Mon, 23 May 2022 20:50:47 +0000 (23:50 +0300)]
[DESK] Add debug prints to pCDevSettings_GetDeviceInstanceId
Addendum to
3900cf88.
Hermès Bélusca-Maïto [Sun, 22 May 2022 23:56:32 +0000 (01:56 +0200)]
[NTOS:SE] Replace a bunch of RtlCopyLuid() calls into direct assignations (#4523)
Nowadays' compilers support such direct structure assignations,
and our existing codebase already uses that in other places.
Hermès Bélusca-Maïto [Fri, 20 May 2022 00:33:00 +0000 (02:33 +0200)]
[NTOS:SE] SepPerformTokenFiltering(): Fix corruption of DynamicPart (#4523)
The problem is that EndMem is changed to point to the DynamicPart of
the token, but the code after that expects it to still point into the
VariablePart instead.
Problem fixed by moving the insertion of RestrictedSids much sooner
(where the original ones are also being copied).
Hermès Bélusca-Maïto [Sun, 22 May 2022 16:33:46 +0000 (18:33 +0200)]
[NTOS:SE] NtAdjustGroupsToken(): Avoid double-free on ObReferenceObjectByHandle failure path (#4523)
Hermès Bélusca-Maïto [Sun, 22 May 2022 16:11:18 +0000 (18:11 +0200)]
[NTOS:SE] Fix locking in SepDuplicateToken() and SepPerformTokenFiltering() (#4523)
Shared locking must be used on the source token as it is accessed for
reading only. This fixes in particular the kmtest SeTokenFiltering that
would hang otherwise on a (wrong) exclusive locking.
- SepPerformTokenFiltering(): Always shared-lock the source token.
Its callers (NtFilterToken and SeFilterToken) just need to sanitize and
put the parameters in correct form before calling this helper function.
- Sync comments in NtFilterToken() with SeFilterToken().
Hermès Bélusca-Maïto [Fri, 20 May 2022 00:26:21 +0000 (02:26 +0200)]
[NTOS:SE] SepPerformTokenFiltering(): Remove useless SEH handling (#4523)
This function is either called inter-kernel (in which case, all
parameters must be valid, and if not, we have to bugcheck), or, it
is called with **captured** parameters (from NtFilterToken) and those
latter ones are now expected to be valid and reside in kernel-mode.
Finally, data copied between token structures reside in kernel-mode
only and again are expected to be valid (if not, we bugcheck).
Hermès Bélusca-Maïto [Thu, 19 May 2022 21:43:18 +0000 (23:43 +0200)]
[NTOS:SE] SepCaptureAcl(): Add missing validation of the captured ACL (#4523)
- The ACL is however not validated when the function is called within
kernel mode and no capture is actually being done.
- Simplify aspects of the function (returning early when possible).
Hermès Bélusca-Maïto [Thu, 19 May 2022 21:19:04 +0000 (23:19 +0200)]
[NTOS:SE] SeValidSecurityDescriptor(): Add missing validation aspects (#4523)
- Add extra bounds checks.
- Add missing RtlValidAcl() calls for verifying the DACL and SACL.
Hermès Bélusca-Maïto [Fri, 6 May 2022 18:34:52 +0000 (20:34 +0200)]
[WIN32K:NTUSER] Only call IntFreeSecurityBuffer() when needed, don't free NULL buffers.
Addendum to
878c2f44.
Stanislav Motylkov [Mon, 23 May 2022 16:04:47 +0000 (19:04 +0300)]
[DESK] Implement pCDevSettings_GetDeviceInstanceId properly
- CM_Locate_DevNodeW expects a Device Instance ID as second argument,
so it cannot be used for converting a Hardware ID.
- Use SetupAPI functions here instead, as documented in:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdisplaydevicesw
- Now our desk.cpl passes correct identifier to CPL extensions,
such as deskadp and deskmon, so clicking on "Properties" in the
advanced display properties now works in Windows XP.
- Also fix copypasta in DisplayAdvancedSettings that affected applet
built with MSVC - deskadp extension was loaded twice.
- Also fix magic flag value for EDD_GET_DEVICE_INTERFACE_NAME.
Stanislav Motylkov [Sun, 22 May 2022 23:44:03 +0000 (02:44 +0300)]
[DESK] Synchronize translations
- Fix differences in punctuation
- pt-PT had something out of place that other translations didn't had at all
Hervé Poussineau [Sun, 22 May 2022 20:47:20 +0000 (22:47 +0200)]
[WIN32K] Improve finding the best matching display mode
Search the display mode having the smallest difference with the requested one.
We can then remove the hardcoded values of 60 Hz and 32 bpp by default.
CORE-18189
Hervé Poussineau [Sun, 22 May 2022 20:43:12 +0000 (22:43 +0200)]
Revert "[WIN32SS] Only refresh graphics mode list when iModeNum = 0"
This reverts commit
c243133b2c598bd004229242f36d9159a8e45b99.
Without the revert, VirtualBox auto-resize doesn't work on first attempt,
but only on next ones.
However, according to documentation, we must only initialize device and
cache information when iModeNum = 0.
CORE-18189
Hervé Poussineau [Sun, 22 May 2022 12:23:26 +0000 (14:23 +0200)]
[WIN32SS] Change LDEVOBJ_bProbeAndCaptureDevmode to load missing settings from registry
- use EngpGetDisplayDriverParameters to get display settings from registry
- update searched display settings with the provided ones (+ add missing SEH2)
- then, search exact mode
User can now change only one display setting, without specifying other ones.
Hervé Poussineau [Sun, 22 May 2022 12:21:34 +0000 (14:21 +0200)]
[WIN32SS] Copy loading of registry settings from mdevobj.c to new function
This function will be used in next commit, and duplicated implementation
in mdevobj.c will be dropped.
Hervé Poussineau [Sun, 22 May 2022 12:13:48 +0000 (14:13 +0200)]
[WIN32SS] In LDEVOBJ_bGetClosestMode, search 60 Hz if everything failed
This function needs probably to be rewritten.
Hervé Poussineau [Sun, 22 May 2022 12:06:19 +0000 (14:06 +0200)]
Revert "[WIN32SS] Handle panning in LDEVOBJ_bProbeAndCaptureDevmode"
This reverts commit
37c2bb3985c5724e9c3d00472f6f3419d65266d1.
CORE-18189
Hervé Poussineau [Sun, 22 May 2022 11:19:55 +0000 (13:19 +0200)]
[WIN32SS] Only refresh graphics mode list when iModeNum = 0
We don't expect graphics mode list to change while enumerating it.
Eric Kohl [Sat, 21 May 2022 14:59:45 +0000 (16:59 +0200)]
[DISKPART] Do not print command descriptions twice
Eric Kohl [Sat, 21 May 2022 08:43:38 +0000 (10:43 +0200)]
[DISKPART] Improvements to the dump, help and delete commands
- Print help only if a help string exists.
- Use the command table for the dump sub commands.
- Add sub commands for the delete command.
Luke Luo [Fri, 20 May 2022 12:38:24 +0000 (20:38 +0800)]
[TRANSLATION] Improve Simplified Chinese (zh-CN) translation (#4513)
- Changed some wording according to the translation requirements.
- Fixed some mistakes.
- Changed my name.
Reviewed-by: He Yang <1160386205@qq.com>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
Marcus Boillat [Fri, 20 May 2022 11:59:01 +0000 (13:59 +0200)]
[FRAGINATOR] Fix some uninitialized variables and make it work again (#4497)
Set BitmapSize to zero so DeviceIOControl doesn't fail.
ROSAPPS-332
Tuur Martens [Tue, 17 May 2022 10:06:28 +0000 (12:06 +0200)]
[NTOS:MM] Fix memory leak in MiMapViewOfDataSection
If inserting the allocated VAD fails, MiMapViewOfDataSection will make no attempt to free the allocated VAD. Nor will it call MiDereferenceControlArea(ControlArea); like other failure return paths. This commit fixes this behavior.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Eric Kohl [Sun, 15 May 2022 23:46:32 +0000 (01:46 +0200)]
[DISKPART] Clean up the help system and fix translations
@Translators: You can translate text again, but please do no translate placeholder text.
Hermès Bélusca-Maïto [Sun, 15 May 2022 17:22:57 +0000 (19:22 +0200)]
[NOTEPAD] Simplify code for UpdateWindowCaption(). Addendum to
1d690f04.
One StringCbPrintf() call is sufficient, that can cover both
clearModifyAlert == TRUE or FALSE cases.
Also, only SendMessage(EM_GETMODIFY) when clearModifyAlert == FALSE
(during text edition).
Stanislav Motylkov [Sun, 15 May 2022 12:10:05 +0000 (15:10 +0300)]
[DISKPART] Fix MSVC build. Addendum to
566e898.
Eric Kohl [Sun, 15 May 2022 10:27:53 +0000 (12:27 +0200)]
[DISKPART] Improve the command table to support subcommands and start work on the create command
- Extend the command table to support subcommands.
- Get rid of the existing subcommand code.
- Use the new subcommand suport for the help system.
- Start work on the create command.
@Translators: Please do not translate any changes yet, because I will improve help system in one of the next steps.
Katayama Hirofumi MZ [Sun, 15 May 2022 05:38:43 +0000 (14:38 +0900)]
[NOTEPAD] Less flickering title bar (#4516)
When typing text on NotePad, then NotePad title bar flickers.
- Save previous modification flag.
- If no change in modification flag, do not set the title bar text.
Katayama Hirofumi MZ [Sun, 15 May 2022 03:53:12 +0000 (12:53 +0900)]
[KBDJA][NTUSER] Improve scancode_to_vk data (#4515)
- Fix scancode_to_vk variable.
- Add special handling to win32k!ProcessKeyEvent function for Japanese.
CORE-11700
Hervé Poussineau [Sun, 8 May 2022 20:26:22 +0000 (22:26 +0200)]
[WIN32SS] Implement display acceleration level 5 (ie no acceleration)
This is a easy as forcing usage of panning driver.
Hervé Poussineau [Sun, 8 May 2022 20:23:32 +0000 (22:23 +0200)]
[WIN32SS] Implement panning driver
This can be configured in registry with DefaultSettings.XPanning and
DefaultSettings.YPanning, which describe the real screen resolution.
DefaultSettings.XResolution and DefaultSettings.YResolution describe
the resolution of the virtual screen.
Hervé Poussineau [Sat, 14 May 2022 13:41:44 +0000 (15:41 +0200)]
[WIN32SS] mouse: call panning driver when moving pointer
Yes, if a driver supports both hardware pointers and panning, it will be called twice on each move.
Hervé Poussineau [Sat, 14 May 2022 13:37:29 +0000 (15:37 +0200)]
[WIN32SS] mouse: use pointer flags in PDEVOBJ
When changing pointer cursor:
- use PDEV_HARDWARE_POINTER flag if using hardware pointer
- use PDEV_SOFTWARE_POINTER flag if using software pointer
- keep pfnMovePointer as an accelerator to driver function (if available) and never change it
- fix bug (2 pointers) when switching between hardware and software pointer
When moving pointer:
- check PDEV_HARDWARE_POINTER flag to know if we need to call the driver
- check PDEV_SOFTWARE_POINTER flag to know if we need to call EngMovePointer
Hervé Poussineau [Sun, 8 May 2022 19:56:00 +0000 (21:56 +0200)]
[WIN32SS] Handle panning in LDEVOBJ_bProbeAndCaptureDevmode
- search a graphic mode corresponding to real screen resolution (not virtual panning one)
- when capturing the selected mode, copy from input the virtual panning resolution
- when searching the best mode, also try without panning
Hervé Poussineau [Sun, 8 May 2022 19:51:10 +0000 (21:51 +0200)]
[WIN32SS] Copy function table earlier, and use it in all PDEVOBJ operations
Tuur Martens [Thu, 12 May 2022 06:11:52 +0000 (08:11 +0200)]
[NTOS:MM] Charge and free quotas for VAD allocations
Charge quotas for VAD allocations and free the quotas again when the VADs are freed.
CORE-18028
Stanislav Motylkov [Fri, 13 May 2022 14:24:02 +0000 (17:24 +0300)]
[BUSLOGIC] Fix reference link to VMware driver source page
- Clarify driver version in 3rd Party Files.
- Fix some minor formatting problems.
- Also add missing OBJ_KERNEL_HANDLE to match Zw*() uses. (#4499)
CORE-10207 CORE-18180
Co-authored-by: Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
Katayama Hirofumi MZ [Thu, 12 May 2022 11:39:56 +0000 (20:39 +0900)]
[KBDJA] Fix key names (#4507)
They will be used at user32!GetKeyNameText function. CORE-11700
Katayama Hirofumi MZ [Thu, 12 May 2022 08:55:59 +0000 (17:55 +0900)]
[KDBJA] Delete duplicate key entries (#4508)
Delete the duplicated key data. CORE-11700
Katayama Hirofumi MZ [Thu, 12 May 2022 05:05:16 +0000 (14:05 +0900)]
[KBDJA] Delete temporary hacks (#4506)
Improve readability of Japanese keyboard.
- SC_13 (0xDE) --> VK_OEM_7
- SC_27 (0xC0) --> VK_OEM_3
- SC_40 (0xBB) --> VK_OEM_PLUS
- SC_41 (0xBA) --> VK_OEM_1
CORE-11700
Katayama Hirofumi MZ [Thu, 12 May 2022 03:48:29 +0000 (12:48 +0900)]
[KBDJA] Enable VK_CONVERT/VK_NONCONVERT keys (#4505)
Enable VK_CONVERT/VK_NONCONVERT keys for Japanese keyboard.
- ScanCode 121 (0x79) --> VK_CONVERT.
- ScanCode 123 (0x7B) --> VK_NONCONVERT.
CORE-11700
Katayama Hirofumi MZ [Wed, 11 May 2022 12:42:32 +0000 (21:42 +0900)]
[USER32][KBDJA] Implement CliImmSetHotKey (#4504)
- Fix Japanese keyboard about [Shift]+[0] and [半/全] (VK_PROCESSKEY).
- Add user32!CliSaveImeHotKey helper function.
- Implement user32!CliImmSetHotKey function. This function is forwarded from imm32!ImmSetHotKey.
- Fix user32!TranslateMessage by using imm32!ImmTranslateMessage.
CORE-11700, CORE-18183, CORE-18182
Katayama Hirofumi MZ [Wed, 11 May 2022 01:03:02 +0000 (10:03 +0900)]
[USER32] Implement UnloadKeyboardLayout (#4503)
- Add IntSetFeKeyboardFlags, CliImmSetHotKeyWorker, CliSetDefaultImeHotKeys, CliGetPreloadKeyboardLayouts, CliGetImeHotKeysFromRegistry, CliImmInitializeHotKeys, CliSetSingleHotKey, and CliReadRegistryValue helper functions.
CORE-11700
Marcus Boillat [Sun, 8 May 2022 17:27:27 +0000 (19:27 +0200)]
[NTOS:KE] Fix CPU extended family and model detection
Based on documentation from Geoff Chappell:
https://www.geoffchappell.com/studies/windows/km/cpu/cpuid/00000001h/eax.htm
CORE-17974
Marcus Boillat [Sat, 7 May 2022 21:27:25 +0000 (23:27 +0200)]
[NTOS:KE] Use bitfield structure for x86 CPU signature in EAX register
This makes code a lot more readable. CORE-17974
Stanislav Motylkov [Mon, 9 May 2022 17:38:02 +0000 (20:38 +0300)]
[NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor
CORE-17974
Raymond Czerny [Mon, 9 May 2022 18:36:23 +0000 (20:36 +0200)]
[SHELL32] Fix visual glitch appeared after fixing CORE-18137 (#4488)
- Check if the parent window of RunDLL is the desktop,
only in this case add the system control applet to the taskbar.
- Try loading small 16x16 icon for the taskbar button.
CORE-18175
George Bișoc [Sun, 8 May 2022 19:49:14 +0000 (21:49 +0200)]
[IMM32] Silence two debug prints
These two debug prints are spammy as fuck and it makes shit harder to debug ReactOS, apart that these prints barely serve any purpose.
George Bișoc [Sat, 7 May 2022 22:51:54 +0000 (00:51 +0200)]
[WINLOGON] Let Winlogon assign security to desktop when a user logs in now
George Bișoc [Sat, 7 May 2022 22:39:44 +0000 (00:39 +0200)]
[WIN32K:NTUSER] Assign a security descriptor when parsing the desktop object
The problem ReactOS currently faces is this -- whenever the desktop is being parsed we aren't assigning a security descriptor to it. As a matter of fact when Winlogon tries to assign new security information to the application desktop when a user logs in, Winlogon fails because no prior descriptor has been created for it even though we already do this when initializing security buffers in Winlogon.
With that said, we must assign a descriptor when parsing the desktop as well. This fixes a hack in Winlogon where security assigning of application desktop during a log in is disabled (which we can now enable such code path back).
Serge Gautherie [Fri, 6 May 2022 22:49:29 +0000 (00:49 +0200)]
[SACDRV] Add 2 OBJ_KERNEL_HANDLE
Match Zw*() uses.
Plus:
- GetRegistryValueBuffer(): Add missing ZwClose(Handle), Fix a copypasta.
- SetRegistryValue(): 1 s/NtClose/ZwClose/.
CORE-10207
George Bișoc [Sun, 8 May 2022 17:16:34 +0000 (19:16 +0200)]
[NTOS:OB] Specify the query security descriptor tag when freeing the allocation
We are allocating blocks of pool memory for a security descriptor with its own specific tag, TAG_SEC_QUERY, so just use it when freeing when releasing the descriptor as well (aka freeing the said pool).
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:55:17 +0000 (04:55 +0100)]
[HAL][HALARM] The HAL should only use KPCR.
And why the ARM HAL uses KPCR::InterruptRoutine, a field only defined
in *powerpc*/ketypes.h, is beyond me, but OK...
See Timo vs. Alex discussion, explaining that KIPCR is a ReactOS-only
thing: https://reactos.org/archives/public/ros-dev/2008-August/010549.html
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:44:46 +0000 (04:44 +0100)]
[FREELDR][MINIHAL] Move KefAcquireSpinLockAtDpcLevel stub back to HAL, #ifdef'ed in _MINIHAL_ where it's only needed.
Katayama Hirofumi MZ [Sun, 8 May 2022 11:16:17 +0000 (20:16 +0900)]
[NTUSER][USER32] Implement IME status (#4472)
- Add IntCheckImeShowStatus, IntSendMessageToUI, IntSendOpenStatusNotify, IntNotifyImeShowStatus, and xxxBroadcastImeShowStatusChange helper functions.
- Renaming: s/X_ROUTINE_IMESHOWSTATUSCHANGE/TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE/
- Implement NtUserCallNoParam.NOPARAM_ROUTINE_GETIMESHOWSTATUS.
- Implement NtUserCallHwndParamLock.TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE.
- Fix hung in User32GetTopLevelWindow and rename it as IntGetTopLevelWindow.
CORE-11700
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 04:32:17 +0000 (05:32 +0100)]
[NDK][XDK] Improve some HAL-related definitions.
- Add more accurate definitions for the values of HAL_DISPATCH_VERSION
and HAL_PRIVATE_DISPATCH_VERSION.
See https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/ntos/hal/hal_dispatch.htm
and https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/ntos/hal/hal_private_dispatch.htm
- Make the conditionals for HalDispatchTable definition MS-WDK-compatible,
and do the same for HalPrivateDispatchTable.
- Remove MinGW-only non-MS-WDK-compatible PHAL_DISPATCH_TABLE and
PHAL_PRIVATE_DISPATCH_TABLE definitions.
- Remove hackish #define _NTSYSTEM_ in the wdm.h header.
Hermès Bélusca-Maïto [Sun, 8 May 2022 01:06:27 +0000 (03:06 +0200)]
[MINIHAL] Compile with _NTSYSTEM_ since it's also part of the bootloader.
Fixes compilation because the Hal(Private)DispatchTable's, defined in
the bootloader's NTOS stub, are not external imports, as they would be
for a standard HAL.
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:47:09 +0000 (04:47 +0100)]
[FREELDR] Remove unnecessary includes and deprecated defines.
Serge Gautherie [Sat, 7 May 2022 19:12:19 +0000 (21:12 +0200)]
[DRIVERS] Add some missing OBJ_KERNEL_HANDLE (#4493)
Match Zw*() uses. CORE-10207
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 04:35:43 +0000 (05:35 +0100)]
[NTOS] Don't define _IN_KERNEL_ globally for the kernel, but just where it's needed: when including regstr.h.
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:56:32 +0000 (04:56 +0100)]
[HALARM] Update defines in hal.h
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 01:25:53 +0000 (02:25 +0100)]
[NDK][HAL][NTOS] Add missing PRCB_MINOR_VERSION / PRCB_MAJOR_VERSION and use them.
Hermès Bélusca-Maïto [Mon, 7 Mar 2022 23:42:06 +0000 (00:42 +0100)]
[NTOS] Remove ROS-specific __NTOSKRNL__
See https://reactos.org/archives/public/ros-kernel/2004-June/003878.html
> In the source files one set of headers is included if
__NTDLL__ is defines and onother set if __NTOSKRNL__ is defines (dirty
workaround for our messy headers).
Stanislav Motylkov [Sat, 7 May 2022 14:24:06 +0000 (17:24 +0300)]
[NVNET] Add more controller descriptions
Addendum to
b79fbe23. Based on NvNetRecognizeHardware function in nic.c
Stanislav Motylkov [Sat, 7 May 2022 13:44:23 +0000 (16:44 +0300)]
[AC97] Fix driver provider name
- Also sort out non-localizeable lines
- Fix German translation encoding and add missing one
- Add Russian translation
Addendum to
9c79a798,
68e19a95 and
9ca32a2b.
Eric Kohl [Sat, 7 May 2022 14:53:26 +0000 (16:53 +0200)]
[NETAPI32] NetSessionEnum: UncClientName and username are optional
Do not fail if UncClientName and username are null.
Serge Gautherie [Wed, 4 May 2022 14:23:54 +0000 (16:23 +0200)]
[PCIX] Add 2 OBJ_KERNEL_HANDLE
Match Zw*() uses.
CORE-10207
Hermès Bélusca-Maïto [Thu, 5 May 2022 20:21:21 +0000 (22:21 +0200)]
[SHELL32_APITEST] ShellExecCmdLine: Do **NOT** use TerminateProcess to close the opened windows.
This design, introduced in
418edcd2b, is fundamentally flawed as it
can also close windows unrelated to the running test (e.g. windows
of programs that the user can start, while the test is running).
But since we cannot do much better, mitigate instead the other main
problem of this design: Just use PostMessageW(WM_CLOSE), as it used
to be, instead of TerminateProcess().
Indeed, using TerminateProcess() otherwise could kill unrelated
processes the test hasn't created. In particular it could kill the
csrss.exe system process if, during the testing procedure, a hard-error
popup shows up.
And this is precisely the case when this test runs with limited memory,
and a hard-error
"Insufficient system resources exist to complete the requested service."
arises.
Hermès Bélusca-Maïto [Thu, 5 May 2022 20:20:59 +0000 (22:20 +0200)]
[SHELL32_APITEST] ShellExecuteEx: Introduce a CleanupNewlyCreatedWindows() helper similar to the one of the ShellExecCmdLine test.
George Bișoc [Sat, 5 Feb 2022 21:38:22 +0000 (22:38 +0100)]
[NTOS:SE] Deny access to the caller if access is not allowed by the object
There are two fundamental problems when it comes to access checks in ReactOS. First, the internal function SepAccessCheck which is the heart and brain of the whole access checks logic of the kernel warrants access to the calling thread of a process to an object even though access could not be given.
This can potentially leave security issues as we literally leave objects to be touched indiscriminately by anyone regardless of their ACEs in the DACL of a security descriptor. Second, the current access check code doesn't take into account the fact that an access token can have restricted SIDs. In such scenario we must perform additional access checks by iterating over the restricted SIDs of the primary token by comparing the SID equality and see if the group can be granted certain rights based on the ACE policy that represents the same SID.
Part of SepAccessCheck's code logic will be split for a separate private kernel routine, SepAnalyzeAcesFromDacl. The reasons for this are primarily two -- such code is subject to grow eventually as we'll support different type ACEs and handle them accordingly -- and we avoid further code duplicates. On Windows Server 2003 there are 5 different type of ACEs that are supported for access checks:
- ACCESS_DENIED_ACE_TYPE (supported by ReactOS)
- ACCESS_ALLOWED_ACE_TYPE (supported by ReactOS)
- ACCESS_DENIED_OBJECT_ACE_TYPE
- ACCESS_ALLOWED_OBJECT_ACE_TYPE
- ACCESS_ALLOWED_COMPOUND_ACE_TYPE
This gives the opportunity for us to have a semi serious kernel where security of objects are are taken into account, rather than giving access to everyone.
CORE-9174
CORE-9175
CORE-9184
CORE-14520
George Bișoc [Sat, 5 Feb 2022 21:21:14 +0000 (22:21 +0100)]
[NTOS:SE] Enable support for principal and restricted SIDs
SepSidInTokenEx function already provides the necessary mechanism to handle scenario where a token has restricted SIDs or a principal SID is given to the call. There's no reason to have these redundant ASSERTs anymore.
In addition to that make sure if the SID is not a restricted and if that SID is the first element on the array and it's enabled, this is the primary user.
George Bișoc [Sat, 5 Feb 2022 21:01:39 +0000 (22:01 +0100)]
[NTOS:SE] Implement SepGetSidFromAce
This function will be used to retrieve a security identifier from a valid access control entry in the kernel. Mostly and exclusively used within access checks related code and such.
George Bișoc [Tue, 19 Apr 2022 09:33:09 +0000 (11:33 +0200)]
[NTOS:SE] Add SepGetSidFromAce prototype & Niscellaneous Stuff
George Bișoc [Sat, 5 Feb 2022 20:50:39 +0000 (21:50 +0100)]
[XDK] Move security object related structures to appropriate place
ACCESS_ALLOWED_OBJECT_ACE and ACCESS_DENIED_OBJECT_ACE structures must be in the XDK section of SDK as these will be used in the future in the security subsystem of the kernel.
George Bișoc [Tue, 8 Feb 2022 10:54:57 +0000 (11:54 +0100)]
[NTOSKRNL] Add security access check rights pool tag
George Bișoc [Sun, 13 Feb 2022 18:12:19 +0000 (19:12 +0100)]
[SERVICES] Assign a World identity authority for Everyone SID, not Null authority
The current code allocates memory and initializes the Everyone "World" security identifier but with a Null authority identifier. This is utterly wrong on so many levels, more so partly because a Null authority identifier is 0 so after the Everyone SID is initialized, it is actually initialized as S-1-0-0 instead of S-1-1-0.
George Bișoc [Mon, 21 Feb 2022 10:12:48 +0000 (11:12 +0100)]
[SERVICES] Grant ReactOS Setup component SYSTEM access
ReactOS Setup is an integral component that is part of the operating system responsible for the installation of ROS during 2nd installation stage. The situation with current master branch is like this -- the Services component always tries to create the process
on behalf of the logged in user with its own security context. That user doesn't have the privileges and access rights like SYSTEM thus the Services component tries to create the process but it fails to do so because of lacking of required access right, TOKEN_DUPLICATE, in order for the calling thread to impersonate as self.
George Bișoc [Fri, 15 Apr 2022 09:11:12 +0000 (11:11 +0200)]
[UMPNPMGR] Create a security descriptor for PnP installation device event
George Bișoc [Thu, 14 Apr 2022 19:14:46 +0000 (21:14 +0200)]
[POWRPROF] Create a security descriptor for power management semaphore