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 PROCESS_CallUserSignalProc( USIG_THREAD_EXIT
, 0 );
159 CloseHandle( thdb
->event
);
160 while (*pptr
&& (*pptr
!= thdb
)) pptr
= &(*pptr
)->next
;
161 if (*pptr
) *pptr
= thdb
->next
;
163 /* Free the associated memory */
165 if (thdb
->teb
.stack_sel
) SELECTOR_FreeBlock( thdb
->teb
.stack_sel
, 1 );
166 SELECTOR_FreeBlock( thdb
->teb_sel
, 1 );
167 close( thdb
->socket
);
168 VirtualFree( thdb
->stack_base
, 0, MEM_RELEASE
);
169 HeapFree( SystemHeap
, HEAP_NO_SERIALIZE
, thdb
);
173 /***********************************************************************
174 * THREAD_CreateInitialThread
176 * Create the initial thread.
178 THDB
*THREAD_CreateInitialThread( PDB
*pdb
, int server_fd
)
180 initial_thdb
.process
= pdb
;
181 initial_thdb
.teb
.except
= (void *)-1;
182 initial_thdb
.teb
.self
= &initial_thdb
.teb
;
183 initial_thdb
.teb
.flags
= /* TEBF_WIN32 */ 0;
184 initial_thdb
.teb
.tls_ptr
= initial_thdb
.tls_array
;
185 initial_thdb
.teb
.process
= pdb
;
186 initial_thdb
.exit_code
= 0x103; /* STILL_ACTIVE */
187 initial_thdb
.socket
= server_fd
;
189 /* Allocate the TEB selector (%fs register) */
191 if (!(initial_thdb
.teb_sel
= SELECTOR_AllocBlock( &initial_thdb
.teb
, 0x1000,
192 SEGMENT_DATA
, TRUE
, FALSE
)))
194 MSG("Could not allocate fs register for initial thread\n" );
197 SET_CUR_THREAD( &initial_thdb
);
198 THREAD_InitDone
= TRUE
;
200 /* Now proceed with normal initialization */
202 if (CLIENT_InitThread()) return NULL
;
203 if (!THREAD_InitTHDB( &initial_thdb
, 0, TRUE
, NULL
)) return NULL
;
204 return &initial_thdb
;
208 /***********************************************************************
211 THDB
*THREAD_Create( PDB
*pdb
, DWORD flags
, DWORD stack_size
, BOOL alloc_stack16
,
212 LPSECURITY_ATTRIBUTES sa
, int *server_handle
)
214 struct new_thread_request request
;
215 struct new_thread_reply reply
= { NULL
, -1 };
218 THDB
*thdb
= HeapAlloc( SystemHeap
, HEAP_ZERO_MEMORY
, sizeof(THDB
) );
219 if (!thdb
) return NULL
;
221 thdb
->teb
.except
= (void *)-1;
222 thdb
->teb
.htask16
= pdb
->task
;
223 thdb
->teb
.self
= &thdb
->teb
;
224 thdb
->teb
.flags
= (pdb
->flags
& PDB32_WIN16_PROC
)? 0 : TEBF_WIN32
;
225 thdb
->teb
.tls_ptr
= thdb
->tls_array
;
226 thdb
->teb
.process
= pdb
;
227 thdb
->exit_code
= 0x103; /* STILL_ACTIVE */
231 /* Allocate the TEB selector (%fs register) */
233 thdb
->teb_sel
= SELECTOR_AllocBlock( &thdb
->teb
, 0x1000, SEGMENT_DATA
,
235 if (!thdb
->teb_sel
) goto error
;
237 /* Create the socket pair for server communication */
239 if (socketpair( AF_UNIX
, SOCK_STREAM
, 0, fd
) == -1)
241 SetLastError( ERROR_TOO_MANY_OPEN_FILES
); /* FIXME */
244 thdb
->socket
= fd
[0];
245 fcntl( fd
[0], F_SETFD
, 1 ); /* set close on exec flag */
247 /* Create the thread on the server side */
249 request
.pid
= thdb
->process
->server_pid
;
250 request
.suspend
= ((thdb
->flags
& CREATE_SUSPENDED
) != 0);
251 request
.inherit
= (sa
&& (sa
->nLength
>=sizeof(*sa
)) && sa
->bInheritHandle
);
252 CLIENT_SendRequest( REQ_NEW_THREAD
, fd
[1], 1, &request
, sizeof(request
) );
253 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) goto error
;
254 thdb
->server_tid
= reply
.tid
;
255 *server_handle
= reply
.handle
;
257 /* Do the rest of the initialization */
259 if (!THREAD_InitTHDB( thdb
, stack_size
, alloc_stack16
, sa
)) goto error
;
260 thdb
->next
= THREAD_First
;
265 if (reply
.handle
!= -1) CloseHandle( reply
.handle
);
266 if (thdb
->teb_sel
) SELECTOR_FreeBlock( thdb
->teb_sel
, 1 );
267 HeapFree( SystemHeap
, 0, thdb
);
268 if (thdb
->socket
!= -1) close( thdb
->socket
);
273 /***********************************************************************
276 * Start execution of a newly created thread. Does not return.
278 static void THREAD_Start(void)
280 THDB
*thdb
= THREAD_Current();
281 LPTHREAD_START_ROUTINE func
= (LPTHREAD_START_ROUTINE
)thdb
->entry_point
;
282 PROCESS_CallUserSignalProc( USIG_THREAD_INIT
, 0 );
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
->teb
.flags
|= TEBF_WIN32
;
300 thread
->entry_point
= start
;
301 thread
->entry_arg
= param
;
302 thread
->startup
= THREAD_Start
;
303 if (SYSDEPS_SpawnThread( thread
) == -1)
305 CloseHandle( handle
);
306 return INVALID_HANDLE_VALUE
;
308 if (id
) *id
= (DWORD
)thread
->server_tid
;
313 /***********************************************************************
314 * ExitThread [KERNEL32.215] Ends a thread
319 void WINAPI
ExitThread( DWORD code
) /* [in] Exit code for this thread */
321 MODULE_InitializeDLLs( 0, DLL_THREAD_DETACH
, NULL
);
322 TerminateThread( GetCurrentThread(), code
);
326 /***********************************************************************
327 * GetCurrentThread [KERNEL32.200] Gets pseudohandle for current thread
330 * Pseudohandle for the current thread
332 HANDLE WINAPI
GetCurrentThread(void)
334 return CURRENT_THREAD_PSEUDOHANDLE
;
338 /***********************************************************************
339 * GetCurrentThreadId [KERNEL32.201] Returns thread identifier.
342 * Thread identifier of calling thread
344 DWORD WINAPI
GetCurrentThreadId(void)
346 THDB
*thdb
= THREAD_Current();
348 assert( thdb
->server_tid
);
349 return (DWORD
)thdb
->server_tid
;
353 /**********************************************************************
354 * GetLastError [KERNEL.148] [KERNEL32.227] Returns last-error code.
357 * Calling thread's last error code value.
359 DWORD WINAPI
GetLastError(void)
361 THDB
*thread
= THREAD_Current();
362 DWORD ret
= thread
->last_error
;
363 TRACE(thread
,"0x%lx\n",ret
);
368 /**********************************************************************
369 * SetLastError [KERNEL.147] [KERNEL32.497] Sets the last-error code.
374 void WINAPI
SetLastError(
375 DWORD error
) /* [in] Per-thread error code */
377 THDB
*thread
= THREAD_Current();
378 /* This one must work before we have a thread (FIXME) */
380 TRACE(thread
,"%p error=0x%lx\n",thread
,error
);
383 thread
->last_error
= error
;
387 /**********************************************************************
388 * SetLastErrorEx [USER32.485] Sets the last-error code.
393 void WINAPI
SetLastErrorEx(
394 DWORD error
, /* [in] Per-thread error code */
395 DWORD type
) /* [in] Error type */
397 TRACE(thread
, "(0x%08lx, 0x%08lx)\n", error
,type
);
404 /* Fall through for now */
406 FIXME(thread
, "(error=%08lx, type=%08lx): Unhandled type\n", error
,type
);
409 SetLastError( error
);
413 /**********************************************************************
414 * TlsAlloc [KERNEL32.530] Allocates a TLS index.
416 * Allocates a thread local storage index
420 * Failure: 0xFFFFFFFF
422 DWORD WINAPI
TlsAlloc( void )
424 THDB
*thread
= THREAD_Current();
425 DWORD i
, mask
, ret
= 0;
426 DWORD
*bits
= thread
->process
->tls_bits
;
427 EnterCriticalSection( &thread
->process
->crit_section
);
428 if (*bits
== 0xffffffff)
432 if (*bits
== 0xffffffff)
434 LeaveCriticalSection( &thread
->process
->crit_section
);
435 SetLastError( ERROR_NO_MORE_ITEMS
);
439 for (i
= 0, mask
= 1; i
< 32; i
++, mask
<<= 1) if (!(*bits
& mask
)) break;
441 LeaveCriticalSection( &thread
->process
->crit_section
);
446 /**********************************************************************
447 * TlsFree [KERNEL32.531] Releases a TLS index.
449 * Releases a thread local storage index, making it available for reuse
456 DWORD index
) /* [in] TLS Index to free */
459 THDB
*thread
= THREAD_Current();
460 DWORD
*bits
= thread
->process
->tls_bits
;
463 SetLastError( ERROR_INVALID_PARAMETER
);
466 EnterCriticalSection( &thread
->process
->crit_section
);
467 if (index
>= 32) bits
++;
468 mask
= (1 << (index
& 31));
469 if (!(*bits
& mask
)) /* already free? */
471 LeaveCriticalSection( &thread
->process
->crit_section
);
472 SetLastError( ERROR_INVALID_PARAMETER
);
476 thread
->tls_array
[index
] = 0;
477 /* FIXME: should zero all other thread values */
478 LeaveCriticalSection( &thread
->process
->crit_section
);
483 /**********************************************************************
484 * TlsGetValue [KERNEL32.532] Gets value in a thread's TLS slot
487 * Success: Value stored in calling thread's TLS slot for index
488 * Failure: 0 and GetLastError returns NO_ERROR
490 LPVOID WINAPI
TlsGetValue(
491 DWORD index
) /* [in] TLS index to retrieve value for */
493 THDB
*thread
= THREAD_Current();
496 SetLastError( ERROR_INVALID_PARAMETER
);
499 SetLastError( ERROR_SUCCESS
);
500 return thread
->tls_array
[index
];
504 /**********************************************************************
505 * TlsSetValue [KERNEL32.533] Stores a value in the thread's TLS slot.
511 BOOL WINAPI
TlsSetValue(
512 DWORD index
, /* [in] TLS index to set value for */
513 LPVOID value
) /* [in] Value to be stored */
515 THDB
*thread
= THREAD_Current();
518 SetLastError( ERROR_INVALID_PARAMETER
);
521 thread
->tls_array
[index
] = value
;
526 /***********************************************************************
527 * SetThreadContext [KERNEL32.670] Sets context of thread.
533 BOOL WINAPI
SetThreadContext(
534 HANDLE handle
, /* [in] Handle to thread with context */
535 CONTEXT
*context
) /* [out] Address of context structure */
537 FIXME( thread
, "not implemented\n" );
541 /***********************************************************************
542 * GetThreadContext [KERNEL32.294] Retrieves context of thread.
548 BOOL WINAPI
GetThreadContext(
549 HANDLE handle
, /* [in] Handle to thread with context */
550 CONTEXT
*context
) /* [out] Address of context structure */
554 FIXME( thread
, "returning dummy info\n" );
556 /* make up some plausible values for segment registers */
569 /**********************************************************************
570 * GetThreadPriority [KERNEL32.296] Returns priority for thread.
573 * Success: Thread's priority level.
574 * Failure: THREAD_PRIORITY_ERROR_RETURN
576 INT WINAPI
GetThreadPriority(
577 HANDLE hthread
) /* [in] Handle to thread */
579 struct get_thread_info_request req
;
580 struct get_thread_info_reply reply
;
581 req
.handle
= hthread
;
582 CLIENT_SendRequest( REQ_GET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
583 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
))
584 return THREAD_PRIORITY_ERROR_RETURN
;
585 return reply
.priority
;
589 /**********************************************************************
590 * SetThreadPriority [KERNEL32.514] Sets priority for thread.
596 BOOL WINAPI
SetThreadPriority(
597 HANDLE hthread
, /* [in] Handle to thread */
598 INT priority
) /* [in] Thread priority level */
600 struct set_thread_info_request req
;
601 req
.handle
= hthread
;
602 req
.priority
= priority
;
603 req
.mask
= SET_THREAD_INFO_PRIORITY
;
604 CLIENT_SendRequest( REQ_SET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
605 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
609 /**********************************************************************
610 * SetThreadAffinityMask (KERNEL32.669)
612 DWORD WINAPI
SetThreadAffinityMask( HANDLE hThread
, DWORD dwThreadAffinityMask
)
614 struct set_thread_info_request req
;
615 req
.handle
= hThread
;
616 req
.affinity
= dwThreadAffinityMask
;
617 req
.mask
= SET_THREAD_INFO_AFFINITY
;
618 CLIENT_SendRequest( REQ_SET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
619 if (CLIENT_WaitReply( NULL
, NULL
, 0 )) return 0;
620 return 1; /* FIXME: should return previous value */
624 /**********************************************************************
625 * TerminateThread [KERNEL32.685] Terminates a thread
631 BOOL WINAPI
TerminateThread(
632 HANDLE handle
, /* [in] Handle to thread */
633 DWORD exitcode
) /* [in] Exit code for thread */
635 struct terminate_thread_request req
;
637 req
.exit_code
= exitcode
;
638 CLIENT_SendRequest( REQ_TERMINATE_THREAD
, -1, 1, &req
, sizeof(req
) );
639 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
643 /**********************************************************************
644 * GetExitCodeThread [KERNEL32.???] Gets termination status of thread.
650 BOOL WINAPI
GetExitCodeThread(
651 HANDLE hthread
, /* [in] Handle to thread */
652 LPDWORD exitcode
) /* [out] Address to receive termination status */
654 struct get_thread_info_request req
;
655 struct get_thread_info_reply reply
;
656 req
.handle
= hthread
;
657 CLIENT_SendRequest( REQ_GET_THREAD_INFO
, -1, 1, &req
, sizeof(req
) );
658 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
659 if (exitcode
) *exitcode
= reply
.exit_code
;
664 /**********************************************************************
665 * ResumeThread [KERNEL32.587] Resumes a thread.
667 * Decrements a thread's suspend count. When count is zero, the
668 * execution of the thread is resumed.
671 * Success: Previous suspend count
672 * Failure: 0xFFFFFFFF
675 DWORD WINAPI
ResumeThread(
676 HANDLE hthread
) /* [in] Identifies thread to restart */
678 struct resume_thread_request req
;
679 struct resume_thread_reply reply
;
680 req
.handle
= hthread
;
681 CLIENT_SendRequest( REQ_RESUME_THREAD
, -1, 1, &req
, sizeof(req
) );
682 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return 0xffffffff;
687 /**********************************************************************
688 * SuspendThread [KERNEL32.681] Suspends a thread.
691 * Success: Previous suspend count
692 * Failure: 0xFFFFFFFF
694 DWORD WINAPI
SuspendThread(
695 HANDLE hthread
) /* [in] Handle to the thread */
697 struct suspend_thread_request req
;
698 struct suspend_thread_reply reply
;
699 req
.handle
= hthread
;
700 CLIENT_SendRequest( REQ_SUSPEND_THREAD
, -1, 1, &req
, sizeof(req
) );
701 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return 0xffffffff;
706 /***********************************************************************
707 * QueueUserAPC (KERNEL32.566)
709 DWORD WINAPI
QueueUserAPC( PAPCFUNC func
, HANDLE hthread
, ULONG_PTR data
)
711 struct queue_apc_request req
;
712 req
.handle
= hthread
;
714 req
.param
= (void *)data
;
715 CLIENT_SendRequest( REQ_QUEUE_APC
, -1, 1, &req
, sizeof(req
) );
716 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
720 /**********************************************************************
721 * GetThreadTimes [KERNEL32.???] Obtains timing information.
724 * What are the fields where these values are stored?
730 BOOL WINAPI
GetThreadTimes(
731 HANDLE thread
, /* [in] Specifies the thread of interest */
732 LPFILETIME creationtime
, /* [out] When the thread was created */
733 LPFILETIME exittime
, /* [out] When the thread was destroyed */
734 LPFILETIME kerneltime
, /* [out] Time thread spent in kernel mode */
735 LPFILETIME usertime
) /* [out] Time thread spent in user mode */
737 FIXME(thread
,"(0x%08x): stub\n",thread
);
738 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
743 /**********************************************************************
744 * AttachThreadInput [KERNEL32.8] Attaches input of 1 thread to other
746 * Attaches the input processing mechanism of one thread to that of
754 * 1. Reset the Key State (currenly per thread key state is not maintained)
756 BOOL WINAPI
AttachThreadInput(
757 DWORD idAttach
, /* [in] Thread to attach */
758 DWORD idAttachTo
, /* [in] Thread to attach to */
759 BOOL fAttach
) /* [in] Attach or detach */
761 MESSAGEQUEUE
*pSrcMsgQ
= 0, *pTgtMsgQ
= 0;
764 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
766 /* A thread cannot attach to itself */
767 if ( idAttach
== idAttachTo
)
770 /* According to the docs this method should fail if a
771 * "Journal record" hook is installed. (attaches all input queues together)
773 if ( HOOK_IsHooked( WH_JOURNALRECORD
) )
776 /* Retrieve message queues corresponding to the thread id's */
777 pTgtMsgQ
= (MESSAGEQUEUE
*)QUEUE_Lock( GetThreadQueue16( idAttach
) );
778 pSrcMsgQ
= (MESSAGEQUEUE
*)QUEUE_Lock( GetThreadQueue16( idAttachTo
) );
780 /* Ensure we have message queues and that Src and Tgt threads
781 * are not system threads.
783 if ( !pSrcMsgQ
|| !pTgtMsgQ
|| !pSrcMsgQ
->pQData
|| !pTgtMsgQ
->pQData
)
786 if (fAttach
) /* Attach threads */
788 /* Only attach if currently detached */
789 if ( pTgtMsgQ
->pQData
!= pSrcMsgQ
->pQData
)
791 /* First release the target threads perQData */
792 PERQDATA_Release( pTgtMsgQ
->pQData
);
794 /* Share a reference to the source threads perQDATA */
795 PERQDATA_Addref( pSrcMsgQ
->pQData
);
796 pTgtMsgQ
->pQData
= pSrcMsgQ
->pQData
;
799 else /* Detach threads */
801 /* Only detach if currently attached */
802 if ( pTgtMsgQ
->pQData
== pSrcMsgQ
->pQData
)
804 /* First release the target threads perQData */
805 PERQDATA_Release( pTgtMsgQ
->pQData
);
807 /* Give the target thread its own private perQDATA once more */
808 pTgtMsgQ
->pQData
= PERQDATA_CreateInstance();
812 /* TODO: Reset the Key State */
818 /* Unlock the queues before returning */
820 QUEUE_Unlock( pSrcMsgQ
);
822 QUEUE_Unlock( pTgtMsgQ
);
827 /**********************************************************************
828 * VWin32_BoostThreadGroup [KERNEL.535]
830 VOID WINAPI
VWin32_BoostThreadGroup( DWORD threadId
, INT boost
)
832 FIXME(thread
, "(0x%08lx,%d): stub\n", threadId
, boost
);
835 /**********************************************************************
836 * VWin32_BoostThreadStatic [KERNEL.536]
838 VOID WINAPI
VWin32_BoostThreadStatic( DWORD threadId
, INT boost
)
840 FIXME(thread
, "(0x%08lx,%d): stub\n", threadId
, boost
);
843 /**********************************************************************
844 * SetThreadLocale [KERNEL32.671] Sets the calling threads current locale.
851 * Implemented in NT only (3.1 and above according to MS
853 BOOL WINAPI
SetThreadLocale(
854 LCID lcid
) /* [in] Locale identifier */
856 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);