using System; using System.Runtime.InteropServices; namespace Packaging.Targets.Native { internal static class WindowsNativeMethods { private const string Kernel32 = "kernel32"; [DllImport(Kernel32, CharSet = CharSet.Ansi, BestFitMapping = false)] public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName); /// /// Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. /// /// /// /// The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). /// The name specified is the file name of the module and is not related to the name stored in the library module itself, /// as specified by the LIBRARY keyword in the module-definition (.def) file. /// /// /// If the string specifies a full path, the function searches only that path for the module. /// /// /// If the string specifies a relative path or a module name without a path, the function uses a standard search strategy /// to find the module; for more information, see the Remarks. /// /// /// If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\), /// not forward slashes (/). For more information about paths, see Naming a File or Directory. /// /// /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the /// default library extension .dll to the module name. To prevent the function from appending .dll to the module name, /// include a trailing point character (.) in the module name string. /// /// /// /// If the function succeeds, the return value is a handle to the module. /// If the function fails, the return value is . To get extended error information, call /// . /// /// [DllImport(Kernel32, SetLastError = true)] public static extern IntPtr LoadLibrary(string dllToLoad); } }