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); }
// <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(); }