using System.Runtime.InteropServices;
[DllImport("advapi32", EntryPoint="SystemFunction040")]
static extern int RtlEncryptMemory(IntPtr Memory, int MemoryLength, int OptionFlags);
const int RTL_ENCRYPT_MEMORY_SIZE = 8;
public static void Main(string[] args) {
IntPtr pLong = Marshal.AllocHGlobal(8);
Marshal.WriteInt64(pLong, 0x1234567890ABCDEF);
Console.WriteLine("SystemFunction040(RtlEncryptMemory) 메서드 호출 전");
Console.WriteLine("\tpLong: 0x{0:X16}", Marshal.ReadInt64(pLong));
RtlEncryptMemory(pLong, 8, 0);
Console.WriteLine("SystemFunction040(RtlEncryptMemory) 메서드 호출 후");
Console.WriteLine("\tpLong: 0x{0:X16}", Marshal.ReadInt64(pLong));
Marshal.FreeHGlobal(pLong);