public void Close() { if (this.driverHandle != IntPtr.Zero) { MmException.Try(AcmInterop.acmDriverClose(this.driverHandle, 0), "acmDriverClose"); this.driverHandle = IntPtr.Zero; } }
protected virtual void Dispose(bool disposing) { if (disposing && this.streamHeader != null) { this.streamHeader.Dispose(); this.streamHeader = null; } if (this.streamHandle != IntPtr.Zero) { MmResult mmResult = AcmInterop.acmStreamClose(this.streamHandle, 0); this.streamHandle = IntPtr.Zero; if (mmResult != MmResult.NoError) { throw new MmException(mmResult, "acmStreamClose"); } } if (this.driverHandle != IntPtr.Zero) { AcmInterop.acmDriverClose(this.driverHandle, 0); this.driverHandle = IntPtr.Zero; } }