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: UnmapViewOfFile.c (test 2) |
8 | ** |
9 | ** Purpose: Negative test the UnmapViewOfFile API. |
10 | ** Call UnmapViewOfFile to unmap a view of |
11 | ** NULL. |
12 | ** |
13 | ** |
14 | **============================================================*/ |
15 | #include <palsuite.h> |
16 | |
17 | int __cdecl main(int argc, char *argv[]) |
18 | { |
19 | int err; |
20 | |
21 | /*Initialize the PAL environment*/ |
22 | err = PAL_Initialize(argc, argv); |
23 | if(0 != err) |
24 | { |
25 | return FAIL; |
26 | } |
27 | |
28 | /* Negative test the UnmapViewOfFile by passing a NULL*/ |
29 | /* mapping address handle*/ |
30 | err = UnmapViewOfFile(NULL); |
31 | if(0 != err) |
32 | { |
33 | Fail("ERROR: Able to call UnmapViewOfFile API " |
34 | "by passing a NULL mapping address.\n" ); |
35 | |
36 | } |
37 | |
38 | /* Terminate the PAL. |
39 | */ |
40 | PAL_Terminate(); |
41 | return PASS; |
42 | } |
43 | |