Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnumerableToDispatchMarshaler.cs
Go to the documentation of this file.
3
5
6[SupportedOSPlatform("windows")]
8{
10
11 public static ICustomMarshaler GetInstance(string cookie)
12 {
14 }
15
17 {
18 }
19
20 public void CleanUpManagedData(object ManagedObj)
21 {
22 }
23
24 public void CleanUpNativeData(IntPtr pNativeData)
25 {
26 Marshal.Release(pNativeData);
27 }
28
29 public int GetNativeDataSize()
30 {
31 return -1;
32 }
33
34 public IntPtr MarshalManagedToNative(object ManagedObj)
35 {
36 if (ManagedObj == null)
37 {
38 throw new ArgumentNullException("ManagedObj");
39 }
40 return Marshal.GetComInterfaceForObject<object, IEnumerable>(ManagedObj);
41 }
42
43 public object MarshalNativeToManaged(IntPtr pNativeData)
44 {
45 if (pNativeData == IntPtr.Zero)
46 {
47 throw new ArgumentNullException("pNativeData");
48 }
49 object objectForIUnknown = Marshal.GetObjectForIUnknown(pNativeData);
50 return ComDataHelpers.GetOrCreateManagedViewFromComData(objectForIUnknown, (object obj) => new EnumerableViewOfDispatch(obj));
51 }
52}
static IntPtr GetComInterfaceForObject(object o, Type T)
Definition Marshal.cs:257
static unsafe int Release(IntPtr pUnk)
Definition Marshal.cs:766
static object GetObjectForIUnknown(IntPtr pUnk)
Definition Marshal.cs:295
static readonly IntPtr Zero
Definition IntPtr.cs:18