2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis
18 /***********************************************************************
19 * GetCurrentThreadId (KERNEL32.200)
22 int GetCurrentThreadId(void)
27 /***********************************************************************
28 * GetThreadContext (KERNEL32.294)
30 BOOL
GetThreadContext(HANDLE hThread
, void *lpContext
)
34 /***********************************************************************
35 * GetCurrentThread (KERNEL32.200)
37 HANDLE
GetCurrentThread(void)
42 /**********************************************************************
43 * Critical Sections are currently ignored
45 void InitializeCriticalSection(CRITICAL_SECTION
*lpCrit
)
47 memset(lpCrit
,0,sizeof(CRITICAL_SECTION
));
50 void EnterCriticalSection(CRITICAL_SECTION
* lpCrit
)
52 if (lpCrit
->LockCount
)
53 fprintf( stderr
, "Error: re-entering critical section %08lx\n",
58 void LeaveCriticalSection(CRITICAL_SECTION
* lpCrit
)
60 if (!lpCrit
->LockCount
)
61 fprintf( stderr
, "Error: leaving critical section %08lx again\n",
66 void DeleteCriticalSection(CRITICAL_SECTION
* lpCrit
)
71 /***********************************************************************
72 * Tls is available only for the single thread
75 static int TlsCount
=0;
81 Tls
=xmalloc(sizeof(LPVOID
));
84 Tls
=xrealloc(Tls
,sizeof(LPVOID
)*(++TlsCount
));
88 void TlsFree(DWORD index
)
90 /*FIXME: should remember that it has been freed */
94 LPVOID
TlsGetValue(DWORD index
)
98 /* FIXME: Set last error*/
104 void TlsSetValue(DWORD index
,LPVOID value
)
108 /* FIXME: Set last error*/