mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +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())
|
if (hWinSta == UserGetProcessWindowStation())
|
||||||
{
|
{
|
||||||
ERR("Attempted to close process window station");
|
ERR("Attempted to close process window station\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,19 +612,13 @@ NtUserGetObjectInformation(
|
||||||
|
|
||||||
/* try windowstation */
|
/* try windowstation */
|
||||||
TRACE("Trying to open window station 0x%x\n", hObject);
|
TRACE("Trying to open window station 0x%x\n", hObject);
|
||||||
Status = IntValidateWindowStationHandle(
|
Status = ObReferenceObjectByHandle(
|
||||||
hObject,
|
hObject,
|
||||||
UserMode,
|
|
||||||
0,
|
0,
|
||||||
&WinStaObject);
|
ExWindowStationObjectType,
|
||||||
|
UserMode,
|
||||||
|
(PVOID*)&WinStaObject,
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_TYPE_MISMATCH)
|
NULL);
|
||||||
{
|
|
||||||
TRACE("Failed: 0x%x\n", Status);
|
|
||||||
SetLastNtError(Status);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Status == STATUS_OBJECT_TYPE_MISMATCH)
|
if (Status == STATUS_OBJECT_TYPE_MISMATCH)
|
||||||
{
|
{
|
||||||
|
@ -635,13 +629,15 @@ NtUserGetObjectInformation(
|
||||||
UserMode,
|
UserMode,
|
||||||
0,
|
0,
|
||||||
&DesktopObject);
|
&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");
|
TRACE("WinSta or Desktop opened!!\n");
|
||||||
|
|
||||||
/* get data */
|
/* get data */
|
||||||
|
@ -713,8 +709,13 @@ NtUserGetObjectInformation(
|
||||||
if (DesktopObject != NULL)
|
if (DesktopObject != NULL)
|
||||||
ObDereferenceObject(DesktopObject);
|
ObDereferenceObject(DesktopObject);
|
||||||
|
|
||||||
SetLastNtError(Status);
|
if (!NT_SUCCESS(Status))
|
||||||
return NT_SUCCESS(Status);
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -48,7 +48,8 @@ GetUserObjectInformationA(
|
||||||
LPDWORD lpnLengthNeeded)
|
LPDWORD lpnLengthNeeded)
|
||||||
{
|
{
|
||||||
LPWSTR buffer;
|
LPWSTR buffer;
|
||||||
BOOL ret = TRUE;
|
BOOL ret = FALSE;
|
||||||
|
DWORD LengthNeeded;
|
||||||
|
|
||||||
TRACE("GetUserObjectInformationA(%x %d %x %d %x)\n", hObj, nIndex,
|
TRACE("GetUserObjectInformationA(%x %d %x %d %x)\n", hObj, nIndex,
|
||||||
pvInfo, nLength, lpnLengthNeeded);
|
pvInfo, nLength, lpnLengthNeeded);
|
||||||
|
@ -65,17 +66,16 @@ GetUserObjectInformationA(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get unicode string */
|
/* get unicode string */
|
||||||
if (!GetUserObjectInformationW(hObj, nIndex, buffer, nLength*2, lpnLengthNeeded))
|
if (GetUserObjectInformationW(hObj, nIndex, buffer, nLength*2, lpnLengthNeeded))
|
||||||
ret = FALSE;
|
|
||||||
*lpnLengthNeeded /= 2;
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
{
|
{
|
||||||
/* convert string */
|
/* convert string */
|
||||||
if (WideCharToMultiByte(CP_THREAD_ACP, 0, buffer, -1,
|
LengthNeeded = WideCharToMultiByte(CP_THREAD_ACP, 0, buffer, -1,
|
||||||
pvInfo, nLength, NULL, NULL) == 0)
|
pvInfo, nLength, NULL, NULL);
|
||||||
|
|
||||||
|
if (LengthNeeded != 0)
|
||||||
{
|
{
|
||||||
ret = FALSE;
|
*lpnLengthNeeded = LengthNeeded;
|
||||||
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue