kernel32/tests: Use inline implementation of NtCurrentTeb for process tests.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-07-18 16:24:59 +02:00 committed by Alexandre Julliard
parent e5fb775142
commit 225498662e
1 changed files with 5 additions and 17 deletions

View File

@ -70,7 +70,6 @@ static BOOL (WINAPI *pVirtualFreeEx)(HANDLE, LPVOID, SIZE_T, DWORD);
static BOOL (WINAPI *pQueryFullProcessImageNameA)(HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD lpdwSize);
static BOOL (WINAPI *pQueryFullProcessImageNameW)(HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD lpdwSize);
static DWORD (WINAPI *pK32GetProcessImageFileNameA)(HANDLE,LPSTR,DWORD);
static struct _TEB * (WINAPI *pNtCurrentTeb)(void);
static HANDLE (WINAPI *pCreateJobObjectW)(LPSECURITY_ATTRIBUTES sa, LPCWSTR name);
static BOOL (WINAPI *pAssignProcessToJobObject)(HANDLE job, HANDLE process);
static BOOL (WINAPI *pIsProcessInJob)(HANDLE process, HANDLE job, PBOOL result);
@ -226,7 +225,6 @@ static BOOL init(void)
hkernel32 = GetModuleHandleA("kernel32");
hntdll = GetModuleHandleA("ntdll.dll");
pNtCurrentTeb = (void *)GetProcAddress(hntdll, "NtCurrentTeb");
pNtQueryInformationProcess = (void *)GetProcAddress(hntdll, "NtQueryInformationProcess");
pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo");
@ -297,6 +295,7 @@ static void WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...
*/
static void doChild(const char* file, const char* option)
{
RTL_USER_PROCESS_PARAMETERS *params = NtCurrentTeb()->Peb->ProcessParameters;
STARTUPINFOA siA;
STARTUPINFOW siW;
int i;
@ -325,15 +324,10 @@ static void doChild(const char* file, const char* option)
siA.dwFlags, siA.wShowWindow,
(DWORD_PTR)siA.hStdInput, (DWORD_PTR)siA.hStdOutput, (DWORD_PTR)siA.hStdError);
if (pNtCurrentTeb)
{
RTL_USER_PROCESS_PARAMETERS *params = pNtCurrentTeb()->Peb->ProcessParameters;
/* check the console handles in the TEB */
childPrintf(hFile, "[TEB]\nhStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
(DWORD_PTR)params->hStdInput, (DWORD_PTR)params->hStdOutput,
(DWORD_PTR)params->hStdError);
}
/* check the console handles in the TEB */
childPrintf(hFile, "[TEB]\nhStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
(DWORD_PTR)params->hStdInput, (DWORD_PTR)params->hStdOutput,
(DWORD_PTR)params->hStdError);
/* since GetStartupInfoW is only implemented in win2k,
* zero out before calling so we can notice the difference
@ -2874,12 +2868,6 @@ static void test_StartupNoConsole(void)
STARTUPINFOA startup;
PROCESS_INFORMATION info;
if (!pNtCurrentTeb)
{
win_skip( "NtCurrentTeb not supported\n" );
return;
}
memset(&startup, 0, sizeof(startup));
startup.cb = sizeof(startup);
startup.dwFlags = STARTF_USESHOWWINDOW;