| 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: getcurrentprocessid/test1/processid.c |
| 8 | ** |
| 9 | ** Purpose: Test to ensure GetCurrentProcessId returns the current |
| 10 | ** process id number. This test compares the result of |
| 11 | ** GetCurrentProcessId to getpid. |
| 12 | ** |
| 13 | ** |
| 14 | **=========================================================*/ |
| 15 | |
| 16 | #include <palsuite.h> |
| 17 | |
| 18 | INT __cdecl main( int argc, char **argv ) |
| 19 | { |
| 20 | |
| 21 | DWORD dwProcessId; |
| 22 | |
| 23 | if(0 != (PAL_Initialize(argc, argv))) |
| 24 | { |
| 25 | return ( FAIL ); |
| 26 | } |
| 27 | |
| 28 | dwProcessId = GetCurrentProcessId(); |
| 29 | |
| 30 | if ( 0 >= dwProcessId ) |
| 31 | { |
| 32 | Fail ("%s has dwProcessId has id value %d\n" , argv[0], |
| 33 | dwProcessId ); |
| 34 | } |
| 35 | Trace ("%s has dwProcessId %d\nPassing test as dwProcessId is > 0\n" |
| 36 | , argv[0], dwProcessId); |
| 37 | |
| 38 | PAL_Terminate(); |
| 39 | return ( PASS ); |
| 40 | |
| 41 | } |
| 42 | |