2878 #include "pshpack1.h" 2894 #include "poppack.h" 2898 DWORD ret, target_offset, old_prot;
2911 #if !defined(__i386__) && !defined(__x86_64__) 2912 skip(
"x86 specific ExitProcess test\n");
2916 if (!pRtlDllShutdownInProgress)
2918 win_skip(
"RtlDllShutdownInProgress is not available on this platform (XP+)\n");
2921 if (!pNtQueryInformationProcess || !pNtSetInformationProcess)
2923 win_skip(
"NtQueryInformationProcess/NtSetInformationProcess are not available on this platform\n");
2926 if (!pNtAllocateVirtualMemory || !pNtFreeVirtualMemory)
2928 win_skip(
"NtAllocateVirtualMemory/NtFreeVirtualMemory are not available on this platform\n");
2942 ok(0,
"could not create %s\n", dll_name);
3002 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3020 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3038 ok(
ret == 197,
"expected exit code 197, got %u\n",
ret);
3056 ok(
ret == 195,
"expected exit code 195, got %u\n",
ret);
3066 if (pLdrLockLoaderLock && pLdrUnlockLoaderLock)
3076 ok(
ret == 198,
"expected exit code 198, got %u\n",
ret);
3086 win_skip(
"LdrLockLoaderLock/LdrUnlockLoaderLock are not available on this platform\n");
3089 if (pRtlAcquirePebLock && pRtlReleasePebLock)
3099 trace(
"terminating child process\n");
3105 ok(
ret == 199,
"expected exit code 199, got %u\n",
ret);
3115 win_skip(
"RtlAcquirePebLock/RtlReleasePebLock are not available on this platform\n");
3126 trace(
"terminating child process\n");
3152 ok(old_prot ==
PAGE_READWRITE,
"expected PAGE_READWRITE, got %#x\n", old_prot);
3160 ok(
size == 4,
"expected 4, got %lu\n",
size);
3177 ok(!
ret,
"NtMapViewOfSection error %#x\n",
ret);
3178 ret = pNtUnmapViewOfSection(
pi.hProcess,
addr);
3179 ok(!
ret,
"NtUnmapViewOfSection error %#x\n",
ret);
3205 ok(
ret == 199,
"expected exit code 199, got %u\n",
ret);
3223 ok(!
ret,
"NtQueryInformationProcess error %#x\n",
ret);
3224 ok(
pbi.ExitStatus == 198,
"expected 198, got %lu\n",
pbi.ExitStatus);
3237 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
3246 "expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
3260 "expected ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
3269 "expected ERROR_ACCESS_DENIED, got %d\n",
GetLastError());
3272 ok(!
ret,
"VirtualProtectEx should fail\n");
3277 ok(!
ret,
"ReadProcessMemory should fail\n");
3279 "expected ERROR_PARTIAL_COPY, got %d\n",
GetLastError());
3283 ok(!
ret,
"VirtualFreeEx should fail\n");
3287 ok(!
addr,
"VirtualAllocEx should fail\n");
3291 ok(!
size,
"VirtualQueryEx should fail\n");
3301 ok(
ret,
"CloseHandle should not fail\n");
3307 ok(!
ret,
"DuplicateHandle should fail\n");
3320 ok(!
thread,
"CreateRemoteThread should fail\n");
3325 ok(!
ret,
"DebugActiveProcess should fail\n");
3331 "expected exit code 198, got %u\n",
ret);
#define ERROR_INVALID_PARAMETER
UINT WINAPI SetErrorMode(IN UINT uMode)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static const char filler[0x1000]
void winetest_add_failures(LONG new_failures)
BOOL WINAPI SetThreadContext(IN HANDLE hThread, IN CONST CONTEXT *lpContext)
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
#define SEM_FAILCRITICALERRORS
#define ERROR_INVALID_FUNCTION
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
struct _IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER
#define IMAGE_SCN_MEM_READ
LPVOID NTAPI VirtualAllocEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
static IMAGE_DOS_HEADER dos_header
#define ReadProcessMemory(a, b, c, d, e)
#define sprintf(buf, format,...)
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
GLenum GLuint GLenum GLsizei const GLchar * buf
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
#define DUPLICATE_SAME_ACCESS
#define ERROR_ACCESS_DENIED
#define PROCESS_ALL_ACCESS_NT4
#define ERROR_PARTIAL_COPY
static const IMAGE_NT_HEADERS nt_header_template
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
_Inout_ PERBANDINFO * pbi
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
SIZE_T NTAPI VirtualQueryEx(IN HANDLE hProcess, IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
struct _IMAGE_OPTIONAL_HEADER IMAGE_OPTIONAL_HEADER
static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
#define CreateFileMappingW(a, b, c, d, e, f)
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)
#define STATUS_PROCESS_IS_TERMINATING
#define IMAGE_FILE_EXECUTABLE_IMAGE
BOOL NTAPI VirtualFreeEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
int winetest_get_mainargs(char ***pargv)
GLenum const GLvoid * addr
#define IMAGE_SCN_CNT_CODE
#define GetCurrentProcess()
static const char section_data[0x10]
BOOL NTAPI VirtualProtectEx(IN HANDLE hProcess, IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
#define FIELD_OFFSET(t, f)
static LONG * child_failures
#define ERROR_NOT_SUPPORTED
#define IMAGE_FILE_RELOCS_STRIPPED
BOOL WINAPI DebugActiveProcess(IN DWORD dwProcessId)
#define ERROR_GEN_FAILURE
#define CreateFileA(a, b, c, d, e, f, g)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
static IMAGE_NT_HEADERS32 nt_header
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
#define IMAGE_SCN_MEM_EXECUTE
HANDLE WINAPI CreateRemoteThread(IN HANDLE hProcess, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)