#include <user32.h>
-/*
- * @implemented
- */
-BOOL STDCALL
-CloseWindowStation(HWINSTA hWinSta)
-{
- return(NtUserCloseWindowStation(hWinSta));
-}
+#include <wine/debug.h>
/*
* @implemented
*/
-HWINSTA STDCALL
+HWINSTA WINAPI
CreateWindowStationA(LPSTR lpwinsta,
DWORD dwReserved,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{
- ANSI_STRING WindowStationNameA;
- UNICODE_STRING WindowStationNameU;
- HWINSTA hWinSta;
+ UNICODE_STRING WindowStationNameU;
+ HWINSTA hWinSta;
- if (lpwinsta != NULL)
+ if (lpwinsta)
{
- RtlInitAnsiString(&WindowStationNameA, lpwinsta);
- RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
- TRUE);
+ /* After conversion, the buffer is zero-terminated */
+ RtlCreateUnicodeStringFromAsciiz(&WindowStationNameU, lpwinsta);
}
- else
+ else
{
- RtlInitUnicodeString(&WindowStationNameU, NULL);
+ RtlInitUnicodeString(&WindowStationNameU, NULL);
}
- hWinSta = CreateWindowStationW(WindowStationNameU.Buffer,
- dwReserved,
- dwDesiredAccess,
- lpsa);
+ hWinSta = CreateWindowStationW(WindowStationNameU.Buffer,
+ dwReserved,
+ dwDesiredAccess,
+ lpsa);
- RtlFreeUnicodeString(&WindowStationNameU);
+ /* Free the string, if it was allocated */
+ if (lpwinsta) RtlFreeUnicodeString(&WindowStationNameU);
- return hWinSta;
+ return hWinSta;
}
/*
* @implemented
*/
-HWINSTA STDCALL
+HWINSTA WINAPI
CreateWindowStationW(LPWSTR lpwinsta,
DWORD dwReserved,
ACCESS_MASK dwDesiredAccess,
return NtUserCreateWindowStation(&WindowStationName,
dwDesiredAccess,
- lpsa, 0, 0, 0);
+ lpsa, 0, 0, 0, 0);
}
/*
*/
if (NULL == WindowStation && Desktops)
{
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
+ WindowStation = GetProcessWindowStation();
}
/*
/*
* @implemented
*/
-BOOL STDCALL
+BOOL WINAPI
EnumWindowStationsA(WINSTAENUMPROCA EnumFunc,
LPARAM Context)
{
/*
* @implemented
*/
-BOOL STDCALL
+BOOL WINAPI
EnumWindowStationsW(WINSTAENUMPROCW EnumFunc,
LPARAM Context)
{
/*
* @implemented
*/
-HWINSTA STDCALL
-GetProcessWindowStation(VOID)
-{
- return NtUserGetProcessWindowStation();
-}
-
-
-/*
- * @implemented
- */
-HWINSTA STDCALL
+HWINSTA WINAPI
OpenWindowStationA(LPSTR lpszWinSta,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
{
- ANSI_STRING WindowStationNameA;
- UNICODE_STRING WindowStationNameU;
- HWINSTA hWinSta;
+ UNICODE_STRING WindowStationNameU;
+ HWINSTA hWinSta;
- if (lpszWinSta != NULL)
+ if (lpszWinSta)
{
- RtlInitAnsiString(&WindowStationNameA, lpszWinSta);
- RtlAnsiStringToUnicodeString(&WindowStationNameU, &WindowStationNameA,
- TRUE);
+ /* After conversion, the buffer is zero-terminated */
+ RtlCreateUnicodeStringFromAsciiz(&WindowStationNameU, lpszWinSta);
}
- else
+ else
{
- RtlInitUnicodeString(&WindowStationNameU, NULL);
+ RtlInitUnicodeString(&WindowStationNameU, NULL);
}
- hWinSta = OpenWindowStationW(WindowStationNameU.Buffer,
- fInherit,
- dwDesiredAccess);
+ hWinSta = OpenWindowStationW(WindowStationNameU.Buffer,
+ fInherit,
+ dwDesiredAccess);
- RtlFreeUnicodeString(&WindowStationNameU);
+ /* Free the string, if it was allocated */
+ if (lpszWinSta) RtlFreeUnicodeString(&WindowStationNameU);
- return hWinSta;
+ return hWinSta;
}
/*
* @implemented
*/
-HWINSTA STDCALL
+HWINSTA WINAPI
OpenWindowStationW(LPWSTR lpszWinSta,
BOOL fInherit,
ACCESS_MASK dwDesiredAccess)
}
-/*
- * @implemented
- */
-BOOL STDCALL
-SetProcessWindowStation(HWINSTA hWinSta)
-{
- return NtUserSetProcessWindowStation(hWinSta);
-}
-
-
/*
* @unimplemented
*/
DWORD
-STDCALL
+WINAPI
SetWindowStationUser(
DWORD Unknown1,
DWORD Unknown2,
return NtUserSetWindowStationUser(Unknown1, Unknown2, Unknown3, Unknown4);
}
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-LockWindowStation(HWINSTA hWinSta)
-{
- return NtUserLockWindowStation(hWinSta);
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-UnlockWindowStation(HWINSTA hWinSta)
-{
- return NtUserUnlockWindowStation(hWinSta);
-}
-
/* EOF */