1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | |
5 | /*============================================================ |
6 | ** |
7 | ** Source: childprocess.c |
8 | ** |
9 | ** Purpose: Test to ensure ExitThread returns the right |
10 | ** value when shutting down the last thread of a process. |
11 | ** All this program does is call ExitThread() with a predefined |
12 | ** value. |
13 | ** |
14 | ** Dependencies: none |
15 | ** |
16 | |
17 | ** |
18 | **=========================================================*/ |
19 | |
20 | #include <palsuite.h> |
21 | #include "myexitcode.h" |
22 | |
23 | int __cdecl main( int argc, char **argv ) |
24 | { |
25 | /* initialize the PAL */ |
26 | if( PAL_Initialize(argc, argv) != 0 ) |
27 | { |
28 | return( FAIL ); |
29 | } |
30 | |
31 | /* exit the current thread with a magic test value -- it should */ |
32 | /* terminate the process and return that test value from this */ |
33 | /* program. */ |
34 | ExitThread( TEST_EXIT_CODE ); |
35 | |
36 | /* technically we should never get here */ |
37 | PAL_Terminate(); |
38 | |
39 | /* return failure */ |
40 | return FAIL; |
41 | } |
42 | |