| 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: loadlibraryw.c |
| 8 | ** |
| 9 | ** Purpose: Negative test the loadlibraryw API. |
| 10 | ** Call loadlibraryw with NULL module name |
| 11 | ** |
| 12 | ** |
| 13 | **============================================================*/ |
| 14 | #define UNICODE |
| 15 | #include <palsuite.h> |
| 16 | |
| 17 | int __cdecl main(int argc, char *argv[]) |
| 18 | { |
| 19 | HMODULE ModuleHandle; |
| 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 | /* load a module with a NULL module name */ |
| 30 | ModuleHandle = LoadLibraryW(NULL); |
| 31 | if(NULL != ModuleHandle) |
| 32 | { |
| 33 | Fail("\nFailed to call loadlibraryw API for a negative test, " |
| 34 | "call loadibraryw with NULL moudle name, a NULL module " |
| 35 | "handle is expected, but no NULL module handle is returned, " |
| 36 | "error code =%u\n" , GetLastError()); |
| 37 | } |
| 38 | |
| 39 | PAL_Terminate(); |
| 40 | return PASS; |
| 41 | } |
| 42 | |