Alias ​​for the function

I want to import some functions from kernel32.dll, but I want to use different names. Function example:

[DllImport("kernel32.dll")] private static extern bool ReadProcessMemoryProc64 (...);

private static bool BetterReadableAndWriteableName (...) {
    ReadProcessMemoryProc64(...);
}

      

Function wrapping is something I really don't want if there is another way.

+6


source to share


2 answers


Use the EntryPoint property of the DllImportAttribute property.



[DllImport("kernel32.dll", EntryPoint="ReadProcessMemoryProc64")]
private static extern bool BetterReadableAndWriteableName (...);

      

+12


source


[DllImport("kernel32.dll", EntryPoint = "ReadProcessMemoryProc64")] 
private static extern bool MyName(...);

      



+4


source







All Articles