void IStream.Clone(out IStream ppstm) { SecurityHelper.DemandCompoundFileIOPermission(); UnsafeNativeCompoundFileMethods.UnsafeNativeIStream stream; _unsafeStream.Clone(out stream); if (stream != null) { ppstm = new SafeIStreamImplementation(stream); } else { ppstm = null; } }
int IStorage.OpenStream( string pwcsName, int reserved1, int grfMode, int reserved2, out IStream ppstm ) { SecurityHelper.DemandCompoundFileIOPermission(); UnsafeNativeCompoundFileMethods.UnsafeNativeIStream stream; int result; result = _unsafeStorage.OpenStream( pwcsName, reserved1, grfMode, reserved2, out stream); if (result == SafeNativeCompoundFileConstants.S_OK) { ppstm = new SafeIStreamImplementation(stream); } else { ppstm = null; } return result; }