reactos.git
23 months ago[KBDJA] Fix key names (#4507)
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

23 months ago[KDBJA] Delete duplicate key entries (#4508)
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

23 months ago[KBDJA] Delete temporary hacks (#4506)
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

23 months ago[KBDJA] Enable VK_CONVERT/VK_NONCONVERT keys (#4505)
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

23 months ago[USER32][KBDJA] Implement CliImmSetHotKey (#4504)
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

23 months ago[USER32] Implement UnloadKeyboardLayout (#4503)
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

23 months ago[NTOS:KE] Fix CPU extended family and model detection 4495/head
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

23 months ago[NTOS:KE] Use bitfield structure for x86 CPU signature in EAX register
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

23 months ago[NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor
Stanislav Motylkov [Mon, 9 May 2022 17:38:02 +0000 (20:38 +0300)]
[NTOS:KE] Move KiGet/SetProcessorType function below KiGetCpuVendor

CORE-17974

23 months ago[SHELL32] Fix visual glitch appeared after fixing CORE-18137 (#4488)
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

23 months ago[IMM32] Silence two debug prints
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.

23 months ago[WINLOGON] Let Winlogon assign security to desktop when a user logs in now 4496/head
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

23 months ago[WIN32K:NTUSER] Assign a security descriptor when parsing the desktop object
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).

23 months ago[SACDRV] Add 2 OBJ_KERNEL_HANDLE
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

23 months ago[NTOS:OB] Specify the query security descriptor tag when freeing the allocation
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).

23 months ago[HAL][HALARM] The HAL should only use KPCR.
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

23 months ago[FREELDR][MINIHAL] Move KefAcquireSpinLockAtDpcLevel stub back to HAL, #ifdef'ed...
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.

23 months ago[NTUSER][USER32] Implement IME status (#4472)
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

23 months ago[NDK][XDK] Improve some HAL-related definitions.
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.

23 months ago[MINIHAL] Compile with _NTSYSTEM_ since it's also part of the bootloader.
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.

23 months ago[FREELDR] Remove unnecessary includes and deprecated defines.
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:47:09 +0000 (04:47 +0100)]
[FREELDR] Remove unnecessary includes and deprecated defines.

23 months ago[DRIVERS] Add some missing OBJ_KERNEL_HANDLE (#4493)
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

23 months ago[NTOS] Don't define _IN_KERNEL_ globally for the kernel, but just where it's needed...
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.

23 months ago[HALARM] Update defines in hal.h
Hermès Bélusca-Maïto [Tue, 8 Mar 2022 03:56:32 +0000 (04:56 +0100)]
[HALARM] Update defines in hal.h

23 months ago[NDK][HAL][NTOS] Add missing PRCB_MINOR_VERSION / PRCB_MAJOR_VERSION and use them.
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.

23 months ago[NTOS] Remove ROS-specific __NTOSKRNL__
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).

23 months ago[NVNET] Add more controller descriptions
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

23 months ago[AC97] Fix driver provider name
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 9c79a79868e19a95 and 9ca32a2b.

23 months ago[NETAPI32] NetSessionEnum: UncClientName and username are optional
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.

23 months ago[PCIX] Add 2 OBJ_KERNEL_HANDLE
Serge Gautherie [Wed, 4 May 2022 14:23:54 +0000 (16:23 +0200)]
[PCIX] Add 2 OBJ_KERNEL_HANDLE

Match Zw*() uses.

CORE-10207

23 months ago[SHELL32_APITEST] ShellExecCmdLine: Do **NOT** use TerminateProcess to close the... 4489/head
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.

23 months ago[SHELL32_APITEST] ShellExecuteEx: Introduce a CleanupNewlyCreatedWindows() helper...
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.

23 months ago[NTOS:SE] Deny access to the caller if access is not allowed by the object 4340/head
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

23 months ago[NTOS:SE] Enable support for principal and restricted SIDs
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.

23 months ago[NTOS:SE] Implement SepGetSidFromAce
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.

23 months ago[NTOS:SE] Add SepGetSidFromAce prototype & Niscellaneous Stuff
George Bișoc [Tue, 19 Apr 2022 09:33:09 +0000 (11:33 +0200)]
[NTOS:SE] Add SepGetSidFromAce prototype & Niscellaneous Stuff

23 months ago[XDK] Move security object related structures to appropriate place
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.

23 months ago[NTOSKRNL] Add security access check rights pool tag
George Bișoc [Tue, 8 Feb 2022 10:54:57 +0000 (11:54 +0100)]
[NTOSKRNL] Add security access check rights pool tag

23 months ago[SERVICES] Assign a World identity authority for Everyone SID, not Null authority
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.

23 months ago[SERVICES] Grant ReactOS Setup component SYSTEM access
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.

23 months ago[UMPNPMGR] Create a security descriptor for PnP installation device event
George Bișoc [Fri, 15 Apr 2022 09:11:12 +0000 (11:11 +0200)]
[UMPNPMGR] Create a security descriptor for PnP installation device event

23 months ago[POWRPROF] Create a security descriptor for power management semaphore
George Bișoc [Thu, 14 Apr 2022 19:14:46 +0000 (21:14 +0200)]
[POWRPROF] Create a security descriptor for power management semaphore

23 months ago[RPCRT4] Set up a security descriptor for RPC named pipes
George Bișoc [Fri, 18 Feb 2022 20:42:51 +0000 (21:42 +0100)]
[RPCRT4] Set up a security descriptor for RPC named pipes

rpcrt4_create_pipe_security function will be held in charge to set up security descriptors specific for each named pipe upon creation in rpcrt4_conn_create_pipe. The descriptor is then freed after the pipe is no longer needed.

23 months ago[DHCPCSVC] Set up a security descriptor for DHCP named pipe
George Bișoc [Sun, 20 Feb 2022 19:31:33 +0000 (20:31 +0100)]
[DHCPCSVC] Set up a security descriptor for DHCP named pipe

23 months ago[ADVAPI32] Implement security descriptor management in CreateProcessAsUserCommon...
George Bișoc [Sat, 26 Mar 2022 21:36:03 +0000 (22:36 +0100)]
[ADVAPI32] Implement security descriptor management in CreateProcessAsUserCommon internal function

Currently CreateProcessAsUserCommon doesn't set a default descriptor for the newly duplicated token object for the new process nor it sets any security information for both the process and thread. This is wrong, because when the process is created on behalf of the user's security context,
it still uses the previous security information of the creator that initially gave birth to the process. CreateDefaultProcessSecurityCommon function will serve as a placeholder until CreatePrivateObjectSecurity is implemented.

23 months ago[ADVAPI32] Soft rewrite of CreateProcessAsUserCommon
George Bișoc [Thu, 10 Mar 2022 11:03:31 +0000 (12:03 +0100)]
[ADVAPI32] Soft rewrite of CreateProcessAsUserCommon

Refactor the function in such a way that it can jump to a single exit but most importantly, implement a "rinse and repeat" mechanism where we assign a primary token to process by disabling impersonation first and retry with impersonation later.

More info can be found in the documention within the code.

23 months ago[KERNEL32] Let KERNEL32 assign security to NLS section names
George Bișoc [Mon, 11 Apr 2022 18:24:41 +0000 (20:24 +0200)]
[KERNEL32] Let KERNEL32 assign security to NLS section names

Currently Kernel32 doesn't make any server call to Basesrv in order to create NLS section names, instead it's Kernel32 itself that handles the job of NLS section names. With that said, let Kernel32 assign a security descriptor to NLS section names. See the FIXME comment on code for further dtails

23 months ago[KERNEL32][BASESRV] Implement NLS section security
George Bișoc [Sun, 10 Apr 2022 17:29:03 +0000 (19:29 +0200)]
[KERNEL32][BASESRV] Implement NLS section security

Implement code that deals with the security side of NLS, more specifically, create two security descriptors for NLS directory and NLS section names and let the server use such code.

23 months ago[WINLOGON][HACK] Allow network services access to default window station
George Bișoc [Sat, 9 Apr 2022 19:17:58 +0000 (21:17 +0200)]
[WINLOGON][HACK] Allow network services access to default window station

HHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCCCKKKKKKKKKKKKKKKKKK!!!

There are two problems concerning with network services. First, a window station should be created for every network service process that gets started although this doesn't happen. Instead, network services like RPCSS and DNS service host process (svchost.exe) attempt to access the default window station (Winsta0).
This is because the access token of these two network service processes have an authentication ID that is uniquely generated. This is incorrect, because NetworkService is a special account with its own designed authentication ID for it. As a matter of fact, no window station is created for a network service and as such
both RPCSS and DNS svchost.exe attempt to access Winsta0 which they cannot.

The second problem, albeit not quite relevant to the first one but still worth mentioning nevertheless, is that network services have an access token that is primary which it should be an impersonation token. These problems all come from LSASS as LSA infrastructure is responsible for creating access tokens with security
context for objects.

For the moment being, add a hack on Winlogon that gives allow access to the default window station to network services. When LSASS and involved components are fixed, this hack must be removed.

23 months ago[WINLOGON] Refactor the security management part
George Bișoc [Sat, 2 Apr 2022 16:16:40 +0000 (18:16 +0200)]
[WINLOGON] Refactor the security management part

Refactor the security related code of Winlogon and move it to its own dedicated place, security.c. This includes code for preparation of security descriptors for window station and desktop objects when their created, helper functions which give allow access to such objects for the logged in user and whatnot.

==== DO NOTE ====
Currently new desktop security assignment fails because for whatever reason the system thinks the application desktop has no prior security even though a descriptor has been created for it before. See the FIXME comment on code for information.

23 months ago[USER32] Capture the security descriptor from the caller when creating a window station
George Bișoc [Sun, 27 Mar 2022 18:01:19 +0000 (20:01 +0200)]
[USER32] Capture the security descriptor from the caller when creating a window station

When creating a window station with CreateWindowStationW, the function ignores the security descriptor provided by the caller and instead it uses whatever descriptor the system can find.

23 months ago[WIN32K:NTUSER] Implement security infrastructure for NTUSER component
George Bișoc [Wed, 16 Mar 2022 20:03:56 +0000 (21:03 +0100)]
[WIN32K:NTUSER] Implement security infrastructure for NTUSER component

Implement a base security infrastructure with code that sets up a security descriptor for the service that we're going to connect through it. Such service is based upon a desktop and a window station.

=== DOCUMENTATION REMARKS ===
The authenticated user, represented by an access token that describes its security context, is the main holder and has ultimate power against the default created desktop and window station objects in USER. The authenticated user in question
is the actual logged in user, this is the case when the server is impersonating a client. Administrators on the other hand have some share of power against default desktop but their power in question is extremely limited against the default
window station as admins can only just enumerate the available and valid handle stations within a desktop.

23 months ago[LSASRV] Set up a security descriptor for the token object
George Bișoc [Mon, 28 Feb 2022 17:35:53 +0000 (18:35 +0100)]
[LSASRV] Set up a security descriptor for the token object

LSASS implements a default ACL inside the token structure field but it doesn't actually set a protective security descriptor for the token object itself. This happens so that the kernel gets whatever default ACLs it finds for the object which is incorrect.

SYSTEM has full and supreme control over tokens, administrators can only read the token as such. The logged in user of their own token has full access. Credits and courtesy goes to Thomas Faber for the patch.

23 months ago[WIN32SS] Fix CF_DIB format not being saved to clipboard on Print Screen key (#3265)
Doug Lyons [Thu, 5 May 2022 15:54:15 +0000 (10:54 -0500)]
[WIN32SS] Fix CF_DIB format not being saved to clipboard on Print Screen key (#3265)

Use pool to allocate (potentially huge) clipboard data buffers.
CORE-17318

23 months ago[SHELL32] Fix Shift-Delete to Permanently Delete Files and Folders (#4004)
Doug Lyons [Thu, 5 May 2022 15:30:06 +0000 (10:30 -0500)]
[SHELL32] Fix Shift-Delete to Permanently Delete Files and Folders (#4004)

CORE-17802

23 months ago[CABMAN] Make cabman exit with non-zero exit code if argument parsing fails (#4022)
William Kent [Sun, 10 Oct 2021 21:01:48 +0000 (17:01 -0400)]
[CABMAN] Make cabman exit with non-zero exit code if argument parsing fails (#4022)

Co-authored-by: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
23 months ago[TXT2NLS] Use delete[] to deallocate new[] output (#4022)
William Kent [Sun, 10 Oct 2021 20:59:48 +0000 (16:59 -0400)]
[TXT2NLS] Use delete[] to deallocate new[] output (#4022)

Per AppleClang 13.0 warning.

23 months ago[SHELL32] Folders: Adjust column sequence in details view (#4279)
Thomas Csovcsity [Thu, 5 May 2022 15:05:18 +0000 (17:05 +0200)]
[SHELL32] Folders: Adjust column sequence in details view (#4279)

Adjust column sequence in folder view to match WinXP and Win2k3 order.
CORE-11846

23 months ago[BROWSEUI] Remove useless variable and unreachable code (#4483)
Serge Gautherie [Thu, 5 May 2022 14:45:56 +0000 (16:45 +0200)]
[BROWSEUI] Remove useless variable and unreachable code (#4483)

Addendum to 0c47416 (r72003).
CORE-12804

Co-authored-by: Victor Martinez Calvo <vicmarcal@gmail.com>
23 months ago[SHELL32] CPrinterFolder: Validate string pointers properly. (#4486)
Raymond Czerny [Thu, 5 May 2022 14:24:38 +0000 (16:24 +0200)]
[SHELL32] CPrinterFolder: Validate string pointers properly. (#4486)

CORE-18174

Check string pointers before determining the length of strings.

23 months ago[NTUSER] NtUserBuildHwndList should return NTSTATUS (#4487)
Katayama Hirofumi MZ [Thu, 5 May 2022 13:53:15 +0000 (22:53 +0900)]
[NTUSER] NtUserBuildHwndList should return NTSTATUS (#4487)

A follow-up to #4485 (c2a51c7). CORE-18173

23 months ago[NTUSER][USER32] Make NtUserBuildHwndList exclusive (#4485)
Katayama Hirofumi MZ [Wed, 4 May 2022 23:49:00 +0000 (08:49 +0900)]
[NTUSER][USER32] Make NtUserBuildHwndList exclusive (#4485)

- Modify prototype of NtUserBuildHwndList function.
- Wrap the code by UserEnterExclusive(); and UserLeave();.
CORE-18173

23 months ago[NTUSER] Add Win: comments to window.c
Katayama Hirofumi MZ [Wed, 4 May 2022 06:40:46 +0000 (15:40 +0900)]
[NTUSER] Add Win: comments to window.c

CORE-18173

23 months ago[REACTOS] Add '\n' to debug logs
Serge Gautherie [Mon, 2 May 2022 12:26:10 +0000 (14:26 +0200)]
[REACTOS] Add '\n' to debug logs

on TRACE, WARN, FIXME and ERR calls.

Plus a few nit picks.

23 months ago[DOC] Update 3rd Party Files (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:38:30 +0000 (21:38 +0200)]
[DOC] Update 3rd Party Files (#4417)

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.8.0 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:37:02 +0000 (21:37 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.8.0 (#4417)

v1.8 (2022-03-12):

- Added minimal support for fs-verity
- ~~Added test suite~~ Not in ReactOS
- Fixed incorrect disk usage statistics
- Fixed potential crashes when renaming stream to file or file to stream
- Fixed potential crashes when querying hard links on file
- Fixed potential hang when opening oplocked file
- Fixed minor issues also uncovered by test suite

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.9 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:35:58 +0000 (21:35 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.9 (#4417)

v1.7.9 (2021-10-02):

- Fixed deadlock when mounting on Windows 11
- Added support for BitLocker-encrypted volumes
- Improved filename checks when renaming or creating hard links
- Miscellaneous bug fixes

23 months ago[PSDK][BOOTMGR] Import NTSTATUS definitions of BitLocker (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:36:34 +0000 (21:36 +0200)]
[PSDK][BOOTMGR] Import NTSTATUS definitions of BitLocker (#4417)

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.8 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:35:40 +0000 (21:35 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.8 (#4417)

v1.7.8.1 (2021-06-13):

- Fixed bug preventing new directories from appearing in listings
- Fixed Release version of driver still not working on XP

v1.7.8 (2021-06-09):

- ~~Upgraded zstd to version 1.5.0~~ Not in ReactOS as it introduces deprecated code
- Fixed regression stopping driver from working under XP
- Fixed compilation on clang
- Fixed corruption issue when Linux mount option inode_cache had been used
- Fixed recursion issue involving virtual directory \$Root

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.7 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:35:05 +0000 (21:35 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.7 (#4417)

v1.7.7 (2021-04-12):

- Fixed deadlock on high load
- Fixed free space issue when installing Genshin Impact
- Fixed issue when copying files with wildcards in command prompt
- Increased speed of directory lookups

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.6 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:34:48 +0000 (21:34 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.6 (#4417)

v1.7.6 (2021-01-14):

- Fixed race condition when booting with Quibble
- No longer need to restart Windows after initial installation
- Forced maximum file name to 255 UTF-8 characters, to match Linux driver
- Fixed issue where directories could be created with trailing backslash
- Fixed potential deadlock when Windows calls NtCreateSection during flush
- Miscellaneous bug fixes

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.5 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:34:24 +0000 (21:34 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.5 (#4417)

v1.7.5 (2020-10-31):

- Fixed text display issue in shell extension
- Added support for mingw 8
- Fixed LXSS permissions not working in new versions of Windows
- Fixed issue where truncating an inline file wouldn't change its size
- Fixed crash with Quibble where driver would try to use AVX2 before Windows had enabled it

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.4 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:33:48 +0000 (21:33 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.4 (#4417)

v1.7.4 (2020-08-23):

- Fixed issue when running compressed EXEs
- Changed build system to cmake
- Upgraded zstd to version 1.4.5
- Added support for FSCTL_GET_RETRIEVAL_POINTERS
- Miscellaneous bug fixes

23 months ago[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.3 (#4417)
Vincent Franchomme [Thu, 28 Apr 2022 19:31:44 +0000 (21:31 +0200)]
[BTRFS][UBTRFS][SHELLBTRFS] Upgrade to 1.7.3 (#4417)

v1.7.3 (2020-05-24):

- Fixed crash when sending file change notifications
- Improved symlink handling with LXSS
- Added support for undocumented flag SL_IGNORE_READONLY_ATTRIBUTE
- Fixed corruption caused by edge case, where address allocated and freed in same flush
- Improved handling of free space tree
- Improved handling of very full volumes
- Fixed spurious warnings raised by GCC 10 static analyser
- Replaced multiplications and divisions with bit shift operations where appropriate
- Fixed combobox stylings in shell extension

23 months ago[BROWSEUI_APITEST] Addendum to 7e22dc05.
Hermès Bélusca-Maïto [Tue, 3 May 2022 15:29:39 +0000 (17:29 +0200)]
[BROWSEUI_APITEST] Addendum to 7e22dc05.

23 months ago[BROWSEUI][BROWSEUI_APITEST] SHExplorerParseCmdLine(): Sync and improve (#3231)
Serge Gautherie [Tue, 3 May 2022 14:32:14 +0000 (16:32 +0200)]
[BROWSEUI][BROWSEUI_APITEST] SHExplorerParseCmdLine(): Sync and improve (#3231)

ROSTESTS-302

- SHCreateFromDesktop(): Sync declaration and spec.
- SHExplorerParseCmdLine(): Sync declaration, header and spec.
- SHExplorerParseCmdLine: Enforce 'UINT_PTR' return type.
Addendum to e39876d and 0f8439a.

- SHExplorerParseCmdLine: Replace '*EXPLORER_INFO'
- SHExplorerParseCmdLine: Fix x64 support; Fix some results.

23 months ago[NEWDEV] Stop update driver wizard from changing device class (#4480)
Olaf Schmerse [Tue, 3 May 2022 14:13:37 +0000 (16:13 +0200)]
[NEWDEV] Stop update driver wizard from changing device class (#4480)

CORE-18166

The update driver wizard should not change the device class by default,
especially when there is already a class set. This is the case when the
wizard gets called from the device manager.

23 months ago[DISKPART] Fixed Volume Number & Label Issue (#4471)
Sahil Shahane [Tue, 3 May 2022 14:06:02 +0000 (19:36 +0530)]
[DISKPART] Fixed Volume Number & Label Issue (#4471)

CORE-18138

- Made Volume label to output only 11 characters at max.
- Made Volume numbering left-padded.

23 months ago[SHELL32] Show system control applet in taskbar (#4437)
Raymond Czerny [Tue, 3 May 2022 14:02:58 +0000 (16:02 +0200)]
[SHELL32] Show system control applet in taskbar (#4437)

Display the control panel applet in the taskbar to allow better navigation between programs.
CORE-18137

This is proceeded by manipulating the window of the current instance of 'rundll32.exe':
- Set title text
- Set icon
- Show window (minimal)
- Engaging the corresponding button in the Taskbar.

23 months ago[GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394)
Victor Martinez Calvo [Tue, 3 May 2022 14:00:21 +0000 (16:00 +0200)]
[GDI32] Fix GetObjectW() GDI_OBJECT_TYPE_BRUSH handling. (#4394)

This fixes the last GetObjectW apitest case:
ok_long(GetObjectA(hBrush, 0, &TestStruct), 0);

- When "cbSize" is "0", GetObjectW shouldn't return "sizeof(LOGBRUSH)" but 0.
- Rely in BRUSH::cjGetObject behavior which returns 0 when cjSize is 0.

Co-authored-by: Víctor Martínez Calvo <victormartinez@alub.io>
23 months ago[SHELL32] Add multiple status bar parts to the file browser (#4401)
Russell Johnson [Tue, 3 May 2022 13:52:23 +0000 (06:52 -0700)]
[SHELL32] Add multiple status bar parts to the file browser (#4401)

The file browser now has a status bar like Windows Server 2003 does.
This includes the sizes of the files, as well as the location.
In certain folders (Network, Desktop, etc.) the status bar is hidden.

Currently it does not handle this in the same way as Windows Shell does,
however it's a good first step to make it work properly.

CORE-17603

Signed-off-by: Russell Johnson <russell.johnson@superdark.net>
Reviewed-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@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: Giannis Adamopoulos <gadamopoulos@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
23 months ago[NTUSER] Fix UserDestroyInputContet (again and again) (#4482)
Katayama Hirofumi MZ [Tue, 3 May 2022 01:17:30 +0000 (10:17 +0900)]
[NTUSER] Fix UserDestroyInputContet (again and again) (#4482)

Add call of UserMarkObjectDestroy.
Fix hung-up. CORE-11700

23 months ago[NTUSER] Fix UserDestroyInputContext (again) (#4476)
Katayama Hirofumi MZ [Mon, 2 May 2022 18:43:26 +0000 (03:43 +0900)]
[NTUSER] Fix UserDestroyInputContext (again) (#4476)

Fix the HIMC handle leak. CORE-11700

23 months ago[WIN32SS] Improve selection of 'closest graphic mode'
Hervé Poussineau [Sun, 1 May 2022 12:35:02 +0000 (14:35 +0200)]
[WIN32SS] Improve selection of 'closest graphic mode'

If color depth is not provided (in registry), try to find a 32 bit one.
If not found, fall back to first available graphic mode.

CORE-18027

23 months ago[WIN32SS] In PDEVOBJ_vRefreshModeList, do not change current stored mode
Hervé Poussineau [Sat, 30 Apr 2022 21:26:53 +0000 (23:26 +0200)]
[WIN32SS] In PDEVOBJ_vRefreshModeList, do not change current stored mode

When changing current devmode, we must not only change ppdev->pdmwDev
pointer, but also update lots of other structures. This work is done by
PDEVOBJ_lChangeDisplaySettings.

CORE-18169

23 months ago[WIN32SS] Set DISPLAY_DEVICE_PRIMARY_DEVICE flag
Hervé Poussineau [Sat, 30 Apr 2022 19:59:44 +0000 (21:59 +0200)]
[WIN32SS] Set DISPLAY_DEVICE_PRIMARY_DEVICE flag

This flag was not set anymore since 2d2824f1b98b772eb36e4e2b75185b48cbeed618
Note that this is still wrong for multi-monitor.

CORE-18169

23 months ago[DESK] Remove call to SetupDiRestartDevices()
Hervé Poussineau [Sat, 30 Apr 2022 11:57:54 +0000 (13:57 +0200)]
[DESK] Remove call to SetupDiRestartDevices()

This effectively reverts a6005299c685bb7669ad7ecb1d9c765bcc494c08, and
parts of c3da00c42c472d07f7a4a4c02d6907ad2956ea66.

This call is not required, as umpnpmgr already does what is needed.
However, keep the call to EnumDisplayDevices(), so win32k knows that a
new graphic card has been installed.

CORE-18168

23 months ago[SETUPAPI] Clarify what functions are exported starting with NT 5.2
Stanislav Motylkov [Sat, 30 Apr 2022 10:36:25 +0000 (13:36 +0300)]
[SETUPAPI] Clarify what functions are exported starting with NT 5.2

CORE-18168

23 months ago[CRT] Fix MinGW-arm intrin minor bug in _byteswap_ushort (#4475)
Julen Urizar Compains [Fri, 29 Apr 2022 22:24:49 +0000 (00:24 +0200)]
[CRT] Fix MinGW-arm intrin minor bug in _byteswap_ushort (#4475)

A little bug were in the CRT, found with RosBE and cegcc compiler:

../sdk/include/crt/mingw32/intrin_arm.h:44:32: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]

Thanks to @HBelusca for suggesting the fix. CORE-17604

23 months ago[ROSTESTS] Fix crash in winhttp:winhttp test (#4303)
Doug Lyons [Fri, 29 Apr 2022 18:50:54 +0000 (13:50 -0500)]
[ROSTESTS] Fix crash in winhttp:winhttp test (#4303)

Fix regression crash in wine_dbgstr_wn. ROSTESTS-377

This brings most of Wine's current wine_dbgstr_wn code into ReactOS.
It's not possible to completely sync this with latest Wine because
there is Wine-specific code regarding "debug_info" and their TEB
in remaining code. Confirmed by @ThFabba.

23 months ago[FREELDR:NTLDR] Add '\n' to debug logs (#4474)
Serge Gautherie [Fri, 29 Apr 2022 15:20:36 +0000 (17:20 +0200)]
[FREELDR:NTLDR] Add '\n' to debug logs (#4474)

23 months ago[GDI32_APITEST] Add CursorIcon tests to GetObject test (#3955)
Jose Carlos Jesus [Fri, 29 Apr 2022 13:45:02 +0000 (14:45 +0100)]
[GDI32_APITEST] Add CursorIcon tests to GetObject test (#3955)

Thanks to @Doug-Lyons for testing.

CORE-17752

23 months ago[NEWDEV] Fix Update Driver wizard dialog position (#4274)
Jose Carlos Jesus [Fri, 29 Apr 2022 12:00:52 +0000 (13:00 +0100)]
[NEWDEV] Fix Update Driver wizard dialog position (#4274)

The Update Driver wizard dialog was not completely visible.
A part of the window was off the screen.

As in Windows XP the dialog box is positioned slightly below
and to the right of the parent window (Z-order).

23 months ago[TRANSLATION] Improve Portuguese (pt-PT) translation (#4445)
Jose Carlos Jesus [Thu, 28 Apr 2022 15:14:33 +0000 (16:14 +0100)]
[TRANSLATION] Improve Portuguese (pt-PT) translation (#4445)

* [RAPPS][EXPLORER] Improve pt-PT translation
* [BROWSEUI][COMCTL32][SHELL32] Improve pt-PT translation
* [INPUT][INTL][POWERCFG] Improve pt-PT translation
* [MAIN] Adjust object position to fit all text
* [SYSSETUP][USERENV] Update pt-PT translation
* [INF] Update pt-PT translation

23 months ago[NTOS:PNP] Fix GCC build (ignoring return value) (#4473)
Katayama Hirofumi MZ [Thu, 28 Apr 2022 13:16:37 +0000 (22:16 +0900)]
[NTOS:PNP] Fix GCC build (ignoring return value) (#4473)

[NTOS:PNP] Fix GCC build (ignoring return value)

Properly handle RtlDuplicateUnicodeString return status. Addendum to de316477. Thanks to @HBelusca and @Doug-Lyons.

23 months ago[NTOS:PNP] IopInitializeDevice: Create a device, allocate a device node and attach...
Eric Kohl [Wed, 27 Apr 2022 19:52:21 +0000 (21:52 +0200)]
[NTOS:PNP] IopInitializeDevice: Create a device, allocate a device node and attach it to the root node

23 months ago[BOOT:RTL] Fix GCC configuration problem for ARM platform
Stanislav Motylkov [Wed, 27 Apr 2022 18:52:05 +0000 (21:52 +0300)]
[BOOT:RTL] Fix GCC configuration problem for ARM platform

Addendum to 24cb57fd. CORE-17604

23 months ago[EXPLORER] syspager.cpp: Add '\n' to debug logs (#4470)
Serge Gautherie [Wed, 27 Apr 2022 12:40:13 +0000 (14:40 +0200)]
[EXPLORER] syspager.cpp: Add '\n' to debug logs (#4470)

23 months ago[NTOS:PNP] Halfplement IoInvalidateDeviceState 4027/head
Victor Perevertkin [Tue, 12 Oct 2021 23:28:24 +0000 (02:28 +0300)]
[NTOS:PNP] Halfplement IoInvalidateDeviceState

Implement the correct start-stop sequence for resource rebalancing
without the actual rebalancing. Also move IoInvalidateDeviceState
processing into the enumeration thread as it should be.

CORE-17519

2 years ago[CMAKE] Build GCC and Clang builds with -fno-common 4469/head
Victor Perevertkin [Tue, 26 Apr 2022 00:15:46 +0000 (03:15 +0300)]
[CMAKE] Build GCC and Clang builds with -fno-common