I am using LoadLibrary function from kernel32.dll to load some 64-bit assembly files with full file path in C#. But it returns null pointer. And also it returns 0 for getLastError() function. Below is the function definition code in C#.
[DllImport("kernel32.dll"), SuppressUnmanagedCodeSecurity]
static extern uint LoadLibraryEx(string fileName, uint notUsedMustBeZero, uint flags);
Below is the code that I tried to load the 64-bit assembly.
var hLib = LoadLibraryEx(filePath, 0, DONT_RESOLVE_DLL_REFERENCES | LOAD_IGNORE_CODE_AUTHZ_LEVEL);
How to fix this issue?