Example #1
0
        // <unmanaged>HRESULT IDirectSoundBuffer::Initialize([In] IDirectSound* pDirectSound,[In] const DSBUFFERDESC* pcDSBufferDesc)</unmanaged>
        public unsafe void Initialize(DirectSoundBase directSoundRef, DSBUFFERDESC cDSBufferDescRef)
        {
            DSBUFFERDESC.__Native _Native = DSBUFFERDESC.__NewNative();
            cDSBufferDescRef.__MarshalTo(ref _Native);
            //Result result = calli(System.Int32(System.Void*,System.Void*,System.Void*), this._nativePointer, (void*)((directSoundRef == null) ? IntPtr.Zero : directSoundRef.NativePointer), &_Native, *(*(IntPtr*)this._nativePointer + (IntPtr)10 * (IntPtr)sizeof(void*)));
            var result = (HRESULT)NativeHelper.CalliInt32(10, _nativePointer, (void *)((directSoundRef == null) ? IntPtr.Zero : directSoundRef.NativePointer), (void *)&_Native);

            cDSBufferDescRef.__MarshalFree(ref _Native);
            result.CheckError();
        }
Example #2
0
        public SecondarySoundBuffer(DirectSoundBase dSound, DSBUFFERDESC bufferDescription)
            : base(IntPtr.Zero)
        {
            IntPtr intPtr;

            dSound.CreateSoundBuffer(bufferDescription, out intPtr, null);
            base.NativePointer = intPtr;
            base.QuerySelfInterfaceFrom <SecondarySoundBuffer>(this);
            Marshal.Release(intPtr);
        }
Example #3
0
        // <unmanaged>HRESULT IDirectSound::CreateSoundBuffer([In] const DSBUFFERDESC* pcDSBufferDesc,[Out] void** ppDSBuffer,[In] IUnknown* pUnkOuter)</unmanaged>
        internal unsafe void CreateSoundBuffer(DSBUFFERDESC cDSBufferDescRef, out IntPtr dSBufferOut, ComObject unkOuterRef)
        {
            DSBUFFERDESC.__Native _Native = DSBUFFERDESC.__NewNative();
            cDSBufferDescRef.__MarshalTo(ref _Native);
            IntPtr pDSBuffer;
            //result = calli(System.Int32(System.Void*,System.Void*,System.Void*,System.Void*), this._nativePointer, &_Native, ptr, (void*)((unkOuterRef == null) ? IntPtr.Zero : unkOuterRef.NativePointer), *(*(IntPtr*)this._nativePointer + (IntPtr)3 * (IntPtr)sizeof(void*)));
            var result = (HRESULT)NativeHelper.CalliInt32(3, _nativePointer, &_Native, &pDSBuffer, (void *)((unkOuterRef == null) ? IntPtr.Zero : unkOuterRef.NativePointer));

            dSBufferOut = pDSBuffer;
            cDSBufferDescRef.__MarshalFree(ref _Native);
            result.CheckError();
        }