Author: gadamopoulos Date: Tue Oct 30 16:50:11 2012 New Revision: 57652
URL: http://svn.reactos.org/svn/reactos?rev=57652&view=rev Log: [win32k] - Fix the remaining tests that failed in user32:winstation
Modified: trunk/reactos/win32ss/user/ntuser/winsta.c trunk/reactos/win32ss/user/user32/misc/object.c
Modified: trunk/reactos/win32ss/user/ntuser/winsta.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winsta.... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] Tue Oct 30 16:50:11 2012 @@ -526,7 +526,7 @@
if (hWinSta == UserGetProcessWindowStation()) { - ERR("Attempted to close process window station"); + ERR("Attempted to close process window station\n"); return FALSE; }
@@ -612,19 +612,13 @@
/* try windowstation */ TRACE("Trying to open window station 0x%x\n", hObject); - Status = IntValidateWindowStationHandle( + Status = ObReferenceObjectByHandle( hObject, + 0, + ExWindowStationObjectType, UserMode, - 0, - &WinStaObject); - - - if (!NT_SUCCESS(Status) && Status != STATUS_OBJECT_TYPE_MISMATCH) - { - TRACE("Failed: 0x%x\n", Status); - SetLastNtError(Status); - return FALSE; - } + (PVOID*)&WinStaObject, + NULL);
if (Status == STATUS_OBJECT_TYPE_MISMATCH) { @@ -635,13 +629,15 @@ 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 @@ if (DesktopObject != NULL) ObDereferenceObject(DesktopObject);
- SetLastNtError(Status); - return NT_SUCCESS(Status); + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + return FALSE; + } + + return TRUE; }
/*
Modified: trunk/reactos/win32ss/user/user32/misc/object.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/ob... ============================================================================== --- trunk/reactos/win32ss/user/user32/misc/object.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/misc/object.c [iso-8859-1] Tue Oct 30 16:50:11 2012 @@ -48,7 +48,8 @@ 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 @@ }
/* 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; } }