| 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: GetCurrentProcess/test1/process.c |
| 8 | ** |
| 9 | ** Purpose: Test for to see if the process GetCurrentProcess |
| 10 | ** returns a handle to the current process or not. |
| 11 | ** |
| 12 | ** Dependencies: TerminateProcess |
| 13 | ** |
| 14 | ** |
| 15 | **=========================================================*/ |
| 16 | |
| 17 | #include <palsuite.h> |
| 18 | |
| 19 | INT __cdecl main( int argc, char **argv ) |
| 20 | { |
| 21 | |
| 22 | HANDLE hProcess; |
| 23 | |
| 24 | if(0 != (PAL_Initialize(argc, argv))) |
| 25 | { |
| 26 | return ( FAIL ); |
| 27 | } |
| 28 | |
| 29 | hProcess = GetCurrentProcess(); |
| 30 | Trace ("Testing the handle returned by GetCurrentProcess\n" ); |
| 31 | if ( 0 == ( TerminateProcess ( hProcess, PASS ) ) ) |
| 32 | { |
| 33 | Fail ("Testing GetCurrentProcess, the TerminateProcess function " |
| 34 | "failed.\n" ); |
| 35 | } |
| 36 | |
| 37 | PAL_Terminate(); |
| 38 | return ( PASS ); |
| 39 | |
| 40 | } |
| 41 | |