kernel32: Added session id tests.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
888d1c67bb
commit
e4e1b89732
|
@ -77,6 +77,8 @@ static BOOL (WINAPI *pSetInformationJobObject)(HANDLE job, JOBOBJECTINFOCLASS
|
||||||
static HANDLE (WINAPI *pCreateIoCompletionPort)(HANDLE file, HANDLE existing_port, ULONG_PTR key, DWORD threads);
|
static HANDLE (WINAPI *pCreateIoCompletionPort)(HANDLE file, HANDLE existing_port, ULONG_PTR key, DWORD threads);
|
||||||
static BOOL (WINAPI *pGetNumaProcessorNode)(UCHAR, PUCHAR);
|
static BOOL (WINAPI *pGetNumaProcessorNode)(UCHAR, PUCHAR);
|
||||||
static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
|
static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
|
||||||
|
static BOOL (WINAPI *pProcessIdToSessionId)(DWORD,DWORD*);
|
||||||
|
static DWORD (WINAPI *pWTSGetActiveConsoleSessionId)(void);
|
||||||
|
|
||||||
/* ############################### */
|
/* ############################### */
|
||||||
static char base[MAX_PATH];
|
static char base[MAX_PATH];
|
||||||
|
@ -233,6 +235,8 @@ static BOOL init(void)
|
||||||
pSetInformationJobObject = (void *)GetProcAddress(hkernel32, "SetInformationJobObject");
|
pSetInformationJobObject = (void *)GetProcAddress(hkernel32, "SetInformationJobObject");
|
||||||
pCreateIoCompletionPort = (void *)GetProcAddress(hkernel32, "CreateIoCompletionPort");
|
pCreateIoCompletionPort = (void *)GetProcAddress(hkernel32, "CreateIoCompletionPort");
|
||||||
pGetNumaProcessorNode = (void *)GetProcAddress(hkernel32, "GetNumaProcessorNode");
|
pGetNumaProcessorNode = (void *)GetProcAddress(hkernel32, "GetNumaProcessorNode");
|
||||||
|
pProcessIdToSessionId = (void *)GetProcAddress(hkernel32, "ProcessIdToSessionId");
|
||||||
|
pWTSGetActiveConsoleSessionId = (void *)GetProcAddress(hkernel32, "WTSGetActiveConsoleSessionId");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2788,6 +2792,25 @@ static void test_GetNumaProcessorNode(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_session_info(void)
|
||||||
|
{
|
||||||
|
DWORD session_id, active_session;
|
||||||
|
BOOL r;
|
||||||
|
|
||||||
|
if (!pProcessIdToSessionId)
|
||||||
|
{
|
||||||
|
win_skip("ProcessIdToSessionId is missing\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = pProcessIdToSessionId(GetCurrentProcessId(), &session_id);
|
||||||
|
ok(r, "ProcessIdToSessionId failed: %u\n", GetLastError());
|
||||||
|
trace("session_id = %x\n", session_id);
|
||||||
|
|
||||||
|
active_session = pWTSGetActiveConsoleSessionId();
|
||||||
|
trace("active_session = %x\n", active_session);
|
||||||
|
}
|
||||||
|
|
||||||
static void test_process_info(void)
|
static void test_process_info(void)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
@ -2994,6 +3017,8 @@ START_TEST(process)
|
||||||
test_DuplicateHandle();
|
test_DuplicateHandle();
|
||||||
test_StartupNoConsole();
|
test_StartupNoConsole();
|
||||||
test_GetNumaProcessorNode();
|
test_GetNumaProcessorNode();
|
||||||
|
test_session_info();
|
||||||
|
|
||||||
/* things that can be tested:
|
/* things that can be tested:
|
||||||
* lookup: check the way program to be executed is searched
|
* lookup: check the way program to be executed is searched
|
||||||
* handles: check the handle inheritance stuff (+sec options)
|
* handles: check the handle inheritance stuff (+sec options)
|
||||||
|
|
Loading…
Reference in New Issue