| 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: getprocheap.c |
| 8 | ** |
| 9 | ** Purpose: Positive test the GetProcessHeap API. |
| 10 | ** Call GetProcessHeap to retrieve the handle of |
| 11 | ** calling process heap |
| 12 | ** |
| 13 | ** |
| 14 | **============================================================*/ |
| 15 | #include <palsuite.h> |
| 16 | |
| 17 | int __cdecl main(int argc, char *argv[]) |
| 18 | { |
| 19 | int err; |
| 20 | HANDLE ProcessHeapHandle; |
| 21 | |
| 22 | //Initialize the PAL environment |
| 23 | err = PAL_Initialize(argc, argv); |
| 24 | if(0 != err) |
| 25 | { |
| 26 | ExitProcess(FAIL); |
| 27 | } |
| 28 | |
| 29 | //Retrieve the calling process heap handle |
| 30 | ProcessHeapHandle = GetProcessHeap(); |
| 31 | |
| 32 | if(!ProcessHeapHandle) |
| 33 | { |
| 34 | Fail("\nFailed to call GetProcessHeap API!\n" ); |
| 35 | } |
| 36 | |
| 37 | PAL_Terminate(); |
| 38 | return PASS; |
| 39 | } |
| 40 | |