| 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: LocalFree.c |
| 8 | ** |
| 9 | ** Purpose: Positive test the LocalFree API. |
| 10 | ** call LocalFree by passing NULL as local memory |
| 11 | ** object handle |
| 12 | ** |
| 13 | ** |
| 14 | **============================================================*/ |
| 15 | #include <palsuite.h> |
| 16 | |
| 17 | int __cdecl main(int argc, char *argv[]) |
| 18 | { |
| 19 | HLOCAL FreeHeap; |
| 20 | int err; |
| 21 | |
| 22 | /*Initialize the PAL environment*/ |
| 23 | err = PAL_Initialize(argc, argv); |
| 24 | if(0 != err) |
| 25 | { |
| 26 | return FAIL; |
| 27 | } |
| 28 | |
| 29 | /*call LocalFree by passing NULL as local memory object handle*/ |
| 30 | FreeHeap = LocalFree(NULL); |
| 31 | if(FreeHeap) |
| 32 | { |
| 33 | Fail("Failed to call LocalFree API, " |
| 34 | "error code=%u\n" , GetLastError()); |
| 35 | } |
| 36 | |
| 37 | PAL_Terminate(); |
| 38 | return PASS; |
| 39 | } |
| 40 | |