Пример #1
0
        public IntPtr MarshalManagedToNative(object managedObj)
        {
#if RECURSIVE_WRAPPING
            managedObj = NativeToManagedWrapper.GetInterface(ManagedToNativeWrapper.GetInterface((IStream)managedObj), true);
#endif
            return(ManagedToNativeWrapper.GetInterface((IStream)managedObj));
        }
Пример #2
0
        public object MarshalNativeToManaged(IntPtr pNativeData)
        {
#if RECURSIVE_WRAPPING
            pNativeData = ManagedToNativeWrapper.GetInterface(NativeToManagedWrapper.GetInterface(pNativeData, true));
#endif
            return(NativeToManagedWrapper.GetInterface(pNativeData, false));
        }
Пример #3
0
            private static int Clone(IntPtr @this, out IntPtr ppstm)
            {
                ppstm = IntPtr.Zero;
#if MAP_EX_TO_HR
                try
                {
#endif
                IStream newInterface;

                GetObject(@this).managedInterface.Clone(out newInterface);
                ppstm = ManagedToNativeWrapper.GetInterface(newInterface);
                return(S_OK);

#if MAP_EX_TO_HR
            }
            catch (Exception e)
            {
                return(GetHRForException(e));
            }
#endif
            }