public unsafe void InstallDirect3DHook() { try { LoggingInterface.Log("Creating Direct3DCreate9Hook..."); Direct3DCreate9Hook = LocalHook.Create(LocalHook.GetProcAddress("D3D9.DLL", "Direct3DCreate9"), new Direct3DCreate9Delegate(MyDirect3DCreate9), this); Direct3DCreate9Hook.ThreadACL.SetInclusiveACL(new Int32[] { 0 }); if (Direct3DCreate9Hook.IsThreadIntercepted(0)) { LoggingInterface.Log("Direct3DCreate9Hook.IsThreadIntercepted(0)"); } } catch (Exception e) { hitCount = 0; LoggingInterface.Log(string.Format("Exception on Direct3DCreate9Hook: " + e.Message)); } }