mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +00:00
[WIN32K:NTUSER]
- Don't access WindowStationName after free - Handle RtlCreateAtomTable failure svn path=/trunk/; revision=71165
This commit is contained in:
parent
8ab4a127ba
commit
270998174c
1 changed files with 10 additions and 3 deletions
|
@ -454,7 +454,7 @@ NtUserCreateWindowStation(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR("ObCreateObject failed for window station %wZ\n", &WindowStationName);
|
ERR("ObCreateObject failed with %lx for window station %wZ\n", Status, &WindowStationName);
|
||||||
ExFreePoolWithTag(WindowStationName.Buffer, TAG_STRING);
|
ExFreePoolWithTag(WindowStationName.Buffer, TAG_STRING);
|
||||||
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -464,9 +464,16 @@ NtUserCreateWindowStation(
|
||||||
RtlZeroMemory(WindowStationObject, sizeof(WINSTATION_OBJECT));
|
RtlZeroMemory(WindowStationObject, sizeof(WINSTATION_OBJECT));
|
||||||
|
|
||||||
InitializeListHead(&WindowStationObject->DesktopListHead);
|
InitializeListHead(&WindowStationObject->DesktopListHead);
|
||||||
Status = RtlCreateAtomTable(37, &WindowStationObject->AtomTable);
|
|
||||||
WindowStationObject->Name = WindowStationName;
|
WindowStationObject->Name = WindowStationName;
|
||||||
WindowStationObject->dwSessionId = NtCurrentPeb()->SessionId;
|
WindowStationObject->dwSessionId = NtCurrentPeb()->SessionId;
|
||||||
|
Status = RtlCreateAtomTable(37, &WindowStationObject->AtomTable);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
ERR("RtlCreateAtomTable failed with %lx for window station %wZ\n", Status, &WindowStationName);
|
||||||
|
ObDereferenceObject(WindowStationObject);
|
||||||
|
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Status = ObInsertObject((PVOID)WindowStationObject,
|
Status = ObInsertObject((PVOID)WindowStationObject,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -477,7 +484,7 @@ NtUserCreateWindowStation(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR("ObInsertObject failed for window station %wZ\n", &WindowStationName);
|
ERR("ObInsertObject failed with %lx for window station\n", Status);
|
||||||
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue