4 * Copyright 1996 Alexandre Julliard
10 #include <sys/socket.h>
12 #include "wine/winbase16.h"
20 #include "selectors.h"
23 #include "stackframe.h"
32 /* Is threading code initialized? */
33 BOOL THREAD_InitDone
= FALSE
;
35 /* THDB of the initial thread */
36 static THDB initial_thdb
;
38 /* Global thread list (FIXME: not thread-safe) */
39 THDB
*THREAD_First
= &initial_thdb
;
41 /***********************************************************************
44 * Return the current thread THDB pointer.
46 THDB
*THREAD_Current(void)
48 if (!THREAD_InitDone
) return NULL
;
49 return (THDB
*)((char *)NtCurrentTeb() - (int)&((THDB
*)0)->teb
);
52 /***********************************************************************
55 BOOL
THREAD_IsWin16( THDB
*thdb
)
57 return !thdb
|| !(thdb
->teb
.flags
& TEBF_WIN32
);
60 /***********************************************************************
63 * Convert a thread id to a THDB, making sure it is valid.
65 THDB
*THREAD_IdToTHDB( DWORD id
)
67 THDB
*thdb
= THREAD_First
;
69 if (!id
) return THREAD_Current();
72 if ((DWORD
)thdb
->server_tid
== id
) return thdb
;
75 /* Allow task handles to be used; convert to main thread */
78 TDB
*pTask
= (TDB
*)GlobalLock16( id
);
79 if (pTask
) return pTask
->thdb
;
81 SetLastError( ERROR_INVALID_PARAMETER
);
86 /***********************************************************************
89 * Initialization of a newly created THDB.
91 static BOOL
THREAD_InitTHDB( THDB
*thdb
, DWORD stack_size
, BOOL alloc_stack16
,
92 LPSECURITY_ATTRIBUTES sa
)
96 /* Allocate the stack */
99 * If stacksize smaller than 1 MB, allocate 1MB
100 * (one program wanted only 10 kB, which is recommendable, but some WINE
101 * functions, noteably in the files subdir, push HUGE structures and
102 * arrays on the stack. They probably shouldn't.)
103 * If stacksize larger than 16 MB, warn the user. (We could shrink the stack
104 * but this could give more or less unexplainable crashes.)
106 if (stack_size
<1024*1024)
107 stack_size
= 1024 * 1024;
108 if (stack_size
>= 16*1024*1024)
109 WARN(thread
,"Thread stack size is %ld MB.\n",stack_size
/1024/1024);
110 thdb
->stack_base
= VirtualAlloc(NULL
,
111 stack_size
+ (alloc_stack16
? 0x10000 : 0),
112 MEM_COMMIT
, PAGE_EXECUTE_READWRITE
);
113 if (!thdb
->stack_base
) goto error
;
114 /* Set a guard page at the bottom of the stack */
115 VirtualProtect( thdb
->stack_base
, 1, PAGE_EXECUTE_READWRITE
| PAGE_GUARD
,
117 thdb
->teb
.stack_top
= (char *)thdb
->stack_base
+ stack_size
;
118 thdb
->teb
.stack_low
= thdb
->stack_base
;
119 thdb
->exit_stack
= thdb
->teb
.stack_top
;
121 /* Allocate the 16-bit stack selector */
125 thdb
->teb
.stack_sel
= SELECTOR_AllocBlock( thdb
->teb
.stack_top
,
126 0x10000, SEGMENT_DATA
,
128 if (!thdb
->teb
.stack_sel
) goto error
;
129 thdb
->cur_stack
= PTR_SEG_OFF_TO_SEGPTR( thdb
->teb
.stack_sel
,
130 0x10000 - sizeof(STACK16FRAME
) );
133 /* Create the thread event */
135 if (!(thdb
->event
= CreateEventA( NULL
, FALSE
, FALSE
, NULL
))) goto error
;
136 thdb
->event
= ConvertToGlobalHandle( thdb
->event
);
140 if (thdb
->event
) CloseHandle( thdb
->event
);
141 if (thdb
->teb
.stack_sel
) SELECTOR_FreeBlock( thdb
->teb
.stack_sel
, 1 );
142 if (thdb
->stack_base
) VirtualFree( thdb
->stack_base
, 0, MEM_RELEASE
);
147 /***********************************************************************
150 * Free data structures associated with a thread.
151 * Must be called from the context of another thread.
153 void THREAD_FreeTHDB( THDB
*thdb
)
155 THDB
**pptr
= &THREAD_First
;
157 /* cleanup the message queue, if there's one */
159 USER_QueueCleanup( thdb
->teb
.queue
);
161 CloseHandle( thdb
->event
);
162 while (*pptr
&& (*pptr
!= thdb
)) pptr
= &(*pptr
)->next
;
163 if (*pptr
) *pptr
= thdb
->next
;
165 /* Free the associated memory */
167 if (thdb
->teb
.stack_sel
) SELECTOR_FreeBlock( thdb
->teb
.stack_sel
, 1 );
168 SELECTOR_FreeBlock( thdb
->teb_sel
, 1 );
169 close( thdb
->socket
);
170 VirtualFree( thdb
->stack_base
, 0, MEM_RELEASE
);
171 HeapFree( SystemHeap
, HEAP_NO_SERIALIZE
, thdb
);
175 /***********************************************************************
176 * THREAD_CreateInitialThread
178 * Create the initial thread.
180 THDB
*THREAD_CreateInitialThread( PDB
*pdb
, int server_fd
)
182 initial_thdb
.process
= pdb
;
183 initial_thdb
.teb
.except
= (void *)-1;
184 initial_thdb
.teb
.self
= &initial_thdb
.teb
;
185 initial_thdb
.teb
.flags
= /* TEBF_WIN32 */ 0;
186 initial_thdb
.teb
.tls_ptr
= initial_thdb
.tls_array
;
187 initial_thdb
.teb
.process
= pdb
;
188 initial_thdb
.exit_code
= 0x103; /* STILL_ACTIVE */
189 initial_thdb
.socket
= server_fd
;
191 /* Allocate the TEB selector (%fs register) */
193 if (!(initial_thdb
.teb_sel
= SELECTOR_AllocBlock( &initial_thdb
.teb
, 0x1000,
194 SEGMENT_DATA
, TRUE
, FALSE
)))
196 MSG("Could not allocate fs register for initial thread\n" );
199 SET_CUR_THREAD( &initial_thdb
);
200 THREAD_InitDone
= TRUE
;
202 /* Now proceed with normal initialization */
204 if (!THREAD_InitTHDB( &initial_thdb
, 0, TRUE
, NULL
)) return NULL
;
205 return &initial_thdb
;
209 /***********************************************************************
212 THDB
*THREAD_Create( PDB
*pdb
, DWORD flags
, DWORD stack_size
, BOOL alloc_stack16
,
213 LPSECURITY_ATTRIBUTES sa
, int *server_handle
)
215 struct new_thread_request request
;
216 struct new_thread_reply reply
= { NULL
, -1 };
219 THDB
*thdb
= HeapAlloc( SystemHeap
, HEAP_ZERO_MEMORY
, sizeof(THDB
) );
220 if (!thdb
) return NULL
;
222 thdb
->teb
.except
= (void *)-1;
223 thdb
->teb
.htask16
= pdb
->task
;
224 thdb
->teb
.self
= &thdb
->teb
;
225 thdb
->teb
.flags
= (pdb
->flags
& PDB32_WIN16_PROC
)? 0 : TEBF_WIN32
;
226 thdb
->teb
.tls_ptr
= thdb
->tls_array
;
227 thdb
->teb
.process
= pdb
;
228 thdb
->exit_code
= 0x103; /* STILL_ACTIVE */
232 /* Allocate the TEB selector (%fs register) */
234 thdb
->teb_sel
= SELECTOR_AllocBlock( &thdb
->teb
, 0x1000, SEGMENT_DATA
,
236 if (!thdb
->teb_sel
) goto error
;
238 /* Create the socket pair for server communication */
240 if (socketpair( AF_UNIX
, SOCK_STREAM
, 0, fd
) == -1)
242 SetLastError( ERROR_TOO_MANY_OPEN_FILES
); /* FIXME */
245 thdb
->socket
= fd
[0];
246 fcntl( fd
[0], F_SETFD
, 1 ); /* set close on exec flag */
248 /* Create the thread on the server side */
250 request
.pid
= thdb
->process
->server_pid
;
251 request
.suspend
= ((thdb
->flags
& CREATE_SUSPENDED
) != 0);
252 request
.inherit
= (sa
&& (sa
->nLength
>=sizeof(*sa
)) && sa
->bInheritHandle
);
253 CLIENT_SendRequest( REQ_NEW_THREAD
, fd
[1], 1, &request
, sizeof(request
) );
254 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) goto error
;
255 thdb
->server_tid
= reply
.tid
;
256 *server_handle
= reply
.handle
;
258 /* Do the rest of the initialization */
260 if (!THREAD_InitTHDB( thdb
, stack_size
, alloc_stack16
, sa
)) goto error
;
261 thdb
->next
= THREAD_First
;
267 if (reply
.handle
!= -1) CloseHandle( reply
.handle
);
268 if (thdb
->teb_sel
) SELECTOR_FreeBlock( thdb
->teb_sel
, 1 );
269 HeapFree( SystemHeap
, 0, thdb
);
270 if (thdb
->socket
!= -1) close( thdb
->socket
);
275 /***********************************************************************
278 * Start execution of a newly created thread. Does not return.
280 static void THREAD_Start(void)
282 THDB
*thdb
= THREAD_Current();
283 LPTHREAD_START_ROUTINE func
= (LPTHREAD_START_ROUTINE
)thdb
->entry_point
;
284 MODULE_InitializeDLLs( 0, DLL_THREAD_ATTACH
, NULL
);
285 ExitThread( func( thdb
->entry_arg
) );
289 /***********************************************************************
290 * CreateThread (KERNEL32.63)
292 HANDLE WINAPI
CreateThread( SECURITY_ATTRIBUTES
*sa
, DWORD stack
,
293 LPTHREAD_START_ROUTINE start
, LPVOID param
,
294 DWORD flags
, LPDWORD id
)
297 THDB
*thread
= THREAD_Create( PROCESS_Current(), flags
, stack
, TRUE
, sa
, &handle
);
298 if (!thread
) return INVALID_HANDLE_VALUE
;
299 thread
->entry_point
= start
;
300 thread
->entry_arg
= param
;
301 thread
->startup
= THREAD_Start
;
302 if (SYSDEPS_SpawnThread( thread
) == -1)
304 CloseHandle( handle
);
305 return INVALID_HANDLE_VALUE
;
307 if (id
) *id
= (DWORD
)thread
->server_tid
;
312 /***********************************************************************
313 * ExitThread [KERNEL32.215] Ends a thread
318 void WINAPI
ExitThread( DWORD code
) /* [in] Exit code for this thread */
320 MODULE_InitializeDLLs( 0, DLL_THREAD_DETACH
, NULL
);
321 TerminateThread( GetCurrentThread(), code
);
325 /***********************************************************************
326 * GetCurrentThread [KERNEL32.200] Gets pseudohandle for current thread
329 * Pseudohandle for the current thread
331 HANDLE WINAPI
GetCurrentThread(void)
333 return CURRENT_THREAD_PSEUDOHANDLE
;
337 /***********************************************************************
338 * GetCurrentThreadId [KERNEL32.201] Returns thread identifier.
341 * Thread identifier of calling thread
343 DWORD WINAPI
GetCurrentThreadId(void)
345 THDB
*thdb
= THREAD_Current();
347 return (DWORD
)thdb
->server_tid
;
351 /**********************************************************************
352 * GetLastError [KERNEL.148] [KERNEL32.227] Returns last-error code.
355 * Calling thread's last error code value.
357 DWORD WINAPI
GetLastError(void)
359 THDB
*thread
= THREAD_Current();
360 DWORD ret
= thread
->last_error
;
361 TRACE(thread
,"0x%lx\n",ret
);
366 /**********************************************************************
367 * SetLastError [KERNEL.147] [KERNEL32.497] Sets the last-error code.
372 void WINAPI
SetLastError(
373 DWORD error
) /* [in] Per-thread error code */
375 THDB
*thread
= THREAD_Current();
376 /* This one must work before we have a thread (FIXME) */
378 TRACE(thread
,"%p error=0x%lx\n",thread
,error
);
381 thread
->last_error
= error
;
385 /**********************************************************************
386 * SetLastErrorEx [USER32.485] Sets the last-error code.
391 void WINAPI
SetLastErrorEx(
392 DWORD error
, /* [in] Per-thread error code */
393 DWORD type
) /* [in] Error type */
395 TRACE(thread
, "(0x%08lx, 0x%08lx)\n", error
,type
);
402 /* Fall through for now */
404 FIXME(thread
, "(error=%08lx, type=%08lx): Unhandled type\n", error
,type
);
407 SetLastError( error
);
411 /**********************************************************************
414 DWORD
THREAD_TlsAlloc(THDB
*thread
)
416 DWORD i
, mask
, ret
= 0;
417 DWORD
*bits
= thread
->process
->tls_bits
;
418 EnterCriticalSection( &thread
->process
->crit_section
);
419 if (*bits
== 0xffffffff)
423 if (*bits
== 0xffffffff)
425 LeaveCriticalSection( &thread
->process
->crit_section
);
426 SetLastError( ERROR_NO_MORE_ITEMS
);
430 for (i
= 0, mask
= 1; i
< 32; i
++, mask
<<= 1) if (!(*bits
& mask
)) break;
432 LeaveCriticalSection( &thread
->process
->crit_section
);
437 /**********************************************************************
438 * TlsAlloc [KERNEL32.530] Allocates a TLS index.
440 * Allocates a thread local storage index
444 * Failure: 0xFFFFFFFF
446 DWORD WINAPI
TlsAlloc(void)
448 return THREAD_TlsAlloc(THREAD_Current());
452 /**********************************************************************
453 * TlsFree [KERNEL32.531] Releases a TLS index.
455 * Releases a thread local storage index, making it available for reuse
462 DWORD index
) /* [in] TLS Index to free */
465 THDB
*thread
= THREAD_Current();
466 DWORD
*bits
= thread
->process
->tls_bits
;
469 SetLastError( ERROR_INVALID_PARAMETER
);
472 EnterCriticalSection( &thread
->process
->crit_section
);
473 if (index
>= 32) bits
++;
474 mask
= (1 << (index
& 31));
475 if (!(*bits
& mask
)) /* already free? */
477 LeaveCriticalSection( &thread
->process
->crit_section
);
478 SetLastError( ERROR_INVALID_PARAMETER
);
482 thread
->tls_array
[index
] = 0;
483 /* FIXME: should zero all other thread values */
484 LeaveCriticalSection( &thread
->process
->crit_section
);
489 /**********************************************************************
490 * TlsGetValue [KERNEL32.532] Gets value in a thread's TLS slot
493 * Success: Value stored in calling thread's TLS slot for index
494 * Failure: 0 and GetLastError returns NO_ERROR
496 LPVOID WINAPI
TlsGetValue(
497 DWORD index
) /* [in] TLS index to retrieve value for */
499 THDB
*thread
= THREAD_Current();
502 SetLastError( ERROR_INVALID_PARAMETER
);
505 SetLastError( ERROR_SUCCESS
);
506 return thread
->tls_array
[index
];
510 /**********************************************************************
511 * TlsSetValue [KERNEL32.533] Stores a value in the thread's TLS slot.
517 BOOL WINAPI
TlsSetValue(
518 DWORD index
, /* [in] TLS index to set value for */
519 LPVOID value
) /* [in] Value to be stored */
521 THDB
*thread
= THREAD_Current();
524 SetLastError( ERROR_INVALID_PARAMETER
);
527 thread
->tls_array
[index
] = value
;
532 /***********************************************************************
533 * SetThreadContext [KERNEL32.670] Sets context of thread.
539 BOOL WINAPI
SetThreadContext(
540 HANDLE handle
, /* [in] Handle to thread with context */
541 CONTEXT
*context
) /* [out] Address of context structure */
543 FIXME( thread
, "not implemented\n" );
547 /***********************************************************************
548 * GetThreadContext [KERNEL32.294] Retrieves context of thread.
554 BOOL WINAPI
GetThreadContext(
555 HANDLE handle
, /* [in] Handle to thread with context */
556 CONTEXT
*context
) /* [out] Address of context structure */
560 FIXME( thread
, "returning dummy info\n" );
562 /* make up some plausible values for segment registers */
575 /**********************************************************************
576 * GetThreadPriority [KERNEL32.296] Returns priority for thread.
579 * Success: Thread's priority level.
580 * Failure: THREAD_PRIORITY_ERROR_RETURN
582 INT WINAPI
GetThreadPriority(
583 HANDLE hthread
) /* [in] Handle to thread */
585 struct get_thread_info_request req
;
586 struct get_thread_info_reply reply
;
587 req
.handle
= hthread
;
588 CLIENT_SendRequest( REQ_GET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
589 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
))
590 return THREAD_PRIORITY_ERROR_RETURN
;
591 return reply
.priority
;
595 /**********************************************************************
596 * SetThreadPriority [KERNEL32.514] Sets priority for thread.
602 BOOL WINAPI
SetThreadPriority(
603 HANDLE hthread
, /* [in] Handle to thread */
604 INT priority
) /* [in] Thread priority level */
606 struct set_thread_info_request req
;
607 req
.handle
= hthread
;
608 req
.priority
= priority
;
609 req
.mask
= SET_THREAD_INFO_PRIORITY
;
610 CLIENT_SendRequest( REQ_SET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
611 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
615 /**********************************************************************
616 * SetThreadAffinityMask (KERNEL32.669)
618 DWORD WINAPI
SetThreadAffinityMask( HANDLE hThread
, DWORD dwThreadAffinityMask
)
620 struct set_thread_info_request req
;
621 req
.handle
= hThread
;
622 req
.affinity
= dwThreadAffinityMask
;
623 req
.mask
= SET_THREAD_INFO_AFFINITY
;
624 CLIENT_SendRequest( REQ_SET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
625 if (CLIENT_WaitReply( NULL
, NULL
, 0 )) return 0;
626 return 1; /* FIXME: should return previous value */
630 /**********************************************************************
631 * TerminateThread [KERNEL32.685] Terminates a thread
637 BOOL WINAPI
TerminateThread(
638 HANDLE handle
, /* [in] Handle to thread */
639 DWORD exitcode
) /* [in] Exit code for thread */
641 struct terminate_thread_request req
;
643 req
.exit_code
= exitcode
;
644 CLIENT_SendRequest( REQ_TERMINATE_THREAD
, -1, 1, &req
, sizeof(req
) );
645 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
649 /**********************************************************************
650 * GetExitCodeThread [KERNEL32.???] Gets termination status of thread.
656 BOOL WINAPI
GetExitCodeThread(
657 HANDLE hthread
, /* [in] Handle to thread */
658 LPDWORD exitcode
) /* [out] Address to receive termination status */
660 struct get_thread_info_request req
;
661 struct get_thread_info_reply reply
;
662 req
.handle
= hthread
;
663 CLIENT_SendRequest( REQ_GET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
664 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
665 if (exitcode
) *exitcode
= reply
.exit_code
;
670 /**********************************************************************
671 * ResumeThread [KERNEL32.587] Resumes a thread.
673 * Decrements a thread's suspend count. When count is zero, the
674 * execution of the thread is resumed.
677 * Success: Previous suspend count
678 * Failure: 0xFFFFFFFF
681 DWORD WINAPI
ResumeThread(
682 HANDLE hthread
) /* [in] Identifies thread to restart */
684 struct resume_thread_request req
;
685 struct resume_thread_reply reply
;
686 req
.handle
= hthread
;
687 CLIENT_SendRequest( REQ_RESUME_THREAD
, -1, 1, &req
, sizeof(req
) );
688 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return 0xffffffff;
693 /**********************************************************************
694 * SuspendThread [KERNEL32.681] Suspends a thread.
697 * Success: Previous suspend count
698 * Failure: 0xFFFFFFFF
700 DWORD WINAPI
SuspendThread(
701 HANDLE hthread
) /* [in] Handle to the thread */
703 struct suspend_thread_request req
;
704 struct suspend_thread_reply reply
;
705 req
.handle
= hthread
;
706 CLIENT_SendRequest( REQ_SUSPEND_THREAD
, -1, 1, &req
, sizeof(req
) );
707 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return 0xffffffff;
712 /***********************************************************************
713 * QueueUserAPC (KERNEL32.566)
715 DWORD WINAPI
QueueUserAPC( PAPCFUNC func
, HANDLE hthread
, ULONG_PTR data
)
717 struct queue_apc_request req
;
718 req
.handle
= hthread
;
720 req
.param
= (void *)data
;
721 CLIENT_SendRequest( REQ_QUEUE_APC
, -1, 1, &req
, sizeof(req
) );
722 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
726 /**********************************************************************
727 * GetThreadTimes [KERNEL32.???] Obtains timing information.
730 * What are the fields where these values are stored?
736 BOOL WINAPI
GetThreadTimes(
737 HANDLE thread
, /* [in] Specifies the thread of interest */
738 LPFILETIME creationtime
, /* [out] When the thread was created */
739 LPFILETIME exittime
, /* [out] When the thread was destroyed */
740 LPFILETIME kerneltime
, /* [out] Time thread spent in kernel mode */
741 LPFILETIME usertime
) /* [out] Time thread spent in user mode */
743 FIXME(thread
,"(0x%08x): stub\n",thread
);
744 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
749 /**********************************************************************
750 * AttachThreadInput [KERNEL32.8] Attaches input of 1 thread to other
752 * Attaches the input processing mechanism of one thread to that of
760 * 1. Reset the Key State (currenly per thread key state is not maintained)
762 BOOL WINAPI
AttachThreadInput(
763 DWORD idAttach
, /* [in] Thread to attach */
764 DWORD idAttachTo
, /* [in] Thread to attach to */
765 BOOL fAttach
) /* [in] Attach or detach */
767 MESSAGEQUEUE
*pSrcMsgQ
= 0, *pTgtMsgQ
= 0;
770 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
772 /* A thread cannot attach to itself */
773 if ( idAttach
== idAttachTo
)
776 /* According to the docs this method should fail if a
777 * "Journal record" hook is installed. (attaches all input queues together)
779 if ( HOOK_IsHooked( WH_JOURNALRECORD
) )
782 /* Retrieve message queues corresponding to the thread id's */
783 pTgtMsgQ
= (MESSAGEQUEUE
*)QUEUE_Lock( GetThreadQueue16( idAttach
) );
784 pSrcMsgQ
= (MESSAGEQUEUE
*)QUEUE_Lock( GetThreadQueue16( idAttachTo
) );
786 /* Ensure we have message queues and that Src and Tgt threads
787 * are not system threads.
789 if ( !pSrcMsgQ
|| !pTgtMsgQ
|| !pSrcMsgQ
->pQData
|| !pTgtMsgQ
->pQData
)
792 if (fAttach
) /* Attach threads */
794 /* Only attach if currently detached */
795 if ( pTgtMsgQ
->pQData
!= pSrcMsgQ
->pQData
)
797 /* First release the target threads perQData */
798 PERQDATA_Release( pTgtMsgQ
->pQData
);
800 /* Share a reference to the source threads perQDATA */
801 PERQDATA_Addref( pSrcMsgQ
->pQData
);
802 pTgtMsgQ
->pQData
= pSrcMsgQ
->pQData
;
805 else /* Detach threads */
807 /* Only detach if currently attached */
808 if ( pTgtMsgQ
->pQData
== pSrcMsgQ
->pQData
)
810 /* First release the target threads perQData */
811 PERQDATA_Release( pTgtMsgQ
->pQData
);
813 /* Give the target thread its own private perQDATA once more */
814 pTgtMsgQ
->pQData
= PERQDATA_CreateInstance();
818 /* TODO: Reset the Key State */
824 /* Unlock the queues before returning */
826 QUEUE_Unlock( pSrcMsgQ
);
828 QUEUE_Unlock( pTgtMsgQ
);
833 /**********************************************************************
834 * VWin32_BoostThreadGroup [KERNEL.535]
836 VOID WINAPI
VWin32_BoostThreadGroup( DWORD threadId
, INT boost
)
838 FIXME(thread
, "(0x%08lx,%d): stub\n", threadId
, boost
);
841 /**********************************************************************
842 * VWin32_BoostThreadStatic [KERNEL.536]
844 VOID WINAPI
VWin32_BoostThreadStatic( DWORD threadId
, INT boost
)
846 FIXME(thread
, "(0x%08lx,%d): stub\n", threadId
, boost
);
849 /**********************************************************************
850 * SetThreadLocale [KERNEL32.671] Sets the calling threads current locale.
857 * Implemented in NT only (3.1 and above according to MS
859 BOOL WINAPI
SetThreadLocale(
860 LCID lcid
) /* [in] Locale identifier */
862 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);