3cd8292e5bb5e7515387531193a986ddbd89d217
[platform/upstream/dotnet/runtime.git] /
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5 using System;
6 using System.Collections;
7 using System.Collections.Generic;
8 using System.Runtime.InteropServices.ComTypes;
9 using System.Text;
10
11 namespace System.Runtime.InteropServices.CustomMarshalers
12 {
13     internal class ExpandoToDispatchExMarshaler : ICustomMarshaler
14     {
15         private static readonly ExpandoToDispatchExMarshaler s_ExpandoToDispatchExMarshaler = new ExpandoToDispatchExMarshaler();
16
17         public static ICustomMarshaler GetInstance(string cookie) => s_ExpandoToDispatchExMarshaler;
18
19         private ExpandoToDispatchExMarshaler()
20         {
21         }
22
23         public void CleanUpManagedData(object ManagedObj)
24         {
25         }
26
27         public void CleanUpNativeData(IntPtr pNativeData)
28         {
29         }
30
31         public int GetNativeDataSize()
32         {
33             // Return -1 to indicate the managed type this marshaler handles is not a value type.
34             return -1;
35         }
36
37         public IntPtr MarshalManagedToNative(object ManagedObj)
38         {
39             throw new PlatformNotSupportedException(SR.PlatformNotSupported_IExpando);
40         }
41
42         public object MarshalNativeToManaged(IntPtr pNativeData)
43         {
44             throw new PlatformNotSupportedException(SR.PlatformNotSupported_IExpando);
45         }
46     }
47 }