How to import ZwDeleteKey in C#: "External component has thrown an exception"
I am trying to use ZwDeleteKey to delete a registry symbolic link. I imported it like that: [DllImport("NtosKrnl.exe", CharSet = CharSet.Ansi, EntryPoint = "ZwDeleteKey", SetLastError = true)] private static extern int ZwDeleteKey(SafeRegistryHandle hKey); But after I call it, I receive an exception: "External component has thrown an exception" My full code: [DllImport("NtosKrnl.exe", CharSet = CharSet.Ansi,… Read More How to import ZwDeleteKey in C#: "External component has thrown an exception"