4 * Copyright 1996 Alexandre Julliard
10 #include "wine/winbase16.h"
18 #include "selectors.h"
22 #include "stackframe.h"
31 static void THREAD_Destroy( K32OBJ *obj );
33 const K32OBJ_OPS THREAD_Ops =
35 THREAD_Destroy /* destroy */
38 /* Is threading code initialized? */
39 BOOL32 THREAD_InitDone = FALSE;
42 /***********************************************************************
45 * Return the current thread THDB pointer.
47 THDB *THREAD_Current(void)
49 if (!THREAD_InitDone) return NULL;
50 return (THDB *)((char *)NtCurrentTeb() - (int)&((THDB *)0)->teb);
53 /***********************************************************************
56 BOOL32 THREAD_IsWin16( THDB *thdb )
58 if (!thdb || !thdb->process)
62 TDB* pTask = (TDB*)GlobalLock16( thdb->process->task );
63 return !pTask || pTask->thdb == thdb;
67 /***********************************************************************
70 * Convert a thread id to a THDB, making sure it is valid.
72 THDB *THREAD_IdToTHDB( DWORD id )
76 if (!id) return THREAD_Current();
77 thdb = THREAD_ID_TO_THDB( id );
78 if (!K32OBJ_IsValid( &thdb->header, K32OBJ_THREAD ))
80 /* Allow task handles to be used; convert to main thread */
83 TDB *pTask = (TDB *)GlobalLock16( id );
84 if (pTask) return pTask->thdb;
87 SetLastError( ERROR_INVALID_PARAMETER );
94 /***********************************************************************
97 * Add a thread to a queue.
99 void THREAD_AddQueue( THREAD_QUEUE *queue, THDB *thread )
101 THREAD_ENTRY *entry = HeapAlloc( SystemHeap, HEAP_NO_SERIALIZE,
105 entry->thread = thread;
108 entry->next = (*queue)->next;
109 (*queue)->next = entry;
111 else entry->next = entry;
116 /***********************************************************************
119 * Remove a thread from a queue.
121 void THREAD_RemoveQueue( THREAD_QUEUE *queue, THDB *thread )
123 THREAD_ENTRY *entry = *queue;
125 if (entry->next == entry) /* Only one element in the queue */
127 assert( entry->thread == thread );
133 while (entry->next->thread != thread)
136 assert( entry != *queue ); /* Have we come all the way around? */
138 if ((next = entry->next) == *queue) *queue = entry;
139 entry->next = entry->next->next;
140 entry = next; /* This is the one we want to free */
142 HeapFree( SystemHeap, 0, entry );
147 /***********************************************************************
150 THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size, BOOL32 alloc_stack16,
151 int *server_thandle, int *server_phandle,
152 LPTHREAD_START_ROUTINE start_addr, LPVOID param )
156 THDB *thdb = HeapAlloc( SystemHeap, HEAP_ZERO_MEMORY, sizeof(THDB) );
157 if (!thdb) return NULL;
158 thdb->header.type = K32OBJ_THREAD;
159 thdb->header.refcount = 1;
161 thdb->teb.except = (void *)-1;
162 thdb->teb.htask16 = 0; /* FIXME */
163 thdb->teb.self = &thdb->teb;
164 thdb->teb.flags = (pdb->flags & PDB32_WIN16_PROC)? 0 : TEBF_WIN32;
165 thdb->teb.tls_ptr = thdb->tls_array;
166 thdb->teb.process = pdb;
167 thdb->wait_list = &thdb->wait_struct;
168 thdb->exit_code = 0x103; /* STILL_ACTIVE */
169 thdb->entry_point = start_addr;
170 thdb->entry_arg = param;
173 /* Allocate the stack */
176 * If stacksize smaller than 1 MB, allocate 1MB
177 * (one program wanted only 10 kB, which is recommendable, but some WINE
178 * functions, noteably in the files subdir, push HUGE structures and
179 * arrays on the stack. They probably shouldn't.)
180 * If stacksize larger than 16 MB, warn the user. (We could shrink the stack
181 * but this could give more or less unexplainable crashes.)
183 if (stack_size<1024*1024)
184 stack_size = 1024 * 1024;
185 if (stack_size >= 16*1024*1024)
186 WARN(thread,"Thread stack size is %ld MB.\n",stack_size/1024/1024);
187 thdb->stack_base = VirtualAlloc(NULL,
188 stack_size + (alloc_stack16 ? 0x10000 : 0),
189 MEM_COMMIT, PAGE_EXECUTE_READWRITE );
190 if (!thdb->stack_base) goto error;
191 /* Set a guard page at the bottom of the stack */
192 VirtualProtect( thdb->stack_base, 1, PAGE_EXECUTE_READWRITE | PAGE_GUARD,
194 thdb->teb.stack_top = (char *)thdb->stack_base + stack_size;
195 thdb->teb.stack_low = thdb->stack_base;
196 thdb->exit_stack = thdb->teb.stack_top;
198 /* Allocate the TEB selector (%fs register) */
200 thdb->teb_sel = SELECTOR_AllocBlock( &thdb->teb, 0x1000, SEGMENT_DATA,
202 if (!thdb->teb_sel) goto error;
204 /* Allocate the 16-bit stack selector */
208 thdb->teb.stack_sel = SELECTOR_AllocBlock( thdb->teb.stack_top,
209 0x10000, SEGMENT_DATA,
211 if (!thdb->teb.stack_sel) goto error;
212 thdb->cur_stack = PTR_SEG_OFF_TO_SEGPTR( thdb->teb.stack_sel,
213 0x10000 - sizeof(STACK16FRAME) );
216 /* Create the thread socket */
218 if (CLIENT_NewThread( thdb, server_thandle, server_phandle )) goto error;
220 /* Add thread to process's list of threads */
222 THREAD_AddQueue( &pdb->thread_list, thdb );
224 /* Create the thread event */
226 if (!(thdb->event = CreateEvent32A( NULL, FALSE, FALSE, NULL ))) goto error;
227 thdb->event = ConvertToGlobalHandle( thdb->event );
233 if (thdb->socket != -1) close( thdb->socket );
234 if (thdb->event) CloseHandle( thdb->event );
235 if (thdb->teb.stack_sel) SELECTOR_FreeBlock( thdb->teb.stack_sel, 1 );
236 if (thdb->teb_sel) SELECTOR_FreeBlock( thdb->teb_sel, 1 );
237 if (thdb->stack_base) VirtualFree( thdb->stack_base, 0, MEM_RELEASE );
238 HeapFree( SystemHeap, 0, thdb );
243 /***********************************************************************
246 static void THREAD_Destroy( K32OBJ *ptr )
248 THDB *thdb = (THDB *)ptr;
250 assert( ptr->type == K32OBJ_THREAD );
251 ptr->type = K32OBJ_UNKNOWN;
253 /* Free the associated memory */
257 /* Check if we are deleting the current thread */
260 if (fs == thdb->teb_sel)
267 CloseHandle( thdb->event );
268 close( thdb->socket );
269 SELECTOR_FreeBlock( thdb->teb_sel, 1 );
270 if (thdb->teb.stack_sel) SELECTOR_FreeBlock( thdb->teb.stack_sel, 1 );
271 HeapFree( SystemHeap, 0, thdb );
276 /***********************************************************************
279 * Start execution of a newly created thread. Does not return.
281 void THREAD_Start( THDB *thdb )
283 LPTHREAD_START_ROUTINE func = (LPTHREAD_START_ROUTINE)thdb->entry_point;
284 assert( THREAD_Current() == thdb );
286 MODULE_InitializeDLLs( thdb->process, 0, DLL_THREAD_ATTACH, NULL );
287 ExitThread( func( thdb->entry_arg ) );
291 /***********************************************************************
292 * CreateThread (KERNEL32.63)
294 HANDLE32 WINAPI CreateThread( SECURITY_ATTRIBUTES *sa, DWORD stack,
295 LPTHREAD_START_ROUTINE start, LPVOID param,
296 DWORD flags, LPDWORD id )
298 int server_handle = -1;
299 HANDLE32 handle = INVALID_HANDLE_VALUE32;
300 BOOL32 inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
302 THDB *thread = THREAD_Create( PROCESS_Current(), stack,
303 TRUE, &server_handle, NULL, start, param );
304 if (!thread) return INVALID_HANDLE_VALUE32;
305 handle = HANDLE_Alloc( PROCESS_Current(), &thread->header,
306 THREAD_ALL_ACCESS, inherit, server_handle );
307 if (handle == INVALID_HANDLE_VALUE32) goto error;
308 if (SYSDEPS_SpawnThread( thread ) == -1) goto error;
309 if (id) *id = THDB_TO_THREAD_ID( thread );
313 if (handle != INVALID_HANDLE_VALUE32) CloseHandle( handle );
314 K32OBJ_DecCount( &thread->header );
315 return INVALID_HANDLE_VALUE32;
319 /***********************************************************************
320 * ExitThread [KERNEL32.215] Ends a thread
325 void WINAPI ExitThread(
326 DWORD code) /* [in] Exit code for this thread */
328 THDB *thdb = THREAD_Current();
331 /* Remove thread from process's list */
332 THREAD_RemoveQueue( &thdb->process->thread_list, thdb );
334 MODULE_InitializeDLLs( thdb->process, 0, DLL_THREAD_DETACH, NULL );
337 thdb->exit_code = code;
339 /* cleanup the message queue, if there's one */
341 USER_QueueCleanup( thdb->teb.queue );
343 /* FIXME: should free the stack somehow */
345 /* FIXME: We cannot do this; once the current thread is destroyed,
346 synchronization primitives do not work properly. */
347 K32OBJ_DecCount( &thdb->header );
349 /* Completely unlock the system lock just in case */
350 count = SYSTEM_LOCK_COUNT();
351 while (count--) SYSTEM_UNLOCK();
352 SYSDEPS_ExitThread();
356 /***********************************************************************
357 * GetCurrentThread [KERNEL32.200] Gets pseudohandle for current thread
360 * Pseudohandle for the current thread
362 HANDLE32 WINAPI GetCurrentThread(void)
364 return CURRENT_THREAD_PSEUDOHANDLE;
368 /***********************************************************************
369 * GetCurrentThreadId [KERNEL32.201] Returns thread identifier.
372 * Thread identifier of calling thread
374 DWORD WINAPI GetCurrentThreadId(void)
376 return THDB_TO_THREAD_ID( THREAD_Current() );
380 /**********************************************************************
381 * GetLastError [KERNEL.148] [KERNEL32.227] Returns last-error code.
384 * Calling thread's last error code value.
386 DWORD WINAPI GetLastError(void)
388 THDB *thread = THREAD_Current();
389 DWORD ret = thread->last_error;
390 TRACE(thread,"0x%lx\n",ret);
395 /**********************************************************************
396 * SetLastError [KERNEL.147] [KERNEL32.497] Sets the last-error code.
401 void WINAPI SetLastError(
402 DWORD error) /* [in] Per-thread error code */
404 THDB *thread = THREAD_Current();
405 /* This one must work before we have a thread (FIXME) */
407 TRACE(thread,"%p error=0x%lx\n",thread,error);
410 thread->last_error = error;
414 /**********************************************************************
415 * SetLastErrorEx [USER32.485] Sets the last-error code.
420 void WINAPI SetLastErrorEx(
421 DWORD error, /* [in] Per-thread error code */
422 DWORD type) /* [in] Error type */
424 TRACE(thread, "(0x%08lx, 0x%08lx)\n", error,type);
431 /* Fall through for now */
433 FIXME(thread, "(error=%08lx, type=%08lx): Unhandled type\n", error,type);
436 SetLastError( error );
440 /**********************************************************************
443 DWORD THREAD_TlsAlloc(THDB *thread)
445 DWORD i, mask, ret = 0;
446 DWORD *bits = thread->process->tls_bits;
447 EnterCriticalSection( &thread->process->crit_section );
448 if (*bits == 0xffffffff)
452 if (*bits == 0xffffffff)
454 LeaveCriticalSection( &thread->process->crit_section );
455 SetLastError( ERROR_NO_MORE_ITEMS );
459 for (i = 0, mask = 1; i < 32; i++, mask <<= 1) if (!(*bits & mask)) break;
461 LeaveCriticalSection( &thread->process->crit_section );
466 /**********************************************************************
467 * TlsAlloc [KERNEL32.530] Allocates a TLS index.
469 * Allocates a thread local storage index
473 * Failure: 0xFFFFFFFF
475 DWORD WINAPI TlsAlloc(void)
477 return THREAD_TlsAlloc(THREAD_Current());
481 /**********************************************************************
482 * TlsFree [KERNEL32.531] Releases a TLS index.
484 * Releases a thread local storage index, making it available for reuse
490 BOOL32 WINAPI TlsFree(
491 DWORD index) /* [in] TLS Index to free */
494 THDB *thread = THREAD_Current();
495 DWORD *bits = thread->process->tls_bits;
498 SetLastError( ERROR_INVALID_PARAMETER );
501 EnterCriticalSection( &thread->process->crit_section );
502 if (index >= 32) bits++;
503 mask = (1 << (index & 31));
504 if (!(*bits & mask)) /* already free? */
506 LeaveCriticalSection( &thread->process->crit_section );
507 SetLastError( ERROR_INVALID_PARAMETER );
511 thread->tls_array[index] = 0;
512 /* FIXME: should zero all other thread values */
513 LeaveCriticalSection( &thread->process->crit_section );
518 /**********************************************************************
519 * TlsGetValue [KERNEL32.532] Gets value in a thread's TLS slot
522 * Success: Value stored in calling thread's TLS slot for index
523 * Failure: 0 and GetLastError returns NO_ERROR
525 LPVOID WINAPI TlsGetValue(
526 DWORD index) /* [in] TLS index to retrieve value for */
528 THDB *thread = THREAD_Current();
531 SetLastError( ERROR_INVALID_PARAMETER );
534 SetLastError( ERROR_SUCCESS );
535 return thread->tls_array[index];
539 /**********************************************************************
540 * TlsSetValue [KERNEL32.533] Stores a value in the thread's TLS slot.
546 BOOL32 WINAPI TlsSetValue(
547 DWORD index, /* [in] TLS index to set value for */
548 LPVOID value) /* [in] Value to be stored */
550 THDB *thread = THREAD_Current();
553 SetLastError( ERROR_INVALID_PARAMETER );
556 thread->tls_array[index] = value;
561 /***********************************************************************
562 * SetThreadContext [KERNEL32.670] Sets context of thread.
568 BOOL32 WINAPI SetThreadContext(
569 HANDLE32 handle, /* [in] Handle to thread with context */
570 CONTEXT *context) /* [out] Address of context structure */
572 FIXME( thread, "not implemented\n" );
576 /***********************************************************************
577 * GetThreadContext [KERNEL32.294] Retrieves context of thread.
583 BOOL32 WINAPI GetThreadContext(
584 HANDLE32 handle, /* [in] Handle to thread with context */
585 CONTEXT *context) /* [out] Address of context structure */
589 FIXME( thread, "returning dummy info\n" );
591 /* make up some plausible values for segment registers */
604 /**********************************************************************
605 * GetThreadPriority [KERNEL32.296] Returns priority for thread.
608 * Success: Thread's priority level.
609 * Failure: THREAD_PRIORITY_ERROR_RETURN
611 INT32 WINAPI GetThreadPriority(
612 HANDLE32 hthread) /* [in] Handle to thread */
614 struct get_thread_info_request req;
615 struct get_thread_info_reply reply;
616 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
617 K32OBJ_THREAD, THREAD_QUERY_INFORMATION );
618 CLIENT_SendRequest( REQ_GET_THREAD_INFO, -1, 1, &req, sizeof(req) );
619 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL ))
620 return THREAD_PRIORITY_ERROR_RETURN;
621 return reply.priority;
625 /**********************************************************************
626 * SetThreadPriority [KERNEL32.514] Sets priority for thread.
632 BOOL32 WINAPI SetThreadPriority(
633 HANDLE32 hthread, /* [in] Handle to thread */
634 INT32 priority) /* [in] Thread priority level */
636 struct set_thread_info_request req;
637 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
638 K32OBJ_THREAD, THREAD_SET_INFORMATION );
639 if (req.handle == -1) return FALSE;
640 req.priority = priority;
641 req.mask = SET_THREAD_INFO_PRIORITY;
642 CLIENT_SendRequest( REQ_SET_THREAD_INFO, -1, 1, &req, sizeof(req) );
643 return !CLIENT_WaitReply( NULL, NULL, 0 );
647 /**********************************************************************
648 * SetThreadAffinityMask (KERNEL32.669)
650 DWORD WINAPI SetThreadAffinityMask( HANDLE32 hThread, DWORD dwThreadAffinityMask )
652 struct set_thread_info_request req;
653 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hThread,
654 K32OBJ_THREAD, THREAD_SET_INFORMATION );
655 if (req.handle == -1) return FALSE;
656 req.affinity = dwThreadAffinityMask;
657 req.mask = SET_THREAD_INFO_AFFINITY;
658 CLIENT_SendRequest( REQ_SET_THREAD_INFO, -1, 1, &req, sizeof(req) );
659 if (CLIENT_WaitReply( NULL, NULL, 0 )) return 0;
660 return 1; /* FIXME: should return previous value */
664 /**********************************************************************
665 * TerminateThread [KERNEL32.685] Terminates a thread
671 BOOL32 WINAPI TerminateThread(
672 HANDLE32 handle, /* [in] Handle to thread */
673 DWORD exitcode) /* [in] Exit code for thread */
675 struct terminate_thread_request req;
677 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), handle,
678 K32OBJ_THREAD, THREAD_TERMINATE );
679 req.exit_code = exitcode;
680 CLIENT_SendRequest( REQ_TERMINATE_THREAD, -1, 1, &req, sizeof(req) );
681 return !CLIENT_WaitReply( NULL, NULL, 0 );
685 /**********************************************************************
686 * GetExitCodeThread [KERNEL32.???] Gets termination status of thread.
692 BOOL32 WINAPI GetExitCodeThread(
693 HANDLE32 hthread, /* [in] Handle to thread */
694 LPDWORD exitcode) /* [out] Address to receive termination status */
696 struct get_thread_info_request req;
697 struct get_thread_info_reply reply;
698 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
699 K32OBJ_THREAD, THREAD_QUERY_INFORMATION );
700 CLIENT_SendRequest( REQ_GET_THREAD_INFO, -1, 1, &req, sizeof(req) );
701 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return FALSE;
702 if (exitcode) *exitcode = reply.exit_code;
707 /**********************************************************************
708 * ResumeThread [KERNEL32.587] Resumes a thread.
710 * Decrements a thread's suspend count. When count is zero, the
711 * execution of the thread is resumed.
714 * Success: Previous suspend count
715 * Failure: 0xFFFFFFFF
718 DWORD WINAPI ResumeThread(
719 HANDLE32 hthread) /* [in] Identifies thread to restart */
721 struct resume_thread_request req;
722 struct resume_thread_reply reply;
723 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
724 K32OBJ_THREAD, THREAD_SUSPEND_RESUME );
725 CLIENT_SendRequest( REQ_RESUME_THREAD, -1, 1, &req, sizeof(req) );
726 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return 0xffffffff;
731 /**********************************************************************
732 * SuspendThread [KERNEL32.681] Suspends a thread.
735 * Success: Previous suspend count
736 * Failure: 0xFFFFFFFF
738 DWORD WINAPI SuspendThread(
739 HANDLE32 hthread) /* [in] Handle to the thread */
741 struct suspend_thread_request req;
742 struct suspend_thread_reply reply;
743 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
744 K32OBJ_THREAD, THREAD_SUSPEND_RESUME );
745 CLIENT_SendRequest( REQ_SUSPEND_THREAD, -1, 1, &req, sizeof(req) );
746 if (CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL )) return 0xffffffff;
751 /***********************************************************************
752 * QueueUserAPC (KERNEL32.566)
754 DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE32 hthread, ULONG_PTR data )
756 struct queue_apc_request req;
757 req.handle = HANDLE_GetServerHandle( PROCESS_Current(), hthread,
758 K32OBJ_THREAD, THREAD_SET_CONTEXT );
760 req.param = (void *)data;
761 CLIENT_SendRequest( REQ_QUEUE_APC, -1, 1, &req, sizeof(req) );
762 return !CLIENT_WaitReply( NULL, NULL, 0 );
766 /**********************************************************************
767 * GetThreadTimes [KERNEL32.???] Obtains timing information.
770 * What are the fields where these values are stored?
776 BOOL32 WINAPI GetThreadTimes(
777 HANDLE32 thread, /* [in] Specifies the thread of interest */
778 LPFILETIME creationtime, /* [out] When the thread was created */
779 LPFILETIME exittime, /* [out] When the thread was destroyed */
780 LPFILETIME kerneltime, /* [out] Time thread spent in kernel mode */
781 LPFILETIME usertime) /* [out] Time thread spent in user mode */
783 FIXME(thread,"(0x%08x): stub\n",thread);
784 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
789 /**********************************************************************
790 * AttachThreadInput [KERNEL32.8] Attaches input of 1 thread to other
792 * Attaches the input processing mechanism of one thread to that of
800 * 1. Reset the Key State (currenly per thread key state is not maintained)
802 BOOL32 WINAPI AttachThreadInput(
803 DWORD idAttach, /* [in] Thread to attach */
804 DWORD idAttachTo, /* [in] Thread to attach to */
805 BOOL32 fAttach) /* [in] Attach or detach */
807 MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
810 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
812 /* A thread cannot attach to itself */
813 if ( idAttach == idAttachTo )
816 /* According to the docs this method should fail if a
817 * "Journal record" hook is installed. (attaches all input queues together)
819 if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
822 /* Retrieve message queues corresponding to the thread id's */
823 pTgtMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue( idAttach ) );
824 pSrcMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue( idAttachTo ) );
826 /* Ensure we have message queues and that Src and Tgt threads
827 * are not system threads.
829 if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
832 if (fAttach) /* Attach threads */
834 /* Only attach if currently detached */
835 if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
837 /* First release the target threads perQData */
838 PERQDATA_Release( pTgtMsgQ->pQData );
840 /* Share a reference to the source threads perQDATA */
841 PERQDATA_Addref( pSrcMsgQ->pQData );
842 pTgtMsgQ->pQData = pSrcMsgQ->pQData;
845 else /* Detach threads */
847 /* Only detach if currently attached */
848 if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
850 /* First release the target threads perQData */
851 PERQDATA_Release( pTgtMsgQ->pQData );
853 /* Give the target thread its own private perQDATA once more */
854 pTgtMsgQ->pQData = PERQDATA_CreateInstance();
858 /* TODO: Reset the Key State */
864 /* Unlock the queues before returning */
866 QUEUE_Unlock( pSrcMsgQ );
868 QUEUE_Unlock( pTgtMsgQ );
873 /**********************************************************************
874 * VWin32_BoostThreadGroup [KERNEL.535]
876 VOID WINAPI VWin32_BoostThreadGroup( DWORD threadId, INT32 boost )
878 FIXME(thread, "(0x%08lx,%d): stub\n", threadId, boost);
881 /**********************************************************************
882 * VWin32_BoostThreadStatic [KERNEL.536]
884 VOID WINAPI VWin32_BoostThreadStatic( DWORD threadId, INT32 boost )
886 FIXME(thread, "(0x%08lx,%d): stub\n", threadId, boost);
889 /**********************************************************************
890 * SetThreadLocale [KERNEL32.671] Sets the calling threads current locale.
897 * Implemented in NT only (3.1 and above according to MS
899 BOOL32 WINAPI SetThreadLocale(
900 LCID lcid) /* [in] Locale identifier */
902 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);