private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer) { streamPointer = IntPtr.Zero; var result = Result.Ok; try { var shadow = ToShadow <ComStreamShadow>(thisPtr); var callback = ((IStream)shadow.Callback); var clone = callback.Clone(); streamPointer = ComStreamShadow.ToIntPtr(clone); } catch (SharpDXException exception) { result = exception.ResultCode; } catch (Exception) { result = Result.Fail.Code; } return(result); }
public static IntPtr ToIntPtr(IStream stream) { return(ComStreamShadow.ToIntPtr(stream)); }