Beispiel #1
0
 public static extern void PhRegisterCallbackEx(
     [In, Out] PhCallback *Callback,
     [In, MarshalAs(UnmanagedType.FunctionPtr)] PhCallbackFunction Function,
     [In, Optional] IntPtr Context,
     [In] ushort Flags,
     [Out] PhCallbackRegistration *Registration
     );
Beispiel #2
0
        public CallbackRegistration(PhCallback *callback, PhCallbackFunction function)
        {
            this.Callback         = callback;
            this.CallbackFunction = function;
            this.CallbackAlloc    = MemoryAlloc.PrivateHeap.Allocate(PhCallbackRegistration.SizeOf);

            NativeApi.PhRegisterCallback(this.Callback, this.CallbackFunction, IntPtr.Zero, this.CallbackAlloc);

            this.RegistrationCallback = (PhCallbackRegistration *)this.CallbackAlloc;
        }
        public CallbackRegistration(PhCallback* callback, PhCallbackFunction function)
        {
            this.Callback = callback;
            this.CallbackFunction = function;
            this.CallbackAlloc = MemoryAlloc.PrivateHeap.Allocate(PhCallbackRegistration.SizeOf);

            NativeApi.PhRegisterCallback(this.Callback, this.CallbackFunction, IntPtr.Zero, this.CallbackAlloc);

            this.RegistrationCallback = (PhCallbackRegistration*)this.CallbackAlloc;
        }
Beispiel #4
0
        public void Dispose()
        {
            if (this.CallbackAlloc != null && this.RegistrationCallback != null)
            {
                // Unregister the callback.
                NativeApi.PhUnregisterCallback(this.Callback, this.RegistrationCallback);

                // Free the callback.
                MemoryAlloc.PrivateHeap.Free(this.CallbackAlloc);

                this.RegistrationCallback = null;
            }
        }
        public void Dispose()
        {
            if (this.CallbackAlloc != null && this.RegistrationCallback != null)
            {
                // Unregister the callback.
                NativeApi.PhUnregisterCallback(this.Callback, this.RegistrationCallback);

                // Free the callback.
                MemoryAlloc.PrivateHeap.Free(this.CallbackAlloc);

                this.RegistrationCallback = null;
            }
        }
Beispiel #6
0
 public static extern void PhUnregisterCallback(
     [In, Out] PhCallback *Callback,
     [In, Out] PhCallbackRegistration *Registration
     );