Commit 22549866 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

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

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