mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 04:37:15 +00:00
[win32k]
- Fix the remaining tests that failed in user32:winstation svn path=/trunk/; revision=57652
This commit is contained in:
parent
864bf93f95
commit
ccb9c49a46
2 changed files with 30 additions and 29 deletions
|
@ -526,7 +526,7 @@ NtUserCloseWindowStation(
|
|||
|
||||
if (hWinSta == UserGetProcessWindowStation())
|
||||
{
|
||||
ERR("Attempted to close process window station");
|
||||
ERR("Attempted to close process window station\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -612,19 +612,13 @@ NtUserGetObjectInformation(
|
|||
|
||||
/* try windowstation */
|
||||
TRACE("Trying to open window station 0x%x\n", hObject);
|
||||
Status = IntValidateWindowStationHandle(
|
||||
Status = ObReferenceObjectByHandle(
|
||||
hObject,
|
||||
UserMode,
|
||||
0,
|
||||
&WinStaObject);
|
||||
|
||||
|
||||
if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_TYPE_MISMATCH)
|
||||
{
|
||||
TRACE("Failed: 0x%x\n", Status);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
ExWindowStationObjectType,
|
||||
UserMode,
|
||||
(PVOID*)&WinStaObject,
|
||||
NULL);
|
||||
|
||||
if (Status == STATUS_OBJECT_TYPE_MISMATCH)
|
||||
{
|
||||
|
@ -635,13 +629,15 @@ NtUserGetObjectInformation(
|
|||
UserMode,
|
||||
0,
|
||||
&DesktopObject);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
TRACE("Failed: 0x%x\n", Status);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("Failed: 0x%x\n", Status);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRACE("WinSta or Desktop opened!!\n");
|
||||
|
||||
/* get data */
|
||||
|
@ -713,8 +709,13 @@ NtUserGetObjectInformation(
|
|||
if (DesktopObject != NULL)
|
||||
ObDereferenceObject(DesktopObject);
|
||||
|
||||
SetLastNtError(Status);
|
||||
return NT_SUCCESS(Status);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -48,7 +48,8 @@ GetUserObjectInformationA(
|
|||
LPDWORD lpnLengthNeeded)
|
||||
{
|
||||
LPWSTR buffer;
|
||||
BOOL ret = TRUE;
|
||||
BOOL ret = FALSE;
|
||||
DWORD LengthNeeded;
|
||||
|
||||
TRACE("GetUserObjectInformationA(%x %d %x %d %x)\n", hObj, nIndex,
|
||||
pvInfo, nLength, lpnLengthNeeded);
|
||||
|
@ -65,17 +66,16 @@ GetUserObjectInformationA(
|
|||
}
|
||||
|
||||
/* get unicode string */
|
||||
if (!GetUserObjectInformationW(hObj, nIndex, buffer, nLength*2, lpnLengthNeeded))
|
||||
ret = FALSE;
|
||||
*lpnLengthNeeded /= 2;
|
||||
|
||||
if (ret)
|
||||
if (GetUserObjectInformationW(hObj, nIndex, buffer, nLength*2, lpnLengthNeeded))
|
||||
{
|
||||
/* convert string */
|
||||
if (WideCharToMultiByte(CP_THREAD_ACP, 0, buffer, -1,
|
||||
pvInfo, nLength, NULL, NULL) == 0)
|
||||
LengthNeeded = WideCharToMultiByte(CP_THREAD_ACP, 0, buffer, -1,
|
||||
pvInfo, nLength, NULL, NULL);
|
||||
|
||||
if (LengthNeeded != 0)
|
||||
{
|
||||
ret = FALSE;
|
||||
*lpnLengthNeeded = LengthNeeded;
|
||||
ret = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue