ReactOS 0.4.16-dev-1409-g71b6fab
thread.c
Go to the documentation of this file.
1/*
2 * Win32 threads
3 *
4 * Copyright 1996, 2002, 2019 Alexandre Julliard
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include <stdarg.h>
22#include <string.h>
23#include <limits.h>
24
25#include "ntstatus.h"
26#define WIN32_NO_STATUS
27#include "windef.h"
28#include "winbase.h"
29#include "winnls.h"
30#include "winternl.h"
31
32#include "kernelbase.h"
33#include "wine/exception.h"
34#include "wine/asm.h"
35#include "wine/debug.h"
36#include "wine/heap.h"
37
39
40
41/***********************************************************************
42 * Threads
43 ***********************************************************************/
44
45
47{
48 DWORD win32mode = 0;
49
50 if (rtlmode & 0x10) win32mode |= SEM_FAILCRITICALERRORS;
51 if (rtlmode & 0x20) win32mode |= SEM_NOGPFAULTERRORBOX;
52 if (rtlmode & 0x40) win32mode |= SEM_NOOPENFILEERRORBOX;
53 return win32mode;
54}
55
56
57/***************************************************************************
58 * CreateRemoteThread (kernelbase.@)
59 */
62 DWORD flags, DWORD *id )
63{
65}
66
67
68/***************************************************************************
69 * CreateRemoteThreadEx (kernelbase.@)
70 */
74 LPPROC_THREAD_ATTRIBUTE_LIST attributes, DWORD *id )
75{
78 SIZE_T stack_reserve = 0, stack_commit = 0;
79
80 if (attributes) FIXME("thread attributes ignored\n");
81
82 if (flags & STACK_SIZE_PARAM_IS_A_RESERVATION) stack_reserve = stack;
83 else stack_commit = stack;
84
85 if (!set_ntstatus( RtlCreateUserThread( process, sa ? sa->lpSecurityDescriptor : NULL, TRUE,
86 0, stack_reserve, stack_commit,
88 return 0;
89
90 if (id) *id = HandleToULong( client_id.UniqueThread );
91 if (sa && sa->nLength >= sizeof(*sa) && sa->bInheritHandle)
93 if (!(flags & CREATE_SUSPENDED))
94 {
95 ULONG ret;
96 if (NtResumeThread( handle, &ret ))
97 {
98 NtClose( handle );
100 handle = 0;
101 }
102 }
103 return handle;
104}
105
106
107/***********************************************************************
108 * CreateThread (kernelbase.@)
109 */
112 DWORD flags, LPDWORD id )
113{
115}
116
117
118/***********************************************************************
119 * FreeLibraryAndExitThread (kernelbase.@)
120 */
122{
125}
126
127
128/***********************************************************************
129 * GetCurrentThreadStackLimits (kernelbase.@)
130 */
132{
133 *low = (ULONG_PTR)NtCurrentTeb()->DeallocationStack;
134 *high = (ULONG_PTR)NtCurrentTeb()->Tib.StackBase;
135}
136
137
138/***********************************************************************
139 * GetCurrentThread (kernelbase.@)
140 */
142{
143 return (HANDLE)~(ULONG_PTR)1;
144}
145
146
147/***********************************************************************
148 * GetCurrentThreadId (kernelbase.@)
149 */
151{
153}
154
155
156/**********************************************************************
157 * GetExitCodeThread (kernelbase.@)
158 */
160{
163 &info, sizeof(info), NULL );
164 if (!status && exit_code) *exit_code = info.ExitStatus;
165 return set_ntstatus( status );
166}
167
168
169/**********************************************************************
170 * GetLastError (kernelbase.@)
171 */
173{
174 return NtCurrentTeb()->LastErrorValue;
175}
176
177
178/**********************************************************************
179 * GetProcessIdOfThread (kernelbase.@)
180 */
182{
184
186 return 0;
188}
189
190
191/***********************************************************************
192 * GetThreadContext (kernelbase.@)
193 */
195{
197}
198
199
200/***********************************************************************
201 * GetThreadErrorMode (kernelbase.@)
202 */
204{
206}
207
208
209/***********************************************************************
210 * GetThreadGroupAffinity (kernelbase.@)
211 */
213{
214 if (!affinity)
215 {
217 return FALSE;
218 }
220 affinity, sizeof(*affinity), NULL ));
221}
222
223
224/***********************************************************************
225 * GetThreadIOPendingFlag (kernelbase.@)
226 */
228{
230 pending, sizeof(*pending), NULL ));
231}
232
233
234/**********************************************************************
235 * GetThreadId (kernelbase.@)
236 */
238{
240
242 return 0;
243 return HandleToULong( tbi.ClientId.UniqueThread );
244}
245
246
247/***********************************************************************
248 * GetThreadIdealProcessorEx (kernelbase.@)
249 */
251{
252 return set_ntstatus( NtQueryInformationThread( thread, ThreadIdealProcessorEx, ideal, sizeof(*ideal), NULL));
253}
254
255
256/***********************************************************************
257 * GetThreadLocale (kernelbase.@)
258 */
259LCID WINAPI /* DECLSPEC_HOTPATCH */ GetThreadLocale(void)
260{
261 LCID ret = NtCurrentTeb()->CurrentLocale;
262 if (!ret) NtCurrentTeb()->CurrentLocale = ret = GetUserDefaultLCID();
263 return ret;
264}
265
266
267/**********************************************************************
268 * GetThreadPriority (kernelbase.@)
269 */
271{
273
275 &info, sizeof(info), NULL )))
277 return info.Priority;
278}
279
280
281/**********************************************************************
282 * GetThreadPriorityBoost (kernelbase.@)
283 */
285{
287}
288
289
290/**********************************************************************
291 * GetThreadTimes (kernelbase.@)
292 */
294 LPFILETIME kerneltime, LPFILETIME usertime )
295{
297
299 return FALSE;
300
301 if (creationtime)
302 {
303 creationtime->dwLowDateTime = times.CreateTime.u.LowPart;
304 creationtime->dwHighDateTime = times.CreateTime.u.HighPart;
305 }
306 if (exittime)
307 {
308 exittime->dwLowDateTime = times.ExitTime.u.LowPart;
309 exittime->dwHighDateTime = times.ExitTime.u.HighPart;
310 }
311 if (kerneltime)
312 {
313 kerneltime->dwLowDateTime = times.KernelTime.u.LowPart;
314 kerneltime->dwHighDateTime = times.KernelTime.u.HighPart;
315 }
316 if (usertime)
317 {
318 usertime->dwLowDateTime = times.UserTime.u.LowPart;
319 usertime->dwHighDateTime = times.UserTime.u.HighPart;
320 }
321 return TRUE;
322}
323
324
325/***********************************************************************
326 * GetThreadUILanguage (kernelbase.@)
327 */
329{
330 LANGID lang;
331
332 FIXME(": stub, returning default language.\n");
334 return lang;
335}
336
337
338/***********************************************************************
339 * OpenThread (kernelbase.@)
340 */
342{
346
347 attr.Length = sizeof(attr);
348 attr.RootDirectory = 0;
349 attr.Attributes = inherit ? OBJ_INHERIT : 0;
350 attr.ObjectName = NULL;
351 attr.SecurityDescriptor = NULL;
352 attr.SecurityQualityOfService = NULL;
353
354 cid.UniqueProcess = 0;
355 cid.UniqueThread = ULongToHandle( id );
356
357 if (!set_ntstatus( NtOpenThread( &handle, access, &attr, &cid ))) handle = 0;
358 return handle;
359}
360
361
362/* callback for QueueUserAPC */
364{
366 func( arg2 );
367}
368
369/***********************************************************************
370 * QueueUserAPC (kernelbase.@)
371 */
373{
375}
376
377
378/***********************************************************************
379 * QueryThreadCycleTime (kernelbase.@)
380 */
382{
383 static int once;
384 if (!once++) FIXME( "(%p,%p): stub!\n", thread, cycle );
386 return FALSE;
387}
388
389
390/**********************************************************************
391 * ResumeThread (kernelbase.@)
392 */
394{
395 DWORD ret;
396
397 if (!set_ntstatus( NtResumeThread( thread, &ret ))) ret = ~0U;
398 return ret;
399}
400
401
402/***********************************************************************
403 * SetThreadContext (kernelbase.@)
404 */
406{
408}
409
410
411/***********************************************************************
412 * SetThreadDescription (kernelbase.@)
413 */
415{
416 THREAD_NAME_INFORMATION info;
417 int length;
418
419 TRACE( "(%p, %s)\n", thread, debugstr_w( description ));
420
421 length = description ? lstrlenW( description ) * sizeof(WCHAR) : 0;
422
423 if (length > USHRT_MAX)
425
426 info.ThreadName.Length = info.ThreadName.MaximumLength = length;
427 info.ThreadName.Buffer = (WCHAR *)description;
428
430}
431
432/***********************************************************************
433 * GetThreadDescription (kernelbase.@)
434 */
436{
437 THREAD_NAME_INFORMATION *info;
440
441 TRACE( "(%p, %p)\n", thread, description );
442
443 *description = NULL;
444
445 length = 0;
448 return HRESULT_FROM_NT(status);
449
450 if (!(info = heap_alloc( length )))
452
454 if (!status)
455 {
456 if (!(*description = LocalAlloc( 0, info->ThreadName.Length + sizeof(WCHAR))))
458 else
459 {
460 if (info->ThreadName.Length)
461 memcpy(*description, info->ThreadName.Buffer, info->ThreadName.Length);
462 (*description)[info->ThreadName.Length / sizeof(WCHAR)] = 0;
463 }
464 }
465
467
468 return HRESULT_FROM_NT(status);
469}
470
471/***********************************************************************
472 * SetThreadErrorMode (kernelbase.@)
473 */
475{
477 DWORD new = 0;
478
480 {
482 return FALSE;
483 }
484
485 if (mode & SEM_FAILCRITICALERRORS) new |= 0x10;
486 if (mode & SEM_NOGPFAULTERRORBOX) new |= 0x20;
487 if (mode & SEM_NOOPENFILEERRORBOX) new |= 0x40;
488
489 status = RtlSetThreadErrorMode( new, old );
490 if (!status && old) *old = rtlmode_to_win32mode( *old );
491 return set_ntstatus( status );
492}
493
494
495/***********************************************************************
496 * SetThreadGroupAffinity (kernelbase.@)
497 */
499 GROUP_AFFINITY *old )
500{
501 if (old && !GetThreadGroupAffinity( thread, old )) return FALSE;
503}
504
505
506/**********************************************************************
507 * SetThreadIdealProcessor (kernelbase.@)
508 */
510{
512
514 if (NT_SUCCESS(status)) return status;
515
517 return ~0u;
518}
519
520
521/***********************************************************************
522 * SetThreadIdealProcessorEx (kernelbase.@)
523 */
525 PROCESSOR_NUMBER *previous )
526{
527 FIXME( "(%p %p %p): stub\n", thread, ideal, previous );
529 return FALSE;
530}
531
532
533/**********************************************************************
534 * SetThreadLocale (kernelbase.@)
535 */
537{
539 if (lcid != GetThreadLocale())
540 {
542 {
544 return FALSE;
545 }
546 NtCurrentTeb()->CurrentLocale = lcid;
547 }
548 return TRUE;
549}
550
551
552/**********************************************************************
553 * SetThreadPriority (kernelbase.@)
554 */
556{
557 DWORD prio = priority;
558 return set_ntstatus( NtSetInformationThread( thread, ThreadBasePriority, &prio, sizeof(prio) ));
559}
560
561
562/**********************************************************************
563 * SetThreadPriorityBoost (kernelbase.@)
564 */
566{
568}
569
570
571/**********************************************************************
572 * SetThreadStackGuarantee (kernelbase.@)
573 */
575{
576 ULONG prev_size = NtCurrentTeb()->GuaranteedStackBytes;
577 ULONG new_size = (*size + 4095) & ~4095;
578
579 /* at least 2 pages on 64-bit */
580 if (sizeof(void *) > sizeof(int) && new_size) new_size = max( new_size, 8192 );
581
582 *size = prev_size;
583 if (new_size >= (char *)NtCurrentTeb()->Tib.StackBase - (char *)NtCurrentTeb()->DeallocationStack)
584 {
586 return FALSE;
587 }
588 if (new_size > prev_size) NtCurrentTeb()->GuaranteedStackBytes = (new_size + 4095) & ~4095;
589 return TRUE;
590}
591
592
593/**********************************************************************
594 * SetThreadUILanguage (kernelbase.@)
595 */
597{
598 TRACE( "(0x%04x) stub - returning success\n", langid );
599
601 return langid;
602}
603
604
605/**********************************************************************
606 * SetThreadInformation (kernelbase.@)
607 */
609 VOID *info, DWORD size )
610{
611 switch (info_class)
612 {
613 case ThreadMemoryPriority:
615 case ThreadPowerThrottling:
617 default:
618 FIXME("Unsupported class %u.\n", info_class);
619 return FALSE;
620 }
621}
622
623
624/**********************************************************************
625 * SuspendThread (kernelbase.@)
626 */
628{
629 DWORD ret;
630
631 if (!set_ntstatus( NtSuspendThread( thread, &ret ))) ret = ~0U;
632 return ret;
633}
634
635
636/***********************************************************************
637 * SwitchToThread (kernelbase.@)
638 */
640{
642}
643
644
645/**********************************************************************
646 * TerminateThread (kernelbase.@)
647 */
649{
651}
652
653
654/**********************************************************************
655 * TlsAlloc (kernelbase.@)
656 */
658{
659 DWORD index;
660 PEB * const peb = NtCurrentTeb()->Peb;
661
663 index = RtlFindClearBitsAndSet( peb->TlsBitmap, 1, 1 );
664 if (index != ~0U) NtCurrentTeb()->TlsSlots[index] = 0; /* clear the value */
665 else
666 {
668 if (index != ~0U)
669 {
670 if (!NtCurrentTeb()->TlsExpansionSlots &&
671 !(NtCurrentTeb()->TlsExpansionSlots = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
672 8 * sizeof(peb->TlsExpansionBitmapBits) * sizeof(void*) )))
673 {
675 index = ~0U;
677 }
678 else
679 {
680 NtCurrentTeb()->TlsExpansionSlots[index] = 0; /* clear the value */
682 }
683 }
685 }
687 return index;
688}
689
690
691/**********************************************************************
692 * TlsFree (kernelbase.@)
693 */
695{
696 BOOL ret;
697
700 {
703 }
704 else
705 {
708 }
712 return ret;
713}
714
715
716/**********************************************************************
717 * TlsGetValue (kernelbase.@)
718 */
720{
722 if (index < TLS_MINIMUM_AVAILABLE) return NtCurrentTeb()->TlsSlots[index];
723
725 if (index >= 8 * sizeof(NtCurrentTeb()->Peb->TlsExpansionBitmapBits))
726 {
728 return NULL;
729 }
730 if (!NtCurrentTeb()->TlsExpansionSlots) return NULL;
731 return NtCurrentTeb()->TlsExpansionSlots[index];
732}
733
734
735/**********************************************************************
736 * TlsSetValue (kernelbase.@)
737 */
739{
741 {
742 NtCurrentTeb()->TlsSlots[index] = value;
743 }
744 else
745 {
747 if (index >= 8 * sizeof(NtCurrentTeb()->Peb->TlsExpansionBitmapBits))
748 {
750 return FALSE;
751 }
752 if (!NtCurrentTeb()->TlsExpansionSlots &&
753 !(NtCurrentTeb()->TlsExpansionSlots = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
754 8 * sizeof(NtCurrentTeb()->Peb->TlsExpansionBitmapBits) * sizeof(void*) )))
755 {
757 return FALSE;
758 }
759 NtCurrentTeb()->TlsExpansionSlots[index] = value;
760 }
761 return TRUE;
762}
763
764
765/***********************************************************************
766 * Wow64GetThreadContext (kernelbase.@)
767 */
769{
770#ifdef __i386__
772#elif defined(__x86_64__)
773 return set_ntstatus( RtlWow64GetThreadContext( handle, context ));
774#else
776#endif
777}
778
779
780/***********************************************************************
781 * Wow64SetThreadContext (kernelbase.@)
782 */
784{
785#ifdef __i386__
787#elif defined(__x86_64__)
788 return set_ntstatus( RtlWow64SetThreadContext( handle, context ));
789#else
791#endif
792}
793
794
795/***********************************************************************
796 * Fibers
797 ***********************************************************************/
798
799
801{
802 ACTIVATION_CONTEXT_STACK stack_space; /* activation context stack space */
803 ACTIVATION_CONTEXT_STACK *stack_ptr; /* last value of ActivationContextStackPointer */
804};
805
807{
808 LPVOID param; /* 00/00 fiber param */
809 void *except; /* 04/08 saved exception handlers list */
810 void *stack_base; /* 08/10 top of fiber stack */
811 void *stack_limit; /* 0c/18 fiber stack low-water mark */
812 void *stack_allocation; /* 10/20 base of the fiber stack allocation */
813 CONTEXT context; /* 14/30 fiber context */
814 DWORD flags; /* fiber flags */
815 LPFIBER_START_ROUTINE start; /* start routine */
816 void *fls_slots; /* fiber storage slots */
817 struct fiber_actctx actctx; /* activation context state */
818};
819
820#ifdef __i386__
821extern void WINAPI switch_fiber( CONTEXT *old, CONTEXT *new );
823 "movl 4(%esp),%ecx\n\t" /* old */
824 "movl %edi,0x9c(%ecx)\n\t" /* old->Edi */
825 "movl %esi,0xa0(%ecx)\n\t" /* old->Esi */
826 "movl %ebx,0xa4(%ecx)\n\t" /* old->Ebx */
827 "movl %ebp,0xb4(%ecx)\n\t" /* old->Ebp */
828 "movl 0(%esp),%eax\n\t"
829 "movl %eax,0xb8(%ecx)\n\t" /* old->Eip */
830 "leal 12(%esp),%eax\n\t"
831 "movl %eax,0xc4(%ecx)\n\t" /* old->Esp */
832 "movl 8(%esp),%ecx\n\t" /* new */
833 "movl 0x9c(%ecx),%edi\n\t" /* new->Edi */
834 "movl 0xa0(%ecx),%esi\n\t" /* new->Esi */
835 "movl 0xa4(%ecx),%ebx\n\t" /* new->Ebx */
836 "movl 0xb4(%ecx),%ebp\n\t" /* new->Ebp */
837 "movl 0xc4(%ecx),%esp\n\t" /* new->Esp */
838 "jmp *0xb8(%ecx)" ) /* new->Eip */
839#elif defined(__arm64ec__)
840static void __attribute__((naked)) WINAPI switch_fiber( CONTEXT *old, CONTEXT *new )
841{
842 asm( "mov x2, sp\n\t"
843 "stp x27, x2, [x0, #0x90]\n\t" /* old->Rbx,Rsp */
844 "str x29, [x0, #0xa0]\n\t" /* old->Rbp */
845 "stp x25, x26, [x0, #0xa8]\n\t" /* old->Rsi,Rdi */
846 "stp x19, x20, [x0, #0xd8]\n\t" /* old->R12,R13 */
847 "stp x21, x22, [x0, #0xe8]\n\t" /* old->R14,R15 */
848 "str x30, [x0, #0xf8]\n\t" /* old->Rip */
849 "stp q8, q9, [x0, #0x220]\n\t" /* old->Xmm8,Xmm9 */
850 "stp q10, q11, [x0, #0x240]\n\t" /* old->Xmm10,Xmm11 */
851 "stp q12, q13, [x0, #0x260]\n\t" /* old->Xmm12,Xmm13 */
852 "stp q14, q15, [x0, #0x280]\n\t" /* old->Xmm14,Xmm15 */
853 /* FIXME: MxCsr */
854 "ldp x27, x2, [x1, #0x90]\n\t" /* old->Rbx,Rsp */
855 "ldr x29, [x1, #0xa0]\n\t" /* old->Rbp */
856 "ldp x25, x26, [x1, #0xa8]\n\t" /* old->Rsi,Rdi */
857 "ldp x19, x20, [x1, #0xd8]\n\t" /* old->R12,R13 */
858 "ldp x21, x22, [x1, #0xe8]\n\t" /* old->R14,R15 */
859 "ldr x30, [x1, #0xf8]\n\t" /* old->Rip */
860 "ldp q8, q9, [x1, #0x220]\n\t" /* old->Xmm8,Xmm9 */
861 "ldp q10, q11, [x1, #0x240]\n\t" /* old->Xmm10,Xmm11 */
862 "ldp q12, q13, [x1, #0x260]\n\t" /* old->Xmm12,Xmm13 */
863 "ldp q14, q15, [x1, #0x280]\n\t" /* old->Xmm14,Xmm15 */
864 "mov sp, x2\n\t"
865 "ret" );
866}
867#elif defined(__x86_64__)
868extern void WINAPI switch_fiber( CONTEXT *old, CONTEXT *new );
870 "movq %rbx,0x90(%rcx)\n\t" /* old->Rbx */
871 "leaq 0x8(%rsp),%rax\n\t"
872 "movq %rax,0x98(%rcx)\n\t" /* old->Rsp */
873 "movq %rbp,0xa0(%rcx)\n\t" /* old->Rbp */
874 "movq %rsi,0xa8(%rcx)\n\t" /* old->Rsi */
875 "movq %rdi,0xb0(%rcx)\n\t" /* old->Rdi */
876 "movq %r12,0xd8(%rcx)\n\t" /* old->R12 */
877 "movq %r13,0xe0(%rcx)\n\t" /* old->R13 */
878 "movq %r14,0xe8(%rcx)\n\t" /* old->R14 */
879 "movq %r15,0xf0(%rcx)\n\t" /* old->R15 */
880 "movq (%rsp),%rax\n\t"
881 "movq %rax,0xf8(%rcx)\n\t" /* old->Rip */
882 "movdqa %xmm6,0x200(%rcx)\n\t" /* old->Xmm6 */
883 "movdqa %xmm7,0x210(%rcx)\n\t" /* old->Xmm7 */
884 "movdqa %xmm8,0x220(%rcx)\n\t" /* old->Xmm8 */
885 "movdqa %xmm9,0x230(%rcx)\n\t" /* old->Xmm9 */
886 "movdqa %xmm10,0x240(%rcx)\n\t" /* old->Xmm10 */
887 "movdqa %xmm11,0x250(%rcx)\n\t" /* old->Xmm11 */
888 "movdqa %xmm12,0x260(%rcx)\n\t" /* old->Xmm12 */
889 "movdqa %xmm13,0x270(%rcx)\n\t" /* old->Xmm13 */
890 "movdqa %xmm14,0x280(%rcx)\n\t" /* old->Xmm14 */
891 "movdqa %xmm15,0x290(%rcx)\n\t" /* old->Xmm15 */
892 "movq 0x90(%rdx),%rbx\n\t" /* new->Rbx */
893 "movq 0xa0(%rdx),%rbp\n\t" /* new->Rbp */
894 "movq 0xa8(%rdx),%rsi\n\t" /* new->Rsi */
895 "movq 0xb0(%rdx),%rdi\n\t" /* new->Rdi */
896 "movq 0xd8(%rdx),%r12\n\t" /* new->R12 */
897 "movq 0xe0(%rdx),%r13\n\t" /* new->R13 */
898 "movq 0xe8(%rdx),%r14\n\t" /* new->R14 */
899 "movq 0xf0(%rdx),%r15\n\t" /* new->R15 */
900 "movdqa 0x200(%rdx),%xmm6\n\t" /* new->Xmm6 */
901 "movdqa 0x210(%rdx),%xmm7\n\t" /* new->Xmm7 */
902 "movdqa 0x220(%rdx),%xmm8\n\t" /* new->Xmm8 */
903 "movdqa 0x230(%rdx),%xmm9\n\t" /* new->Xmm9 */
904 "movdqa 0x240(%rdx),%xmm10\n\t" /* new->Xmm10 */
905 "movdqa 0x250(%rdx),%xmm11\n\t" /* new->Xmm11 */
906 "movdqa 0x260(%rdx),%xmm12\n\t" /* new->Xmm12 */
907 "movdqa 0x270(%rdx),%xmm13\n\t" /* new->Xmm13 */
908 "movdqa 0x280(%rdx),%xmm14\n\t" /* new->Xmm14 */
909 "movdqa 0x290(%rdx),%xmm15\n\t" /* new->Xmm15 */
910 "movq 0x98(%rdx),%rsp\n\t" /* new->Rsp */
911 "jmp *0xf8(%rdx)" ) /* new->Rip */
912#elif defined(__arm__)
913extern void WINAPI switch_fiber( CONTEXT *old, CONTEXT *new );
915 "str r4, [r0, #0x14]\n\t" /* old->R4 */
916 "str r5, [r0, #0x18]\n\t" /* old->R5 */
917 "str r6, [r0, #0x1c]\n\t" /* old->R6 */
918 "str r7, [r0, #0x20]\n\t" /* old->R7 */
919 "str r8, [r0, #0x24]\n\t" /* old->R8 */
920 "str r9, [r0, #0x28]\n\t" /* old->R9 */
921 "str r10, [r0, #0x2c]\n\t" /* old->R10 */
922 "str r11, [r0, #0x30]\n\t" /* old->R11 */
923 "str sp, [r0, #0x38]\n\t" /* old->Sp */
924 "str lr, [r0, #0x40]\n\t" /* old->Pc */
925 "ldr r4, [r1, #0x14]\n\t" /* new->R4 */
926 "ldr r5, [r1, #0x18]\n\t" /* new->R5 */
927 "ldr r6, [r1, #0x1c]\n\t" /* new->R6 */
928 "ldr r7, [r1, #0x20]\n\t" /* new->R7 */
929 "ldr r8, [r1, #0x24]\n\t" /* new->R8 */
930 "ldr r9, [r1, #0x28]\n\t" /* new->R9 */
931 "ldr r10, [r1, #0x2c]\n\t" /* new->R10 */
932 "ldr r11, [r1, #0x30]\n\t" /* new->R11 */
933 "ldr sp, [r1, #0x38]\n\t" /* new->Sp */
934 "ldr r2, [r1, #0x40]\n\t" /* new->Pc */
935 "bx r2" )
936#elif defined(__aarch64__)
937extern void WINAPI switch_fiber( CONTEXT *old, CONTEXT *new );
939 "stp x19, x20, [x0, #0xa0]\n\t" /* old->X19,X20 */
940 "stp x21, x22, [x0, #0xb0]\n\t" /* old->X21,X22 */
941 "stp x23, x24, [x0, #0xc0]\n\t" /* old->X23,X24 */
942 "stp x25, x26, [x0, #0xd0]\n\t" /* old->X25,X26 */
943 "stp x27, x28, [x0, #0xe0]\n\t" /* old->X27,X28 */
944 "str x29, [x0, #0xf0]\n\t" /* old->Fp */
945 "mov x2, sp\n\t"
946 "str x2, [x0, #0x100]\n\t" /* old->Sp */
947 "str x30, [x0, #0x108]\n\t" /* old->Pc */
948 "ldp x19, x20, [x1, #0xa0]\n\t" /* new->X19,X20 */
949 "ldp x21, x22, [x1, #0xb0]\n\t" /* new->X21,X22 */
950 "ldp x23, x24, [x1, #0xc0]\n\t" /* new->X23,X24 */
951 "ldp x25, x26, [x1, #0xd0]\n\t" /* new->X25,X26 */
952 "ldp x27, x28, [x1, #0xe0]\n\t" /* new->X27,X28 */
953 "ldr x29, [x1, #0xf0]\n\t" /* new->Fp */
954 "ldr x2, [x1, #0x100]\n\t" /* new->Sp */
955 "ldr x30, [x1, #0x108]\n\t" /* new->Pc */
956 "mov sp, x2\n\t"
957 "ret" )
958#else
959static void WINAPI switch_fiber( CONTEXT *old, CONTEXT *new )
960{
961 FIXME( "not implemented\n" );
963}
964#endif
965
966/* call the fiber initial function once we have switched stack */
967static void CDECL start_fiber(void)
968{
969 struct fiber_data *fiber = NtCurrentTeb()->Tib.FiberData;
971
972 __TRY
973 {
974 start( fiber->param );
976 }
978 {
980 }
982}
983
984static void init_fiber_context( struct fiber_data *fiber )
985{
986#ifdef __i386__
987 fiber->context.Esp = (ULONG_PTR)fiber->stack_base - 4;
989#elif defined(__arm64ec__)
990 fiber->context.Rsp = (ULONG_PTR)fiber->stack_base;
991 fiber->context.Rip = (ULONG_PTR)start_fiber;
992#elif defined(__x86_64__)
993 fiber->context.Rsp = (ULONG_PTR)fiber->stack_base - 0x28;
994 fiber->context.Rip = (ULONG_PTR)start_fiber;
995#elif defined(__arm__)
996 fiber->context.Sp = (ULONG_PTR)fiber->stack_base;
998#elif defined(__aarch64__)
999 fiber->context.Sp = (ULONG_PTR)fiber->stack_base;
1000 fiber->context.Pc = (ULONG_PTR)start_fiber;
1001#endif
1002}
1003
1005{
1006 LIST_ENTRY *head = src->Flink;
1007 LIST_ENTRY *tail = src->Blink;
1008
1009 if (src != head)
1010 {
1011 dest->Flink = head;
1012 dest->Blink = tail;
1013 head->Blink = dest;
1014 tail->Flink = dest;
1015 }
1016 else InitializeListHead( dest );
1017}
1018
1020{
1021 ACTIVATION_CONTEXT_STACK *src = NtCurrentTeb()->ActivationContextStackPointer;
1022
1023 C_ASSERT(sizeof(*dest) == sizeof(dest->ActiveFrame) + sizeof(dest->FrameListCache) +
1024 sizeof(dest->Flags) + sizeof(dest->NextCookieSequenceNumber) +
1025 sizeof(dest->StackId));
1026
1027 dest->ActiveFrame = src->ActiveFrame;
1028 move_list( &dest->FrameListCache, &src->FrameListCache );
1029 dest->Flags = src->Flags;
1030 dest->NextCookieSequenceNumber = src->NextCookieSequenceNumber;
1031 dest->StackId = src->StackId;
1032
1033 NtCurrentTeb()->ActivationContextStackPointer = dest;
1034}
1035
1036
1037/***********************************************************************
1038 * CreateFiber (kernelbase.@)
1039 */
1041{
1042 return CreateFiberEx( stack, 0, 0, start, param );
1043}
1044
1045
1046/***********************************************************************
1047 * CreateFiberEx (kernelbase.@)
1048 */
1051{
1052 struct fiber_data *fiber;
1054
1055 if (!(fiber = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*fiber) )))
1056 {
1058 return NULL;
1059 }
1060
1061 if (!set_ntstatus( RtlCreateUserStack( stack_commit, stack_reserve, 0, 1, 1, &stack )))
1062 {
1063 HeapFree( GetProcessHeap(), 0, fiber );
1064 return NULL;
1065 }
1066
1067 fiber->stack_allocation = stack.DeallocationStack;
1068 fiber->stack_base = stack.StackBase;
1069 fiber->stack_limit = stack.StackLimit;
1070 fiber->param = param;
1071 fiber->except = (void *)-1;
1072 fiber->start = start;
1073 fiber->flags = flags;
1074 InitializeListHead( &fiber->actctx.stack_space.FrameListCache );
1075 fiber->actctx.stack_ptr = &fiber->actctx.stack_space;
1076 init_fiber_context( fiber );
1077 return fiber;
1078}
1079
1080
1081/***********************************************************************
1082 * ConvertFiberToThread (kernelbase.@)
1083 */
1085{
1086 struct fiber_data *fiber = NtCurrentTeb()->Tib.FiberData;
1087
1088 if (fiber)
1089 {
1090 relocate_thread_actctx_stack( &NtCurrentTeb()->ActivationContextStack );
1091 NtCurrentTeb()->Tib.FiberData = NULL;
1092 HeapFree( GetProcessHeap(), 0, fiber );
1093 }
1094 return TRUE;
1095}
1096
1097
1098/***********************************************************************
1099 * ConvertThreadToFiber (kernelbase.@)
1100 */
1102{
1103 return ConvertThreadToFiberEx( param, 0 );
1104}
1105
1106
1107/***********************************************************************
1108 * ConvertThreadToFiberEx (kernelbase.@)
1109 */
1111{
1112 struct fiber_data *fiber;
1113
1114 if (NtCurrentTeb()->Tib.FiberData)
1115 {
1117 return NULL;
1118 }
1119
1120 if (!(fiber = HeapAlloc( GetProcessHeap(), 0, sizeof(*fiber) )))
1121 {
1123 return NULL;
1124 }
1125 fiber->param = param;
1126 fiber->except = NtCurrentTeb()->Tib.ExceptionList;
1127 fiber->stack_base = NtCurrentTeb()->Tib.StackBase;
1128 fiber->stack_limit = NtCurrentTeb()->Tib.StackLimit;
1129 fiber->stack_allocation = NtCurrentTeb()->DeallocationStack;
1130 fiber->start = NULL;
1131 fiber->flags = flags;
1132 fiber->fls_slots = NtCurrentTeb()->FlsSlots;
1133 relocate_thread_actctx_stack( &fiber->actctx.stack_space );
1134 NtCurrentTeb()->Tib.FiberData = fiber;
1135 return fiber;
1136}
1137
1138
1139/***********************************************************************
1140 * DeleteFiber (kernelbase.@)
1141 */
1143{
1144 struct fiber_data *fiber = fiber_ptr;
1145
1146 if (!fiber) return;
1147 if (fiber == NtCurrentTeb()->Tib.FiberData)
1148 {
1149 relocate_thread_actctx_stack( &NtCurrentTeb()->ActivationContextStack );
1150 HeapFree( GetProcessHeap(), 0, fiber );
1151 RtlExitUserThread( 1 );
1152 }
1153 RtlFreeUserStack( fiber->stack_allocation );
1154 RtlProcessFlsData( fiber->fls_slots, 3 );
1155 RtlFreeActivationContextStack( &fiber->actctx.stack_space );
1156 HeapFree( GetProcessHeap(), 0, fiber );
1157}
1158
1159
1160/***********************************************************************
1161 * IsThreadAFiber (kernelbase.@)
1162 */
1164{
1165 return NtCurrentTeb()->Tib.FiberData != NULL;
1166}
1167
1168
1169/***********************************************************************
1170 * SwitchToFiber (kernelbase.@)
1171 */
1173{
1174 struct fiber_data *new_fiber = fiber;
1175 struct fiber_data *current_fiber = NtCurrentTeb()->Tib.FiberData;
1176
1177 current_fiber->except = NtCurrentTeb()->Tib.ExceptionList;
1178 current_fiber->stack_limit = NtCurrentTeb()->Tib.StackLimit;
1179 current_fiber->fls_slots = NtCurrentTeb()->FlsSlots;
1180 current_fiber->actctx.stack_ptr = NtCurrentTeb()->ActivationContextStackPointer;
1181 /* stack_allocation and stack_base never change */
1182
1183 /* FIXME: should save floating point context if requested in fiber->flags */
1184 NtCurrentTeb()->Tib.FiberData = new_fiber;
1185 NtCurrentTeb()->Tib.ExceptionList = new_fiber->except;
1186 NtCurrentTeb()->Tib.StackBase = new_fiber->stack_base;
1187 NtCurrentTeb()->Tib.StackLimit = new_fiber->stack_limit;
1188 NtCurrentTeb()->DeallocationStack = new_fiber->stack_allocation;
1189 NtCurrentTeb()->FlsSlots = new_fiber->fls_slots;
1190 NtCurrentTeb()->ActivationContextStackPointer = new_fiber->actctx.stack_ptr;
1191 switch_fiber( &current_fiber->context, &new_fiber->context );
1192}
1193
1194
1195/***********************************************************************
1196 * FlsAlloc (kernelbase.@)
1197 */
1199{
1200 DWORD index;
1201
1202 if (!set_ntstatus( RtlFlsAlloc( callback, &index ))) return FLS_OUT_OF_INDEXES;
1203 return index;
1204}
1205
1206
1207/***********************************************************************
1208 * FlsFree (kernelbase.@)
1209 */
1211{
1212 return set_ntstatus( RtlFlsFree( index ));
1213}
1214
1215
1216/***********************************************************************
1217 * FlsGetValue (kernelbase.@)
1218 */
1220{
1221 void *data;
1222
1223 if (!set_ntstatus( RtlFlsGetValue( index, &data ))) return NULL;
1225 return data;
1226}
1227
1228
1229/***********************************************************************
1230 * FlsSetValue (kernelbase.@)
1231 */
1233{
1234 return set_ntstatus( RtlFlsSetValue( index, data ));
1235}
1236
1237
1238/***********************************************************************
1239 * Thread pool
1240 ***********************************************************************/
1241
1242
1243/***********************************************************************
1244 * CallbackMayRunLong (kernelbase.@)
1245 */
1247{
1249}
1250
1251
1252/***********************************************************************
1253 * CreateThreadpool (kernelbase.@)
1254 */
1256{
1257 TP_POOL *pool;
1258
1260 return pool;
1261}
1262
1263
1264/***********************************************************************
1265 * CreateThreadpoolCleanupGroup (kernelbase.@)
1266 */
1268{
1270
1271 if (!set_ntstatus( TpAllocCleanupGroup( &group ))) return NULL;
1272 return group;
1273}
1274
1275
1276static void WINAPI tp_io_callback( TP_CALLBACK_INSTANCE *instance, void *userdata, void *cvalue, IO_STATUS_BLOCK *iosb, TP_IO *io )
1277{
1278 PTP_WIN32_IO_CALLBACK callback = *(void **)io;
1279 callback( instance, userdata, cvalue, RtlNtStatusToDosError( iosb->Status ), iosb->Information, io );
1280}
1281
1282
1283/***********************************************************************
1284 * CreateThreadpoolIo (kernelbase.@)
1285 */
1287 PVOID userdata, TP_CALLBACK_ENVIRON *environment )
1288{
1289 TP_IO *io;
1290 if (!set_ntstatus( TpAllocIoCompletion( &io, handle, tp_io_callback, userdata, environment ))) return NULL;
1291 *(void **)io = callback; /* ntdll leaves us space to store our callback at the beginning of TP_IO struct */
1292 return io;
1293}
1294
1295
1296/***********************************************************************
1297 * CreateThreadpoolTimer (kernelbase.@)
1298 */
1300 TP_CALLBACK_ENVIRON *environment )
1301{
1302 TP_TIMER *timer;
1303
1304 if (!set_ntstatus( TpAllocTimer( &timer, callback, userdata, environment ))) return NULL;
1305 return timer;
1306}
1307
1308
1309/***********************************************************************
1310 * CreateThreadpoolWait (kernelbase.@)
1311 */
1313 TP_CALLBACK_ENVIRON *environment )
1314{
1315 TP_WAIT *wait;
1316
1317 if (!set_ntstatus( TpAllocWait( &wait, callback, userdata, environment ))) return NULL;
1318 return wait;
1319}
1320
1321
1322/***********************************************************************
1323 * CreateThreadpoolWork (kernelbase.@)
1324 */
1326 TP_CALLBACK_ENVIRON *environment )
1327{
1328 TP_WORK *work;
1329
1330 if (!set_ntstatus( TpAllocWork( &work, callback, userdata, environment ))) return NULL;
1331 return work;
1332}
1333
1334
1335/***********************************************************************
1336 * TrySubmitThreadpoolCallback (kernelbase.@)
1337 */
1339 TP_CALLBACK_ENVIRON *environment )
1340{
1341 return set_ntstatus( TpSimpleTryPost( callback, userdata, environment ));
1342}
1343
1344
1345/***********************************************************************
1346 * QueueUserWorkItem (kernelbase.@)
1347 */
1349{
1351}
1352
1353/***********************************************************************
1354 * SetThreadpoolStackInformation (kernelbase.@)
1355 */
1357{
1358 return set_ntstatus( TpSetPoolStackInformation( pool, stack_info ));
1359}
1360
1361/***********************************************************************
1362 * QueryThreadpoolStackInformation (kernelbase.@)
1363 */
1365{
1366 return set_ntstatus( TpQueryPoolStackInformation( pool, stack_info ));
1367}
struct outqueuenode * tail
Definition: adnsresfilter.c:66
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
struct outqueuenode * head
Definition: adnsresfilter.c:66
static int state
Definition: maze.c:121
static struct @1687 move_list[MOVE_LIST_SIZE]
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
LONG NTSTATUS
Definition: precomp.h:26
#define index(s, c)
Definition: various.h:29
#define U(x)
Definition: wordpad.c:45
#define FIXME(fmt,...)
Definition: precomp.h:53
static HANDLE thread
Definition: service.c:33
#define ULongToHandle(h)
Definition: basetsd.h:81
#define HandleToULong(h)
Definition: basetsd.h:95
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define RtlAreBitsSet
Definition: dbgbitmap.h:328
#define RtlClearBits
Definition: dbgbitmap.h:331
#define RtlFindClearBitsAndSet
Definition: dbgbitmap.h:333
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
static HINSTANCE instance
Definition: main.c:40
#define __attribute__(x)
Definition: wpp_private.h:207
static __inline BOOL set_ntstatus(NTSTATUS status)
Definition: security.c:227
#define CDECL
Definition: compat.h:29
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define HeapAlloc
Definition: compat.h:733
@ ThreadIdealProcessorEx
Definition: compat.h:968
@ ThreadTimes
Definition: compat.h:936
@ ThreadPagePriority
Definition: compat.h:959
@ ThreadIdealProcessor
Definition: compat.h:948
@ ThreadGroupInformation
Definition: compat.h:965
@ ThreadBasePriority
Definition: compat.h:938
@ ThreadBasicInformation
Definition: compat.h:935
@ ThreadPriorityBoost
Definition: compat.h:949
@ ThreadIsIoPending
Definition: compat.h:951
@ ThreadZeroTlsCell
Definition: compat.h:945
#define __TRY
Definition: compat.h:80
#define FreeLibrary(x)
Definition: compat.h:748
#define GetCurrentProcess()
Definition: compat.h:759
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define HeapFree(x, y, z)
Definition: compat.h:735
#define __ENDTRY
Definition: compat.h:82
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrlenW
Definition: compat.h:750
PPEB Peb
Definition: dllmain.c:27
LONG WINAPI UnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
Definition: except.c:269
BOOL WINAPI SetHandleInformation(IN HANDLE hObject, IN DWORD dwMask, IN DWORD dwFlags)
Definition: handle.c:78
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
Definition: thread.c:959
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
HANDLE WINAPI CreateRemoteThread(IN HANDLE hProcess, IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:159
BOOL WINAPI SetThreadContext(IN HANDLE hThread, IN CONST CONTEXT *lpContext)
Definition: thread.c:521
DWORD WINAPI SuspendThread(IN HANDLE hThread)
Definition: thread.c:642
BOOL NTAPI GetThreadTimes(IN HANDLE hThread, OUT LPFILETIME lpCreationTime, OUT LPFILETIME lpExitTime, OUT LPFILETIME lpKernelTime, OUT LPFILETIME lpUserTime)
Definition: thread.c:469
LANGID WINAPI SetThreadUILanguage(IN LANGID LangId)
Definition: thread.c:937
HANDLE WINAPI OpenThread(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwThreadId)
Definition: thread.c:403
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:1076
DWORD WINAPI GetProcessIdOfThread(IN HANDLE Thread)
Definition: thread.c:889
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
DWORD WINAPI SetThreadIdealProcessor(IN HANDLE hThread, IN DWORD dwIdealProcessor)
Definition: thread.c:866
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
BOOL WINAPI TerminateThread(IN HANDLE hThread, IN DWORD dwExitCode)
Definition: thread.c:587
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
BOOL WINAPI SetThreadStackGuarantee(IN OUT PULONG StackSizeInBytes)
Definition: thread.c:1006
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:913
BOOL WINAPI GetThreadPriorityBoost(IN HANDLE hThread, OUT PBOOL pDisablePriorityBoost)
Definition: thread.c:778
BOOL NTAPI SetThreadPriorityBoost(IN HANDLE hThread, IN BOOL bDisablePriorityBoost)
Definition: thread.c:804
int WINAPI GetThreadPriority(IN HANDLE hThread)
Definition: thread.c:739
BOOL WINAPI GetThreadIOPendingFlag(IN HANDLE hThread, OUT PBOOL lpIOIsPending)
Definition: thread.c:1047
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:541
BOOL WINAPI GetThreadContext(IN HANDLE hThread, OUT LPCONTEXT lpContext)
Definition: thread.c:501
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2925
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
LCID WINAPI ConvertDefaultLocale(LCID lcid)
Definition: locale.c:2879
LCID lcid
Definition: locale.c:5656
LPVOID WINAPI DECLSPEC_HOTPATCH ConvertThreadToFiberEx(LPVOID param, DWORD flags)
Definition: thread.c:1110
LCID WINAPI GetThreadLocale(void)
Definition: thread.c:259
BOOL WINAPI DECLSPEC_HOTPATCH GetThreadGroupAffinity(HANDLE thread, GROUP_AFFINITY *affinity)
Definition: thread.c:212
BOOL WINAPI Wow64GetThreadContext(HANDLE handle, WOW64_CONTEXT *context)
Definition: thread.c:768
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadIdealProcessorEx(HANDLE thread, PROCESSOR_NUMBER *ideal, PROCESSOR_NUMBER *previous)
Definition: thread.c:524
PTP_POOL WINAPI DECLSPEC_HOTPATCH CreateThreadpool(void *reserved)
Definition: thread.c:1255
BOOL WINAPI DECLSPEC_HOTPATCH ConvertFiberToThread(void)
Definition: thread.c:1084
static void WINAPI switch_fiber(CONTEXT *old, CONTEXT *new)
Definition: thread.c:959
BOOL WINAPI DECLSPEC_HOTPATCH TrySubmitThreadpoolCallback(PTP_SIMPLE_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: thread.c:1338
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
void WINAPI DECLSPEC_HOTPATCH DeleteFiber(LPVOID fiber_ptr)
Definition: thread.c:1142
PTP_IO WINAPI DECLSPEC_HOTPATCH CreateThreadpoolIo(HANDLE handle, PTP_WIN32_IO_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: thread.c:1286
void WINAPI DECLSPEC_HOTPATCH GetCurrentThreadStackLimits(ULONG_PTR *low, ULONG_PTR *high)
Definition: thread.c:131
PTP_WAIT WINAPI DECLSPEC_HOTPATCH CreateThreadpoolWait(PTP_WAIT_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: thread.c:1312
void WINAPI DECLSPEC_HOTPATCH FreeLibraryAndExitThread(HINSTANCE module, DWORD exit_code)
Definition: thread.c:121
DWORD WINAPI DECLSPEC_HOTPATCH FlsAlloc(PFLS_CALLBACK_FUNCTION callback)
Definition: thread.c:1198
static void relocate_thread_actctx_stack(ACTIVATION_CONTEXT_STACK *dest)
Definition: thread.c:1019
static void init_fiber_context(struct fiber_data *fiber)
Definition: thread.c:984
BOOL WINAPI DECLSPEC_HOTPATCH QueryThreadCycleTime(HANDLE thread, ULONG64 *cycle)
Definition: thread.c:381
static DWORD rtlmode_to_win32mode(DWORD rtlmode)
Definition: thread.c:46
LPVOID WINAPI DECLSPEC_HOTPATCH CreateFiber(SIZE_T stack, LPFIBER_START_ROUTINE start, LPVOID param)
Definition: thread.c:1040
PTP_TIMER WINAPI DECLSPEC_HOTPATCH CreateThreadpoolTimer(PTP_TIMER_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: thread.c:1299
DWORD WINAPI DECLSPEC_HOTPATCH GetThreadErrorMode(void)
Definition: thread.c:203
static void WINAPI tp_io_callback(TP_CALLBACK_INSTANCE *instance, void *userdata, void *cvalue, IO_STATUS_BLOCK *iosb, TP_IO *io)
Definition: thread.c:1276
BOOL WINAPI DECLSPEC_HOTPATCH FlsSetValue(DWORD index, PVOID data)
Definition: thread.c:1232
static void CALLBACK call_user_apc(ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3)
Definition: thread.c:363
HRESULT WINAPI DECLSPEC_HOTPATCH GetThreadDescription(HANDLE thread, WCHAR **description)
Definition: thread.c:435
PTP_CLEANUP_GROUP WINAPI DECLSPEC_HOTPATCH CreateThreadpoolCleanupGroup(void)
Definition: thread.c:1267
void WINAPI DECLSPEC_HOTPATCH SwitchToFiber(LPVOID fiber)
Definition: thread.c:1172
LPVOID WINAPI ConvertThreadToFiber(LPVOID param)
Definition: thread.c:1101
HANDLE WINAPI DECLSPEC_HOTPATCH CreateRemoteThreadEx(HANDLE process, SECURITY_ATTRIBUTES *sa, SIZE_T stack, LPTHREAD_START_ROUTINE start, LPVOID param, DWORD flags, LPPROC_THREAD_ATTRIBUTE_LIST attributes, DWORD *id)
Definition: thread.c:71
BOOL WINAPI Wow64SetThreadContext(HANDLE handle, const WOW64_CONTEXT *context)
Definition: thread.c:783
HANDLE WINAPI kernelbase_GetCurrentThread(void)
Definition: thread.c:141
HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription(HANDLE thread, PCWSTR description)
Definition: thread.c:414
BOOL WINAPI SetThreadErrorMode(DWORD mode, DWORD *old)
Definition: thread.c:474
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadInformation(HANDLE thread, THREAD_INFORMATION_CLASS info_class, VOID *info, DWORD size)
Definition: thread.c:608
DWORD WINAPI kernelbase_GetLastError(void)
Definition: thread.c:172
static void CDECL start_fiber(void)
Definition: thread.c:967
BOOL WINAPI DECLSPEC_HOTPATCH CallbackMayRunLong(TP_CALLBACK_INSTANCE *instance)
Definition: thread.c:1246
BOOL WINAPI DECLSPEC_HOTPATCH IsThreadAFiber(void)
Definition: thread.c:1163
BOOL WINAPI DECLSPEC_HOTPATCH SwitchToThread(void)
Definition: thread.c:639
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadLocale(LCID lcid)
Definition: thread.c:536
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadpoolStackInformation(PTP_POOL pool, PTP_POOL_STACK_INFORMATION stack_info)
Definition: thread.c:1356
BOOL WINAPI DECLSPEC_HOTPATCH QueryThreadpoolStackInformation(PTP_POOL pool, PTP_POOL_STACK_INFORMATION stack_info)
Definition: thread.c:1364
LPVOID WINAPI DECLSPEC_HOTPATCH CreateFiberEx(SIZE_T stack_commit, SIZE_T stack_reserve, DWORD flags, LPFIBER_START_ROUTINE start, LPVOID param)
Definition: thread.c:1049
DWORD WINAPI kernelbase_GetCurrentThreadId(void)
Definition: thread.c:150
PTP_WORK WINAPI DECLSPEC_HOTPATCH CreateThreadpoolWork(PTP_WORK_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: thread.c:1325
BOOL WINAPI DECLSPEC_HOTPATCH GetThreadIdealProcessorEx(HANDLE thread, PROCESSOR_NUMBER *ideal)
Definition: thread.c:250
LANGID WINAPI DECLSPEC_HOTPATCH GetThreadUILanguage(void)
Definition: thread.c:328
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadGroupAffinity(HANDLE thread, const GROUP_AFFINITY *new, GROUP_AFFINITY *old)
Definition: thread.c:498
PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue(DWORD index)
Definition: thread.c:1219
BOOL WINAPI DECLSPEC_HOTPATCH FlsFree(DWORD index)
Definition: thread.c:1210
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
return ret
Definition: mutex.c:146
r reserved
Definition: btrfs.c:3006
KAFFINITY affinity
Definition: wave.h:2
#define ULONG_PTR
Definition: config.h:101
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
size_t const new_size
Definition: expand.cpp:66
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint start
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum func
Definition: glext.h:6028
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
GLuint index
Definition: glext.h:6031
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLenum mode
Definition: glext.h:6217
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLboolean GLuint group
Definition: glext.h:11120
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLfloat param
Definition: glext.h:5796
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
#define OBJ_INHERIT
Definition: winternl.h:225
NTSYSAPI void WINAPI RtlReleasePebLock(void)
Definition: libsupp.c:84
NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void)
Definition: error.c:217
NTSYSAPI void WINAPI RtlAcquirePebLock(void)
Definition: libsupp.c:74
NTSYSAPI void WINAPI DbgBreakPoint(void)
NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void)
Definition: thrdschd.c:887
NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD, LPDWORD)
void(CALLBACK * PRTL_THREAD_START_ROUTINE)(LPVOID)
Definition: winternl.h:1892
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define USHRT_MAX
Definition: limits.h:38
@ ThreadPowerThrottlingState
Definition: pstypes.h:337
@ ThreadNameInformation
Definition: pstypes.h:326
#define C_ASSERT(e)
Definition: intsafe.h:73
#define NtCurrentTeb
#define debugstr_w
Definition: kernel32.h:32
USHORT LANGID
Definition: mui.h:9
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void * PAPCFUNC
Definition: mmstream.idl:42
unsigned __int64 ULONG64
Definition: imports.h:198
static IPrintDialogCallback callback
Definition: printdlg.c:326
static const struct encodedFiletime times[]
Definition: encode.c:556
static UINT exit_code
Definition: process.c:78
static TfClientId cid
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
Definition: file.c:100
static PIO_STATUS_BLOCK iosb
Definition: file.c:98
static PIO_STATUS_BLOCK void ULONG FS_INFORMATION_CLASS info_class
Definition: pipe.c:76
static char * dest
Definition: rtl.c:135
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
static int priority
Definition: timer.c:163
int disable
Definition: msacm.c:1365
LANGID langid
Definition: msctf.idl:626
NTSYSAPI NTSTATUS NTAPI RtlQueueWorkItem(_In_ WORKERCALLBACKFUNC Function, _In_opt_ PVOID Context, _In_ ULONG Flags)
NTSYSAPI VOID NTAPI RtlExitUserThread(_In_ NTSTATUS Status)
NTSYSAPI NTSTATUS NTAPI RtlCreateUserThread(_In_ PVOID ThreadContext, _Out_ HANDLE *OutThreadHandle, _Reserved_ PVOID Reserved1, _Reserved_ PVOID Reserved2, _Reserved_ PVOID Reserved3, _Reserved_ PVOID Reserved4, _Reserved_ PVOID Reserved5, _Reserved_ PVOID Reserved6, _Reserved_ PVOID Reserved7, _Reserved_ PVOID Reserved8)
#define SEM_FAILCRITICALERRORS
Definition: rtltypes.h:69
#define SEM_NOGPFAULTERRORBOX
Definition: rtltypes.h:70
#define SEM_NOOPENFILEERRORBOX
Definition: rtltypes.h:72
NTSTATUS NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
Definition: kill.c:1279
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
PROCESSOR_NUMBER
Definition: ntbasedef.h:654
NTSTATUS NTAPI NtQueryDefaultUILanguage(OUT LANGID *LanguageId)
Definition: locale.c:645
NTSTATUS NTAPI NtSetContextThread(IN HANDLE ThreadHandle, IN PCONTEXT ThreadContext)
Definition: debug.c:387
NTSTATUS NTAPI NtGetContextThread(IN HANDLE ThreadHandle, IN OUT PCONTEXT ThreadContext)
Definition: debug.c:350
NTSTATUS NTAPI NtQueryInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength, OUT PULONG ReturnLength OPTIONAL)
Definition: query.c:2680
NTSTATUS NTAPI NtSetInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: query.c:2074
NTSTATUS NTAPI NtQueueApcThread(IN HANDLE ThreadHandle, IN PKNORMAL_ROUTINE ApcRoutine, IN PVOID NormalContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: state.c:600
NTSTATUS NTAPI NtResumeThread(IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL)
Definition: state.c:290
NTSTATUS NTAPI NtSuspendThread(IN HANDLE ThreadHandle, OUT PULONG PreviousSuspendCount OPTIONAL)
Definition: state.c:352
NTSTATUS NTAPI NtOpenThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PCLIENT_ID ClientId OPTIONAL)
Definition: thread.c:1013
#define STATUS_NO_YIELD_PERFORMED
Definition: ntstatus.h:150
static HANDLE proc()
Definition: pdb.c:34
#define __ASM_STDCALL_FUNC(name, args, code)
Definition: asm.h:123
#define __EXCEPT(func)
Definition: exception.h:59
#define GetExceptionCode()
Definition: exception.h:68
DWORD LCID
Definition: nls.h:13
#define DECLSPEC_HOTPATCH
Definition: config.h:9
NTSTATUS WINAPI TpAllocTimer(TP_TIMER **out, PTP_TIMER_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: threadpool.c:2604
NTSTATUS WINAPI TpCallbackMayRunLong(TP_CALLBACK_INSTANCE *instance)
Definition: threadpool.c:2756
NTSTATUS WINAPI TpSimpleTryPost(PTP_SIMPLE_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: threadpool.c:3246
NTSTATUS WINAPI TpAllocWork(TP_WORK **out, PTP_WORK_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: threadpool.c:2690
NTSTATUS WINAPI TpAllocCleanupGroup(TP_CLEANUP_GROUP **out)
Definition: threadpool.c:2537
NTSTATUS WINAPI TpAllocWait(TP_WAIT **out, PTP_WAIT_CALLBACK callback, PVOID userdata, TP_CALLBACK_ENVIRON *environment)
Definition: threadpool.c:2680
NTSTATUS WINAPI TpQueryPoolStackInformation(TP_POOL *pool, TP_POOL_STACK_INFORMATION *stack_info)
Definition: threadpool.c:3367
NTSTATUS WINAPI TpAllocIoCompletion(TP_IO **out, HANDLE file, PTP_IO_CALLBACK callback, void *userdata, TP_CALLBACK_ENVIRON *environment)
Definition: threadpool.c:2547
NTSTATUS WINAPI TpSetPoolStackInformation(TP_POOL *pool, TP_POOL_STACK_INFORMATION *stack_info)
Definition: threadpool.c:3348
NTSTATUS WINAPI TpAllocPool(TP_POOL **out, PVOID reserved)
Definition: threadpool.c:2591
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
static int client_id
Definition: sock.c:234
#define TRACE(s)
Definition: solgame.cpp:4
#define TLS_MINIMUM_AVAILABLE
Definition: ntddk_ex.h:236
HANDLE UniqueThread
Definition: compat.h:826
HANDLE UniqueProcess
Definition: compat.h:825
ULONG Esp
Definition: nt_native.h:1479
ULONG Eip
Definition: nt_native.h:1476
ULONG Sp
Definition: ke.h:269
ULONG Pc
Definition: ke.h:271
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
Definition: typedefs.h:120
ULONG TlsExpansionBitmapBits[32]
Definition: winternl.h:347
PVOID TlsBitmap
Definition: ntddk_ex.h:259
PRTL_BITMAP TlsExpansionBitmap
Definition: winternl.h:346
Definition: cookie.c:202
Definition: http.c:7252
ACTIVATION_CONTEXT_STACK * stack_ptr
Definition: thread.c:803
ACTIVATION_CONTEXT_STACK stack_space
Definition: thread.c:802
LPVOID param
Definition: thread.c:808
void * stack_limit
Definition: thread.c:811
DWORD flags
Definition: thread.c:814
void * except
Definition: thread.c:809
LPFIBER_START_ROUTINE start
Definition: thread.c:815
struct fiber_actctx actctx
Definition: thread.c:817
CONTEXT context
Definition: thread.c:813
void * fls_slots
Definition: thread.c:816
void * stack_allocation
Definition: thread.c:812
void * stack_base
Definition: thread.c:810
Definition: format.c:80
Definition: ps.c:97
#define max(a, b)
Definition: svc.c:63
VOID(WINAPI * PTP_WIN32_IO_CALLBACK)(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Context, _Inout_opt_ PVOID Overlapped, _In_ ULONG IoResult, _In_ ULONG_PTR NumberOfBytesTransferred, _Inout_ PTP_IO Io)
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
Definition: pdh_main.c:96
static const WCHAR lang[]
Definition: wbemdisp.c:287
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define FLS_OUT_OF_INDEXES
Definition: winbase.h:612
#define HANDLE_FLAG_INHERIT
Definition: winbase.h:297
#define STACK_SIZE_PARAM_IS_A_RESERVATION
Definition: winbase.h:230
#define CREATE_SUSPENDED
Definition: winbase.h:188
VOID(WINAPI * PFLS_CALLBACK_FUNCTION)(PVOID)
Definition: winbase.h:1485
PFIBER_START_ROUTINE LPFIBER_START_ROUTINE
Definition: winbase.h:1483
DWORD(WINAPI * LPTHREAD_START_ROUTINE)(LPVOID)
Definition: winbase.h:764
#define THREAD_PRIORITY_ERROR_RETURN
Definition: winbase.h:315
BOOL * PBOOL
Definition: windef.h:161
#define WINAPI
Definition: msvc.h:6
const char * description
Definition: directx.c:2497
#define HRESULT_FROM_NT(x)
Definition: winerror.h:94
#define ERROR_ALREADY_FIBER
Definition: winerror.h:777
#define LCID_SUPPORTED
Definition: winnls.h:215
struct _TP_WAIT * PTP_WAIT
Definition: winnt_old.h:4492
struct _TP_CLEANUP_GROUP TP_CLEANUP_GROUP
Definition: winnt_old.h:4518
VOID(NTAPI * PTP_WAIT_CALLBACK)(PTP_CALLBACK_INSTANCE, PVOID, PTP_WAIT, TP_WAIT_RESULT)
Definition: winnt_old.h:4531
struct _TP_TIMER * PTP_TIMER
Definition: winnt_old.h:4491
struct _TP_WORK * PTP_WORK
Definition: winnt_old.h:4489
struct _TP_POOL TP_POOL
Definition: winnt_old.h:4488
VOID(NTAPI * PTP_WORK_CALLBACK)(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Context, _Inout_ PTP_WORK Work)
Definition: winnt_old.h:4513
struct _TP_WAIT TP_WAIT
Definition: winnt_old.h:4492
struct _TP_IO * PTP_IO
Definition: winnt_old.h:4493
struct _TP_WORK TP_WORK
Definition: winnt_old.h:4489
struct _TP_IO TP_IO
Definition: winnt_old.h:4493
struct _TP_TIMER TP_TIMER
Definition: winnt_old.h:4491
VOID(NTAPI * PTP_SIMPLE_CALLBACK)(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Context)
Definition: winnt_old.h:4521
struct _TP_POOL * PTP_POOL
Definition: winnt_old.h:4488
struct _TP_CLEANUP_GROUP * PTP_CLEANUP_GROUP
Definition: winnt_old.h:4518
VOID(NTAPI * PTP_TIMER_CALLBACK)(PTP_CALLBACK_INSTANCE, PVOID, PTP_TIMER)
Definition: winnt_old.h:4530
struct _TP_CALLBACK_INSTANCE TP_CALLBACK_INSTANCE
Definition: winnt_old.h:4490
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151
__wchar_t WCHAR
Definition: xmlstorage.h:180