コード例 #1
0
        public unsafe override void Initialize()
        {
            Form form = new Form();

            D3D11.SwapChainDescription swapChainDescription = new D3D11.SwapChainDescription
            {
                BufferCount     = 1,
                ModeDescription = new D3D11.ModeDescription
                {
                    Format = 28
                },
                Usage             = 32,
                OutputHandle      = form.Handle,
                SampleDescription = new D3D11.SampleDescription
                {
                    Count = 1
                },
                IsWindowed = true
            };
            IntPtr zero  = IntPtr.Zero;
            IntPtr zero2 = IntPtr.Zero;
            IntPtr zero3 = IntPtr.Zero;

            D3D11CreateDeviceAndSwapChain((void *)IntPtr.Zero, 1, (void *)IntPtr.Zero, 0, (void *)IntPtr.Zero, 0, 7, (void *)(&swapChainDescription), (void *)(&zero), (void *)(&zero2), (void *)IntPtr.Zero, (void *)(&zero3));
            this.intptr_0 = zero;
            this.intptr_1 = zero2;
            this.intptr_2 = zero3;
            IntPtr intPtr = Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_0), 32);

            D3D11.Delegate0 @delegate = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_0), 8), typeof(D3D11.Delegate0));
            D3D11.Delegate0 delegate2 = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_1), 8), typeof(D3D11.Delegate0));
            D3D11.Delegate0 delegate3 = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_2), 8), typeof(D3D11.Delegate0));
            @delegate(this.intptr_0);
            delegate2(this.intptr_1);
            delegate3(this.intptr_2);
            this.delegate1_0 = (D3D11.Delegate1)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(D3D11.Delegate1));
            this.localHook_0 = LocalHook.Create(intPtr, new D3D11.Delegate1(this.method_0), this);

            int[] exclusiveACL = new int[1];
            localHook_0.ThreadACL.SetExclusiveACL(exclusiveACL);
        }
コード例 #2
0
ファイル: D3D11.cs プロジェクト: tjuckett/OmniEve
        public unsafe override void Initialize()
        {
            Form form = new Form();
            D3D11.SwapChainDescription swapChainDescription = new D3D11.SwapChainDescription
            {
                BufferCount = 1,
                ModeDescription = new D3D11.ModeDescription
                {
                    Format = 28
                },
                Usage = 32,
                OutputHandle = form.Handle,
                SampleDescription = new D3D11.SampleDescription
                {
                    Count = 1
                },
                IsWindowed = true
            };
            IntPtr zero = IntPtr.Zero;
            IntPtr zero2 = IntPtr.Zero;
            IntPtr zero3 = IntPtr.Zero;
            D3D11CreateDeviceAndSwapChain((void*)IntPtr.Zero, 1, (void*)IntPtr.Zero, 0, (void*)IntPtr.Zero, 0, 7, (void*)(&swapChainDescription), (void*)(&zero), (void*)(&zero2), (void*)IntPtr.Zero, (void*)(&zero3));
            this.intptr_0 = zero;
            this.intptr_1 = zero2;
            this.intptr_2 = zero3;
            IntPtr intPtr = Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_0), 32);
            D3D11.Delegate0 @delegate = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_0), 8), typeof(D3D11.Delegate0));
            D3D11.Delegate0 delegate2 = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_1), 8), typeof(D3D11.Delegate0));
            D3D11.Delegate0 delegate3 = (D3D11.Delegate0)Marshal.GetDelegateForFunctionPointer(Marshal.ReadIntPtr(Marshal.ReadIntPtr(this.intptr_2), 8), typeof(D3D11.Delegate0));
            @delegate(this.intptr_0);
            delegate2(this.intptr_1);
            delegate3(this.intptr_2);
            this.delegate1_0 = (D3D11.Delegate1)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(D3D11.Delegate1));
            this.localHook_0 = LocalHook.Create(intPtr, new D3D11.Delegate1(this.method_0), this);

            int[] exclusiveACL = new int[1];
            localHook_0.ThreadACL.SetExclusiveACL(exclusiveACL);
        }