Advertisement
Guest User

Micah

a guest
Feb 13th, 2009
992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. namespace Win32
  5. {
  6.     class Kernel32
  7.     {
  8.         [DllImport("kernel32.dll", SetLastError = true)]
  9.         public static extern IntPtr HeapAlloc(IntPtr hHeap, uint dwFlags, UIntPtr dwBytes);
  10.  
  11.         [DllImport("kernel32.dll", SetLastError = true)]
  12.         public static extern IntPtr GetProcessHeap();
  13.  
  14.         [DllImport("kernel32.dll", SetLastError = true)]
  15.         public static extern bool HeapFree(IntPtr hHeap, uint dwFlags, IntPtr lpMem);
  16.     }
  17.    
  18.     public unsafe class D3D9
  19.     {
  20.         [StructLayout(LayoutKind.Sequential, Pack = 4)]
  21.         public unsafe struct IDirect3D9
  22.         {
  23.             public IntPtr* VFTable;
  24.         }
  25.  
  26.         [StructLayout(LayoutKind.Sequential, Pack = 4)]
  27.         public unsafe struct IDirect3D9Ex
  28.         {
  29.             public IntPtr* VFTable;
  30.         }
  31.  
  32.         [DllImport("d3d9.dll", EntryPoint = "Direct3DCreate9", CallingConvention = CallingConvention.StdCall), System.Security.SuppressUnmanagedCodeSecurity]
  33.         public static extern IDirect3D9* Direct3DCreate9(ushort SDKVersion);
  34.  
  35.         [DllImport("d3d9.dll", EntryPoint = "Direct3DCreate9Ex", CallingConvention = CallingConvention.StdCall), System.Security.SuppressUnmanagedCodeSecurity]
  36.         public static extern int Direct3DCreate9Ex(ushort SDKVersion, [Out] out IDirect3D9Ex ex);
  37.     }
  38. }
  39.  
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement