Esempio n. 1
0
        /// <summary>
        ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
        /// </summary>
        /// <param name="callback">
        ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
        ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
        ///     will be removed.
        /// </param>
        public override unsafe void UnregisterForCallbacks(IXAudio2EngineCallback callback)
        {
            IntPtr ptr = IntPtr.Zero;

            if (callback != null)
            {
                ptr = Marshal.GetComInterfaceForObject(callback, typeof(IXAudio2EngineCallback));
                ptr = Utils.Utils.GetComInterfaceForObjectWithAdjustedVtable(ptr, 3, 3);
            }
            try
            {
                InteropCalls.CallI(UnsafeBasePtr, (void *)ptr, ((void **)(*(void **)UnsafeBasePtr))[7]);
            }
            finally
            {
                if (ptr != IntPtr.Zero)
                {
                    //while patching the IUnknown-members out of the vtable, we've made a backup of the release pointer,
                    //which gets called here -> the Marshal.Release method would call any function on index 2 of the vtable
                    //we've patched there
                    Utils.Utils.Release(ptr);
                    //Marshal.Release(ptr);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
        /// </summary>
        /// <param name="callback">
        ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
        ///     callback list.
        /// </param>
        /// <returns>HRESULT</returns>
        public override unsafe int RegisterForCallbacksNative(IXAudio2EngineCallback callback)
        {
            IntPtr ptr = IntPtr.Zero;

            if (callback != null)
            {
                ptr = Marshal.GetComInterfaceForObject(callback, typeof(IXAudio2EngineCallback));
                ptr = Utils.Utils.GetComInterfaceForObjectWithAdjustedVtable(ptr, 3, 3);
            }
            return(InteropCalls.CallI(UnsafeBasePtr, ptr.ToPointer(), ((void **)(*(void **)UnsafeBasePtr))[6]));
        }
Esempio n. 3
0
 internal static unsafe void CallI6(void *_basePtr, IXAudio2EngineCallback callback, void *p)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 /// <summary>
 ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
 ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
 ///     will be removed.
 /// </param>
 public unsafe override void UnregisterForCallbacks(IXAudio2EngineCallback callback)
 {
     InteropCalls.CallI6(UnsafeBasePtr, callback, ((void**) (*(void**) UnsafeBasePtr))[7]);
 }
Esempio n. 5
0
 /// <summary>
 ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
 ///     callback list.
 /// </param>
 /// <returns>HRESULT</returns>
 public unsafe override int RegisterForCallbacksNative(IXAudio2EngineCallback callback)
 {
     IntPtr ptr = IntPtr.Zero;
     if (callback != null)
     {
         ptr = Marshal.GetComInterfaceForObject(callback, typeof (IXAudio2EngineCallback));
         ptr = Utils.Utils.GetComInterfaceForObjectWithAdjustedVtable(ptr, 3, 3);
     }
     return InteropCalls.CallI(UnsafeBasePtr, ptr.ToPointer(), ((void**) (*(void**) UnsafeBasePtr))[6]);
 }
Esempio n. 6
0
 /// <summary>
 ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
 ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
 ///     will be removed.
 /// </param>
 public override unsafe void UnregisterForCallbacks(IXAudio2EngineCallback callback)
 {
     InteropCalls.CallI6(UnsafeBasePtr, callback, ((void **)(*(void **)UnsafeBasePtr))[7]);
 }
Esempio n. 7
0
 /// <summary>
 ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
 ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
 ///     will be removed.
 /// </param>
 public abstract void UnregisterForCallbacks(IXAudio2EngineCallback callback);
Esempio n. 8
0
 /// <summary>
 ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
 ///     callback list.
 /// </param>
 /// <returns>HRESULT</returns>
 public abstract int RegisterForCallbacksNative(IXAudio2EngineCallback callback);
Esempio n. 9
0
 /// <summary>
 ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
 ///     callback list.
 /// </param>
 public void RegisterForCallbacks(IXAudio2EngineCallback callback)
 {
     XAudio2Exception.Try(RegisterForCallbacksNative(callback), N, "RegisterForCallbacks");
 }
Esempio n. 10
0
 /// <summary>
 ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
 ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
 ///     will be removed.
 /// </param>
 public abstract void UnregisterForCallbacks(IXAudio2EngineCallback callback);
Esempio n. 11
0
 /// <summary>
 ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
 ///     callback list.
 /// </param>
 /// <returns>HRESULT</returns>
 public abstract int RegisterForCallbacksNative(IXAudio2EngineCallback callback);
Esempio n. 12
0
 /// <summary>
 ///     Adds an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to add to the <see cref="XAudio2" /> engine
 ///     callback list.
 /// </param>
 public void RegisterForCallbacks(IXAudio2EngineCallback callback)
 {
     XAudio2Exception.Try(RegisterForCallbacksNative(callback), N, "RegisterForCallbacks");
 }
Esempio n. 13
0
 /// <summary>
 ///     Removes an <see cref="IXAudio2EngineCallback" /> from the <see cref="XAudio2" /> engine callback list.
 /// </summary>
 /// <param name="callback">
 ///     <see cref="IXAudio2EngineCallback" /> object to remove from the <see cref="XAudio2" /> engine
 ///     callback list. If the given interface is present more than once in the list, only the first instance in the list
 ///     will be removed.
 /// </param>
 public unsafe override void UnregisterForCallbacks(IXAudio2EngineCallback callback)
 {
     IntPtr ptr = IntPtr.Zero;
     if (callback != null)
     {
         ptr = Marshal.GetComInterfaceForObject(callback, typeof(IXAudio2EngineCallback));
         ptr = Utils.Utils.GetComInterfaceForObjectWithAdjustedVtable(ptr, 3, 3);
     }
     try
     {
         InteropCalls.CallI(UnsafeBasePtr, (void*) ptr, ((void**) (*(void**) UnsafeBasePtr))[7]);
     }
     finally
     {
         if (ptr != IntPtr.Zero)
         {
             //while patching the IUnknown-members out of the vtable, we've made a backup of the release pointer,
             //which gets called here -> the Marshal.Release method would call any function on index 2 of the vtable
             //we've patched there
             Utils.Utils.Release(ptr);
             //Marshal.Release(ptr);
         }
     }
 }
Esempio n. 14
0
 internal static unsafe void CallI6(void* _basePtr, IXAudio2EngineCallback callback, void* p)
 {
     throw new NotImplementedException();
 }