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: test.c |
8 | ** |
9 | ** Purpose: Test for CloseHandle function, try to close an unopened HANDLE |
10 | ** |
11 | ** |
12 | **=========================================================*/ |
13 | |
14 | #include <palsuite.h> |
15 | |
16 | int __cdecl main(int argc, char *argv[]) |
17 | { |
18 | |
19 | HANDLE SomeHandle = NULL; |
20 | |
21 | /* |
22 | * Initialize the PAL and return FAILURE if this fails |
23 | */ |
24 | |
25 | if(0 != (PAL_Initialize(argc, argv))) |
26 | { |
27 | return FAIL; |
28 | } |
29 | |
30 | /* If the handle is already closed and you can close it again, |
31 | * something is wrong. |
32 | */ |
33 | |
34 | if(CloseHandle(SomeHandle) != 0) |
35 | { |
36 | Fail("ERROR: Called CloseHandle on an already closed Handle " |
37 | "and it still returned as a success.\n" ); |
38 | } |
39 | |
40 | |
41 | PAL_Terminate(); |
42 | return PASS; |
43 | } |
44 | |
45 | |
46 | |
47 | |