ReactOS 0.4.16-dev-1946-g52006dd
setjmp.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS CRT
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Tests for setjmp and longjmp
5 * COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
6 * Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7 * Copyright 2025 Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
8 */
9
10#include <apitest.h>
11#include <pseh/pseh2.h>
12#include <setjmp.h>
13#include <assert.h>
14#include <rtlfuncs.h>
15
16#if defined(_M_IX86) && !defined(_MSC_VER)
17#define todo_pseh todo_if(1)
18#else
19#define todo_pseh
20#endif
21
23
24static void TEST_setjmp_normal(void)
25{
26 volatile int stage = 0;
27 volatile DWORD exception = 0;
28 volatile BOOL abnormal = FALSE, finally_called = FALSE;
29 int value;
30
32 switch (stage)
33 {
34 case 0:
35 ok_int(value, 0);
36 stage = 1;
37 longjmp(g_jmp_buf, 999);
39 break;
40 case 1:
41 ok_int(value, 999);
42 stage = 2;
43 longjmp(g_jmp_buf, 0);
45 break;
46 case 2:
47 ok_int(value, 1);
48 stage = 3;
49#ifdef __clang__ /* avoiding clang build hung up */
50 skip("avoiding clang build crash\n");
51#else /* ndef __clang__ */
53 {
54 longjmp(g_jmp_buf, 333);
55 }
57 {
58 finally_called = TRUE;
59 abnormal = AbnormalTermination();
60 }
63 break;
64#endif /* ndef __clang__ */
65 case 3:
66 ok_int(value, 333);
67#ifdef _M_AMD64 // This is broken on Windows 2003 x64
68 if (NtCurrentPeb()->OSMajorVersion >= 6)
69#endif
70 {
71 ok_int(finally_called, TRUE);
72 ok_int(abnormal, TRUE);
73 }
74 stage = 4;
75#ifdef __clang__ /* avoiding clang build hung up */
76 skip("avoiding clang build crash\n");
77#else /* ndef __clang__ */
79 {
80 longjmp(g_jmp_buf, 444);
81 }
83 {
84 exception = -1;
85 }
88 break;
89#endif /* ndef __clang__ */
90 case 4:
91 ok_int(value, 444);
92 ok_int(exception, 0);
93 break;
94 default:
96 break;
97 }
98
99 ok_int(stage, 4);
100}
101
102static INT s_check_points[16] = { 0 };
103
104#define CHECK_POINT(number) do { \
105 assert(number < _countof(s_check_points)); \
106 s_check_points[number] = __LINE__; \
107} while (0)
108
110{
111 volatile int x = 1001, value;
112 memset(&g_jmp_buf, 0xCC, sizeof(g_jmp_buf));
114
115 if (value == 0)
116 {
117 CHECK_POINT(0);
118 longjmp(g_jmp_buf, 999);
119 CHECK_POINT(1);
120 }
121 else if (value == 999)
122 {
123 CHECK_POINT(2);
124 ok_int(x, 1001);
125 }
126 else
127 {
128 CHECK_POINT(3);
129 }
130}
131
132static void TEST_longjmp(int value)
133{
134 CHECK_POINT(4);
135 longjmp(g_jmp_buf, value);
136 CHECK_POINT(5);
137}
138
140{
141 volatile int value;
142
143 memset(&g_jmp_buf, 0xCC, sizeof(g_jmp_buf));
145
146 if (value == 0)
147 {
148 CHECK_POINT(6);
149 TEST_longjmp(0xBEEFCAFE);
150 CHECK_POINT(7);
151 }
152 else if (value == 0xBEEFCAFE)
153 {
154 CHECK_POINT(8);
155 }
156 else
157 {
158 CHECK_POINT(9);
159 }
160}
161
163{
164 volatile int value;
165 volatile BOOL went_zero = FALSE;
166
167 memset(&g_jmp_buf, 0xCC, sizeof(g_jmp_buf));
169
170 if (value == 0)
171 {
172 if (went_zero)
173 {
174 CHECK_POINT(10);
175 return;
176 }
177 went_zero = TRUE;
178
179 CHECK_POINT(11);
180
181 TEST_longjmp(0); /* giving zero should go to one */
182
183 CHECK_POINT(12);
184 }
185 else if (value == 1)
186 {
187 if (went_zero)
188 {
189 CHECK_POINT(13);
190 }
191 else
192 {
193 CHECK_POINT(14);
194 }
195 }
196 else
197 {
198 CHECK_POINT(15);
199 }
200}
201
202void call_setjmp(_JUMP_BUFFER *Buf);
204extern char setjmp_return_address;
205#ifdef _M_AMD64
206void call_setjmpex(_JUMP_BUFFER *Buf);
207#elif defined(_M_IX86)
208int _setjmp3(jmp_buf env, int count, /* void* UnwindFunc, unsigned TryLevel, */ ...);
209int _setjmp1(jmp_buf env); // ASM call wrapper around _setjmp, which is an intrinsic on MSVC
210void call_setjmp3(_JUMP_BUFFER *Buf);
211#endif
212
213static void check_buffer_registers_(ULONG Line, _JUMP_BUFFER* Buf, ULONG_PTR Sp, void* Pc)
214{
215#ifdef _M_AMD64
216 ok_eq_hex64_(__FILE__, Line, Buf->Frame, Sp - 0xF0);
217 ok_eq_hex64_(__FILE__, Line, Buf->Rbx, 0xA1A1A1A1A1A1A1A1ULL);
218 ok_eq_hex64_(__FILE__, Line, Buf->Rsp, Sp - 0xF0);
219 ok_eq_hex64_(__FILE__, Line, Buf->Rbp, 0xA2A2A2A2A2A2A2A2ULL);
220 ok_eq_hex64_(__FILE__, Line, Buf->Rsi, 0xA3A3A3A3A3A3A3A3ULL);
221 ok_eq_hex64_(__FILE__, Line, Buf->Rdi, 0xA4A4A4A4A4A4A4A4ULL);
222 ok_eq_hex64_(__FILE__, Line, Buf->R12, 0xACACACACACACACACULL);
223 ok_eq_hex64_(__FILE__, Line, Buf->R13, 0xADADADADADADADADULL);
224 ok_eq_hex64_(__FILE__, Line, Buf->R14, 0xAEAEAEAEAEAEAEAEULL);
225 ok_eq_hex64_(__FILE__, Line, Buf->R15, 0xAFAFAFAFAFAFAFAFULL);
226 ok_eq_hex64_(__FILE__, Line, Buf->Rip, (ULONG64)Pc);
227 ok_eq_hex_(__FILE__, Line, Buf->MxCsr, 0x00001f80);
228 ok_eq_hex64_(__FILE__, Line, Buf->FpCsr, 0x27F);
229 ok_eq_hex64_(__FILE__, Line, Buf->Spare, 0xCCCC);
230 ok_eq_hex64_(__FILE__, Line, Buf->Xmm6.Part[0], 0x0606060606060606ULL);
231 ok_eq_hex64_(__FILE__, Line, Buf->Xmm6.Part[1], 0x1616161616161616ULL);
232 ok_eq_hex64_(__FILE__, Line, Buf->Xmm7.Part[0], 0x0707070707070707ULL);
233 ok_eq_hex64_(__FILE__, Line, Buf->Xmm7.Part[1], 0x1717171717171717ULL);
234 ok_eq_hex64_(__FILE__, Line, Buf->Xmm8.Part[0], 0x0808080808080808ULL);
235 ok_eq_hex64_(__FILE__, Line, Buf->Xmm8.Part[1], 0x1818181818181818ULL);
236 ok_eq_hex64_(__FILE__, Line, Buf->Xmm9.Part[0], 0x0909090909090909ULL);
237 ok_eq_hex64_(__FILE__, Line, Buf->Xmm9.Part[1], 0x1919191919191919ULL);
238 ok_eq_hex64_(__FILE__, Line, Buf->Xmm10.Part[0], 0x0A0A0A0A0A0A0A0AULL);
239 ok_eq_hex64_(__FILE__, Line, Buf->Xmm10.Part[1], 0x1A1A1A1A1A1A1A1AULL);
240 ok_eq_hex64_(__FILE__, Line, Buf->Xmm11.Part[0], 0x0B0B0B0B0B0B0B0BULL);
241 ok_eq_hex64_(__FILE__, Line, Buf->Xmm11.Part[1], 0x1B1B1B1B1B1B1B1BULL);
242 ok_eq_hex64_(__FILE__, Line, Buf->Xmm12.Part[0], 0x0C0C0C0C0C0C0C0CULL);
243 ok_eq_hex64_(__FILE__, Line, Buf->Xmm12.Part[1], 0x1C1C1C1C1C1C1C1CULL);
244 ok_eq_hex64_(__FILE__, Line, Buf->Xmm13.Part[0], 0x0D0D0D0D0D0D0D0DULL);
245 ok_eq_hex64_(__FILE__, Line, Buf->Xmm13.Part[1], 0x1D1D1D1D1D1D1D1DULL);
246 ok_eq_hex64_(__FILE__, Line, Buf->Xmm14.Part[0], 0x0E0E0E0E0E0E0E0EULL);
247 ok_eq_hex64_(__FILE__, Line, Buf->Xmm14.Part[1], 0x1E1E1E1E1E1E1E1EULL);
248 ok_eq_hex64_(__FILE__, Line, Buf->Xmm15.Part[0], 0x0F0F0F0F0F0F0F0FULL);
249 ok_eq_hex64_(__FILE__, Line, Buf->Xmm15.Part[1], 0x1F1F1F1F1F1F1F1FULL);
250#elif defined(_M_IX86)
251 ok_eq_hex_(__FILE__, Line, Buf->Ebp, 0xA1A1A1A1ul);
252 ok_eq_hex_(__FILE__, Line, Buf->Ebx, 0xA2A2A2A2ul);
253 ok_eq_hex_(__FILE__, Line, Buf->Edi, 0xA3A3A3A3ul);
254 ok_eq_hex_(__FILE__, Line, Buf->Esi, 0xA4A4A4A4ul);
255 ok_eq_hex_(__FILE__, Line, Buf->Esp, Sp - 0x38);
256 ok_eq_hex_(__FILE__, Line, Buf->Eip, (ULONG)Pc);
257#endif
258}
259#define check_buffer_registers(Buf, Sp, Pc) \
260 check_buffer_registers_(__LINE__, Buf, Sp, Pc)
261
262static void TEST_buffer_contents(void)
263{
264 _JUMP_BUFFER buf;
265
266 memset(&buf, 0xCC, sizeof(buf));
269
270#ifdef _M_AMD64
271
272 memset(&buf, 0xCC, sizeof(buf));
273 call_setjmpex(&buf);
275
276#elif defined(_M_IX86)
277
278 ok_eq_hex(buf.Registration, __readfsdword(0));
279 todo_pseh ok_eq_hex(buf.TryLevel, 0xFFFFFFFF);
280 ok_eq_hex(buf.Cookie, 0xCCCCCCCC);
281 ok_eq_hex(buf.UnwindFunc, 0xCCCCCCCC);
282 ok_eq_hex(buf.UnwindData[0], 0xCCCCCCCC);
283 ok_eq_hex(buf.UnwindData[1], 0xCCCCCCCC);
284 ok_eq_hex(buf.UnwindData[2], 0xCCCCCCCC);
285 ok_eq_hex(buf.UnwindData[3], 0xCCCCCCCC);
286 ok_eq_hex(buf.UnwindData[4], 0xCCCCCCCC);
287 ok_eq_hex(buf.UnwindData[5], 0xCCCCCCCC);
288
289 // Temporarily remove the SEH registration (__writefsdword(0, ...) is not allowed with MSVC)
290 PULONG ExceptionRegistrationPtr = (PULONG)NtCurrentTeb();
291 ULONG Registration = *ExceptionRegistrationPtr;
292 *ExceptionRegistrationPtr = 0xFFFFFFFF;
293
294 memset(&buf, 0xCC, sizeof(buf));
296 ok_eq_hex(buf.Registration, 0xFFFFFFFF);
297 ok_eq_hex(buf.TryLevel, 0xFFFFFFFF);
298 ok_eq_hex(buf.Cookie, 0xCCCCCCCC);
299 ok_eq_hex(buf.UnwindFunc, 0xCCCCCCCC);
300
301 // Restore the SEH registration
302 *ExceptionRegistrationPtr = Registration;
303
305 {
308 {
310 memset(&buf, 0xCC, sizeof(buf));
312 }
314 {
315 /* This is to ensure that the exception handler is not optimized out. */
317 }
318 _SEH2_END;
319 }
321 {
322 /* This is to ensure that the exception handler is not optimized out. */
324 }
325 _SEH2_END;
326
327 ok_eq_hex(buf.Registration, Registration);
328 todo_pseh ok_eq_hex(buf.TryLevel, 1);
329 ok_eq_hex(buf.Cookie, 0xCCCCCCCC);
330 ok_eq_hex(buf.UnwindFunc, 0xCCCCCCCC);
331#endif
332}
333
334#ifdef _M_IX86
335
337static void Test_setjmp1_longjmp_inside_SEH(void)
338{
339 jmp_buf buf;
340 int finally_called = 0;
341
342 // Use the legacy _setjmp
343 int longjmp_value = _setjmp1(buf);
344 if (longjmp_value == 0)
345 {
347 {
348 longjmp(buf, 0x12345678);
349 }
351 {
352 finally_called = 1;
353 }
354 _SEH2_END;
355 }
356
357 ok_eq_int(longjmp_value, 0x12345678);
358 ok_eq_int(finally_called, 1);
359}
360
362static int Test_setjmp1_inner(void)
363{
364 jmp_buf buf;
365
366 int longjmp_value = _setjmp1(buf);
367 if (longjmp_value == 0)
368 {
369 longjmp(buf, 0x12345678);
370 }
371 return longjmp_value;
372}
373
375static void Test_setjmp1_external_inside_SEH(void)
376{
377 volatile int ret = 0;
379 {
381 {
382 ret = Test_setjmp1_inner();
383 }
385 {
387 ret = -1;
388 }
389 _SEH2_END;
390 }
392 {
393 ret = -2;
394 }
395 _SEH2_END;
396 ok_eq_int(ret, 0x12345678);
397}
398
399#if 0 // This actually crashes on Windows!
401void Test_setjmp1_no_SEH_registration(void)
402{
403 jmp_buf buf;
404
405 // Temporarily remove the SEH registration
406 PULONG ExceptionRegistrationPtr = (PULONG)NtCurrentTeb();
407 ULONG Registration = *ExceptionRegistrationPtr;
408 *ExceptionRegistrationPtr = 0xFFFFFFFF;
409
410 // This will save 0xFFFFFFFF in the Registration field
411 int longjmp_value = _setjmp1(buf);
412 if (longjmp_value == 0)
413 {
414 // This will check if Registration is 0(!) and if not, it will
415 // call _local_unwind2, which will dereference the Registration
416 // and crash.
417 longjmp(buf, 1);
418 }
419
420 ok_eq_int(longjmp_value, 1);
421
422 // Restore the SEH registration
423 *ExceptionRegistrationPtr = Registration;
424}
425#endif
426
428static void Test_setjmp3(void)
429{
430 ULONG BufferData[18];
431 _JUMP_BUFFER* Buf = (_JUMP_BUFFER*)&BufferData;
432
433 memset(&BufferData, 0xCC, sizeof(BufferData));
434 call_setjmp3(Buf);
436 ok_eq_hex(Buf->Registration, __readfsdword(0));
437 ok_eq_hex(Buf->TryLevel, 7);
438 ok_eq_hex(Buf->Cookie, 0x56433230);
439 ok_eq_hex(Buf->UnwindFunc, 0x00012345);
440 ok_eq_hex(Buf->UnwindData[0], 0x12345678);
441 ok_eq_hex(Buf->UnwindData[1], 0x23456789);
442 ok_eq_hex(Buf->UnwindData[2], 0x3456789a);
443 ok_eq_hex(Buf->UnwindData[3], 0xCCCCCCCC);
444 ok_eq_hex(Buf->UnwindData[4], 0xCCCCCCCC);
445 ok_eq_hex(Buf->UnwindData[5], 0xCCCCCCCC);
446
447 memset(&BufferData, 0xCC, sizeof(BufferData));
448 _setjmp3((int*)Buf, 0, (void*)0x12345, 3, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4);
449 ok_eq_hex(Buf->Registration, __readfsdword(0));
450 ok_eq_hex(Buf->TryLevel, 0);
451 ok_eq_hex(Buf->Cookie, 0x56433230);
452 ok_eq_hex(Buf->UnwindFunc, 0x00000000);
453 ok_eq_hex(Buf->UnwindData[0], 0xCCCCCCCC);
454 ok_eq_hex(Buf->UnwindData[1], 0xCCCCCCCC);
455 ok_eq_hex(Buf->UnwindData[2], 0xCCCCCCCC);
456 ok_eq_hex(Buf->UnwindData[3], 0xCCCCCCCC);
457 ok_eq_hex(Buf->UnwindData[4], 0xCCCCCCCC);
458 ok_eq_hex(Buf->UnwindData[5], 0xCCCCCCCC);
459
460 static ULONG Data[4] = { 0x0123, 0x1234, 0x2345, 0x3456 };
461 memset(&BufferData, 0xCC, sizeof(BufferData));
462 _setjmp3((int*)Buf, 1, Data, 7, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4);
463 ok_eq_hex(Buf->Registration, __readfsdword(0));
464 ok_eq_hex(Buf->TryLevel, 0x00003456);
465 ok_eq_hex(Buf->Cookie, 0x56433230);
466 ok_eq_hex(Buf->UnwindFunc, (ULONG)Data);
467 ok_eq_hex(Buf->UnwindData[0], 0xCCCCCCCC);
468
469 memset(&BufferData, 0xCC, sizeof(BufferData));
470 _setjmp3((int*)Buf, 2, Data, 7, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4);
471 ok_eq_hex(Buf->Registration, __readfsdword(0));
472 ok_eq_hex(Buf->TryLevel, 7);
473 ok_eq_hex(Buf->Cookie, 0x56433230);
474 ok_eq_hex(Buf->UnwindFunc, (ULONG)Data);
475 ok_eq_hex(Buf->UnwindData[0], 0xCCCCCCCC);
476
477 memset(&BufferData, 0xCC, sizeof(BufferData));
478 _setjmp3((int*)Buf, 3, Data, 7, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4);
479 ok_eq_hex(Buf->Registration, __readfsdword(0));
480 ok_eq_hex(Buf->TryLevel, 7);
481 ok_eq_hex(Buf->Cookie, 0x56433230);
482 ok_eq_hex(Buf->UnwindFunc, (ULONG)Data);
483 ok_eq_hex(Buf->UnwindData[0], 0xA1A1A1A1);
484 ok_eq_hex(Buf->UnwindData[1], 0xCCCCCCCC);
485
486 memset(&BufferData, 0xCC, sizeof(BufferData));
487 _setjmp3((int*)Buf, 11, (PVOID)0xdeadbeef, 7, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4, 0xA5A5A5A5, 0xA6A6A6A6, 0xA7A7A7A7, 0xA8A8A8A8, 0xA9A9A9A9);
488 ok_eq_hex(Buf->Registration, __readfsdword(0));
489 ok_eq_hex(Buf->TryLevel, 7);
490 ok_eq_hex(Buf->Cookie, 0x56433230);
491 ok_eq_hex(Buf->UnwindFunc, 0xdeadbeef);
492 ok_eq_hex(Buf->UnwindData[0], 0xA1A1A1A1);
493 ok_eq_hex(Buf->UnwindData[1], 0xA2A2A2A2);
494 ok_eq_hex(Buf->UnwindData[2], 0xA3A3A3A3);
495 ok_eq_hex(Buf->UnwindData[3], 0xA4A4A4A4);
496 ok_eq_hex(Buf->UnwindData[4], 0xA5A5A5A5);
497 ok_eq_hex(Buf->UnwindData[5], 0xA6A6A6A6);
498 ok_eq_hex(BufferData[16], 0xCCCCCCCC);
499 ok_eq_hex(BufferData[17], 0xCCCCCCCC);
500
501 // Temporarily remove the SEH registration
502 PULONG ExceptionRegistrationPtr = (PULONG)NtCurrentTeb();
503 ULONG Registration = *ExceptionRegistrationPtr;
504 *ExceptionRegistrationPtr = 0xFFFFFFFF;
505
506 memset(&BufferData, 0xCC, sizeof(BufferData));
507 _setjmp3((int*)Buf, 11, (PVOID)0xdeadbeef, 7, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4, 0xA5A5A5A5, 0xA6A6A6A6, 0xA7A7A7A7, 0xA8A8A8A8, 0xA9A9A9A9);
508 ok_eq_hex(Buf->Registration, 0xFFFFFFFF);
509 ok_eq_hex(Buf->TryLevel, 0xFFFFFFFF);
510 ok_eq_hex(Buf->Cookie, 0x56433230);
511 ok_eq_hex(Buf->UnwindFunc, 0x00000000);
512 ok_eq_hex(Buf->UnwindData[0], 0xCCCCCCCC);
513 ok_eq_hex(Buf->UnwindData[1], 0xCCCCCCCC);
514
515 int value = _setjmp3((int*)Buf, 0);
516 if (value == 0)
517 {
518 ok_eq_hex(Buf->Registration, 0xFFFFFFFF);
519 ok_eq_hex(Buf->TryLevel, 0xFFFFFFFF);
520 ok_eq_hex(Buf->Cookie, 0x56433230);
521 ok_eq_hex(Buf->UnwindFunc, 0x00000000);
522 ok_eq_hex(Buf->UnwindData[0], 0xCCCCCCCC);
523 ok_eq_hex(Buf->UnwindData[1], 0xCCCCCCCC);
524 longjmp((int*)Buf, 0xBEEFCAFE);
525 ok(0, "Should not get here\n");
526 }
527 ok_int(value, 0xBEEFCAFE);
528
529 // Restore the SEH registration
530 *ExceptionRegistrationPtr = Registration;
531}
532
534void Test_setjmp3_with_SEH(void)
535{
536 _JUMP_BUFFER buf;
537 volatile int dummy;
538
540 {
541 dummy = 0;
542 (void)dummy;
543 }
545 {
546 }
547 _SEH2_END;
548
549 memset(&buf, 0xCC, sizeof(buf));
550 _setjmp3((int*)& buf, 0, (void*)0x12345, 3, 0xA1A1A1A1, 0xA2A2A2A2, 0xA3A3A3A3, 0xA4A4A4A4);
551 ok_eq_hex(buf.Registration, __readfsdword(0));
552 todo_pseh ok_eq_hex(buf.TryLevel, 0xffffffff);
553}
554
555#endif // _M_IX86
556
557#undef setjmp
559{
561
562 /* FIXME: These tests are insufficient */
568#ifdef _M_IX86
569 Test_setjmp1_longjmp_inside_SEH();
570 Test_setjmp1_external_inside_SEH();
571 //Test_setjmp1_no_SEH_registration();
572 Test_setjmp3();
573 Test_setjmp3_with_SEH();
574#endif /* _M_IX86 */
575
576#define DO_COME(number) \
577 ok(s_check_points[number], "CheckPoint #%d: Didn't reach\n", number)
578#define NEVER_COME(number) \
579 ok(!s_check_points[number], "CheckPoint #%d: Wrongly reached Line %d\n", \
580 number, s_check_points[number])
581
582 DO_COME(0);
583 NEVER_COME(1);
584
585 DO_COME(0);
586 NEVER_COME(1);
587 DO_COME(2);
588 NEVER_COME(3);
589 DO_COME(4);
590 NEVER_COME(5);
591 DO_COME(6);
592 NEVER_COME(7);
593 DO_COME(8);
594 NEVER_COME(9);
595 NEVER_COME(10);
596 DO_COME(11);
597 NEVER_COME(12);
598 DO_COME(13);
599 NEVER_COME(14);
600 NEVER_COME(15);
601}
#define NtCurrentPeb()
Definition: FLS.c:22
#define ok_eq_hex(value, expected)
Definition: apitest.h:134
#define ok_eq_hex_(file, line, value, expected)
Definition: apitest.h:144
#define ok_eq_hex64_(file, line, value, expected)
Definition: apitest.h:145
#define ok_eq_int(value, expected)
Definition: apitest.h:117
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:171
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define assert(x)
Definition: debug.h:53
return ret
Definition: mutex.c:146
#define noinline
Definition: types.h:64
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_ CONST FLT_REGISTRATION * Registration
Definition: fltkernel.h:991
void __declspec(noinline) __cdecl _free_base(void *const block)
Definition: free_base.cpp:98
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define GetExceptionCode
Definition: excpt.h:83
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define AbnormalTermination
Definition: excpt.h:87
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition: intrin_ppc.h:382
#define NtCurrentTeb
ULONG Sp
Definition: kdb_expr.c:99
#define ZeroMemory
Definition: minwinbase.h:31
unsigned __int64 ULONG64
Definition: imports.h:198
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:182
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_FINALLY
Definition: pseh2_64.h:130
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
int _setjmp3(jmp_buf env, int count,...)
#define memset(x, y, z)
Definition: compat.h:39
static void TEST_buffer_contents(void)
Definition: setjmp.c:262
char setjmp_return_address
static void TEST_setjmp_normal(void)
Definition: setjmp.c:24
#define todo_pseh
Definition: setjmp.c:19
#define NEVER_COME(number)
static void check_buffer_registers_(ULONG Line, _JUMP_BUFFER *Buf, ULONG_PTR Sp, void *Pc)
Definition: setjmp.c:213
static void TEST_setjmp_return_check(void)
Definition: setjmp.c:109
#define DO_COME(number)
static INT s_check_points[16]
Definition: setjmp.c:102
#define CHECK_POINT(number)
Definition: setjmp.c:104
static void TEST_longjmp(int value)
Definition: setjmp.c:132
void call_setjmp(_JUMP_BUFFER *Buf)
ULONG_PTR get_sp(void)
#define check_buffer_registers(Buf, Sp, Pc)
Definition: setjmp.c:259
static jmp_buf g_jmp_buf
Definition: setjmp.c:22
static void TEST_setjmp_zero_longjmp_check(void)
Definition: setjmp.c:162
static void TEST_setjmp_longjmp_integration(void)
Definition: setjmp.c:139
Definition: ncftp.h:79
uint32_t * PULONG
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
Definition: pdh_main.c:96
#define setjmp
Definition: setjmp.h:211
_JBTYPE jmp_buf[_JBLEN]
Definition: setjmp.h:188