20 {
L"WinSta0",
L"Default"},
21 {
L"WinSta0",
L"Default"},
24 {
L"WinSta0",
L"Default"},
29 {
L"WinSta0",
L"Default"},
33 {
L"TestWinsta",
L"TestDesktop"},
35 {
L"WinSta0",
L"Default"},
48 ok(
FALSE,
"%d: Process should have failed to initialize\n",
i);
87 ok(
ret > 0 ,
"%d: GetExitCodeProcess failed\n",
i);
93 ok(ExitCode == expectedExitCode,
"%d: expected error 0x%x in child process got 0x%x\n",
i, (
int)expectedExitCode, (
int)ExitCode);
102 sa.nLength =
sizeof(
sa);
103 sa.lpSecurityDescriptor =
NULL;
104 sa.bInheritHandle = inheritable;
115 sa.nLength =
sizeof(
sa);
116 sa.lpSecurityDescriptor =
NULL;
117 sa.bInheritHandle = inheritable;
126 HWINSTA hwinsta =
NULL, hwinstaInitial;
127 HDESK hdesktop =
NULL;
148 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
150 ok(hdesktop !=
NULL &&
error == 0xfeedf00d,
"CreateDesktop failed, got 0x%p, 0x%lx\n", hdesktop,
error);
160 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
166 ok(
ret !=
FALSE,
"CloseWindowStation failed\n");
173 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
175 ok(hdesktop !=
NULL &&
error == 0xfeedf00d,
"CreateDesktop failed, got 0x%p, 0x%lx\n", hdesktop,
error);
181 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
187 ok(
ret !=
FALSE,
"CloseWindowStation failed\n");
193 HDESK hDeskInput ,hDeskInput2;
196 HWINSTA hwinsta =
NULL, hwinstaInitial;
200 ok(hDeskInput !=
NULL,
"OpenInputDesktop failed\n");
202 ok(hDeskInitial !=
NULL,
"GetThreadDesktop failed\n");
203 ok(hDeskInput != hDeskInitial,
"OpenInputDesktop returned thread desktop\n");
206 ok(hDeskInput2 !=
NULL,
"Second call to OpenInputDesktop failed\n");
207 ok(hDeskInput2 != hDeskInput,
"Second call to OpenInputDesktop returned same handle\n");
212 ok(
ret ==
TRUE,
"SetThreadDesktop for input desktop failed\n");
215 ok(
ret ==
TRUE,
"SetThreadDesktop for initial desktop failed\n");
221 ok(hwinstaInitial != 0,
"GetProcessWindowStation failed\n");
224 ok(hwinsta != 0,
"CreateWindowStationW failed\n");
227 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
230 ok(hDeskInput == 0,
"OpenInputDesktop should fail\n");
236 ok(
ret !=
FALSE,
"SetProcessWindowStation failed\n");
239 ok(
ret !=
FALSE,
"CloseWindowStation failed\n");
281 PCWSTR winstaName =
L"RefTestWinsta";
282 PCWSTR deskName =
L"RefTestDesktop";
285 HWINSTA hwinstaProcess;
294#define check_ref(handle, hdlcnt, ptrcnt) \
295 status = NtQueryObject(handle, ObjectBasicInformation, &objectInfo, sizeof(objectInfo), NULL); \
296 ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status); \
297 ok(objectInfo.HandleCount == (hdlcnt), "HandleCount = %lu, expected %lu\n", objectInfo.HandleCount, (ULONG)(hdlcnt)); \
298 ok(objectInfo.PointerCount == (ptrcnt), "PointerCount = %lu, expected %lu\n", objectInfo.PointerCount, (ULONG)(ptrcnt));
309 ok(baseRefs == 4,
"Window station initially has %lu references, expected 4\n", baseRefs);
314 ok(hwinsta2 !=
NULL &&
error == 0xfeedf00d,
"Got 0x%p, 0x%lx\n", hwinsta,
error);
324 ok(hwinsta2 !=
NULL &&
error == 0xfeedf00d,
"Got 0x%p, 0x%lx\n", hwinsta,
error);
337 ok(hdesk !=
NULL &&
error == 0xfeedf00d,
"Got 0x%p, 0x%lx\n", hdesk,
error);
374 ok(hdesk !=
NULL &&
error == 0xfeedf00d,
"Got 0x%p, 0x%lx\n", hdesk,
error);
387 ok (hdesk1 != hdesk,
"Expected the new desktop not to be the thread desktop\n");
391 ok(baseRefs == 8,
"Desktop initially has %lu references, expected 8\n", baseRefs);
static void startup(void)
static struct sockaddr_in sa
#define ERROR_INVALID_FUNCTION
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define ERROR_FILE_NOT_FOUND
#define sprintf(buf, format,...)
void do_InitialDesktop_child(int i)
#define check_ref(handle, hdlcnt, ptrcnt)
HWINSTA CreateInheritableWinsta(WCHAR *name, ACCESS_MASK dwDesiredAccess, BOOL inheritable, DWORD *error)
void test_CreateProcessWithDesktop(int i, char *argv0, char *Desktop, DWORD expectedExitCode)
void Test_OpenInputDesktop()
static HDESK create_desk(PCWSTR deskName, DWORD *error)
static HWINSTA open_winsta(PCWSTR winstaName, DWORD *error)
static void Test_References(void)
static HDESK open_desk(PCWSTR deskName, DWORD *error)
static HWINSTA create_winsta(PCWSTR winstaName, DWORD *error)
static struct test_info TestResults[]
void Test_InitialDesktop(char *argv0)
HDESK CreateInheritableDesktop(WCHAR *name, ACCESS_MASK dwDesiredAccess, BOOL inheritable, DWORD *error)
#define DESKTOP_ALL_ACCESS
#define STATUS_DLL_INIT_FAILED
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
int winetest_get_mainargs(char ***pargv)
static char argv0[MAX_PATH]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HDESK WINAPI CreateDesktopW(LPCWSTR lpszDesktop, LPCWSTR lpszDevice, LPDEVMODEW pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
BOOL WINAPI IsGUIThread(BOOL bConvert)
DWORD WINAPI GetLastError(void)
#define STARTF_USESHOWWINDOW
DWORD WINAPI GetCurrentThreadId(void)
HWINSTA WINAPI GetProcessWindowStation(void)
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
HDESK WINAPI OpenDesktopW(_In_ LPCWSTR, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
HWINSTA WINAPI CreateWindowStationW(_In_opt_ LPCWSTR lpwinsta, _In_ DWORD dwFlags, _In_ ACCESS_MASK dwDesiredAccess, _In_opt_ LPSECURITY_ATTRIBUTES lpsa)
HDESK WINAPI OpenInputDesktop(_In_ DWORD, _In_ BOOL, _In_ DWORD)
HWINSTA WINAPI OpenWindowStationW(_In_ LPCWSTR, _In_ BOOL, _In_ DWORD)
BOOL WINAPI CloseWindowStation(_In_ HWINSTA)
BOOL WINAPI SetProcessWindowStation(_In_ HWINSTA)
#define WINSTA_ALL_ACCESS
BOOL WINAPI GetUserObjectInformationW(_In_ HANDLE hObj, _In_ int nIndex, _Out_writes_bytes_opt_(nLength) PVOID pvInfo, _In_ DWORD nLength, _Out_opt_ LPDWORD lpnLengthNeeded)
BOOL WINAPI CloseDesktop(_In_ HDESK)