Commit graph

81066 commits

Author SHA1 Message Date
Marat Nagayev 073607c237
[NET] Improve displaying status message (#4096)
- Simplify conditions
- Add application error translation function

[NET][MC] Add missing Russian (ru-RU) translation
2022-01-13 18:10:55 +03:00
Stanislav Motylkov cde6339155
[SAMSRV] Return correct status for existing groups and users
[NETAPI32] NetpNtStatusToApiStatus: Update accordingly

This fixes net command output in PR #4096.
2022-01-13 16:38:04 +03:00
Katayama Hirofumi MZ 2ea30b2ed3 [USERSRV][TRANSLATION] Improve Japanese (ja-JP.rc) 2022-01-13 14:09:03 +09:00
Katayama Hirofumi MZ 1a5005679c [POWERCFG][TRANSLATION] Improve Japanese (ja-JP.rc) 2022-01-13 11:44:02 +09:00
Katayama Hirofumi MZ dafac2131b [WINLOGON][TRANSLATION] Improve Japanese translation (ja-JP.rc) 2022-01-13 11:40:05 +09:00
Katayama Hirofumi MZ 48827cf6c5 [NTUSER] Follow-up of #4277 (ea1353e)
According to ThFabba, NtUserSetThreadLayoutHandles returns zero.
CORE-11700
2022-01-13 10:41:03 +09:00
Katayama Hirofumi MZ ea1353e4be
[NTUSER] Implement NtUserSetThreadLayoutHandles (#4277)
- Modify NtUserSetThreadLayoutHandles prototype.
- Implement NtUserSetThreadLayoutHandles function.
CORE-11700
2022-01-12 14:48:20 +09:00
Katayama Hirofumi MZ 28959a2dfd [NTUSER] Follow-up of #4271 (36740ca)
- Delete the excessive comments.
- Delete the debugging leftover.
CORE-11700
2022-01-12 14:08:10 +09:00
Katayama Hirofumi MZ 1f44693657
[NTUSER] Implement NtUserSetImeInfoEx (#4276)
- Modify NtUserSetImeInfoEx prototype.
- Add UserSetImeInfoEx helper function.
- Implement NtUserSetImeInfoEx function.
CORE-11700
2022-01-12 12:07:31 +09:00
Katayama Hirofumi MZ 36740ca981
[NTUSER][IMM32] Implement NtUserGetImeInfoEx (#4271)
- Add UserGetImeInfoEx helper function.
- Implement NtUserGetImeInfoEx function by using UserGetImeInfoEx.
- Fix imm32.ImmGetImeInfoEx.
- Modify enum IMEINFOEXCLASS.
CORE-11700
2022-01-12 12:06:24 +09:00
Doug Lyons a47590c9cf
[USER32] Improve icon extraction to handle RIFF formats and Fix crash (#4262)
- Add handling for 'RIFF' formats (for animated cursors). This makes explorer able to display animated cursors.
- Fix crash in extracting icons/cursors.
CORE-16287
2022-01-12 08:03:44 +09:00
Hervé Poussineau 236ddd4f50 [DESK] Update available settings when selecting another display 2022-01-11 23:47:55 +01:00
Hervé Poussineau 6caf7124b5 [DESK] Factorize changing device description to OnDisplayDeviceChanged() 2022-01-11 23:47:55 +01:00
Hermès Bélusca-Maïto 1df87d7fe9
[SHELL32:WINE][PSDK] Addendum to 0bf768a1: Add missing FARPROC16 definition for CallCPLEntry16() prototype. 2022-01-11 23:31:26 +01:00
Hermès Bélusca-Maïto 0bf768a145
[SHELL32:WINE][PSDK] Fix the prototype of CallCPLEntry16(). 2022-01-11 23:03:25 +01:00
Hermès Bélusca-Maïto afb04208f7
[KERNEL32] Add missing NTOS_MODE_USER when including the NDK. 2022-01-11 22:45:15 +01:00
Hermès Bélusca-Maïto c1a8dce23c
[CPORTLIB] Remove any usage of debug.h since this lib implements the support for said debugging output. 2022-01-11 22:45:14 +01:00
Serge Gautherie 9a523c8135 [CRT/arm64] Fix handling of intrinsics
Fix msvc14.1-arm64-Release build.

Follow-up to db41787 (0.4.15-dev-2914).
CORE-17518
2022-01-11 20:52:48 +03:00
Serge Gautherie 724774505e [CRT/arm64] Build wine/except_arm64.c
Follow-up to 9efafd6 (0.4.14-dev-934).
CORE-17518
2022-01-11 20:52:34 +03:00
Serge Gautherie c3e0df0611 [BCRYPT] Add ECDSA P384 to known algorithms
Add missing structs and handler in BCryptOpenAlgorithmProvider().

Cherry-pick a part of Michael Müller's
76b6c360fa

Follow-up to e0a47b7 (0.4.15-dev-3603).
CORE-14198
2022-01-11 20:52:02 +03:00
George Bișoc be56aff102
[NTOS:PS] Use quota types on process quota querying
Quota limits on a block are enumerated on a per quota type basis thus we should use the values from PS_QUOTA_TYPE enumeration, not from POOL_TYPE.
2022-01-11 11:21:15 +01:00
George Bișoc 4e25c35375
[KMTESTS:PS] Write some tests for process quota management 2022-01-11 10:11:10 +01:00
George Bișoc 0c07eac5b4
[NTOS:OB] Charge/Return pool quotas of objects
As it currently stands the Object Manager doesn't charge any quotas when objects are created, nor it returns quotas when objects are de-allocated and freed from the objects namespace database. This alone can bring inconsistencies in the kernel as we simply don't know what is the amount charged in an object and thus we aren't keeping track of quotas flow.

Now with both PsReturnSharedPoolQuota and PsChargeSharedPoolQuota implemented, the Object Manager can now track the said flow of quotas every time an object is created or de-allocated, thus enforcing consistency with the use of quota resources.
2022-01-11 10:11:10 +01:00
George Bișoc ee697cfeef
[NTOS:PS] Dereference the quota block during process cleanup
Ensure that when we're cleaning up the EPROCESS object, that we are dereferencing the quota block the process in question was using. The routine will automatically request a quota block cleanup if the process that dereferenced the quota block was the last.
2022-01-11 10:11:10 +01:00
George Bișoc b22eefac88
[NTOS:PS] Process Quota Overhaul
-- Rewrite PspChargeProcessQuotaSpecifiedPool and PspReturnProcessQuotaSpecifiedPool private kernel routines, with the goal to implement the algorithms necessary to manage the fields of quota blocks (Usage, Return, Limit and Peak).
-- Invoke the Mm if quota limit raising or returning has to be done
-- When destroying a quota block, make sure that we're giving back all the rest of non-returned quotas to Memory Mm
-- Crash the system with QUOTA_UNDERFLOW if someone is returning way too much quota than it was previously charged
-- When a process exits, ensure that it doesn't hold up any charged quotas in QuotaUsage field of the process object, that way we're enforcing proper kernel consistency
-- Implement PsChargeSharedPoolQuota and PsChargeProcessPageFileQuota functions, used exclusively by the Object Manager. These routines are used to charge or return amount of quotas of a newly created object.
-- On PspInheritQuota, when assigning to process the default quota block if no parent process is given, we must increment the reference counts as we're using it
-- Handle the ProcessCount reference field, as it wasn't used
-- Annotate the functions with SAL
-- Document the code

=== REMARKS ===
Windows LogOn (Winlogon) is responsible for setting up a different quota block for all the processes within an interactive session, which is what we don't do. What we're currently doing instead is we're using the default block, PspDefaultQuotaBlock, for all the processes
across the system. The default block contains the default limits of -1 (which would imply no limits). By definition, the kernel won't ever return STATUS_QUOTA_EXCEEDED as we literally don't set up a definite limit for regular processes. This situation has to be tackled
in the future.

=== TODO FOR FUTURE ===
Most of the code in PspChargeProcessQuotaSpecifiedPool and PspReturnProcessQuotaSpecifiedPool private routines must be refactored in order to reduce the usage of the quota spin lock, possibly wrapping such code in a loop and whatnot.

CORE-17784
2022-01-11 10:11:09 +01:00
George Bișoc 1649a89cfa
[NTOS:MM] Implement Raise/Return pool quota functions
This implements both MmRaisePoolQuota and MmReturnPoolQuota functions, which serve exclusively for quota pool management. The process manager communicates with the memory manager in a call of need to charge or return pool quota limits.
2022-01-11 10:11:09 +01:00
George Bișoc 32e9710fd1
[NTOS:OB] Add a system process quota block macro
OBP_SYSTEM_PROCESS_QUOTA is a macro that'll be used as a way to assign a dummy quota block to system processes, as we mustn't do anything to those in case the Object Manager is charging or returning pool quotas.
2022-01-11 10:11:09 +01:00
George Bișoc c9755651cd
[NTOS:PS] Declare some prototypes and annotate the quota functions with SAL
Declare PsReturnSharedPoolQuota and PsChargeSharedPoolQuota prototypes and annotate the functions. Furthermore, add two definitions related to quota pool limits threshold -- PSP_NON_PAGED_POOL_QUOTA_THRESHOLD and PSP_PAGED_POOL_QUOTA_THRESHOLD. For further details, see the commit description of "[NTOS:MM] Add the pool quota prototypes and some definitions".
2022-01-11 10:11:09 +01:00
George Bișoc 13cbc7fbf9
[NTOS:MM] Add the pool quota prototypes and some definitions
Declare the MmRaisePoolQuota and MmReturnPoolQuota prototypes in the header and add some definitions related to pool quotas, namely MmTotalNonPagedPoolQuota and MmTotalPagedPoolQuota. These variables are used internally by the kernel as sort of "containers" (for the lack of a better term)
which uphold the amount of quotas that the Process Manager is requesting the Memory Manager to raise or return the pool quota limit. In addition to that, add some definitions needed for both of these functions.

The definitions, MI_CHARGE_PAGED_POOL_QUOTA and MI_CHARGE_NON_PAGED_POOL_QUOTA respectively, bear some interesting aspect. Seemingly the 0x80000 and 0x10000 values (that would denote to 524288 and 65536 specifically) are used as quota "limits" or in other words, thresholds that the kernel
uses. So for example if one would want to raise the quota limit charge, MmRaisePoolQuota will raise it so based on this formula -- NewMaxQuota = CurrentQuota + LIMIT_VALUE. LIMIT_VALUE can be either MI_CHARGE_PAGED_POOL_QUOTA or MI_CHARGE_NON_PAGED_POOL_QUOTA, depending a per quota pool basis.

What's more interesting is that these values are pervasive in Process Manager even. This is when quotas are to be returned back and trim the limit of the quota block if needed, the kernel would either take the amount provided by the caller of quotas to return or the threshold (paged or not paged)
if the amount to return exceeds the said threshold in question.
2022-01-11 10:11:08 +01:00
George Bișoc abe89d7cde
[NTOS:FSRTL] Assign the buffer length to ThisBufferLength field
This fixes an issue where ReactOS would assert on QuotaUsage == 0 as the process was still taking up quotas during a quota block de-reference with root cause of ThisBufferLength member field being 0 which made process quota charging/returning flow unbalanced.
In addition to that, on FsRtlCancelNotify routine API all we must ensure that if PsChargePoolQuota or ExAllocatePoolWithTag function fails we have to handle the raised exceptions accordingly and return the charged quota back (if we actually charged quotas that is). With said, wrap that part of code with SEH.

=== DOCUMENTATION REMARKS ===
The cause of the assert is due to the fact ThisBufferLength was being handled wrongly ever since, until this commit. When FsRtl of the Executive has to filter reported changes (with logic algorithm implemented in FsRtlNotifyFilterReportChange function), the said function will charge the quota of a given process
with an amount that is represented as the buffer length whose size is expressed in bytes. This length buffer is preserved in a local variable called NumberOfBytes, which is initialized from BufferLength member field of notification structure or from the length from stack parameters pointed from an IRP.

As it currently stands, the code is implemented in such a way that FsRtlNotifyFilterReportChange will charge quotas to a process but it doesn't assign the buffer length to ThisBufferLength. On the first glimpse ThisBufferLength and BufferLength are very similar members that serve exact same purpose but in reality there's a subtle distinction between the two.

BufferLength is a member whose length size is given by FSDs (filesystem drivers) during a notification dispatching. Whenever FsRtl receives the notification structure packed with data from the filesystem, the length pointed by BufferLength gets passed to ThisBufferLength and from now on the kernel has to use this member for the whole time of its task to accomplish
whatever request it's been given by the filesystem. In other words, BufferLength is strictly used only to pass length size data to the kernel by initializing ThisBufferLength based on that length and unequivocally the kernel uses this member field. What we're doing is that ThisBufferLength never receives the length from BufferLength therefore whenever FsRtl component
has to return quotas back it'll return an amount of 0 (which means no amount to return) and that's a bug in the kernel.
2022-01-11 10:11:08 +01:00
George Bișoc 71a4921f8a
[NTOS:EX] Manage quotas when allocating or freeing pool tables
This fixes an assertion where QuotaUsage == 0 is actually not 0 when a process is about to be destroyed.
2022-01-11 10:11:08 +01:00
George Bișoc 47cb3c20a3
[NTOSKRNL] Implement InterlockedExchangeSizeT macro 2022-01-11 10:10:56 +01:00
Jesús Sanz del Rey 47f6745bcd
[SHELL32] Fix folders on recycle bin and adjust the column size (#4234)
CORE-11000

- Now, folders can be sent to recycle bin (fixed a bug inside the implementation).
- Adjust column size of the RecycleBin virtual folder in details mode.
2022-01-11 00:40:25 +01:00
Jesús Sanz del Rey dae6035b3b
[SHELL32] Fix recycle bin handle reference leaking (#4222)
CORE-13730

There was a handle reference leak in the recycler bin and the bin wasn't removing the copied file after restoring it.
Close the handle were the memory leak was and move the file when restoring it.
2022-01-11 00:20:23 +01:00
Katayama Hirofumi MZ 3456538e3a
[MSPAINT] Some minor improvements (#4264)
- Fix Japanese IDS_MINIATURETITLE resource string.
- Fix Japanese IDM_VIEWSHOWMINIATURE menu item text.
- Fix DWORD as COLORREF.
- Improve some OnPaint's.
CORE-17969
2022-01-10 21:44:13 +09:00
Katayama Hirofumi MZ edf92c004d
[MSPAINT] Don't hide selection on zooming (#4266)
- Don't hide the selection window on zooming.
- Move the selection window by calling placeSelWin() when zoomed.
CORE-17969
2022-01-10 21:41:00 +09:00
Vadim Galyant fec440d8b8
[SDK:DDK][NTOS:PNP] Implement PnP arbiters initialization 2022-01-10 06:35:45 +03:00
Katayama Hirofumi MZ b2f8d62cd1
[MSPAINT] Prepare for debugging (#4257)
- Add #include <debug.h> and add link to ntdll.dll for debugging.
- Add CopyDIBImage helper function.
CORE-17969
2022-01-10 08:50:37 +09:00
Hermès Bélusca-Maïto 48d1a7bf4d
[SHELL32] Use the already existing g_pszShell32 instead of re-defining a new variable holding the very same string. 2022-01-09 22:44:21 +01:00
Hermès Bélusca-Maïto 83be315abf
[SHELL32] Use wide char string literals.
Import parts of Wine commit b215536852dc5a132108db92c90a41c70b738e50
shell32: Use wide char string literals.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-09 22:39:29 +01:00
Hermès Bélusca-Maïto 59b3545603
[SHELL32] recyclebin.h: Correctly balance the INTERFACE defines/undefs. 2022-01-09 19:02:41 +01:00
Arnav Bhatt 8df70629b6
[SYSDM] Fix the "fancy" edit Environment dialog box (#4258)
Fix the issue of the changes of the environment values not being set sometimes through fancy dialog box:
Make sure the environment value buffer is always reallocated before taking the values.
2022-01-09 17:55:25 +01:00
Katayama Hirofumi MZ 17f34887f3
[MSPAINT] Add ICC_BAR_CLASSES (#4261)
The Fonts toolbar uses toolbar and tooltips. Thus this flag is needed. CORE-17949
2022-01-09 23:24:30 +09:00
Eric Kohl 3f053db3e7 [SYSSETUP] Improve the Process Page
- The page will support multiple tasks (WIP)
- The background thread uses messages to update the page
2022-01-09 14:29:17 +01:00
Serge Gautherie fdcefaa7cb [HDAUDBUS] HDA_PdoPnp(): Remove a redundant ASSERT()
Addendum to cf7fc81 (r68311).
2022-01-08 18:00:38 +03:00
Serge Gautherie cba4fd57d0 [KS] KsServiceBusEnumPnpRequest(): Remove a redundant ASSERT()
Addendum to c6b26fa (r50531).
2022-01-08 18:00:38 +03:00
Hervé Poussineau 2538583dbe [VIDEOPRT] Query children only when device has been opened
HwGetVideoChildDescriptor callback must be called only after HwInitialize.

CORE-17979
2022-01-06 22:02:07 +01:00
Hervé Poussineau 983d9a1c2a [VBEMP] Disable reporting multiple monitors
It has never worked, and only leads to some infinite loops with some hardware or BIOS configurations.
2022-01-06 20:16:12 +01:00
Hervé Poussineau f03750de6a [VBEMP] Rename to vgapnp.sys
- rename driver vbemp.sys to vgapnp.sys
- rename service VBE to vga
- store settings in non hardware-profile registry key
2022-01-06 20:16:12 +01:00
Hervé Poussineau 073a1ea34c [VGAMP] Rename to vga.sys
- rename driver vgamp.sys to vga.sys
- rename service Vga to VgaSave
- store settings in non hardware-profile registry key
2022-01-06 20:16:12 +01:00