Commit graph

83721 commits

Author SHA1 Message Date
Jose Carlos Jesus 9ff9580fb0
[MSPAINT] Fix the type of cursor displayed when overlaying scrollbars (#5332)
When the window size is smaller than the image size in both directions, the wrong cursor is displayed when hovering the mouse over the scrollbars.

Readjust position for file date and file size objects, to fit all text.

CORE-18867
2023-06-13 13:01:39 +09:00
Thamatip Chitpong 3da25b73c2
[MMSYS] Use PWSTR instead of PWCHAR for string (#5333)
Use PWSTR instead of PWCHAR for string
Constify some function arguments
2023-06-12 21:52:56 +02:00
Katayama Hirofumi MZ 83762575e1 [MSPAINT] Add (CS_HREDRAW | CS_VREDRAW) style to CCanvasWindow
Reduce repainting defects. CORE-18867
2023-06-12 21:12:37 +09:00
Joachim Henze d3164a0f55
[SHELL32] Strip leftover in CDefView::FillFileMenu() (#5330)
In 0.4.14-dev-955-g 1cf564c25f
Katayama experimented with populating explorers file-menu when no object is selected.

Later we found out, that none of the new entries introduced by that commit really
made sense and even created duplicates. So the commit was reverted by
0.4.15-dev-6039-g 0fa4edebd9 'Revert CDefView::FillFileMenu (#5278)' CORE-18429

But it seems that not all parts were properly reverted back then,
maybe because 6 lines of new code were written between the two lines in the meantime.
2023-06-11 20:53:25 +02:00
George Bișoc 0f9be53985
[WIN32K:NTUSER] Fix an unintialized user's token variable case
And remove the "!NT_SUCCESS(Status)" check which is excessive, the expected
status will always be STATUS_BUFFER_TOO_SMALL anyway. This should fix
some compilation warnings spotted by GCC. Courtesy goes to Hermes for letting
me know of these warnings.
2023-06-11 18:14:02 +02:00
Stanislav Motylkov 7d5e159131 [NTOS:PNP] Assign correct PnP IDs to the devices detected by bootloader
Based on a commit by Vadim Galyant:
5ef5c11e7f

Also fix a minor type conversion warning. CORE-18963 CORE-17977

Co-authored-by: Vadim Galyant <vgal@rambler.ru>
2023-06-11 16:19:02 +03:00
Oleg Dubinskiy 114bc2b96e
[NTGDI][NTUSER] Load DirectX graphics driver at system startup (#4551)
CORE-18221

Load the DirectX graphics kernel driver (dxg.sys) by win32k at WINSRV
initialization time, in NtUserInitialize(). Keep it always loaded in
memory, as on Windows, instead of loading it only by DirectX dlls.

This fixes the problem of acessing this driver: we need only to call
DxDdEnableDirectDraw() and do other stuff when DirectDraw/Direct3D is
required by anything. In other cases, it is called from win32k PDEV
functions when changing display mode (as in Windows). Since it's used
by other things too, it needs to be always loaded.

Otherwise, if it's not loaded, its APIs are not accessible when needed,
and execution fails.

For example, it fixes display mode change problem in VMWare, when a
new mode fails to be applied. Indeed, when it manages DirectDraw stuff,
it calls DXG routines, and therefore fails if dxg.sys isn't loaded
in memory at this moment.

- Implement InitializeGreCSRSS() initialization routine, that initializes
  supplemental NTGDI/GRE data once CSRSS and WINSRV are loaded:
  * Call DxDdStartupDxGraphics() inside it, which loads dxg.sys.
  * Additionally, move fonts and language ID initialization there, from
   win32k!DriverEntry. Confirmed by analysis on Windows.

- Call InitializeGreCSRSS() in NtUserInitialize() main initialization routine
  (called by WINSRV initialization).

Moved to NTGDI from previously NTUSER place:

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2023-06-11 13:44:56 +02:00
Sophie Lemos 29a706fc5a [NTOS:PNP] Fix bug causing all devices be considered as already existing
We should compare against DeviceObject as DeviceInstance is never NULL.
Fix a resource leak as well. The bug CORE-18983 seems to lay somewhere
else though, I just stumbled upon this one while researching it.

Note there is a BSOD in the PnP manager on reboot after the driver
installation failure, but it seems it was uncovered by the fix
as opposed to caused by it.
2023-06-11 13:13:11 +03:00
Andrei Miloiu fa388640ca
[GETUNAME] Update Romanian translation (#5323) 2023-06-10 20:03:23 +00:00
Andrei Miloiu 0887c1c040
[GETUNAME] Update Romanian translation (#5323) 2023-06-10 21:47:35 +02:00
Jose Carlos Jesus ed22908780
[MSPAINT] Update Portuguese (pt-PT) translation (#5319) 2023-06-10 16:21:54 +00:00
Milan Raymakers 4782c314d4 [TRANSLATION] Improve Dutch (nl-NL) translation (#4765)
- [NOTEPAD] Improve Dutch (nl-NL) translation
- [TASKMGR] Improve Dutch (nl-NL) translation
- [WELCOME] Improve Dutch (nl-NL) translation
- [EXPLORER] Improve Dutch (nl-NL) translation

Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
2023-06-10 18:32:03 +03:00
Eric Kohl c3db5e9c8e [ADVAPI32][SECLOGON] CreateProcessWithLogonW: Pass the environment to the callee 2023-06-10 14:10:14 +02:00
George Bișoc 59e74584ac
[NTOS:SE] Refactor SeTokenCanImpersonate
- Refactor most of the code, since there's quite some stuff that don't make much sense.
For instance ImpersonationLevel is basically the requested impersonation level a
server asks for. PsImpersonateClient doesn't explicitly say that SecurityAnonymous
and SecurityIdentification are not allowed. If the server was to give such levels
it simply means it doesn't want to impersonate the client.

Another thing that doesn't make much sense is that we check if the client is
associated with an anonymous token, then avoid impersonating regular anonymous
tokens that weren't created by the system. Only system can create such tokens
and an anonymous token basically means a token with hidden security info.

- Check that the server is within the same client logon session.

- If the server is granted the SeImpersonatePrivilege privilege, allow impersonation
regardless of the conditions we want to check for.

- Update the documentation and code comments.
2023-06-09 11:53:56 +02:00
George Bișoc 8e2fe925f2
[NTOS:PS] Do not reference the copied token twice and properly assign the impersonation level in case the server can't impersonate
As it currently stands the PsImpersonateClient routine does the following approach.
If impersonation couldn't be granted to a client the routine will make a copy
of the client's access token. As it makes a copy of the said token PsImpersonateClient
will reference the copied token after impersonation info have been filled out.
In the same code path we are assigning the desired level for impersonation to thread
impersonation info.

This is wrong for two reasons:

- On a copy situation the SeCopyClientToken routine holds a reference as the object
has been created. Referencing it at the bottom of the PsImpersonateClient routine
will make it that the token is referenced twice and whenever a server stops
impersonation the token still has an extra reference count which keeps the token
still alive in object database and memory space.

- If client impersonation is not possible the thread impersonation info should
have been assigned SecurityIdentification level to further indicate that the
actual impersonation of the thread is not currently in force but instead we
are assigning the impersonation level that is supplied by the caller. For instance
if the requested level is SecurityDelegation but impersonation is not possible
the level will be assigned that of SecurityDelegation yet the token has an
impersonation level of SecurityIdentification. This could lead to erratic behaviors
as well as potential impersonation escalation.

Fix the aforementioned issues by avoiding a double reference and properly assign
the impersonation level to SecurityIdentification if the server is not able to
impersonate the target client.
2023-06-09 11:53:55 +02:00
George Bișoc f483e42f89
[NTOS:SE] Grant the SYSTEM process the missing privileges
- Add the missing privileges to the SYSTEM privileges which might be needed,
notably SeUndockPrivilege, SeManageVolumePrivilege, SeCreateGlobalPrivilege and
SeImpersonatePrivilege.

Specifically SeImpersonatePrivilege is important here because with it we
allow system components of the core OS to perform certain system tasks.

- Declare the Groups array with a maximum of 3 elements in SepCreateSystemProcessToken
and 1 element in SepCreateSystemAnonymousLogonToken respectively, because previously
this array was oversized with most of free space left as a waste.

- Avoid hardcoding the size value of the Privilege array, instead initialize it
by hand and compute the exact number of elements with RTL_NUMBER_OF.
2023-06-09 11:53:51 +02:00
George Bișoc d8bfe2a261
[GITHUB] Draft PRs should be exempt from closure by the stale PR bot 2023-06-09 11:43:04 +02:00
George Bișoc 56a450147c
[GITHUB] Temporarily disable MSBuild
Due to a update of MSBuild build worker, MSBuild keeps failing which is a nuisance.
Temporarily disable that worker until a proper fix is shipped.

CORE-18911
2023-06-06 20:06:01 +02:00
Hermès Bélusca-Maïto 8061a6f6f4
[FREELDR] Cleanup some FldrCreateComponentKey() calls and archwsup.c 2023-06-05 22:39:47 +02:00
Hermès Bélusca-Maïto 0b695a6f70
[NTOS:IO] iorsrce.c: Add DBG traces for bus/device enumeration functions. 2023-06-04 21:40:08 +02:00
Hermès Bélusca-Maïto 2674e26cbb
[NTOS:IO] Reformat iorsrce.c, no functional code changes.
- Fix whitespace; add SAL annotations, doxygen documentation...

- Deduplicate the array of description strings corresponding to
  IO_QUERY_DEVICE_DATA_FORMAT.

- Unhardcode the "[3]" into 'IoQueryDeviceMaxData': the maximum number
  of device data queried.
2023-06-04 21:40:07 +02:00
Hermès Bélusca-Maïto 509359b3ec
[DDK] Add some documentation about the VIDEO_HARDWARE_CONFIGURATION_DATA structure. 2023-06-04 21:40:06 +02:00
Hermès Bélusca-Maïto 2e305b251b
[DDK] Correct PERF_CONFIGURATION_DATA definition. 2023-06-04 21:40:05 +02:00
Hermès Bélusca-Maïto 8d242c6229
[SDK] Add CONFIGURATION_TYPE definition back in arc.h
The definition is also in xdk/iotypes.h and ntddk.h around _ARC_DDK_
for compatibility, but arc.h should also be self-contained regarding
ARC definitions.
2023-06-04 21:40:04 +02:00
Hermès Bélusca-Maïto 789a296c43
[SDK:XBOX] Add missing 'VOID' in empty function prototypes. 2023-06-04 21:40:03 +02:00
Hermès Bélusca-Maïto 6db0d24fb6
Fix typo "managment" -> "management" in our codebase...
... except for 3rd-party code or "official" names.
2023-06-04 21:39:56 +02:00
Katayama Hirofumi MZ 13b1eadebb
[KERNEL32] LCMapString: Convert Chinese characters (#5316)
* [KERNEL32] LCMAP_SIMPLIFIED_CHINESE and LCMAP_TRADITIONAL_CHINESE

* fix

* improve

* reduce data

* improve
2023-06-04 21:46:01 +09:00
George Bișoc 51279c3e44
[NTOS:SE] Refactor NtOpenThreadTokenEx
- Wrap most of the code into a new private routine, SepOpenThreadToken.
And properly fail gracefully if we fail to open a thread's token instead of just keeping going.

- Do not use the same thread object that we have referenced in NtOpenThreadTokenEx
to do a copy of the access token in case we can't open it directly.
Instead we must reference a new object with full access, solely used for
the purpose to do our required operations.

- Add debug prints

CORE-18986
2023-06-04 11:09:34 +02:00
George Bișoc a389f8aa0c
[NTOS:SE] Make an access token effective after the end of token duplication
Removing any disabled privileges or groups in the middle of token dynamic
part allocation can pose problems. During the operation of making an access
token as effective, we are toying with the privileges and groups arrays
of the token.

After that we are allocating the dynamic part and set EndMem (the end tail
of the memory part) to that dynamic part, previously it was set to the
variable part. As a matter of fact we are making the token effective in
the middle where EndMem still points to VariablePart, thus DynamicPart
will end up with memory pool blocks butchered in the pool list.

Another problem, albeit not related to the DynamicPart corruption, is that
the code starts iterating over the UserAndGroups array from 0, which is
the actual user. One cannot simply remove the user from the array, so we
have to start looping right from the groups.

Move the token effective code part at the end of the SepDuplicateToken
function, which fixes the random pool corruptions caused by the butchered
DynamicPart.

CORE-18986
2023-06-04 11:09:22 +02:00
Katayama Hirofumi MZ d708c7947b
[MSPAINT] Use better units for image resolution (#5301)
Our paint program used the pixels per meter (PPM)
unit but this unit is hardly used in the world.
Let's use DPI (dots per inch) and/or pixels per
centimeter (PPCM). CORE-18867
2023-06-04 11:24:00 +09:00
Timo Kreuzer b29b2682bf
[UMPNPMGR] Fix uninitialized variable (#5310)
The unhiding and guilty revision that was identified by @stasm by bisecting the
bootability of LiveCD was 0.4.15-dev-6050-g13e6cbc
As that was the symptom: "We could not longer boot livecd". CORE-18986
2023-06-01 19:44:05 +09:00
Katayama Hirofumi MZ 36cdd34814 [MSPAINT] Use black and R2_NOTXORPEN instead of white and R2_XORPEN
Workaround. CORE-18867, CORE-18921
2023-05-31 17:00:05 +09:00
Katayama Hirofumi MZ bddd8b058c [MSPAINT] Minor adjustment on drawing text on TOOL_TEXT
CORE-18867
2023-05-31 13:31:50 +09:00
Katayama Hirofumi MZ aeffa57ec7 [MSPAINT] Fix textbox background by using WM_CTLCOLOREDIT
CORE-18867
2023-05-31 13:21:01 +09:00
Eric Kohl 2626c724e9 [UMPNPMGR] Replace some magic values 2023-05-29 11:58:09 +02:00
Eric Kohl 024daea0af [UMPNPMGR] Check ulFlags in PNP_GetGlobalState
Return CR_INVALID_FLAG if ulFlags is not zero.
2023-05-29 09:54:31 +02:00
Eric Kohl 13e6cbcafa [UMPNPMGR] Check for interactive caller in PNP_ReportLogOn
Do not run device install when a non-interactive user logs on.
2023-05-29 09:38:31 +02:00
Eric Kohl e54b32b434 [RPCRT4] Set binding handle for server functions
This enables us to impersonate server functions using RpcImpersonateClient.
2023-05-28 21:04:01 +02:00
Timo Kreuzer 8f9ef68ea7
[WIN32K][WIN32U] Fix system call ids (#5287)
- Delete the win32ksvc-ros.h file, which was not used
- Use a separate file for x64 (based on 2k3 x64 free)
- Delete w32ksvc.db. It's unused since ages.
2023-05-28 16:19:50 +03:00
Stanislav Motylkov b29e82d0e0 [APPWIZ] Use new Appwiz-mode to start RAPPS with "Installed" section open
CORE-18981
2023-05-27 15:38:35 +03:00
Stanislav Motylkov acbb73a89d [RAPPS] Open "Installed" section in Appwiz-mode when RAPPS already runs
CORE-18981
2023-05-27 15:38:01 +03:00
Stanislav Motylkov ff1fa4f38a [RAPPS] Add /APPWIZ command-line key to open "Installed" section
Addendum to ab7ddc44. CORE-18981
2023-05-27 15:36:53 +03:00
Stanislav Motylkov d6fecc52d1 [RAPPS] Move CMainWindow creation to upper function 2023-05-27 15:31:03 +03:00
Stanislav Motylkov 85ca8afb60
[NTOS:PNP] IopEnumerateDetectedDevices(): General refactoring
CORE-18962

- Deduplicate a while-loop by adding one more recursive call.
- Add IopMapDetectedDeviceId() helper function with a structure
  in order to reduce hardcoded constants and checks.
2023-05-27 12:22:57 +02:00
Nikita Piatygorskiy 2eb67000a5
[DXDIAG] Fix inconsistent WS_DISABLED style (#5303)
Make resource files consistent among different languages.

CORE-18903

Add the WS_DISABLED flag for IDC_BUTTON_HELP and IDC_BUTTON_SAVE_INFO,
in those places where it was not done. The actions corresponding to those
buttons are currently unimplemented, this is why they were disabled.

Signed-off-by: Nikita Piatygorskiy <generalhammond16@gmail.com>
2023-05-26 18:47:06 +02:00
Timo Kreuzer 2b8c1b0dac [WIN32K] Fix WindowExtra for some server-side classes
These values are based on apitest results.
2023-05-25 18:56:02 +03:00
Timo Kreuzer 05cd3406e7 [USER32] Fix SetWindowWord/Long
These must use the corresponding NtUserSetWindowWord/Long function and cannot use NtUserSetWindowLongPtr, otherwise the function can fail, when there is only space for a LONG, but not for a LONG_PTR at the specified offset.
2023-05-25 18:56:02 +03:00
Katayama Hirofumi MZ 0fa4edebd9
[SHELL32] Revert CDefView::FillFileMenu (#5278)
CORE-9467, CORE-18429, CORE-11797
2023-05-23 17:38:12 +09:00
Stanislav Motylkov 634415cace [RAPPS] Update Russian (ru-RU) translation 2023-05-21 23:24:05 +03:00
Hermès Bélusca-Maïto 44e1d87596
[USER32] RegisterClassExWOWW/ExA: NULL or IS_ATOM class are treated the same. (#5291)
CORE-18978

Fixes NULL pointer access when e.g. class.lpszClassName == NULL and
the class is registered. The RegisterClass(ExA/W/...) should return 0
instead of throwing an invalid access exception.

However, providing an invalid pointer will trigger a crash.
2023-05-21 19:35:19 +02:00