The utility called METAINFO, produces a listing of the file’s metadata. Below is an example of its output for the MessageBox example shown earlier. This output is produced with the command:
Metainfo MessageBox.exe
To view the several options supported by Metainfo, type:
Metainfo /?
Microsoft (R) NGWS SDK Runtime Meta Data Dump Utility Version 1999.13.1020.9 Copyright (C) Microsoft Corp. 1998-1999 //////////////////////////////////////////////////////////////// File messagebox.exe: ScopeName : GUID : {00000000-0000-0000-0000-000000000000} MVID : {60C6BAD1-013A-4E19-9C0E-36921AA0EFCD} CustomAttribute #1 (0c000001) ------------------------------------------------------- CustomValueName: System.Runtime.Diagnostic.SymbolStore.CORDB_SymbolStoreMatchingReader Value Blob length : 16 Value : c2 96 82 10 1e 28 d3 11 bd 22 00 00 f8 08 49 bd =========================================================== Global functions ------------------------------------------------------- Method #1 ------------------------------------------------------- MethodName: main (06000001) Flags : [Public] [Static] [ReuseSlot] (00000011) RVA : 0x00001000 ImplFlags : [IL] [Managed] [Implemented] (00000011) CallCnvntn: [DEFAULT] ReturnType: Void No arguments. Method #2 ------------------------------------------------------- MethodName: _mainMSIL (06000002) Flags : [Public] [Static] [ReuseSlot] (00000011) RVA : 0x00001040 ImplFlags : [IL] [Managed] [Implemented] (00000011) CallCnvntn: [DEFAULT] ReturnType: I4 3 Arguments Argument #1: I4 Argument #2: Ptr Ptr I1 Argument #3: Ptr Ptr I1 Method #3 ------------------------------------------------------- MethodName: MessageBox (06000003) Flags : [Public] [Static] [ReuseSlot] [PinvokeImpl] (00002011) RVA : 0x00000000 ImplFlags : [IL] [Managed] (00000001) CallCnvntn: [DEFAULT] ReturnType: I4 4 Arguments Argument #1: Ptr Void Argument #2: Class String Argument #3: Class String Argument #4: UI4 4 Parameters (1) MethodToken : (06000003) Name : hWnd flags: [none] (00000000) default: (2) MethodToken : (06000003) Name : pText flags: [none] (00000000) default: (3) MethodToken : (06000003) Name : pCaption flags: [none] (00000000) default: (4) MethodToken : (06000003) Name : uType flags: [none] (00000000) default: MemberRef #1 ------------------------------------------------------- Member: (0a000002) MessageBox: CallCnvntn: [DEFAULT] ReturnType: I4 4 Arguments Argument #1: Ptr Void Argument #2: Class String Argument #3: Class String Argument #4: UI4 CustomAttribute #1 (0c000005) ------------------------------------------------------- CustomValueName: __CustomMetaData Value Blob length : 4 Value : 04 00 00 00 CustomAttribute #2 (0c000006) ------------------------------------------------------- CustomValueName: __DecoratedName Value Blob length : 11 Value : 4d 65 73 73 61 67 65 42 6f 78 00 Pinvoke Map Data: Entry point: MessageBox Module ref: 1a000001 Mapping flags: [CharSetAnsi] (00000002) Ordinal: 00000000 Global fields ------------------------------------------------------- Global MemberRefs ------------------------------------------------------- TypeDef #1 ------------------------------------------------------- TypDefName: __IsConst (02000002) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #2 ------------------------------------------------------- TypDefName: __IsVolatile (02000003) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #3 ------------------------------------------------------- TypDefName: __IsReallyLong (02000004) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #4 ------------------------------------------------------- TypDefName: __IsReallySigned (02000005) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #5 ------------------------------------------------------- TypDefName: __CustomMetaData (02000006) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #6 ------------------------------------------------------- TypDefName: __DecoratedName (02000007) Flags : [Public] [AutoLayout] [Class] [Sealed] [AnsiClass] (00000101) Name Space: __Microsoft_Visual_CPP__ Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object TypeDef #7 ------------------------------------------------------- TypDefName: $MultiByte$24 (02000008) Flags : [Public] [ExplicitLayout] [ValueType] [AnsiClass] (00000051) Name Space: Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object Layout : Packing:1, Size:24 TypeDef #8 ------------------------------------------------------- TypDefName: $MultiByte$26 (02000009) Flags : [Public] [ExplicitLayout] [ValueType] [AnsiClass] (00000051) Name Space: Class ID : {00000000-0000-0000-0000-000000000000} Version : 0:0:0:0 Extends : 01000001 [TypeRef] Object Layout : Packing:1, Size:26 TypeRef #1 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System TypeRefName: Object TypeRef #2 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System TypeRefName: String MemberRef #1 ------------------------------------------------------- Member: (0a000001) .ctor: CallCnvntn: [DEFAULT] hasThis ReturnType: Void 1 Arguments Argument #1: Ptr Char TypeRef #3 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System.Runtime.Diagnostic.SymbolStore TypeRefName: CORDB_SymbolStoreMatchingReader TypeRef #4 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System.Runtime.Diagnostic.SymbolStore TypeRefName: CORDB_SymbolStoreDocumentLanguage TypeRef #5 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System.Runtime.Diagnostic.SymbolStore TypeRefName: CORDB_SymbolStoreDocumentLanguageVendor TypeRef #6 ------------------------------------------------------- ResolutionScope: 0x1a000000 NameSpace: System.Runtime.Diagnostic.SymbolStore TypeRefName: CORDB_SymbolStoreDocumentType ModuleRef #1 ------------------------------------------------------- ModuleRef: (1a000001) user32.dll: GUID : {00000000-0000-0000-0000-000000000000} MVID : {00000000-0000-0000-0000-000000000000} Signature #1 ------------------------------------------------------- CallCnvntn: [LOCALSIG] 2 Arguments Argument #1: Class String Argument #2: Class String
Observe that the output of METAINFO is language-neutral. That is, the data types and PInvoke annotations that the VC7 developer typed were emitted by the VC7 compiler into metadata using the NGWS runtime data types in the signatures and metadata for the PInvoke information.