summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp')
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp
new file mode 100644
index 0000000000..c722edaf13
--- /dev/null
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp
@@ -0,0 +1,41 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: loadlibraryw.c
+**
+** Purpose: Negative test the loadlibraryw API.
+** Call loadlibraryw with NULL module name
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ int err;
+
+ /* Initialize the PAL environment */
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /* load a module with a NULL module name */
+ ModuleHandle = LoadLibraryW(NULL);
+ if(NULL != ModuleHandle)
+ {
+ Fail("\nFailed to call loadlibraryw API for a negative test, "
+ "call loadibraryw with NULL moudle name, a NULL module "
+ "handle is expected, but no NULL module handle is returned, "
+ "error code =%u\n", GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}