#include <errno.h>
#include <stdarg.h>
#include <process.h>
#include <windef.h>
#include <winbase.h>
#include "wine/test.h"
#include "threaddll.h"
Go to the source code of this file.
◆ _beginthread_start_routine_t
◆ _beginthreadex_start_routine_t
◆ beginthread_method
| Enumerator |
|---|
| use_beginthread | |
| use_beginthreadex | |
Definition at line 32 of file thread.c.
◆ get_thread_dll_path()
| static char * get_thread_dll_path |
( |
void |
| ) |
|
|
static |
Definition at line 38 of file thread.c.
39{
41 const char dll_name[] = "threaddll.dll";
46
49
53
60
62}
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ set_thead_dll_detach_event()
◆ START_TEST()
Definition at line 173 of file thread.c.
174{
177
182
185
187}
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
static void test_thread_library_reference(char *thread_dll, enum beginthread_method beginthread_method, enum thread_exit_method exit_method)
static char * get_thread_dll_path(void)
static void test_thread_invalid_params(void)
@ thread_exit_endthreadex
◆ test_invalid_parameter_handler()
Definition at line 142 of file thread.c.
147{
149}
static BOOL handler_called
◆ test_thread_invalid_params()
| static void test_thread_invalid_params |
( |
void |
| ) |
|
|
static |
Definition at line 151 of file thread.c.
152{
155
162
169
171}
static void test_invalid_parameter_handler(void)
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
_CRTIMP uintptr_t __cdecl _beginthread(_In_ void(__cdecl *_StartAddress)(void *), _In_ unsigned _StackSize, _In_opt_ void *_ArgList)
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler)
void(__cdecl * _invalid_parameter_handler)(const wchar_t *, const wchar_t *, const wchar_t *, unsigned int, uintptr_t)
Referenced by START_TEST().
◆ test_thread_library_reference()
Definition at line 72 of file thread.c.
75{
81
83
90
93
95
97 {
101 }
102 else
103 {
107 }
108
109 ok(thread_handle != -1 && thread_handle != 0,
"Failed to begin thread: %u\n",
errno);
110
113
116
119
122
124 {
127 }
128
131
134
138}
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
static void set_thead_dll_detach_event(HANDLE dll, HANDLE event)
unsigned int(__stdcall * _beginthreadex_start_routine_t)(void *)
void(__cdecl * _beginthread_start_routine_t)(void *)
enum thread_exit_method exit_method
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
static HANDLE detach_event
Referenced by START_TEST().
◆ handler_called