wined3d: Pass a wined3d_resource_desc structure to wined3d_texture_create_3d().
[wine/multimedia.git] / dlls / kernel32 / thread.c
blobc82ef58ab53ef1e24c5b5fdb37b2459518d545a6
1 /*
2 * Win32 threads
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "config.h"
22 #include "wine/port.h"
24 #include <assert.h>
25 #include <fcntl.h>
26 #include <stdarg.h>
27 #include <sys/types.h>
28 #ifdef HAVE_UNISTD_H
29 # include <unistd.h>
30 #endif
32 #include "ntstatus.h"
33 #define WIN32_NO_STATUS
34 #include "windef.h"
35 #include "winbase.h"
36 #include "winerror.h"
37 #include "winternl.h"
38 #include "wine/exception.h"
39 #include "wine/library.h"
40 #include "wine/server.h"
41 #include "wine/debug.h"
43 #include "kernel_private.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(thread);
48 /***********************************************************************
49 * CreateThread (KERNEL32.@)
51 HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread( SECURITY_ATTRIBUTES *sa, SIZE_T stack, LPTHREAD_START_ROUTINE start,
52 LPVOID param, DWORD flags, LPDWORD id )
54 return CreateRemoteThread( GetCurrentProcess(),
55 sa, stack, start, param, flags, id );
59 /***************************************************************************
60 * CreateRemoteThread (KERNEL32.@)
62 * Creates a thread that runs in the address space of another process
64 * PARAMS
66 * RETURNS
67 * Success: Handle to the new thread.
68 * Failure: NULL. Use GetLastError() to find the error cause.
70 * BUGS
71 * Improper memory allocation: there's no ability to free new_thread_info
72 * in other process.
73 * Bad start address for RtlCreateUserThread because the library
74 * may be loaded at different address in other process.
76 HANDLE WINAPI CreateRemoteThread( HANDLE hProcess, SECURITY_ATTRIBUTES *sa, SIZE_T stack,
77 LPTHREAD_START_ROUTINE start, LPVOID param,
78 DWORD flags, LPDWORD id )
80 HANDLE handle;
81 CLIENT_ID client_id;
82 NTSTATUS status;
83 SIZE_T stack_reserve = 0, stack_commit = 0;
85 if (flags & STACK_SIZE_PARAM_IS_A_RESERVATION) stack_reserve = stack;
86 else stack_commit = stack;
88 status = RtlCreateUserThread( hProcess, NULL, TRUE,
89 NULL, stack_reserve, stack_commit,
90 (PRTL_THREAD_START_ROUTINE)start, param, &handle, &client_id );
91 if (status == STATUS_SUCCESS)
93 if (id) *id = HandleToULong(client_id.UniqueThread);
94 if (sa && (sa->nLength >= sizeof(*sa)) && sa->bInheritHandle)
95 SetHandleInformation( handle, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT );
96 if (!(flags & CREATE_SUSPENDED))
98 ULONG ret;
99 if (NtResumeThread( handle, &ret ))
101 NtClose( handle );
102 SetLastError( ERROR_NOT_ENOUGH_MEMORY );
103 handle = 0;
107 else
109 SetLastError( RtlNtStatusToDosError(status) );
110 handle = 0;
112 return handle;
116 /***********************************************************************
117 * OpenThread [KERNEL32.@] Retrieves a handle to a thread from its thread id
119 HANDLE WINAPI OpenThread( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwThreadId )
121 NTSTATUS status;
122 HANDLE handle;
123 OBJECT_ATTRIBUTES attr;
124 CLIENT_ID cid;
126 attr.Length = sizeof(attr);
127 attr.RootDirectory = 0;
128 attr.Attributes = bInheritHandle ? OBJ_INHERIT : 0;
129 attr.ObjectName = NULL;
130 attr.SecurityDescriptor = NULL;
131 attr.SecurityQualityOfService = NULL;
133 cid.UniqueProcess = 0; /* FIXME */
134 cid.UniqueThread = ULongToHandle(dwThreadId);
135 status = NtOpenThread( &handle, dwDesiredAccess, &attr, &cid );
136 if (status)
138 SetLastError( RtlNtStatusToDosError(status) );
139 handle = 0;
141 return handle;
145 /***********************************************************************
146 * ExitThread [KERNEL32.@] Ends a thread
148 * RETURNS
149 * None
151 void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
153 RtlFreeThreadActivationContextStack();
154 RtlExitUserThread( code );
158 /**********************************************************************
159 * TerminateThread [KERNEL32.@] Terminates a thread
161 * RETURNS
162 * Success: TRUE
163 * Failure: FALSE
165 BOOL WINAPI TerminateThread( HANDLE handle, /* [in] Handle to thread */
166 DWORD exit_code) /* [in] Exit code for thread */
168 NTSTATUS status = NtTerminateThread( handle, exit_code );
169 if (status) SetLastError( RtlNtStatusToDosError(status) );
170 return !status;
174 /***********************************************************************
175 * FreeLibraryAndExitThread (KERNEL32.@)
177 void WINAPI FreeLibraryAndExitThread(HINSTANCE hLibModule, DWORD dwExitCode)
179 FreeLibrary(hLibModule);
180 ExitThread(dwExitCode);
184 /**********************************************************************
185 * GetExitCodeThread (KERNEL32.@)
187 * Gets termination status of thread.
189 * RETURNS
190 * Success: TRUE
191 * Failure: FALSE
193 BOOL WINAPI GetExitCodeThread(
194 HANDLE hthread, /* [in] Handle to thread */
195 LPDWORD exitcode) /* [out] Address to receive termination status */
197 THREAD_BASIC_INFORMATION info;
198 NTSTATUS status = NtQueryInformationThread( hthread, ThreadBasicInformation,
199 &info, sizeof(info), NULL );
201 if (status)
203 SetLastError( RtlNtStatusToDosError(status) );
204 return FALSE;
206 if (exitcode) *exitcode = info.ExitStatus;
207 return TRUE;
211 /***********************************************************************
212 * SetThreadContext [KERNEL32.@] Sets context of thread.
214 * RETURNS
215 * Success: TRUE
216 * Failure: FALSE
218 BOOL WINAPI SetThreadContext( HANDLE handle, /* [in] Handle to thread with context */
219 const CONTEXT *context ) /* [in] Address of context structure */
221 NTSTATUS status = NtSetContextThread( handle, context );
222 if (status) SetLastError( RtlNtStatusToDosError(status) );
223 return !status;
227 /***********************************************************************
228 * GetThreadContext [KERNEL32.@] Retrieves context of thread.
230 * RETURNS
231 * Success: TRUE
232 * Failure: FALSE
234 BOOL WINAPI GetThreadContext( HANDLE handle, /* [in] Handle to thread with context */
235 CONTEXT *context ) /* [out] Address of context structure */
237 NTSTATUS status = NtGetContextThread( handle, context );
238 if (status) SetLastError( RtlNtStatusToDosError(status) );
239 return !status;
243 /**********************************************************************
244 * SuspendThread [KERNEL32.@] Suspends a thread.
246 * RETURNS
247 * Success: Previous suspend count
248 * Failure: 0xFFFFFFFF
250 DWORD WINAPI SuspendThread( HANDLE hthread ) /* [in] Handle to the thread */
252 DWORD ret;
253 NTSTATUS status = NtSuspendThread( hthread, &ret );
255 if (status)
257 ret = ~0U;
258 SetLastError( RtlNtStatusToDosError(status) );
260 return ret;
264 /**********************************************************************
265 * ResumeThread [KERNEL32.@] Resumes a thread.
267 * Decrements a thread's suspend count. When count is zero, the
268 * execution of the thread is resumed.
270 * RETURNS
271 * Success: Previous suspend count
272 * Failure: 0xFFFFFFFF
273 * Already running: 0
275 DWORD WINAPI ResumeThread( HANDLE hthread ) /* [in] Identifies thread to restart */
277 DWORD ret;
278 NTSTATUS status = NtResumeThread( hthread, &ret );
280 if (status)
282 ret = ~0U;
283 SetLastError( RtlNtStatusToDosError(status) );
285 return ret;
289 /**********************************************************************
290 * GetThreadPriority [KERNEL32.@] Returns priority for thread.
292 * RETURNS
293 * Success: Thread's priority level.
294 * Failure: THREAD_PRIORITY_ERROR_RETURN
296 INT WINAPI GetThreadPriority(
297 HANDLE hthread) /* [in] Handle to thread */
299 THREAD_BASIC_INFORMATION info;
300 NTSTATUS status = NtQueryInformationThread( hthread, ThreadBasicInformation,
301 &info, sizeof(info), NULL );
303 if (status)
305 SetLastError( RtlNtStatusToDosError(status) );
306 return THREAD_PRIORITY_ERROR_RETURN;
308 return info.Priority;
312 /**********************************************************************
313 * SetThreadPriority [KERNEL32.@] Sets priority for thread.
315 * RETURNS
316 * Success: TRUE
317 * Failure: FALSE
319 BOOL WINAPI SetThreadPriority(
320 HANDLE hthread, /* [in] Handle to thread */
321 INT priority) /* [in] Thread priority level */
323 DWORD prio = priority;
324 NTSTATUS status;
326 status = NtSetInformationThread(hthread, ThreadBasePriority,
327 &prio, sizeof(prio));
329 if (status)
331 SetLastError( RtlNtStatusToDosError(status) );
332 return FALSE;
335 return TRUE;
339 /**********************************************************************
340 * GetThreadPriorityBoost [KERNEL32.@] Returns priority boost for thread.
342 * Always reports that priority boost is disabled.
344 * RETURNS
345 * Success: TRUE.
346 * Failure: FALSE
348 BOOL WINAPI GetThreadPriorityBoost(
349 HANDLE hthread, /* [in] Handle to thread */
350 PBOOL pstate) /* [out] pointer to var that receives the boost state */
352 if (pstate) *pstate = FALSE;
353 return TRUE;
357 /**********************************************************************
358 * SetThreadPriorityBoost [KERNEL32.@] Sets priority boost for thread.
360 * Priority boost is not implemented, but we return TRUE
361 * anyway because some games crash otherwise.
363 BOOL WINAPI SetThreadPriorityBoost(
364 HANDLE hthread, /* [in] Handle to thread */
365 BOOL disable) /* [in] TRUE to disable priority boost */
367 return TRUE;
371 /**********************************************************************
372 * SetThreadStackGuarantee (KERNEL32.@)
374 BOOL WINAPI SetThreadStackGuarantee(PULONG stacksize)
376 static int once;
377 if (once++ == 0)
378 FIXME("(%p): stub\n", stacksize);
379 return TRUE;
382 /**********************************************************************
383 * SetThreadAffinityMask (KERNEL32.@)
385 DWORD_PTR WINAPI SetThreadAffinityMask( HANDLE hThread, DWORD_PTR dwThreadAffinityMask )
387 NTSTATUS status;
388 THREAD_BASIC_INFORMATION tbi;
390 status = NtQueryInformationThread( hThread, ThreadBasicInformation,
391 &tbi, sizeof(tbi), NULL );
392 if (status)
394 SetLastError( RtlNtStatusToDosError(status) );
395 return 0;
397 status = NtSetInformationThread( hThread, ThreadAffinityMask,
398 &dwThreadAffinityMask,
399 sizeof(dwThreadAffinityMask));
400 if (status)
402 SetLastError( RtlNtStatusToDosError(status) );
403 return 0;
405 return tbi.AffinityMask;
409 /**********************************************************************
410 * SetThreadIdealProcessor [KERNEL32.@] Sets preferred processor for thread.
412 * RETURNS
413 * Success: Value of last call to SetThreadIdealProcessor
414 * Failure: -1
416 DWORD WINAPI SetThreadIdealProcessor(
417 HANDLE hThread, /* [in] Specifies the thread of interest */
418 DWORD dwIdealProcessor) /* [in] Specifies the new preferred processor */
420 FIXME("(%p): stub\n",hThread);
421 if (dwIdealProcessor > MAXIMUM_PROCESSORS)
423 SetLastError(ERROR_INVALID_PARAMETER);
424 return ~0u;
426 return 0;
430 /***********************************************************************
431 * GetThreadSelectorEntry (KERNEL32.@)
433 BOOL WINAPI GetThreadSelectorEntry( HANDLE hthread, DWORD sel, LPLDT_ENTRY ldtent )
435 THREAD_DESCRIPTOR_INFORMATION tdi;
436 NTSTATUS status;
438 tdi.Selector = sel;
439 status = NtQueryInformationThread( hthread, ThreadDescriptorTableEntry, &tdi, sizeof(tdi), NULL);
440 if (status)
442 SetLastError( RtlNtStatusToDosError(status) );
443 return FALSE;
445 *ldtent = tdi.Entry;
446 return TRUE;
450 /* callback for QueueUserAPC */
451 static void CALLBACK call_user_apc( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3 )
453 PAPCFUNC func = (PAPCFUNC)arg1;
454 func( arg2 );
457 /***********************************************************************
458 * QueueUserAPC (KERNEL32.@)
460 DWORD WINAPI QueueUserAPC( PAPCFUNC func, HANDLE hthread, ULONG_PTR data )
462 NTSTATUS status = NtQueueApcThread( hthread, call_user_apc, (ULONG_PTR)func, data, 0 );
464 if (status) SetLastError( RtlNtStatusToDosError(status) );
465 return !status;
468 /***********************************************************************
469 * QueueUserWorkItem (KERNEL32.@)
471 BOOL WINAPI QueueUserWorkItem( LPTHREAD_START_ROUTINE Function, PVOID Context, ULONG Flags )
473 NTSTATUS status;
475 TRACE("(%p,%p,0x%08x)\n", Function, Context, Flags);
477 status = RtlQueueWorkItem( Function, Context, Flags );
479 if (status) SetLastError( RtlNtStatusToDosError(status) );
480 return !status;
483 /**********************************************************************
484 * GetThreadTimes [KERNEL32.@] Obtains timing information.
486 * RETURNS
487 * Success: TRUE
488 * Failure: FALSE
490 BOOL WINAPI GetThreadTimes(
491 HANDLE thread, /* [in] Specifies the thread of interest */
492 LPFILETIME creationtime, /* [out] When the thread was created */
493 LPFILETIME exittime, /* [out] When the thread was destroyed */
494 LPFILETIME kerneltime, /* [out] Time thread spent in kernel mode */
495 LPFILETIME usertime) /* [out] Time thread spent in user mode */
497 KERNEL_USER_TIMES kusrt;
498 NTSTATUS status;
500 status = NtQueryInformationThread(thread, ThreadTimes, &kusrt,
501 sizeof(kusrt), NULL);
502 if (status)
504 SetLastError( RtlNtStatusToDosError(status) );
505 return FALSE;
507 if (creationtime)
509 creationtime->dwLowDateTime = kusrt.CreateTime.u.LowPart;
510 creationtime->dwHighDateTime = kusrt.CreateTime.u.HighPart;
512 if (exittime)
514 exittime->dwLowDateTime = kusrt.ExitTime.u.LowPart;
515 exittime->dwHighDateTime = kusrt.ExitTime.u.HighPart;
517 if (kerneltime)
519 kerneltime->dwLowDateTime = kusrt.KernelTime.u.LowPart;
520 kerneltime->dwHighDateTime = kusrt.KernelTime.u.HighPart;
522 if (usertime)
524 usertime->dwLowDateTime = kusrt.UserTime.u.LowPart;
525 usertime->dwHighDateTime = kusrt.UserTime.u.HighPart;
528 return TRUE;
531 /**********************************************************************
532 * GetThreadId [KERNEL32.@]
534 * Retrieve the identifier of a thread.
536 * PARAMS
537 * Thread [I] The thread to retrieve the identifier of.
539 * RETURNS
540 * Success: Identifier of the target thread.
541 * Failure: 0
543 DWORD WINAPI GetThreadId(HANDLE Thread)
545 THREAD_BASIC_INFORMATION tbi;
546 NTSTATUS status;
548 TRACE("(%p)\n", Thread);
550 status = NtQueryInformationThread(Thread, ThreadBasicInformation, &tbi,
551 sizeof(tbi), NULL);
552 if (status)
554 SetLastError( RtlNtStatusToDosError(status) );
555 return 0;
558 return HandleToULong(tbi.ClientId.UniqueThread);
562 /***********************************************************************
563 * GetCurrentThread [KERNEL32.@] Gets pseudohandle for current thread
565 * RETURNS
566 * Pseudohandle for the current thread
568 #undef GetCurrentThread
569 HANDLE WINAPI GetCurrentThread(void)
571 return (HANDLE)~(ULONG_PTR)1;
575 #ifdef __i386__
577 /***********************************************************************
578 * SetLastError (KERNEL32.@)
580 /* void WINAPI SetLastError( DWORD error ); */
581 __ASM_STDCALL_FUNC( SetLastError, 4,
582 "movl 4(%esp),%eax\n\t"
583 ".byte 0x64\n\t"
584 "movl %eax,0x34\n\t"
585 "ret $4" )
587 /***********************************************************************
588 * GetLastError (KERNEL32.@)
590 /* DWORD WINAPI GetLastError(void); */
591 __ASM_STDCALL_FUNC( GetLastError, 0, ".byte 0x64\n\tmovl 0x34,%eax\n\tret" )
593 /***********************************************************************
594 * GetCurrentProcessId (KERNEL32.@)
596 /* DWORD WINAPI GetCurrentProcessId(void) */
597 __ASM_STDCALL_FUNC( GetCurrentProcessId, 0, ".byte 0x64\n\tmovl 0x20,%eax\n\tret" )
599 /***********************************************************************
600 * GetCurrentThreadId (KERNEL32.@)
602 /* DWORD WINAPI GetCurrentThreadId(void) */
603 __ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" )
605 /***********************************************************************
606 * GetProcessHeap (KERNEL32.@)
608 /* HANDLE WINAPI GetProcessHeap(void) */
609 __ASM_STDCALL_FUNC( GetProcessHeap, 0, ".byte 0x64\n\tmovl 0x30,%eax\n\tmovl 0x18(%eax),%eax\n\tret");
611 #elif defined(__x86_64__)
613 /***********************************************************************
614 * SetLastError (KERNEL32.@)
616 /* void WINAPI SetLastError( DWORD error ); */
617 __ASM_STDCALL_FUNC( SetLastError, 8, ".byte 0x65\n\tmovl %ecx,0x68\n\tret" );
619 /***********************************************************************
620 * GetLastError (KERNEL32.@)
622 /* DWORD WINAPI GetLastError(void); */
623 __ASM_STDCALL_FUNC( GetLastError, 0, ".byte 0x65\n\tmovl 0x68,%eax\n\tret" );
625 /***********************************************************************
626 * GetCurrentProcessId (KERNEL32.@)
628 /* DWORD WINAPI GetCurrentProcessId(void) */
629 __ASM_STDCALL_FUNC( GetCurrentProcessId, 0, ".byte 0x65\n\tmovl 0x40,%eax\n\tret" );
631 /***********************************************************************
632 * GetCurrentThreadId (KERNEL32.@)
634 /* DWORD WINAPI GetCurrentThreadId(void) */
635 __ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x65\n\tmovl 0x48,%eax\n\tret" );
637 /***********************************************************************
638 * GetProcessHeap (KERNEL32.@)
640 /* HANDLE WINAPI GetProcessHeap(void) */
641 __ASM_STDCALL_FUNC( GetProcessHeap, 0, ".byte 0x65\n\tmovq 0x60,%rax\n\tmovq 0x30(%rax),%rax\n\tret");
643 #else /* __x86_64__ */
645 /**********************************************************************
646 * SetLastError (KERNEL32.@)
648 * Sets the last-error code.
650 * RETURNS
651 * Nothing.
653 void WINAPI SetLastError( DWORD error ) /* [in] Per-thread error code */
655 NtCurrentTeb()->LastErrorValue = error;
658 /**********************************************************************
659 * GetLastError (KERNEL32.@)
661 * Get the last-error code.
663 * RETURNS
664 * last-error code.
666 DWORD WINAPI GetLastError(void)
668 return NtCurrentTeb()->LastErrorValue;
671 /***********************************************************************
672 * GetCurrentProcessId (KERNEL32.@)
674 * Get the current process identifier.
676 * RETURNS
677 * current process identifier
679 DWORD WINAPI GetCurrentProcessId(void)
681 return HandleToULong(NtCurrentTeb()->ClientId.UniqueProcess);
684 /***********************************************************************
685 * GetCurrentThreadId (KERNEL32.@)
687 * Get the current thread identifier.
689 * RETURNS
690 * current thread identifier
692 DWORD WINAPI GetCurrentThreadId(void)
694 return HandleToULong(NtCurrentTeb()->ClientId.UniqueThread);
697 /***********************************************************************
698 * GetProcessHeap (KERNEL32.@)
700 HANDLE WINAPI GetProcessHeap(void)
702 return NtCurrentTeb()->Peb->ProcessHeap;
705 #endif /* __i386__ */
707 /*************************************************************************
708 * rtlmode_to_win32mode
710 static DWORD rtlmode_to_win32mode( DWORD rtlmode )
712 DWORD win32mode = 0;
714 if (rtlmode & 0x10)
715 win32mode |= SEM_FAILCRITICALERRORS;
716 if (rtlmode & 0x20)
717 win32mode |= SEM_NOGPFAULTERRORBOX;
718 if (rtlmode & 0x40)
719 win32mode |= SEM_NOOPENFILEERRORBOX;
721 return win32mode;
724 /***********************************************************************
725 * SetThreadErrorMode (KERNEL32.@)
727 * Set the thread local error mode.
729 * PARAMS
730 * mode [I] The new error mode, a bitwise or of SEM_FAILCRITICALERRORS,
731 * SEM_NOGPFAULTERRORBOX and SEM_NOOPENFILEERRORBOX.
732 * oldmode [O] Destination of the old error mode (may be NULL)
734 * RETURNS
735 * Success: TRUE
736 * Failure: FALSE, check GetLastError
738 BOOL WINAPI SetThreadErrorMode( DWORD mode, LPDWORD oldmode )
740 NTSTATUS status;
741 DWORD tmp = 0;
743 if (mode & ~(SEM_FAILCRITICALERRORS |
744 SEM_NOGPFAULTERRORBOX |
745 SEM_NOOPENFILEERRORBOX))
747 SetLastError( ERROR_INVALID_PARAMETER );
748 return FALSE;
751 if (mode & SEM_FAILCRITICALERRORS)
752 tmp |= 0x10;
753 if (mode & SEM_NOGPFAULTERRORBOX)
754 tmp |= 0x20;
755 if (mode & SEM_NOOPENFILEERRORBOX)
756 tmp |= 0x40;
758 status = RtlSetThreadErrorMode( tmp, oldmode );
759 if (status)
761 SetLastError( RtlNtStatusToDosError(status) );
762 return FALSE;
765 if (oldmode)
766 *oldmode = rtlmode_to_win32mode(*oldmode);
768 return TRUE;
771 /***********************************************************************
772 * GetThreadErrorMode (KERNEL32.@)
774 * Get the thread local error mode.
776 * PARAMS
777 * None.
779 * RETURNS
780 * The current thread local error mode.
782 DWORD WINAPI GetThreadErrorMode( void )
784 return rtlmode_to_win32mode( RtlGetThreadErrorMode() );
787 /***********************************************************************
788 * GetThreadUILanguage (KERNEL32.@)
790 * Get the current thread's language identifier.
792 * PARAMS
793 * None.
795 * RETURNS
796 * The current thread's language identifier.
798 LANGID WINAPI GetThreadUILanguage( void )
800 LANGID lang;
801 NtQueryDefaultUILanguage( &lang );
802 FIXME(": stub, returning default language.\n");
803 return lang;
806 /***********************************************************************
807 * GetThreadIOPendingFlag (KERNEL32.@)
809 BOOL WINAPI GetThreadIOPendingFlag( HANDLE thread, PBOOL io_pending )
811 FIXME("%p, %p\n", thread, io_pending);
812 *io_pending = FALSE;
813 return TRUE;
816 /***********************************************************************
817 * SetThreadPreferredUILanguages (KERNEL32.@)
819 BOOL WINAPI SetThreadPreferredUILanguages( DWORD flags, PCZZWSTR buffer, PULONG count )
821 FIXME( "%u, %p, %p\n", flags, buffer, count );
822 return TRUE;
825 /***********************************************************************
826 * GetThreadPreferredUILanguages (KERNEL32.@)
828 BOOL WINAPI GetThreadPreferredUILanguages( DWORD flags, PULONG count, PCZZWSTR buffer, PULONG buffersize )
830 FIXME( "%u, %p, %p %p\n", flags, count, buffer, buffersize );
831 *count = 0;
832 *buffersize = 0;
833 return TRUE;
836 /***********************************************************************
837 * InitializeSRWLock (KERNEL32.@)
839 VOID WINAPI InitializeSRWLock( PSRWLOCK srwlock )
841 FIXME( "(%p): stub\n", srwlock );
844 /***********************************************************************
845 * AcquireSRWLockExclusive (KERNEL32.@)
847 VOID WINAPI AcquireSRWLockExclusive( PSRWLOCK srwlock )
849 FIXME( "(%p): stub\n", srwlock );
852 /***********************************************************************
853 * ReleaseSRWLockExclusive (KERNEL32.@)
855 VOID WINAPI ReleaseSRWLockExclusive( PSRWLOCK srwlock )
857 FIXME( "(%p): stub\n", srwlock );
860 /***********************************************************************
861 * AcquireSRWLockShared (KERNEL32.@)
863 VOID WINAPI AcquireSRWLockShared( PSRWLOCK srwlock )
865 FIXME( "(%p): stub\n", srwlock );
868 /***********************************************************************
869 * ReleaseSRWLockShared (KERNEL32.@)
871 VOID WINAPI ReleaseSRWLockShared( PSRWLOCK srwlock )
873 FIXME( "(%p): stub\n", srwlock );