diff options
Diffstat (limited to 'src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c')
-rw-r--r-- | src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c deleted file mode 100644 index a15ff5745b..0000000000 --- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c +++ /dev/null @@ -1,62 +0,0 @@ -// 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: pal_registerlibraryw_unregisterlibraryw_neg.c -** -** Purpose: Negative test the PAL_RegisterLibrary API. -** Call PAL_RegisterLibrary to map a non-existant module -** into the calling process address space. -** -** -**============================================================*/ -#define UNICODE -#include <palsuite.h> - -int __cdecl main(int argc, char *argv[]) -{ - HMODULE ModuleHandle; - char ModuleName[64]; - WCHAR *wpModuleName = NULL; - int err; - - /*Initialize the PAL environment*/ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - memset(ModuleName, 0, 64); - sprintf(ModuleName, "%s", "not_exist_module_name"); - - /*convert a normal string to a wide one*/ - wpModuleName = convert(ModuleName); - - /*load a not exist module*/ - ModuleHandle = PAL_RegisterLibrary(wpModuleName); - - /*free the memory*/ - free(wpModuleName); - - if(NULL != ModuleHandle) - { - Trace("ERROR: PAL_RegisterLibrary successfully mapped " - "a module that does not exist into the calling process\n"); - - /*decrement the reference count of the loaded DLL*/ - err = PAL_UnregisterLibrary(ModuleHandle); - if(0 == err) - { - Trace("\nFailed to call PAL_UnregisterLibrary API to decrement the " - "count of the loaded DLL module!\n"); - } - Fail(""); - - } - - PAL_Terminate(); - return PASS; -} |