private static int CopyTo(IntPtr thisPtr, IntPtr pstm, ulong cb, ulong *pcbRead, ulong *pcbWritten) { try { Interop.Ole32.IStream inst = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); return((int)inst.CopyTo(pstm, cb, pcbRead, pcbWritten)); } catch (Exception e) { return(e.HResult); } }
private static int CopyTo(IntPtr thisPtr, IntPtr pstm, ulong cb, ulong *pcbRead, ulong *pcbWritten) { try { Interop.Ole32.IStream instance = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); Interop.Ole32.IStream pstmStream = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)pstm); instance.CopyTo(pstmStream, cb, pcbRead, pcbWritten); return(S_OK); } catch (Exception ex) { Debug.WriteLine(ex); return(ex.HResult); } }