private static int Clone(IntPtr thisPtr, IntPtr *ppstm) { try { Interop.Ole32.IStream inst = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); return((int)inst.Clone(ppstm)); } catch (Exception e) { return(e.HResult); } }
private static int Clone(IntPtr thisPtr, IntPtr *ppstm) { if (ppstm is null) { return((int)Interop.HRESULT.STG_E_INVALIDPOINTER); } try { Interop.Ole32.IStream instance = ComInterfaceDispatch.GetInstance <Interop.Ole32.IStream>((ComInterfaceDispatch *)thisPtr); *ppstm = Instance.GetOrCreateComInterfaceForObject(instance.Clone(), CreateComInterfaceFlags.None); return(S_OK); } catch (Exception ex) { Debug.WriteLine(ex); return(ex.HResult); } }