Commit graph

83488 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 4f41000714
[FLOPPY] "zero" parameters in IoQueryDeviceDescription() call are NULL pointers. 2023-06-14 11:24:47 +02:00
Hermès Bélusca-Maïto 84b4a80beb
[NTOS:IO] Fix some bugs in the IoQueryDeviceDescription helpers (#5320)
- Add missing ExAllocatePool NULL checks.

- Fix order of KeBugCheckEx parameters for PNP_DETECTED_FATAL_ERROR.

- The Controller and Peripheral numbers are zero-based, so if the caller
  wants to inspect controller (or peripheral) zero, let it be so!
  The original code was treating controller number zero for enumerating
  controllers of a given class within the different buses, which is
  wrong. See the diff'ed trace below.
  Tested with Windows' videoprt.sys VideoPortGetDeviceData().

```diff
 IoQueryDeviceDescription()
     BusType:          0xB093C224 (0)
     BusNumber:        0xB093C228 (0)
     ControllerType:   0xF9D01030 (19)
     ControllerNumber: 0xF9D01038 (0)
     PeripheralType:   0x00000000 (4294967295)
     PeripheralNumber: 0x00000000 (4294967295)
     CalloutRoutine:   0xF9CF74E4
     Context:          0xF9D5A340
 --> Query: 0xF9D5A22C

 IopQueryBusDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM'
     RootKeyHandle: 0x00000598
     KeyIsRoot: TRUE
     Bus: 0xF9D5A290 (4294967295)
     Seen: 'CentralProcessor'
     Seen: 'FloatingPointProcessor'
     Seen: 'MultifunctionAdapter'
     SubRootRegName: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter'

 IopQueryBusDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter'
     RootKeyHandle: 0x00000590
     KeyIsRoot: FALSE
     Bus: 0xF9D5A290 (4294967295)
     Seen: '0'
     SubRootRegName: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'
     Getting bus value: 'Identifier'
     Getting bus value: 'Configuration Data'
     Getting bus value: 'Component Information'
     --> Getting device on Bus #0 : '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'

 IopQueryDeviceDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'
     RootKeyHandle: 0x00000590
     Bus: 0
-    Enumerating controllers in '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0\DisplayController'...
+    Getting controller #0
+    Retrieving controller '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0\DisplayController\0'
```
2023-06-14 11:20:56 +02:00
Katayama Hirofumi MZ 318b2e786d [MSPAINT] Trivial improvements
- Use SetPixelV instead of SetPixel.
- BI_RGB is zero.
- Use CS_HREDRAW and CS_VREDRAW.
CORE-18867
2023-06-14 17:42:21 +09:00
Katayama Hirofumi MZ 3b4422b41b [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush 3
CORE-18867
2023-06-14 17:14:41 +09:00
Katayama Hirofumi MZ 0334498068 [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush 2
CORE-18867
2023-06-14 17:03:22 +09:00
Katayama Hirofumi MZ 78c8df8393 [MSPAINT] drawing.cpp: Refactor Erase, Replace and Airbrush
CORE-18867
2023-06-14 16:44:54 +09:00
Katayama Hirofumi MZ 6d9b7f77ad [MSPAINT] mouse.cpp: Use override keywords
CORE-18867
2023-06-14 16:01:10 +09:00
Katayama Hirofumi MZ 2b623c1d04
[MSPAINT] Refactor ImageModel (#5335)
- Unify ImageModel::Insert and ImageModel::CopyPrevious to ImageModel::PushImageForUndo.
- Delete useless stuffs.
- Fix some memory leaks.
- Fix IDM_IMAGECROP.
CORE-17969, CORE-18867
2023-06-13 23:23:48 +09:00
Katayama Hirofumi MZ 70f897e4c9 [FONTVIEW] Add Japanese translation (ja-JP) 2023-06-13 22:04:44 +09:00
Stanislav Motylkov 8d8e81ee7a [FONTVIEW] Update Russian (ru-RU) translation
Addendum to 5ef3f347. CORE-18952
2023-06-13 14:40:46 +03:00
Nikita Piatygorskiy 5ef3f347ad
[FONTVIEW] Make hardcoded messages localizable (#5305)
- Move messages from OnInstall procedure to en-US resource file.
- Applied the same changes to all language files, now it's available
  for translation into other languages.

CORE-18952

Signed-off-by: Nikita Piatygorskiy <generalhammond16@gmail.com>
2023-06-13 14:12:26 +03:00
Stanislav Motylkov 2e836fb339 [FONTVIEW] Formatting only (for PR #5305) 2023-06-13 12:44:46 +03:00
Katayama Hirofumi MZ fa4c3bd560 [MSPAINT] s/HasUndoSteps/CanUndo/ and s/HasRedoSteps/CanRedo/
CORE-18867
2023-06-13 18:24:42 +09:00
Katayama Hirofumi MZ 1a88607387
[MSPAINT] Move selection by arrow keys (#5334)
Improve keyboard usability.
- Add CCanvasWindow::MoveSelection.
- Modify CMainWindow::OnKeyDown.
- If Esc key is pressed, then the selection will land to canvas.
- If any arrow key is pressed, then the selection will move a bit.
CORE-18867
2023-06-13 16:31:18 +09:00
Katayama Hirofumi MZ 0087ea6597 [MSPAINT] Set CC_RGBINIT to CMainWindow::ChooseColor
It had failed to set initial color. CORE-18867
2023-06-13 15:51:52 +09:00
Katayama Hirofumi MZ cb245ff711 [MSPAINT] Scrolled canvas has defects in dragging a selection
CORE-18990, CORE-18867
2023-06-13 14:57:59 +09:00
Katayama Hirofumi MZ 62b6859a67 [MSPAINT] Follow-up of #5332 (9ff9580)
Simplify the epilogue code of CCanvasWindow::OnSetCursor by using bHandle variable. CORE-18867
2023-06-13 14:18:12 +09:00
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