|
| 1 | +//--------------------------------------------------------------------- |
| 2 | +// This file is part of the CLR Managed Debugger (mdbg) Sample. |
| 3 | +// |
| 4 | +// Copyright (C) Microsoft Corporation. All rights reserved. |
| 5 | +// |
| 6 | +// Imports ICorPublish interface from CorPublish.idl into managed code |
| 7 | +//--------------------------------------------------------------------- |
| 8 | + |
| 9 | +using System; |
| 10 | +using System.Text; |
| 11 | +using System.Runtime.CompilerServices; |
| 12 | +using System.Runtime.InteropServices; |
| 13 | + |
| 14 | +using IStream=System.Runtime.InteropServices.ComTypes.IStream; |
| 15 | +using Microsoft.Win32.SafeHandles; |
| 16 | + |
| 17 | +namespace Microsoft.Samples.Debugging.CorPublish.NativeApi |
| 18 | +{ |
| 19 | + public enum __MIDL___MIDL_itf_corpub_0000_0001 |
| 20 | + { |
| 21 | + // Fields |
| 22 | + COR_PUB_MANAGEDONLY = 1 |
| 23 | + } |
| 24 | + |
| 25 | + public enum COR_PUB_ENUMPROCESS |
| 26 | + { |
| 27 | + // Fields |
| 28 | + COR_PUB_MANAGEDONLY = 1 |
| 29 | + } |
| 30 | + |
| 31 | + [ComImport, Guid("9613A0E7-5A68-11D3-8F84-00A0C9B4D50C"), CoClass(typeof(CorpubPublishClass))] |
| 32 | + public interface CorpubPublish : ICorPublish |
| 33 | + { |
| 34 | + } |
| 35 | + |
| 36 | + [ComImport, TypeLibType(2), Guid("047a9a40-657e-11d3-8d5b-00104b35e7ef"), ClassInterface(ClassInterfaceType.None)] |
| 37 | + public class CorpubPublishClass : ICorPublish, CorpubPublish |
| 38 | + { |
| 39 | + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] |
| 40 | + public virtual extern void EnumProcesses( |
| 41 | + [In, ComAliasName("CorpubProcessLib.COR_PUB_ENUMPROCESS")] COR_PUB_ENUMPROCESS Type, |
| 42 | + [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcessEnum ppIEnum); |
| 43 | + |
| 44 | + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] |
| 45 | + public virtual extern void GetProcess([In] uint pid, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess ppProcess); |
| 46 | + } |
| 47 | + |
| 48 | + [ComImport, Guid("9613A0E7-5A68-11D3-8F84-00A0C9B4D50C"), InterfaceType(1)] |
| 49 | + public interface ICorPublish |
| 50 | + { |
| 51 | + |
| 52 | + void EnumProcesses([In, ComAliasName("CorpubProcessLib.COR_PUB_ENUMPROCESS")] COR_PUB_ENUMPROCESS Type, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcessEnum ppIEnum); |
| 53 | + |
| 54 | + void GetProcess([In] uint pid, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess ppProcess); |
| 55 | + } |
| 56 | + |
| 57 | + [ComImport, Guid("D6315C8F-5A6A-11D3-8F84-00A0C9B4D50C"), InterfaceType(1)] |
| 58 | + public interface ICorPublishAppDomain |
| 59 | + { |
| 60 | + |
| 61 | + void GetID([Out] out uint puId); |
| 62 | + |
| 63 | + void GetName([In] uint cchName, [Out] out uint pcchName, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName); |
| 64 | + } |
| 65 | + |
| 66 | + [ComImport, InterfaceType(1), Guid("9F0C98F5-5A6A-11D3-8F84-00A0C9B4D50C")] |
| 67 | + public interface ICorPublishAppDomainEnum : ICorPublishEnum |
| 68 | + { |
| 69 | + |
| 70 | + new void Skip([In] uint celt); |
| 71 | + |
| 72 | + new void Reset(); |
| 73 | + |
| 74 | + new void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum); |
| 75 | + |
| 76 | + new void GetCount([Out] out uint pcelt); |
| 77 | + [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)] |
| 78 | + int Next([In] uint celt, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishAppDomain objects, [Out] out uint pceltFetched); |
| 79 | + } |
| 80 | + |
| 81 | + [ComImport, InterfaceType(1), Guid("C0B22967-5A69-11D3-8F84-00A0C9B4D50C")] |
| 82 | + public interface ICorPublishEnum |
| 83 | + { |
| 84 | + |
| 85 | + void Skip([In] uint celt); |
| 86 | + |
| 87 | + void Reset(); |
| 88 | + |
| 89 | + void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum); |
| 90 | + |
| 91 | + void GetCount([Out] out uint pcelt); |
| 92 | + } |
| 93 | + |
| 94 | + [ComImport, InterfaceType(1), Guid("18D87AF1-5A6A-11D3-8F84-00A0C9B4D50C")] |
| 95 | + public interface ICorPublishProcess |
| 96 | + { |
| 97 | + |
| 98 | + void IsManaged([Out] out int pbManaged); |
| 99 | + |
| 100 | + void EnumAppDomains([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishAppDomainEnum ppEnum); |
| 101 | + |
| 102 | + void GetProcessID([Out] out uint pid); |
| 103 | + |
| 104 | + void GetDisplayName([In] uint cchName, [Out] out uint pcchName, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName); |
| 105 | + } |
| 106 | + |
| 107 | + [ComImport, InterfaceType(1), Guid("A37FBD41-5A69-11D3-8F84-00A0C9B4D50C")] |
| 108 | + public interface ICorPublishProcessEnum : ICorPublishEnum |
| 109 | + { |
| 110 | + |
| 111 | + new void Skip([In] uint celt); |
| 112 | + |
| 113 | + new void Reset(); |
| 114 | + |
| 115 | + new void Clone([Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishEnum ppEnum); |
| 116 | + |
| 117 | + new void GetCount([Out] out uint pcelt); |
| 118 | + [PreserveSig, MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)] |
| 119 | + int Next([In] uint celt, [Out, MarshalAs(UnmanagedType.Interface)] out ICorPublishProcess objects, [Out] out uint pceltFetched); |
| 120 | + } |
| 121 | +} |
| 122 | + |
| 123 | + |
0 commit comments