https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e38f4c2b360e40e918da9…
commit e38f4c2b360e40e918da94cf8fe7245fb9433746
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Wed Jun 21 17:52:47 2023 +0200
Commit: unknown <george.bisoc(a)reactos.org>
CommitDate: Tue Aug 22 17:54:17 2023 +0200
[NTOS:SE] Implement object type list utilities
This implements various private kernel routines for object type list management
needed for access check code infrastructure. In addition, update the code documentation
and add missing comments.
---
ntoskrnl/se/objtype.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 298 insertions(+), 23 deletions(-)
diff --git a/ntoskrnl/se/objtype.c b/ntoskrnl/se/objtype.c
index 24af8fff4f0..b459c2dc172 100644
--- a/ntoskrnl/se/objtype.c
+++ b/ntoskrnl/se/objtype.c
@@ -3,6 +3,7 @@
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Security object type list support routines
* COPYRIGHT: Copyright Timo Kreuzer <timo.kreuzer(a)reactos.org>
+ * Copyright 2023 George Bișoc <george.bisoc(a)reactos.org>
*/
/* INCLUDES *******************************************************************/
@@ -11,78 +12,351 @@
#define NDEBUG
#include <debug.h>
-/* PRIVATE FUNCTIONS ***********************************************************/
+/* PRIVATE FUNCTIONS **********************************************************/
/**
* @brief
- * Captures a list of object types.
+ * Validates a list of object types passed from user mode,
+ * ensuring the following conditions are met for a valid
+ * list:
+ *
+ * - The list must not be too big and it can be read
+ * - Each object must have a valid level
+ * - The level hierarchy between objects has to be consistent
+ * (e.g. a root cannot have a level 2 subordinate object)
+ * - The list must have only one root and it must be in the
+ * first position
+ * - Each object type GUID can be read and captured
*
* @param[in] ObjectTypeList
- * An existing list of object types.
+ * A pointer to an object type list of which the elements
+ * are being validated.
*
* @param[in] ObjectTypeListLength
- * The length size of the list.
+ * The length of the list, representing the number of object
+ * elements in that list.
+ *
+ * @return
+ * Returns STATUS_SUCCESS if the list has been validated and it
+ * contains valid objects. STATUS_INVALID_PARAMETER is returned
+ * if the list is not valid. Otherwise a NTSTATUS code is returned.
+ */
+static
+NTSTATUS
+SepValidateObjectTypeList(
+ _In_reads_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
+ _In_ ULONG ObjectTypeListLength)
+{
+ PGUID ObjectTypeGuid;
+ ULONG ObjectTypeIndex;
+ USHORT Level, PrevLevel;
+ SIZE_T Size;
+
+ /* Ensure we do not hit an integer overflow */
+ Size = ObjectTypeListLength * sizeof(OBJECT_TYPE_LIST);
+ if (Size == 0)
+ {
+ DPRINT1("The object type list is too big, integer overflow alert!\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ _SEH2_TRY
+ {
+ /* Ensure we can actually read from that list */
+ ProbeForRead(ObjectTypeList, Size, sizeof(ULONG));
+
+ /* Begin looping for each object from the list */
+ for (ObjectTypeIndex = 0;
+ ObjectTypeIndex < ObjectTypeListLength;
+ ObjectTypeIndex++)
+ {
+ /* Get the level of this object and check for validity */
+ Level = ObjectTypeList[ObjectTypeIndex].Level;
+ if (Level > ACCESS_MAX_LEVEL)
+ {
+ DPRINT1("Invalid object level found (level %u, at index %lu)\n", Level, ObjectTypeIndex);
+ _SEH2_YIELD(return STATUS_INVALID_PARAMETER);
+ }
+
+ /* Are we past the first position in the list? */
+ if (ObjectTypeIndex != 0)
+ {
+ /* Ensure that we do not have two object roots */
+ if (Level == ACCESS_OBJECT_GUID)
+ {
+ DPRINT1("This list has two roots (at index %lu)\n", ObjectTypeIndex);
+ _SEH2_YIELD(return STATUS_INVALID_PARAMETER);
+ }
+
+ /*
+ * Ensure the current level is consistent with the prior level.
+ * That means, if the previous object is the root (denoted by the
+ * level as ACCESS_OBJECT_GUID aka 0) the current object must
+ * be a child of the parent which is the root (also called a
+ * property set). Whereas a property is a sibling of the
+ * child, the property set.
+ */
+ if (Level > PrevLevel + 1)
+ {
+ DPRINT1("The object levels are not consistent (current level %u, previous level %u, at index %lu)\n",
+ Level, PrevLevel, ObjectTypeIndex);
+ _SEH2_YIELD(return STATUS_INVALID_PARAMETER);
+ }
+ }
+ else
+ {
+ /* This is the first position so the object must be the root */
+ if (Level != ACCESS_OBJECT_GUID)
+ {
+ DPRINT1("The object is not the root at first index!\n");
+ _SEH2_YIELD(return STATUS_INVALID_PARAMETER);
+ }
+ }
+
+ /* Get the object type and check that we can read from it */
+ ObjectTypeGuid = ObjectTypeList[ObjectTypeIndex].ObjectType;
+ ProbeForRead(ObjectTypeGuid, sizeof(GUID), sizeof(ULONG));
+
+ /*
+ * Cache the level, we need it to ensure the levels between
+ * the previous and the next object are consistent with each other.
+ */
+ PrevLevel = Level;
+ }
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
+ }
+ _SEH2_END;
+
+ return STATUS_SUCCESS;
+}
+
+/**
+ * @brief
+ * Compares two object type GUIDs for equality.
+ *
+ * @param[in] Guid1
+ * A pointer to the first object type GUID.
+ *
+ * @param[in] Guid2
+ * A pointer to the second object type GUID.
+ *
+ * @return
+ * Returns TRUE if both GUIDs are equal, FALSE otherwise.
+ */
+static
+BOOLEAN
+SepIsEqualObjectTypeGuid(
+ _In_ CONST GUID *Guid1,
+ _In_ CONST GUID *Guid2)
+{
+ return RtlCompareMemory(Guid1, Guid2, sizeof(GUID)) == sizeof(GUID);
+}
+
+/* PUBLIC FUNCTIONS ************************************************************/
+
+/**
+ * @brief
+ * Captures an object type GUID from an object
+ * access control entry (ACE).
+ *
+ * @param[in] Ace
+ * A pointer to an access control entry, of which
+ * the object type GUID is to be captured from.
+ *
+ * @param[in] IsAceDenied
+ * If set to TRUE, the function will capture the
+ * GUID from a denied object ACE, otherwise from
+ * the allowed object ACE.
+ *
+ * @return
+ * Returns a pointer to an object type GUID, otherwise
+ * NULL is returned if the target ACE does not have
+ * an object type GUID.
+ */
+PGUID
+SepGetObjectTypeGuidFromAce(
+ _In_ PACE Ace,
+ _In_ BOOLEAN IsAceDenied)
+{
+ PGUID ObjectTypeGuid = NULL;
+
+ PAGED_CODE();
+
+ /* This Ace must not be NULL */
+ ASSERT(Ace);
+
+ /* Grab the GUID based on the object type ACE header */
+ ObjectTypeGuid = IsAceDenied ? (PGUID)&((PACCESS_DENIED_OBJECT_ACE)Ace)->ObjectType :
+ (PGUID)&((PACCESS_ALLOWED_OBJECT_ACE)Ace)->ObjectType;
+ return ObjectTypeGuid;
+}
+
+/**
+ * @brief
+ * Searches for an object type GUID if it exists
+ * on an object type list.
+ *
+ * @param[in] ObjectTypeList
+ * A pointer to an object type list.
+ *
+ * @param[in] ObjectTypeListLength
+ * The length of the list, representing the number
+ * of object elements in that list.
+ *
+ * @param[in] ObjectTypeGuid
+ * A pointer to an object type GUID to search in the
+ * list of interest.
+ *
+ * @param[out] ObjectIndex
+ * If the function found the target GUID, the function
+ * returns a pointer to the object index location to
+ * this parameter.
+ *
+ * @return
+ * Returns TRUE if the object type GUID of interest exists
+ * in the target list, FALSE otherwise.
+ */
+BOOLEAN
+SepObjectTypeGuidInList(
+ _In_reads_(ObjectTypeListLength) POBJECT_TYPE_LIST_INTERNAL ObjectTypeList,
+ _In_ ULONG ObjectTypeListLength,
+ _In_ PGUID ObjectTypeGuid,
+ _Out_ PULONG ObjectIndex)
+{
+ ULONG ObjectTypeIndex;
+ GUID ObjectTypeGuidToSearch;
+
+ PAGED_CODE();
+
+ /* Loop over the object elements */
+ for (ObjectTypeIndex = 0;
+ ObjectTypeIndex < ObjectTypeListLength;
+ ObjectTypeIndex++)
+ {
+ /* Is this the object we are searching for? */
+ ObjectTypeGuidToSearch = ObjectTypeList[ObjectTypeIndex].ObjectTypeGuid;
+ if (SepIsEqualObjectTypeGuid(ObjectTypeGuid, &ObjectTypeGuidToSearch))
+ {
+ /* Return the indext of that object to caller */
+ *ObjectIndex = ObjectTypeIndex;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/**
+ * @brief
+ * Captures a list of object types and converts it to
+ * an internal form for use by the kernel. The list
+ * is validated before its data is copied.
+ *
+ * @param[in] ObjectTypeList
+ * A pointer to a list of object types passed from
+ * UM to be captured.
+ *
+ * @param[in] ObjectTypeListLength
+ * The length size of the list. This length represents
+ * the number of object elements in that list.
*
* @param[in] PreviousMode
- * Processor access level mode.
+ * Processor access level mode. This has to be set to
+ * UserMode as object type access check is not supported
+ * in the kernel.
*
* @param[out] CapturedObjectTypeList
- * The captured list of object types.
+ * A pointer to a returned captured list of object types.
*
* @return
* Returns STATUS_SUCCESS if the list of object types has been captured
* successfully. STATUS_INVALID_PARAMETER is returned if the caller hasn't
- * supplied a buffer list of object types. STATUS_INSUFFICIENT_RESOURCES
- * is returned if pool memory allocation for the captured list has failed.
+ * supplied a buffer list of object types or the list is invalid.
+ * STATUS_INSUFFICIENT_RESOURCES is returned if pool memory allocation
+ * for the captured list has failed.
*/
NTSTATUS
SeCaptureObjectTypeList(
_In_reads_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
_In_ ULONG ObjectTypeListLength,
_In_ KPROCESSOR_MODE PreviousMode,
- _Out_ POBJECT_TYPE_LIST *CapturedObjectTypeList)
+ _Out_ POBJECT_TYPE_LIST_INTERNAL *CapturedObjectTypeList)
{
+ NTSTATUS Status;
+ ULONG ObjectTypeIndex;
SIZE_T Size;
+ PGUID ObjectTypeGuid;
+ POBJECT_TYPE_LIST_INTERNAL InternalTypeList;
+
+ PAGED_CODE();
+ /* We do not support that in the kernel */
if (PreviousMode == KernelMode)
{
return STATUS_NOT_IMPLEMENTED;
}
+ /* No count elements of objects means no captured list for you */
if (ObjectTypeListLength == 0)
{
*CapturedObjectTypeList = NULL;
return STATUS_SUCCESS;
}
+ /* Check if the caller supplied a list since we have the count of elements */
if (ObjectTypeList == NULL)
{
+ DPRINT1("The caller did not provide a list of object types!\n");
return STATUS_INVALID_PARAMETER;
}
- /* Calculate the list size and check for integer overflow */
- Size = ObjectTypeListLength * sizeof(OBJECT_TYPE_LIST);
- if (Size == 0)
+ /* Validate that list before we copy contents from it */
+ Status = SepValidateObjectTypeList(ObjectTypeList, ObjectTypeListLength);
+ if (!NT_SUCCESS(Status))
{
- return STATUS_INVALID_PARAMETER;
+ DPRINT1("SepValidateObjectTypeList failed (Status 0x%08lx)\n", Status);
+ return Status;
}
/* Allocate a new list */
- *CapturedObjectTypeList = ExAllocatePoolWithTag(PagedPool, Size, TAG_SEPA);
- if (*CapturedObjectTypeList == NULL)
+ Size = ObjectTypeListLength * sizeof(OBJECT_TYPE_LIST_INTERNAL);
+ InternalTypeList = ExAllocatePoolWithTag(PagedPool, Size, TAG_SEPA);
+ if (InternalTypeList == NULL)
{
+ DPRINT1("Failed to allocate pool memory for the object type list!\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
_SEH2_TRY
{
- ProbeForRead(ObjectTypeList, Size, sizeof(ULONG));
- RtlCopyMemory(*CapturedObjectTypeList, ObjectTypeList, Size);
+ /* Loop for every object element, data was already probed */
+ for (ObjectTypeIndex = 0;
+ ObjectTypeIndex < ObjectTypeListLength;
+ ObjectTypeIndex++)
+ {
+ /* Copy the object type GUID */
+ ObjectTypeGuid = ObjectTypeList[ObjectTypeIndex].ObjectType;
+ InternalTypeList[ObjectTypeIndex].ObjectTypeGuid = *ObjectTypeGuid;
+
+ /* Copy the object hierarchy level */
+ InternalTypeList[ObjectTypeIndex].Level = ObjectTypeList[ObjectTypeIndex].Level;
+
+ /* Initialize the access check rights */
+ InternalTypeList[ObjectTypeIndex].ObjectAccessRights.RemainingAccessRights = 0;
+ InternalTypeList[ObjectTypeIndex].ObjectAccessRights.GrantedAccessRights = 0;
+ InternalTypeList[ObjectTypeIndex].ObjectAccessRights.DeniedAccessRights = 0;
+ }
+
+ /* Give the captured list to caller */
+ *CapturedObjectTypeList = InternalTypeList;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- ExFreePoolWithTag(*CapturedObjectTypeList, TAG_SEPA);
- *CapturedObjectTypeList = NULL;
+ ExFreePoolWithTag(InternalTypeList, TAG_SEPA);
+ InternalTypeList = NULL;
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
@@ -99,17 +373,18 @@ SeCaptureObjectTypeList(
*
* @param[in] PreviousMode
* Processor access level mode.
- *
- * @return
- * Nothing.
*/
VOID
SeReleaseObjectTypeList(
- _In_ _Post_invalid_ POBJECT_TYPE_LIST CapturedObjectTypeList,
+ _In_ _Post_invalid_ POBJECT_TYPE_LIST_INTERNAL CapturedObjectTypeList,
_In_ KPROCESSOR_MODE PreviousMode)
{
+ PAGED_CODE();
+
if ((PreviousMode != KernelMode) && (CapturedObjectTypeList != NULL))
+ {
ExFreePoolWithTag(CapturedObjectTypeList, TAG_SEPA);
+ }
}
/* EOF */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ea03b5b22c9d22a949ce…
commit 2ea03b5b22c9d22a949ce498276d494b8bdc758b
Author: Andriy Shevchenko <nfxpnk(a)gmail.com>
AuthorDate: Tue Aug 22 16:20:29 2023 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Aug 22 16:20:29 2023 +0300
[REACTOS] Fix typos in comments (#5591)
Fixing typos in code comments enhances code readability and comprehension for developers and collaborators.
---
sdk/lib/rtl/handle.c | 2 +-
sdk/tools/rsym/rsym64.c | 2 +-
sdk/tools/utf16le/utf16le.cpp | 2 +-
sdk/tools/winesync/winesync.py | 2 +-
subsystems/csr/csrsrv/procsup.c | 2 +-
subsystems/csr/csrsrv/status.h | 4 ++--
subsystems/mvdm/ntvdm/bios/bios32/bios32.c | 2 +-
subsystems/mvdm/ntvdm/cpu/cpu.c | 2 +-
win32ss/drivers/miniport/vga_new/vga.c | 4 ++--
win32ss/gdi/eng/device.c | 2 +-
win32ss/gdi/eng/ldevobj.c | 2 +-
win32ss/gdi/ntgdi/gdipool.c | 2 +-
win32ss/reactx/dxg/historic.c | 2 +-
win32ss/reactx/ntddraw/d3d.c | 2 +-
win32ss/user/ntuser/desktop.c | 2 +-
win32ss/user/ntuser/hook.c | 2 +-
win32ss/user/ntuser/hotkey.c | 4 ++--
win32ss/user/ntuser/input.c | 2 +-
win32ss/user/ntuser/kbdlayout.c | 2 +-
win32ss/user/ntuser/windc.c | 2 +-
win32ss/user/user32/controls/ghost.c | 2 +-
win32ss/user/user32/misc/misc.c | 2 +-
22 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/sdk/lib/rtl/handle.c b/sdk/lib/rtl/handle.c
index 5c24199199b..d811f805be5 100644
--- a/sdk/lib/rtl/handle.c
+++ b/sdk/lib/rtl/handle.c
@@ -71,7 +71,7 @@ RtlAllocateHandle(
/* Check if we are out of free handles entries */
if (HandleTable->FreeHandles == NULL)
{
- /* Check if we don't have uncomitted handle entries yet */
+ /* Check if we don't have uncommitted handle entries yet */
if (HandleTable->UnCommittedHandles == NULL)
{
/* Use the maximum number of handle entries */
diff --git a/sdk/tools/rsym/rsym64.c b/sdk/tools/rsym/rsym64.c
index 80861e4814f..07e5596fa08 100644
--- a/sdk/tools/rsym/rsym64.c
+++ b/sdk/tools/rsym/rsym64.c
@@ -781,7 +781,7 @@ ParsePEHeaders(PFILE_INFO File)
File->UsedSections = 0;
File->eh_frame.idx = -1;
- /* Allocate array of chars, specifiying whether to copy the section */
+ /* Allocate array of chars, specifying whether to copy the section */
File->UseSection = malloc(File->AllSections);
for (i = 0; i < File->AllSections; i++)
diff --git a/sdk/tools/utf16le/utf16le.cpp b/sdk/tools/utf16le/utf16le.cpp
index 391205cbba5..cf41bc0f8c7 100644
--- a/sdk/tools/utf16le/utf16le.cpp
+++ b/sdk/tools/utf16le/utf16le.cpp
@@ -180,7 +180,7 @@ public:
wchar_t ret = (wchar_t)-1;
switch (encoding)
{
- case detect: // if still unknwon
+ case detect: // if still unknown
encoding = utf8; // assume utf8 as default
case utf8:
unsigned char c, tmp;
diff --git a/sdk/tools/winesync/winesync.py b/sdk/tools/winesync/winesync.py
index cdee060db52..d596a5dd710 100644
--- a/sdk/tools/winesync/winesync.py
+++ b/sdk/tools/winesync/winesync.py
@@ -259,7 +259,7 @@ class wine_sync:
return True, warning_message
def revert_staged_patchset(self):
- # revert all of this in one commmit
+ # revert all of this in one commit
staged_patch_dir_path = os.path.join(self.reactos_src, self.staged_patch_dir)
if not os.path.isdir(staged_patch_dir_path):
return True
diff --git a/subsystems/csr/csrsrv/procsup.c b/subsystems/csr/csrsrv/procsup.c
index 7abf0d1f6d6..82b5dbbee3c 100644
--- a/subsystems/csr/csrsrv/procsup.c
+++ b/subsystems/csr/csrsrv/procsup.c
@@ -1048,7 +1048,7 @@ CsrLockProcessByClientId(IN HANDLE Pid,
* @return TRUE if the reversion was succesful, FALSE otherwise.
*
* @remarks Impersonation can be recursive; as such, the impersonation token
- * will only be deleted once the CSR Thread's impersonaton count
+ * will only be deleted once the CSR Thread's impersonation count
* has reached zero.
*
*--*/
diff --git a/subsystems/csr/csrsrv/status.h b/subsystems/csr/csrsrv/status.h
index c8b922f905a..1eebf18a820 100644
--- a/subsystems/csr/csrsrv/status.h
+++ b/subsystems/csr/csrsrv/status.h
@@ -14,7 +14,7 @@
* up the DosDevices Object Directory, and initializing each component.
*
* procsup.c - Handles all internal functions dealing with the CSR Process Object,
- * including de/allocation, de/referencing, un/locking, prority, and
+ * including de/allocation, de/referencing, un/locking, priority, and
* lookups. Also handles all external APIs which touch the CSR Process Object.
*
* server.c - Handles all internal functions related to loading and managing Server
@@ -24,7 +24,7 @@
*
* session.c - Handles all internal functions dealing with the CSR Session Object,
* including de/allocation, de/referencing, and un/locking. Holds the SB API
- * Dispatch/Name Tables and the public CsrSv API Interface for commmunication
+ * Dispatch/Name Tables and the public CsrSv API Interface for communication
* with the Session Manager.
*
* thredsup.c - Handles all internal functions dealing with the CSR Thread Object,
diff --git a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
index 95b2a31f0cf..a5c06c5295f 100644
--- a/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
+++ b/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
@@ -442,7 +442,7 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
case 0xC2:
{
// FIXME: Reenable this call when we understand why
- // our included mouse driver doesn't correctly reeanble
+ // our included mouse driver doesn't correctly reenable
// mouse reporting!
// BiosMousePs2Interface(Stack);
// break;
diff --git a/subsystems/mvdm/ntvdm/cpu/cpu.c b/subsystems/mvdm/ntvdm/cpu/cpu.c
index 2fcbc00dd80..1e0cc03c21a 100644
--- a/subsystems/mvdm/ntvdm/cpu/cpu.c
+++ b/subsystems/mvdm/ntvdm/cpu/cpu.c
@@ -131,7 +131,7 @@ LONG CpuExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
/*
* Check whether the access exception was done inside the virtual memory space
- * (caused by an emulated app) or outside (casued by a bug in ourselves).
+ * (caused by an emulated app) or outside (caused by a bug in ourselves).
*/
if (Address < (ULONG_PTR)BaseAddress ||
Address >= (ULONG_PTR)BaseAddress + MAX_ADDRESS)
diff --git a/win32ss/drivers/miniport/vga_new/vga.c b/win32ss/drivers/miniport/vga_new/vga.c
index 41906254181..1b2da4b548b 100644
--- a/win32ss/drivers/miniport/vga_new/vga.c
+++ b/win32ss/drivers/miniport/vga_new/vga.c
@@ -749,10 +749,10 @@ Return Value:
// eVb: 1.13 [END]
//
- // Always return succcess since settings the text mode will fail on
+ // Always return success since settings the text mode will fail on
// non-x86.
//
- // Also, failiure to set the text mode is not fatal in any way, since
+ // Also, failure to set the text mode is not fatal in any way, since
// this operation must be followed by another set mode operation.
//
diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c
index ed6c00435e2..d9f6b8a9465 100644
--- a/win32ss/gdi/eng/device.c
+++ b/win32ss/gdi/eng/device.c
@@ -200,7 +200,7 @@ EngpUpdateGraphicsDeviceList(VOID)
ERR("VGA adapter = %lu\n", iVGACompatible);
}
- /* Get the maximum mumber of adapters */
+ /* Get the maximum number of adapters */
if (!RegReadDWORD(hkey, L"MaxObjectNumber", &ulMaxObjectNumber))
{
ERR("Could not read MaxObjectNumber, defaulting to 0.\n");
diff --git a/win32ss/gdi/eng/ldevobj.c b/win32ss/gdi/eng/ldevobj.c
index 9582c8e943a..b4f13b88d19 100644
--- a/win32ss/gdi/eng/ldevobj.c
+++ b/win32ss/gdi/eng/ldevobj.c
@@ -407,7 +407,7 @@ LDEVOBJ_pLoadDriver(
/* Check if the ldev is associated with a file */
if (pldev->pGdiDriverInfo)
{
- /* Check for match (case insensative) */
+ /* Check for match (case insensitive) */
if (RtlEqualUnicodeString(&pldev->pGdiDriverInfo->DriverName, &strDriverName, TRUE))
{
/* Image found in LDEV list */
diff --git a/win32ss/gdi/ntgdi/gdipool.c b/win32ss/gdi/ntgdi/gdipool.c
index d85972f38dd..9a19cbea1b6 100644
--- a/win32ss/gdi/ntgdi/gdipool.c
+++ b/win32ss/gdi/ntgdi/gdipool.c
@@ -184,7 +184,7 @@ GdiPoolAllocate(
cjOffset = ulIndex * pPool->cjAllocSize;
pvAlloc = (PVOID)((ULONG_PTR)pSection->pvBaseAddress + cjOffset);
- /* Check if memory is comitted */
+ /* Check if memory is committed */
ulPageBit = 1 << (cjOffset / PAGE_SIZE);
ulPageBit |= 1 << ((cjOffset + pPool->cjAllocSize - 1) / PAGE_SIZE);
if ((pSection->ulCommitBitmap & ulPageBit) != ulPageBit)
diff --git a/win32ss/reactx/dxg/historic.c b/win32ss/reactx/dxg/historic.c
index a24eee8c634..e25d3196f94 100644
--- a/win32ss/reactx/dxg/historic.c
+++ b/win32ss/reactx/dxg/historic.c
@@ -18,7 +18,7 @@
* The function DxDxgGenericThunk redirects DirectX calls to other functions.
*
* @param ULONG_PTR ulIndex
-* The functions we want redirct
+* The functions we want to redirect
*
* @param ULONG_PTR ulHandle
* Unknown
diff --git a/win32ss/reactx/ntddraw/d3d.c b/win32ss/reactx/ntddraw/d3d.c
index 07eb7297829..8eb87a5879f 100644
--- a/win32ss/reactx/ntddraw/d3d.c
+++ b/win32ss/reactx/ntddraw/d3d.c
@@ -135,7 +135,7 @@ NtGdiD3dContextCreate(HANDLE hDirectDrawLocal,
* @name NtGdiD3dContextDestroy
* @implemented
*
-* The Function NtGdiD3dContextDestroy destorys the context data we got from NtGdiD3dContextCreate
+* The Function NtGdiD3dContextDestroy destroys the context data we got from NtGdiD3dContextCreate
* It redirects to dxg.sys in windows XP/2003, dxkrnl.sys in vista and is fully implemented
* in win32k.sys in windows 2000 and below
*
diff --git a/win32ss/user/ntuser/desktop.c b/win32ss/user/ntuser/desktop.c
index 16b7aa0b8c2..7f200cbfc92 100644
--- a/win32ss/user/ntuser/desktop.c
+++ b/win32ss/user/ntuser/desktop.c
@@ -170,7 +170,7 @@ IntDesktopObjectDelete(
if (pdesk->spwndMessage)
co_UserDestroyWindow(pdesk->spwndMessage);
- /* Remove the desktop from the window station's list of associcated desktops */
+ /* Remove the desktop from the window station's list of associated desktops */
RemoveEntryList(&pdesk->ListEntry);
/* Free the heap */
diff --git a/win32ss/user/ntuser/hook.c b/win32ss/user/ntuser/hook.c
index 8f82d5b2f46..b9879c01320 100644
--- a/win32ss/user/ntuser/hook.c
+++ b/win32ss/user/ntuser/hook.c
@@ -43,7 +43,7 @@ IntLoadHookModule(int iHookID, HHOOK hHook, BOOL Unload)
{
/* A callback in user mode can trigger UserLoadApiHook to be called and
as a result IntLoadHookModule will be called recursively.
- To solve this we set the flag that means that the appliaction has
+ To solve this we set the flag that means that the application has
loaded the api hook before the callback and in case of error we remove it */
ppi->W32PF_flags |= W32PF_APIHOOKLOADED;
diff --git a/win32ss/user/ntuser/hotkey.c b/win32ss/user/ntuser/hotkey.c
index 93b43d100d8..d2ae2c4766f 100644
--- a/win32ss/user/ntuser/hotkey.c
+++ b/win32ss/user/ntuser/hotkey.c
@@ -7,7 +7,7 @@
*/
/*
- * FIXME: Hotkey notifications are triggered by keyboard input (physical or programatically)
+ * FIXME: Hotkey notifications are triggered by keyboard input (physical or programmatically)
* and since only desktops on WinSta0 can receive input in seems very wrong to allow
* windows/threads on destops not belonging to WinSta0 to set hotkeys (receive notifications).
* -- Gunnar
@@ -52,7 +52,7 @@ StartDebugHotKeys(VOID)
}
UserRegisterHotKey(PWND_BOTTOM, IDHK_SHIFTF12, MOD_SHIFT, vk);
UserRegisterHotKey(PWND_BOTTOM, IDHK_F12, 0, vk);
- TRACE("Start up the debugger hotkeys!! If you see this you eneabled debugprints. Congrats!\n");
+ TRACE("Start up the debugger hotkeys!! If you see this you enabled debugprints. Congrats!\n");
}
/*
diff --git a/win32ss/user/ntuser/input.c b/win32ss/user/ntuser/input.c
index 9c2c69b353c..f153bcf59a6 100644
--- a/win32ss/user/ntuser/input.c
+++ b/win32ss/user/ntuser/input.c
@@ -42,7 +42,7 @@ IntLastInputTick(BOOL bUpdate)
/*
* DoTheScreenSaver
*
- * Check if scrensaver should be started and sends message to SAS window
+ * Check if screensaver should be started and sends message to SAS window
*/
VOID FASTCALL
DoTheScreenSaver(VOID)
diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c
index ef66cad9ddc..33875c2cebf 100644
--- a/win32ss/user/ntuser/kbdlayout.c
+++ b/win32ss/user/ntuser/kbdlayout.c
@@ -579,7 +579,7 @@ IntReorderKeyboardLayouts(
/*
* UserSetDefaultInputLang
*
- * Sets default kyboard layout for system. Called from UserSystemParametersInfo.
+ * Sets default keyboard layout for system. Called from UserSystemParametersInfo.
*/
BOOL
NTAPI
diff --git a/win32ss/user/ntuser/windc.c b/win32ss/user/ntuser/windc.c
index 9a4a7dde211..0f2d2781e30 100644
--- a/win32ss/user/ntuser/windc.c
+++ b/win32ss/user/ntuser/windc.c
@@ -1022,7 +1022,7 @@ NtUserGetDC(HWND hWnd)
* Select logical palette into device context.
* \param hDC handle to the device context
* \param hpal handle to the palette
- * \param ForceBackground If this value is FALSE the logical palette will be copied to the device palette only when the applicatioon
+ * \param ForceBackground If this value is FALSE the logical palette will be copied to the device palette only when the application
* is in the foreground. If this value is TRUE then map the colors in the logical palette to the device
* palette colors in the best way.
* \return old palette
diff --git a/win32ss/user/user32/controls/ghost.c b/win32ss/user/user32/controls/ghost.c
index 0abc0648731..dac759f3843 100644
--- a/win32ss/user/user32/controls/ghost.c
+++ b/win32ss/user/user32/controls/ghost.c
@@ -331,7 +331,7 @@ Ghost_OnNCPaint(HWND hwnd, HRGN hrgn, BOOL bUnicode)
{
HDC hdc;
- // do the default behaivour
+ // do the default behaviour
if (bUnicode)
DefWindowProcW(hwnd, WM_NCPAINT, (WPARAM)hrgn, 0);
else
diff --git a/win32ss/user/user32/misc/misc.c b/win32ss/user/user32/misc/misc.c
index 621ec567f8e..d834697b6a1 100644
--- a/win32ss/user/user32/misc/misc.c
+++ b/win32ss/user/user32/misc/misc.c
@@ -61,7 +61,7 @@ GetW32ThreadInfo(VOID)
* 2) pSecurityInfo - type of information to retrieve
* 3) pSecurityDescriptor - buffer which receives descriptor
* 4) dwLength - size, in bytes, of buffer 'pSecurityDescriptor'
- * 5) pdwLengthNeeded - reseives actual size of descriptor
+ * 5) pdwLengthNeeded - receives actual size of the descriptor
*
* Return Vaules:
* TRUE on success
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7cb6f49209b95fcac7fc…
commit e7cb6f49209b95fcac7fcf55918cb29289abe455
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Mon Aug 21 21:46:20 2023 +0300
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Aug 21 21:46:20 2023 +0300
[KMTEST:TcpIp] Use 10 second timeout value instead of INFINITE (#5586)
* [KMTEST:TcpIp] Use 10 second timeout value instead of INFINITE
On x64 the test sometimes fails to connect and then times out on the testbot, causing the system to be rebooted.
Co-authored-by: Stanislav Motylkov <x86corez(a)gmail.com>
---
modules/rostests/kmtests/tcpip/TcpIp_user.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/kmtests/tcpip/TcpIp_user.c b/modules/rostests/kmtests/tcpip/TcpIp_user.c
index 60286d2e48a..f28972ff21c 100644
--- a/modules/rostests/kmtests/tcpip/TcpIp_user.c
+++ b/modules/rostests/kmtests/tcpip/TcpIp_user.c
@@ -113,7 +113,8 @@ START_TEST(TcpIpConnect)
Error = KmtSendToDriver(IOCTL_TEST_CONNECT);
ok_eq_ulong(Error, ERROR_SUCCESS);
- WaitForSingleObject(AcceptThread, INFINITE);
+ Error = WaitForSingleObject(AcceptThread, 10 * 1000);
+ ok(Error == WAIT_OBJECT_0, "AcceptThread timed out\n");
UnloadTcpIpTestDriver();