1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
/*
* windows.h
*
* NOT THE REAL windows.h. We're not necessarily concerned
* that value are correct. Just that the types are defined.
*
*/
#define WINAPI
#define CONST const
#define DLL_THREAD_ATTACH 0
#define DLL_THREAD_DETACH 1
#define DLL_PROCESS_ATTACH 2
#define DLL_PROCESS_DETACH 3
/* Error numbers */
enum {
EINVAL,
ENOMEM,
ENOSYS,
EAGAIN
};
typedef void VOID;
typedef int BOOL;
typedef unsigned long DWORD;
typedef unsigned long ULONG;
typedef void * LPVOID;
typedef DWORD * LPDWORD;
typedef char * LPCTSTR;
typedef unsigned long HANDLE;
typedef HANDLE HINSTANCE;
typedef void * LPSECURITY_ATTRIBUTES;
typedef int CRITICAL_SECTION;
typedef CRITICAL_SECTION * LPCRITICAL_SECTION;
HANDLE CreateEvent(LPSECURITY_ATTRIBUTES security,
BOOL manualReset,
BOOL initialState,
LPCTSTR name);
BOOL SetEvent(HANDLE event);
BOOL ResetEvent(HANDLE event);
VOID EnterCriticalSection(LPCRITICAL_SECTION criticalSection);
VOID LeaveCriticalSection(LPCRITICAL_SECTION criticalSection);
VOID DeleteCriticalSection(LPCRITICAL_SECTION criticalSection);
VOID InitializeCriticalSection(LPCRITICAL_SECTION criticalSection);
VOID TryEnterCriticalSection(LPCRITICAL_SECTION criticalSection);
DWORD WaitForMultipleObjects(DWORD numObjects,
CONST HANDLE * objectArray,
BOOL waitForAll,
DWORD timeout);
DWORD WaitForSingleObject(HANDLE object,
DWORD timeout);
DWORD TlsAlloc();
BOOL TlsFree(DWORD index);
BOOL TlsSetValue(DWORD index, LPVOID value);
BOOL TlsSetValue(DWORD index, LPVOID value);
BOOL SetThreadPriority(HANDLE threadHandle, int priority);
int GetThreadPriority(HANDLE threadHandle);
HANDLE _beginthreadex(LPSECURITY_ATTRIBUTES security,
DWORD stack,
unsigned (* start_routine)(void *),
LPVOID param,
DWORD flags,
LPDWORD threadID);
VOID _endthreadex(DWORD);
DWORD GetVersion(VOID);
|