4 * Copyright 1996 Alexandre Julliard
9 #include "wine/winbase16.h"
17 #include "selectors.h"
20 #include "stackframe.h"
29 static void THREAD_Destroy( K32OBJ *obj );
31 const K32OBJ_OPS THREAD_Ops =
33 THREAD_Destroy /* destroy */
36 /* Is threading code initialized? */
37 BOOL32 THREAD_InitDone = FALSE;
40 /***********************************************************************
43 * Return the current thread THDB pointer.
45 THDB *THREAD_Current(void)
47 if (!THREAD_InitDone) return NULL;
48 return (THDB *)((char *)NtCurrentTeb() - (int)&((THDB *)0)->teb);
51 /***********************************************************************
54 BOOL32 THREAD_IsWin16( THDB *thdb )
56 if (!thdb || !thdb->process)
60 TDB* pTask = (TDB*)GlobalLock16( thdb->process->task );
61 return !pTask || pTask->thdb == thdb;
65 /***********************************************************************
68 * Convert a thread id to a THDB, making sure it is valid.
70 THDB *THREAD_IdToTHDB( DWORD id )
74 if (!id) return THREAD_Current();
75 thdb = THREAD_ID_TO_THDB( id );
76 if (!K32OBJ_IsValid( &thdb->header, K32OBJ_THREAD ))
78 /* Allow task handles to be used; convert to main thread */
81 TDB *pTask = (TDB *)GlobalLock16( id );
82 if (pTask) return pTask->thdb;
85 SetLastError( ERROR_INVALID_PARAMETER );
92 /***********************************************************************
95 * Add a thread to a queue.
97 void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread )
99 THREAD_ENTRY *entry = HeapAlloc( SystemHeap, HEAP_NO_SERIALIZE,
103 entry->thread = thread;
106 entry->next = (*queue)->next;
107 (*queue)->next = entry;
109 else entry->next = entry;
114 /***********************************************************************
117 * Remove a thread from a queue.
119 void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread )
121 THREAD_ENTRY *entry = *queue;
123 if (entry->next == entry) /* Only one element in the queue */
125 assert( entry->thread == thread );
131 while (entry->next->thread != thread)
134 assert( entry != *queue ); /* Have we come all the way around? */
136 if ((next = entry->next) == *queue) *queue = entry;
137 entry->next = entry->next->next;
138 entry = next; /* This is the one we want to free */
140 HeapFree( SystemHeap, 0, entry );
145 /***********************************************************************
148 THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size, BOOL32 alloc_stack16,
149 int *server_thandle, int *server_phandle,
150 LPTHREAD_START_ROUTINE start_addr, LPVOID param )
154 THDB *thdb = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, sizeof(THDB) );
155 if (!thdb) return NULL;
156 thdb->header.type = K32OBJ_THREAD;
157 thdb->header.refcount = 1;
159 thdb->teb.except = (void *)-1;
160 thdb->teb.htask16 = 0; /* FIXME */
161 thdb->teb.self = &thdb->teb;
162 thdb->teb.flags = (pdb->flags & PDB32_WIN16_PROC)? 0 : TEBF_WIN32;
163 thdb->teb.tls_ptr = thdb->tls_array;
164 thdb->teb.process = pdb;
165 thdb->wait_list = &thdb->wait_struct;
166 thdb->exit_code = 0x103; /* STILL_ACTIVE */
167 thdb->entry_point = start_addr;
168 thdb->entry_arg = param;
171 /* Allocate the stack */
174 * If stacksize smaller than 1 MB, allocate 1MB
175 * (one program wanted only 10 kB, which is recommendable, but some WINE
176 * functions, noteably in the files subdir, push HUGE structures and
177 * arrays on the stack. They probably shouldn't.)
178 * If stacksize larger than 16 MB, warn the user. (We could shrink the stack
179 * but this could give more or less unexplainable crashes.)
181 if (stack_size<1024*1024)
182 stack_size = 1024 * 1024;
183 if (stack_size >= 16*1024*1024)
184 WARN(thread,"Thread stack size is %ld MB.\n",stack_size/1024/1024);
185 thdb->stack_base = VirtualAlloc(NULL,
186 stack_size + (alloc_stack16 ? 0x10000 : 0),
187 MEM_COMMIT, PAGE_EXECUTE_READWRITE );
188 if (!thdb->stack_base) goto error;
189 /* Set a guard page at the bottom of the stack */
190 VirtualProtect( thdb->stack_base, 1, PAGE_EXECUTE_READWRITE | PAGE_GUARD,
192 thdb->teb.stack_top = (char *)thdb->stack_base + stack_size;
193 thdb->teb.stack_low = thdb->stack_base;
194 thdb->exit_stack = thdb->teb.stack_top;
196 /* Allocate the TEB selector (%fs register) */
198 thdb->teb_sel = SELECTOR_AllocBlock( &thdb->teb, 0x1000, SEGMENT_DATA,
200 if (!thdb->teb_sel) goto error;
202 /* Allocate the 16-bit stack selector */
206 thdb->teb.stack_sel = SELECTOR_AllocBlock( thdb->teb.stack_top,
207 0x10000, SEGMENT_DATA,
209 if (!thdb->teb.stack_sel) goto error;
210 thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR( thdb->teb.stack_sel,
211 0x10000 - sizeof(STACK16FRAME) );
214 /* Create the thread socket */
216 if (CLIENT_NewThread( thdb, server_thandle, server_phandle )) goto error;
218 /* Add thread to process's list of threads */
220 THREAD_AddQueue( &pdb->thread_list, thdb );
222 /* Create the thread event */
224 if (!(thdb->event = CreateEvent32A( NULL, FALSE, FALSE, NULL ))) goto error;
225 thdb->event = ConvertToGlobalHandle( thdb->event );
231 if (thdb->socket != -1) close( thdb->socket );
232 if (thdb->event) CloseHandle( thdb->event );
233 if (thdb->teb.stack_sel) SELECTOR_FreeBlock( thdb->teb.stack_sel, 1 );
234 if (thdb->teb_sel) SELECTOR_FreeBlock( thdb->teb_sel, 1 );
235 if (thdb->stack_base) VirtualFree( thdb->stack_base, 0, MEM_RELEASE );
236 HeapFree( SystemHeap, 0, thdb );
241 /***********************************************************************
244 static void THREAD_Destroy( K32OBJ *ptr )
246 THDB *thdb = (THDB *)ptr;
248 assert( ptr->type == K32OBJ_THREAD );
249 ptr->type = K32OBJ_UNKNOWN;
251 /* Free the associated memory */
255 /* Check if we are deleting the current thread */
258 if (fs == thdb->teb_sel)
265 CloseHandle( thdb->event );
266 close( thdb->socket );
267 SELECTOR_FreeBlock( thdb->teb_sel, 1 );
268 if (thdb->teb.stack_sel) SELECTOR_FreeBlock( thdb->teb.stack_sel, 1 );
269 HeapFree( SystemHeap, 0, thdb );
274 /***********************************************************************
277 * Start execution of a newly created thread. Does not return.
279 void THREAD_Start( THDB *thdb )
281 LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)thdb->entry_point;
282 assert( THREAD_Current() == thdb );
284 MODULE_InitializeDLLs( thdb->process, 0, DLL_THREAD_ATTACH, NULL );
285 ExitThread( func( thdb->entry_arg ) );
289 /***********************************************************************
290 * CreateThread (KERNEL32.63)
292 HANDLE32 WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
293 LPTHREAD_START_ROUTINE start, LPVOID param,
294 DWORD flags, LPDWORD id )
296 int server_handle = -1;
297 HANDLE32 handle = INVALID_HANDLE_VALUE32;
298 BOOL32 inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
300 THDB *thread = THREAD_Create( PROCESS_Current(), stack,
301 TRUE, &server_handle, NULL, start, param );
302 if (!thread) return INVALID_HANDLE_VALUE32;
303 handle = HANDLE_Alloc( PROCESS_Current(), &thread->header,
304 THREAD_ALL_ACCESS, inherit, server_handle );
305 if (handle == INVALID_HANDLE_VALUE32) goto error;
306 if (SYSDEPS_SpawnThread( thread ) == -1) goto error;
307 if (id) *id = THDB_TO_THREAD_ID( thread );
311 if (handle != INVALID_HANDLE_VALUE32) CloseHandle( handle );
312 K32OBJ_DecCount( &thread->header );
313 return INVALID_HANDLE_VALUE32;
317 /***********************************************************************
318 * ExitThread [KERNEL32.215] Ends a thread
323 void WINAPI ExitThread(
324 DWORD code) /* [in] Exit code for this thread */
326 THDB *thdb = THREAD_Current();
329 /* Remove thread from process's list */
330 THREAD_RemoveQueue( &thdb->process->thread_list, thdb );
332 MODULE_InitializeDLLs( thdb->process, 0, DLL_THREAD_DETACH, NULL );
335 thdb->exit_code = code;
337 /* cleanup the message queue, if there's one */
339 USER_QueueCleanup( thdb->teb.queue );
341 /* FIXME: should free the stack somehow */
343 /* FIXME: We cannot do this; once the current thread is destroyed,
344 synchronization primitives do not work properly. */
345 K32OBJ_DecCount( &thdb->header );
347 /* Completely unlock the system lock just in case */
348 count = SYSTEM_LOCK_COUNT();
349 while (count--) SYSTEM_UNLOCK();
350 SYSDEPS_ExitThread();
354 /***********************************************************************
355 * GetCurrentThread [KERNEL32.200] Gets pseudohandle for current thread
358 * Pseudohandle for the current thread
360 HANDLE32 WINAPI GetCurrentThread(void)
362 return CURRENT_THREAD_PSEUDOHANDLE;
366 /***********************************************************************
367 * GetCurrentThreadId [KERNEL32.201] Returns thread identifier.
370 * Thread identifier of calling thread
372 DWORD WINAPI GetCurrentThreadId(void)
374 return THDB_TO_THREAD_ID( THREAD_Current() );
378 /**********************************************************************
379 * GetLastError [KERNEL.148] [KERNEL32.227] Returns last-error code.
382 * Calling thread's last error code value.
384 DWORD WINAPI GetLastError(void)
386 THDB *thread = THREAD_Current();
387 DWORD ret = thread->last_error;
388 TRACE(thread,"0x%lx\n",ret);
393 /**********************************************************************
394 * SetLastError [KERNEL.147] [KERNEL32.497] Sets the last-error code.
399 void WINAPI SetLastError(
400 DWORD error) /* [in] Per-thread error code */
402 THDB *thread = THREAD_Current();
403 /* This one must work before we have a thread (FIXME) */
405 TRACE(thread,"%p error=0x%lx\n",thread,error);
408 thread->last_error = error;
412 /**********************************************************************
413 * SetLastErrorEx [USER32.485] Sets the last-error code.
418 void WINAPI SetLastErrorEx(
419 DWORD error, /* [in] Per-thread error code */
420 DWORD type) /* [in] Error type */
422 TRACE(thread, "(0x%08lx, 0x%08lx)\n", error,type);
429 /* Fall through for now */
431 FIXME(thread, "(error=%08lx, type=%08lx): Unhandled type\n", error,type);
434 SetLastError( error );
438 /**********************************************************************
441 DWORD THREAD_TlsAlloc(THDB *thread)
443 DWORD i, mask, ret = 0;
444 DWORD *bits = thread->process->tls_bits;
445 EnterCriticalSection( &thread->process->crit_section );
446 if (*bits == 0xffffffff)
450 if (*bits == 0xffffffff)
452 LeaveCriticalSection( &thread->process->crit_section );
453 SetLastError( ERROR_NO_MORE_ITEMS );
457 for (i = 0, mask = 1; i < 32; i++, mask <<= 1) if (!(*bits & mask)) break;
459 LeaveCriticalSection( &thread->process->crit_section );
464 /**********************************************************************
465 * TlsAlloc [KERNEL32.530] Allocates a TLS index.
467 * Allocates a thread local storage index
471 * Failure: 0xFFFFFFFF
473 DWORD WINAPI TlsAlloc(void)
475 return THREAD_TlsAlloc(THREAD_Current());
479 /**********************************************************************
480 * TlsFree [KERNEL32.531] Releases a TLS index.
482 * Releases a thread local storage index, making it available for reuse
488 BOOL32 WINAPI TlsFree(
489 DWORD index) /* [in] TLS Index to free */
492 THDB *thread = THREAD_Current();
493 DWORD *bits = thread->process->tls_bits;
496 SetLastError( ERROR_INVALID_PARAMETER );
499 EnterCriticalSection( &thread->process->crit_section );
500 if (index >= 32) bits++;
501 mask = (1 << (index & 31));
502 if (!(*bits & mask)) /* already free? */
504 LeaveCriticalSection( &thread->process->crit_section );
505 SetLastError( ERROR_INVALID_PARAMETER );
509 thread->tls_array[index] = 0;
510 /* FIXME: should zero all other thread values */
511 LeaveCriticalSection( &thread->process->crit_section );
516 /**********************************************************************
517 * TlsGetValue [KERNEL32.532] Gets value in a thread's TLS slot
520 * Success: Value stored in calling thread's TLS slot for index
521 * Failure: 0 and GetLastError returns NO_ERROR
523 LPVOID WINAPI TlsGetValue(
524 DWORD index) /* [in] TLS index to retrieve value for */
526 THDB *thread = THREAD_Current();
529 SetLastError( ERROR_INVALID_PARAMETER );
532 SetLastError( ERROR_SUCCESS );
533 return thread->tls_array[index];
537 /**********************************************************************
538 * TlsSetValue [KERNEL32.533] Stores a value in the thread's TLS slot.
544 BOOL32 WINAPI TlsSetValue(
545 DWORD index, /* [in] TLS index to set value for */
546 LPVOID value) /* [in] Value to be stored */
548 THDB *thread = THREAD_Current();
551 SetLastError( ERROR_INVALID_PARAMETER );
554 thread->tls_array[index] = value;
559 /***********************************************************************
560 * SetThreadContext [KERNEL32.670] Sets context of thread.
566 BOOL32 WINAPI SetThreadContext(
567 HANDLE32 handle, /* [in] Handle to thread with context */
568 CONTEXT *context) /* [out] Address of context structure */
570 FIXME( thread, "not implemented\n" );
574 /***********************************************************************
575 * GetThreadContext [KERNEL32.294] Retrieves context of thread.
581 BOOL32 WINAPI GetThreadContext(
582 HANDLE32 handle, /* [in] Handle to thread with context */
583 CONTEXT *context) /* [out] Address of context structure */
587 FIXME( thread, "returning dummy info\n" );
589 /* make up some plausible values for segment registers */
602 /**********************************************************************
603 * GetThreadPriority [KERNEL32.296] Returns priority for thread.
606 * Success: Thread's priority level.
607 * Failure: THREAD_PRIORITY_ERROR_RETURN
609 INT32 WINAPI GetThreadPriority(
610 HANDLE32 hthread) /* [in] Handle to thread */
612 struct get_thread_info_request req;
613 struct get_thread_info_reply reply;
614 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
615 K32OBJ_THREAD, THREAD_QUERY_INFORMATION );
616 CLIENT_SendRequest( REQ_GET_THREAD_INFO, -1, 1, &req, sizeof(req) );
617 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL ))
618 return THREAD_PRIORITY_ERROR_RETURN;
619 return reply.priority;
623 /**********************************************************************
624 * SetThreadPriority [KERNEL32.514] Sets priority for thread.
630 BOOL32 WINAPI SetThreadPriority(
631 HANDLE32 hthread, /* [in] Handle to thread */
632 INT32 priority) /* [in] Thread priority level */
634 struct set_thread_info_request req;
635 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
636 K32OBJ_THREAD, THREAD_SET_INFORMATION );
637 if (req.handle == -1) return FALSE;
638 req.priority = priority;
639 req.mask = SET_THREAD_INFO_PRIORITY;
640 CLIENT_SendRequest( REQ_SET_THREAD_INFO, -1, 1, &req, sizeof(req) );
641 return !CLIENT_WaitReply( NULL, NULL, 0 );
645 /**********************************************************************
646 * SetThreadAffinityMask (KERNEL32.669)
648 DWORD WINAPI SetThreadAffinityMask( HANDLE32 hThread, DWORD dwThreadAffinityMask )
650 struct set_thread_info_request req;
651 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hThread,
652 K32OBJ_THREAD, THREAD_SET_INFORMATION );
653 if (req.handle == -1) return FALSE;
654 req.affinity = dwThreadAffinityMask;
655 req.mask = SET_THREAD_INFO_AFFINITY;
656 CLIENT_SendRequest( REQ_SET_THREAD_INFO, -1, 1, &req, sizeof(req) );
657 if (CLIENT_WaitReply( NULL, NULL, 0 )) return 0;
658 return 1; /* FIXME: should return previous value */
662 /**********************************************************************
663 * TerminateThread [KERNEL32.685] Terminates a thread
669 BOOL32 WINAPI TerminateThread(
670 HANDLE32 handle, /* [in] Handle to thread */
671 DWORD exitcode) /* [in] Exit code for thread */
673 struct terminate_thread_request req;
675 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), handle,
676 K32OBJ_THREAD, THREAD_TERMINATE );
677 req.exit_code = exitcode;
678 CLIENT_SendRequest( REQ_TERMINATE_THREAD, -1, 1, &req, sizeof(req) );
679 return !CLIENT_WaitReply( NULL, NULL, 0 );
683 /**********************************************************************
684 * GetExitCodeThread [KERNEL32.???] Gets termination status of thread.
690 BOOL32 WINAPI GetExitCodeThread(
691 HANDLE32 hthread, /* [in] Handle to thread */
692 LPDWORD exitcode) /* [out] Address to receive termination status */
694 struct get_thread_info_request req;
695 struct get_thread_info_reply reply;
696 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
697 K32OBJ_THREAD, THREAD_QUERY_INFORMATION );
698 CLIENT_SendRequest( REQ_GET_THREAD_INFO, -1, 1, &req, sizeof(req) );
699 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return FALSE;
700 if (exitcode) *exitcode = reply.exit_code;
705 /**********************************************************************
706 * ResumeThread [KERNEL32.587] Resumes a thread.
708 * Decrements a thread's suspend count. When count is zero, the
709 * execution of the thread is resumed.
712 * Success: Previous suspend count
713 * Failure: 0xFFFFFFFF
716 DWORD WINAPI ResumeThread(
717 HANDLE32 hthread) /* [in] Identifies thread to restart */
719 struct resume_thread_request req;
720 struct resume_thread_reply reply;
721 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
722 K32OBJ_THREAD, THREAD_SUSPEND_RESUME );
723 CLIENT_SendRequest( REQ_RESUME_THREAD, -1, 1, &req, sizeof(req) );
724 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return 0xffffffff;
729 /**********************************************************************
730 * SuspendThread [KERNEL32.681] Suspends a thread.
733 * Success: Previous suspend count
734 * Failure: 0xFFFFFFFF
736 DWORD WINAPI SuspendThread(
737 HANDLE32 hthread) /* [in] Handle to the thread */
739 struct suspend_thread_request req;
740 struct suspend_thread_reply reply;
741 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
742 K32OBJ_THREAD, THREAD_SUSPEND_RESUME );
743 CLIENT_SendRequest( REQ_SUSPEND_THREAD, -1, 1, &req, sizeof(req) );
744 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return 0xffffffff;
749 /***********************************************************************
750 * QueueUserAPC (KERNEL32.566)
752 DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE32 hthread, ULONG_PTR data )
754 struct queue_apc_request req;
755 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
756 K32OBJ_THREAD, THREAD_SET_CONTEXT );
758 req.param = (void *)data;
759 CLIENT_SendRequest( REQ_QUEUE_APC, -1, 1, &req, sizeof(req) );
760 return !CLIENT_WaitReply( NULL, NULL, 0 );
764 /**********************************************************************
765 * GetThreadTimes [KERNEL32.???] Obtains timing information.
768 * What are the fields where these values are stored?
774 BOOL32 WINAPI GetThreadTimes(
775 HANDLE32 thread, /* [in] Specifies the thread of interest */
776 LPFILETIME creationtime, /* [out] When the thread was created */
777 LPFILETIME exittime, /* [out] When the thread was destroyed */
778 LPFILETIME kerneltime, /* [out] Time thread spent in kernel mode */
779 LPFILETIME usertime) /* [out] Time thread spent in user mode */
781 FIXME(thread,"(0x%08x): stub\n",thread);
782 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
787 /**********************************************************************
788 * AttachThreadInput [KERNEL32.8] Attaches input of 1 thread to other
790 * Attaches the input processing mechanism of one thread to that of
798 * 1. Reset the Key State (currenly per thread key state is not maintained)
800 BOOL32 WINAPI AttachThreadInput(
801 DWORD idAttach, /* [in] Thread to attach */
802 DWORD idAttachTo, /* [in] Thread to attach to */
803 BOOL32 fAttach) /* [in] Attach or detach */
805 MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
808 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
810 /* A thread cannot attach to itself */
811 if ( idAttach == idAttachTo )
814 /* According to the docs this method should fail if a
815 * "Journal record" hook is installed. (attaches all input queues together)
817 if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
820 /* Retrieve message queues corresponding to the thread id's */
821 pTgtMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue( idAttach ) );
822 pSrcMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue( idAttachTo ) );
824 /* Ensure we have message queues and that Src and Tgt threads
825 * are not system threads.
827 if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
830 if (fAttach) /* Attach threads */
832 /* Only attach if currently detached */
833 if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
835 /* First release the target threads perQData */
836 PERQDATA_Release( pTgtMsgQ->pQData );
838 /* Share a reference to the source threads perQDATA */
839 PERQDATA_Addref( pSrcMsgQ->pQData );
840 pTgtMsgQ->pQData = pSrcMsgQ->pQData;
843 else /* Detach threads */
845 /* Only detach if currently attached */
846 if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
848 /* First release the target threads perQData */
849 PERQDATA_Release( pTgtMsgQ->pQData );
851 /* Give the target thread its own private perQDATA once more */
852 pTgtMsgQ->pQData = PERQDATA_CreateInstance();
856 /* TODO: Reset the Key State */
862 /* Unlock the queues before returning */
864 QUEUE_Unlock( pSrcMsgQ );
866 QUEUE_Unlock( pTgtMsgQ );
871 /**********************************************************************
872 * VWin32_BoostThreadGroup [KERNEL.535]
874 VOID WINAPI VWin32_BoostThreadGroup( DWORD threadId, INT32 boost )
876 FIXME(thread, "(0x%08lx,%d): stub\n", threadId, boost);
879 /**********************************************************************
880 * VWin32_BoostThreadStatic [KERNEL.536]
882 VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT32 boost )
884 FIXME(thread, "(0x%08lx,%d): stub\n", threadId, boost);
887 /**********************************************************************
888 * SetThreadLocale [KERNEL32.671] Sets the calling threads current locale.
895 * Implemented in NT only (3.1 and above according to MS
897 BOOL32 WINAPI SetThreadLocale(
898 LCID lcid) /* [in] Locale identifier */
900 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);