home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples1.exe / smc / CORwrap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  38.8 KB  |  964 lines

  1. /*****************************************************************************/
  2. #ifndef _CORWRAP_H
  3. #define _CORWRAP_H
  4. /*****************************************************************************/
  5.  
  6. #ifndef COR_IMPORT
  7. #ifndef __SMC__
  8.  
  9. #ifdef  __IL__
  10. #define COR_IMPORT(d,e) [sysimport(dll=d, name=e)]
  11. #else
  12. #define COR_IMPORT(d,e) __declspec(dllimport)
  13. #endif
  14.  
  15. #endif
  16. #endif
  17.  
  18. /*****************************************************************************/
  19.  
  20. #ifdef  __IL__
  21.  
  22. #ifdef  _MSC_VER
  23.  
  24. #define SectEH_Emit                 fake_SectEH_Emit
  25. #define SectEH_EHClause             fake_SectEH_EHClause
  26. #define SectEH_SizeExact            fake_SectEH_SizeExact
  27.  
  28. #define IlmethodSize                fake_IlmethodSize
  29. #define IlmethodEmit                fake_IlmethodEmit
  30.  
  31. #include "corhlpr.h"
  32.  
  33. #undef  SectEH_Emit
  34. #undef  SectEH_EHClause
  35. #undef  SectEH_SizeExact
  36.  
  37. #undef  IlmethodSize
  38. #undef  IlmethodEmit
  39.  
  40. #endif
  41.  
  42. #else
  43.  
  44. #include "corhlpr.h"
  45.  
  46. #endif
  47.  
  48. /*****************************************************************************/
  49. #ifdef SMC_MD_PERF
  50. /*****************************************************************************/
  51. #pragma warning(disable:4035)
  52.  
  53. #define CCNT_OVERHEAD64 13
  54.  
  55. static __int64         CycleCount64()
  56. {
  57. __asm   _emit   0x0F
  58. __asm   _emit   0x31
  59. };
  60.  
  61. #define CCNT_OVERHEAD32 13
  62.  
  63. static unsigned        CycleCount32()        // enough for about 40 seconds
  64. {
  65. __asm   push    EDX
  66. __asm   _emit   0x0F
  67. __asm   _emit   0x31
  68. __asm   pop     EDX
  69. };
  70.  
  71. #pragma warning(default:4035)
  72.  
  73. /*****************************************************************************/
  74. #endif
  75. /*****************************************************************************/
  76.  
  77. struct  WMetaData
  78. {
  79.     unsigned            useCount;
  80.  
  81. #ifdef  __SMC__
  82.     COR_IMPORT("CORwrap.dll", "?AddRef@WMetaData@@UAEXXZ")
  83. #endif
  84.     virtual void        AddRef();
  85.  
  86. #ifdef  __SMC__
  87.     COR_IMPORT("CORwrap.dll", "?Release@WMetaData@@UAEXXZ")
  88. #endif
  89.     virtual void        Release();
  90.  
  91. #ifdef  SMC_MD_PERF
  92.  
  93.     __int64             cycleBegin;
  94.     __int64             cycleTotal;
  95.     __int64             cycleStart;
  96.     unsigned            cyclePause;
  97.  
  98.     void                cycleCounterInit()
  99.     {
  100.         cycleBegin = CycleCount64();
  101.         cycleTotal = 0;
  102.         cycleStart = 0;
  103.         cyclePause = 0;
  104.     }
  105.  
  106.     __int64             cycleCounterDone(__int64 *realPtr)
  107.     {
  108.         assert(cyclePause == 0);
  109.  
  110.         *realPtr = CycleCount64() - cycleBegin;
  111.  
  112.         return cycleTotal;
  113.     }
  114.  
  115.     void                cycleCounterBeg()
  116.     {
  117.         assert(cyclePause == 0);
  118.  
  119.         cycleStart = CycleCount64();
  120.     }
  121.  
  122.     void                cycleCounterEnd()
  123.     {
  124.         assert(cycleStart != 0);
  125.         assert(cyclePause == 0);
  126.  
  127.         cycleTotal += CycleCount64() - cycleStart;// - CCNT_OVERHEAD64;
  128.  
  129.         cycleStart  = 0;
  130.     }
  131.  
  132.     void                cycleCounterPause()
  133.     {
  134.         assert(cycleStart != 0);
  135.  
  136.         if  (!cyclePause)
  137.             cycleTotal += CycleCount64() - cycleStart;// - CCNT_OVERHEAD64;
  138.  
  139.         cyclePause++;
  140.     }
  141.  
  142.     void                cycleCounterResume()
  143.     {
  144.         assert(cycleStart != 0);
  145.         assert(cyclePause != 0);
  146.  
  147.         if  (--cyclePause)
  148.             return;
  149.  
  150.         cycleStart = CycleCount64();
  151.     }
  152.  
  153.     __int64 __stdcall   getTotalCycles()
  154.     {
  155.         return cycleTotal;
  156.     }
  157.  
  158. #else //SMC_MD_PERF
  159.  
  160.     void                cycleCounterPause () {}
  161.     void                cycleCounterResume() {}
  162.  
  163. #endif//SMC_MD_PERF
  164.  
  165. };
  166.  
  167. struct  WSymWriter;
  168.  
  169. struct  WMetaDataImport : WMetaData
  170. {
  171.     IMetaDataImport    *imdi;
  172.  
  173.     COR_IMPORT("CORwrap.dll", "?CloseEnum@WMetaDataImport@@QAGXPAX@Z")
  174.     void    __stdcall   CloseEnum(HCORENUM hEnum);
  175.  
  176.     COR_IMPORT("CORwrap.dll", "?CountEnum@WMetaDataImport@@QAGHPAXPAK@Z")
  177.     int     __stdcall   CountEnum(HCORENUM hEnum, ULONG *pulCount);
  178.  
  179.     COR_IMPORT("CORwrap.dll", "?ResetEnum@WMetaDataImport@@QAGHPAXK@Z")
  180.     int     __stdcall   ResetEnum(HCORENUM hEnum, ULONG ulPos);
  181.  
  182.     COR_IMPORT("CORwrap.dll", "?EnumTypeDefs@WMetaDataImport@@QAGHPAPAXQAIKPAK@Z")
  183.     int     __stdcall   EnumTypeDefs(HCORENUM *phEnum, mdTypeDef rTypeDefs[], ULONG cMax, ULONG *pcTypeDefs);
  184.  
  185.     COR_IMPORT("CORwrap.dll", "?EnumInterfaceImpls@WMetaDataImport@@QAGHPAPAXIQAIKPAK@Z")
  186.     int     __stdcall   EnumInterfaceImpls(HCORENUM *phEnum, mdTypeDef td, mdInterfaceImpl rImpls[], ULONG cMax, ULONG* pcImpls);
  187.  
  188.     COR_IMPORT("CORwrap.dll", "?EnumTypeRefs@WMetaDataImport@@QAGHPAPAXQAIKPAK@Z")
  189.     int     __stdcall   EnumTypeRefs(HCORENUM *phEnum, mdTypeRef rTypeRefs[], ULONG cMax, ULONG* pcTypeRefs);
  190.  
  191.     COR_IMPORT("CORwrap.dll", "?GetScopeProps@WMetaDataImport@@QAGHPAGKPAKPAU_GUID@@@Z")
  192.     int     __stdcall   GetScopeProps(
  193.                 LPWSTR          szName,
  194.                 ULONG           cchName,
  195.                 ULONG          *pchName,
  196.                 GUID           *pmvid);
  197.  
  198.     COR_IMPORT("CORwrap.dll", "?GetNameFromToken@WMetaDataImport@@QAGHIPAPBD@Z")
  199.     int     __stdcall   GetNameFromToken(
  200.                 mdToken         tk,
  201.                 const char *   *pszUtf8NamePtr);
  202.  
  203.     COR_IMPORT("CORwrap.dll", "?GetTypeDefProps@WMetaDataImport@@QAGHIPAGKPAKPA_K1PAI@Z")
  204.     int     __stdcall   GetTypeDefProps(
  205.                 mdTypeDef       td,
  206.                 LPWSTR          szTypeDef,
  207.                 ULONG           cchTypeDef,
  208.                 ULONG          *pchTypeDef,
  209.                 CLASSVERSION   *pver,
  210.                 DWORD          *pdwTypeDefFlags,
  211.                 mdToken        *ptkExtends);
  212.  
  213.     COR_IMPORT("CORwrap.dll", "?EnumMembers@WMetaDataImport@@QAGHPAPAXIQAIKPAK@Z")
  214.     int     __stdcall   EnumMembers(
  215.                 HCORENUM        *phEnum,
  216.                 mdTypeDef       cl,
  217.                 mdToken         rMembers[],
  218.                 ULONG           cMax,
  219.                 ULONG           *pcTokens); /* abstract */
  220.  
  221.     COR_IMPORT("CORwrap.dll", "?GetMemberProps@WMetaDataImport@@QAGHIPAIPAGKPAK2PAPB_E2222PAPBX2@Z")
  222.     int     __stdcall   GetMemberProps(
  223.                 mdToken         mb,
  224.                 mdTypeDef       *pClass,
  225.                 LPWSTR          szMember,
  226.                 ULONG           cchMember,
  227.                 ULONG           *pchMember,
  228.                 DWORD           *pdwAttr,
  229.                 PCCOR_SIGNATURE *ppvSigBlob,
  230.                 ULONG           *pcbSigBlob,
  231.                 ULONG           *pulCodeRVA,
  232.                 DWORD           *pdwImplFlags,
  233.                 DWORD           *pdwCPlusTypeFlag,
  234.                 void const      **ppValue,
  235.                 ULONG           *pcbValue); /* abstract */
  236.  
  237.     COR_IMPORT("CORwrap.dll", "?EnumProperties@WMetaDataImport@@QAGHPAPAXIQAIKPAK@Z")
  238.     int     __stdcall   EnumProperties(
  239.                 HCORENUM       *phEnum,
  240.                 mdTypeDef       td,
  241.                 mdProperty      rProperties[],
  242.                 ULONG           cMax,
  243.                 ULONG          *pcProperties);
  244.  
  245.     COR_IMPORT("CORwrap.dll", "?GetPropertyProps@WMetaDataImport@@QAGHIPAIPBGKPAK2PAPB_E22PAPBX200QAIK20@Z")
  246.     int     __stdcall   GetPropertyProps(
  247.                 mdProperty      prop,
  248.                 mdTypeDef      *pClass,
  249.                 LPCWSTR         szProperty,
  250.                 ULONG           cchProperty,
  251.                 ULONG          *pchProperty,
  252.                 DWORD          *pdwPropFlags,
  253.                 PCCOR_SIGNATURE*ppvSig,
  254.                 ULONG          *pbSig,
  255.                 DWORD          *pdwCPlusTypeFlag,
  256.                 void const    **ppDefaultValue,
  257.                 ULONG          *pcbDefaultValue,
  258.                 mdMethodDef    *pmdSetter,
  259.                 mdMethodDef    *pmdGetter,
  260.                 mdMethodDef     rmdOtherMethod[],
  261.                 ULONG           cMax,
  262.                 ULONG          *pcOtherMethod,
  263.                 mdFieldDef     *pmdBackingField);
  264.  
  265.     COR_IMPORT("CORwrap.dll", "?EnumParams@WMetaDataImport@@QAGHPAPAXIQAIKPAK@Z")
  266.     int     __stdcall   EnumParams(
  267.                 HCORENUM        *phEnum,
  268.                 mdMethodDef mb,
  269.                 mdParamDef      rParams[],
  270.                 ULONG           cMax,
  271.                 ULONG           *pcTokens); /* abstract */
  272.  
  273.     COR_IMPORT("CORwrap.dll", "?GetParamProps@WMetaDataImport@@QAGHIPAIPAKPAGK111PAPBX1@Z")
  274.     int     __stdcall   GetParamProps(
  275.                 mdToken         tk,
  276.                 mdMethodDef     *pmd,
  277.                 ULONG           *pulSequence,
  278.                 LPWSTR          szName,
  279.                 ULONG           cchName,
  280.                 ULONG           *pchName,
  281.                 DWORD           *pdwAttr,
  282.                 DWORD           *pdwCPlusTypeFlag,
  283.                 void const      **ppValue,
  284.                 ULONG           *pcbValue); /* abstract */
  285.  
  286.     COR_IMPORT("CORwrap.dll", "?GetInterfaceImplProps@WMetaDataImport@@QAGHIPAI0@Z")
  287.     int     __stdcall   GetInterfaceImplProps(
  288.                 mdInterfaceImpl iiImpl,
  289.                 mdTypeDef       *pClass,
  290.                 mdToken         *ptkIface);
  291.  
  292.     COR_IMPORT("CORwrap.dll", "?GetClassLayout@WMetaDataImport@@QAGHIPAKQAUCOR_FIELD_OFFSET@@K00@Z")
  293.     int     __stdcall   GetClassLayout(
  294.                 mdTypeDef   td,
  295.                 DWORD       *pdwPackSize,
  296.                 COR_FIELD_OFFSET rFieldOffset[],
  297.                 ULONG       cMax,
  298.                 ULONG       *pcFieldOffset,
  299.                 ULONG       *pulClassSize);
  300.  
  301.     COR_IMPORT("CORwrap.dll", "?GetFieldMarshal@WMetaDataImport@@QAGHIPAPB_EPAK@Z")
  302.     int     __stdcall   GetFieldMarshal(
  303.                 mdToken         tk,
  304.                 PCCOR_SIGNATURE*ppvNativeType,
  305.                 ULONG          *pcbNativeType);
  306.  
  307.     COR_IMPORT("CORwrap.dll", "?GetPermissionSetProps@WMetaDataImport@@QAGHIPAKPAPBX0@Z")
  308.     int     __stdcall   GetPermissionSetProps(
  309.                 mdPermission    pm,
  310.                 DWORD          *pdwAction,
  311.                 void const    **ppvPermission,
  312.                 ULONG          *pcbPermission);
  313.  
  314.     COR_IMPORT("CORwrap.dll", "?GetNestedClassProps@WMetaDataImport@@QAGHIPAI@Z")
  315.     int     __stdcall   GetNestedClassProps(
  316.                 mdTypeDef       tdNestedClass,
  317.                 mdTypeDef      *ptdEnclosingClass);
  318.  
  319.     COR_IMPORT("CORwrap.dll", "?GetTypeRefProps@WMetaDataImport@@QAGHIIPAGKPAK@Z")
  320.     int     __stdcall   GetTypeRefProps(
  321.                 mdTypeRef       tr,
  322.                 mdToken         tkResolutionScope,
  323.  
  324.                 LPWSTR          szTypeRef,
  325.                 ULONG           cchTypeRef,
  326.                 ULONG          *pchTypeRef);
  327.  
  328.     COR_IMPORT("CORwrap.dll", "?GetMemberRefProps@WMetaDataImport@@QAGHIPAIPAGKPAKPAPB_E2@Z")
  329.     int     __stdcall   GetMemberRefProps(
  330.                 mdMemberRef     mr,
  331.                 mdToken        *ptk,
  332.                 LPWSTR          szMember,
  333.                 ULONG           cchMember,
  334.                 ULONG          *pchMember,
  335.                 PCCOR_SIGNATURE*ppvSigBlob,
  336.                 ULONG          *pbSig);
  337.  
  338.     COR_IMPORT("CORwrap.dll", "?GetMethodProps@WMetaDataImport@@QAGHIPAIPAGKPAK2PAPB_E222@Z")
  339.     int     __stdcall   GetMethodProps(
  340.                 mdMethodDef     mb,
  341.                 mdTypeDef      *pClass,
  342.                 LPWSTR          szMethod,
  343.                 ULONG           cchMethod,
  344.                 ULONG          *pchMethod,
  345.                 DWORD          *pdwAttr,
  346.                 PCCOR_SIGNATURE*ppvSigBlob,
  347.                 ULONG          *pcbSigBlob,
  348.                 ULONG          *pulCodeRVA,
  349.                 DWORD          *pdwImplFlags);
  350.  
  351.     COR_IMPORT("CORwrap.dll", "?ResolveTypeRef@WMetaDataImport@@QAGHIPBU_GUID@@PAPAU1@PAI@Z")
  352.     int     __stdcall   ResolveTypeRef(mdTypeRef tr, const IID * riid, WMetaDataImport **scope, mdTypeDef *ptd);
  353.  
  354.     COR_IMPORT("CORwrap.dll", "?FindTypeRef@WMetaDataImport@@QAGHIPBGPAI@Z")
  355.     int     __stdcall   FindTypeRef(
  356.                 mdToken         tkResolutionScope,
  357.                 LPCWSTR         szTypeName,
  358.                 mdTypeRef      *ptr);
  359.  
  360.     COR_IMPORT("CORwrap.dll", "?GetCustomAttributeByName@WMetaDataImport@@QAGHIPBGPAPBXPAK@Z")
  361.     int     __stdcall   GetCustomAttributeByName(mdToken tkObj, LPCWSTR szName, void const **ppBlob, ULONG *pcbSize);
  362.  
  363.     COR_IMPORT("CORwrap.dll", "?EnumCustomAttributes@WMetaDataImport@@QAGHPAPAXIIQAIKPAK@Z")
  364.     int     __stdcall   EnumCustomAttributes(
  365.                 HCORENUM       *phEnum,
  366.                 mdToken         tk,
  367.                 mdToken         tkType,
  368.                 mdCustomValue   rCustomValues[],
  369.                 ULONG           cMax,
  370.                 ULONG          *pcCustomValues);
  371.  
  372.     COR_IMPORT("CORwrap.dll", "?GetCustomAttributeProps@WMetaDataImport@@QAGHIPAI0PAPBXPAK@Z")
  373.     int     __stdcall   GetCustomAttributeProps(
  374.                 mdCustomValue   cv,
  375.                 mdToken        *ptkObj,
  376.                 mdToken        *ptkType,
  377.                 void const    **ppBlob,
  378.                 ULONG          *pcbSize);
  379. };
  380.  
  381. struct  WMetaDataEmit : WMetaData
  382. {
  383.     IMetaDataEmit      *imde;
  384.  
  385.     COR_IMPORT("CORwrap.dll", "?SetModuleProps@WMetaDataEmit@@QAGHPBG@Z")
  386.     int     __stdcall SetModuleProps(
  387.                 LPCWSTR         szName);
  388.  
  389.     COR_IMPORT("CORwrap.dll", "?DefineTypeDef@WMetaDataEmit@@QAGHPBGPA_KKIQAIPAI@Z")
  390.     int     __stdcall   DefineTypeDef(
  391.                 LPCWSTR         szTypeDef,
  392.                 CLASSVERSION    *pVer,
  393.                 DWORD           dwTypeDefFlags,
  394.                 mdToken         tkExtends,
  395.                 mdToken         rtkImplements[],
  396.                 mdTypeDef       *ptd);
  397.  
  398.     COR_IMPORT("CORwrap.dll", "?DefineNestedType@WMetaDataEmit@@QAGHPBGPA_KKIQAIIPAI@Z")
  399.     int     __stdcall   DefineNestedType(
  400.                 LPCWSTR         szTypeDef,
  401.                 CLASSVERSION    *pVer,
  402.                 DWORD           dwTypeDefFlags,
  403.                 mdToken         tkExtends,
  404.                 mdToken         rtkImplements[],
  405.                 mdTypeDef       tkEncloser,
  406.                 mdTypeDef       *ptd);
  407.  
  408.     COR_IMPORT("CORwrap.dll", "?SetTypeDefProps@WMetaDataEmit@@QAGHIPA_KKIQAI@Z")
  409.     int     __stdcall   SetTypeDefProps(
  410.                 mdTypeDef       td,
  411.                 CLASSVERSION    *pVer,
  412.                 DWORD           dwTypeDefFlags,
  413.                 mdToken         tkExtends,
  414.                 mdToken         rtkImplements[]);
  415.  
  416.     COR_IMPORT("CORwrap.dll", "?DefineMethod@WMetaDataEmit@@QAGHIPBGKPB_EKKKPAI@Z")
  417.     int     __stdcall   DefineMethod(
  418.                 mdTypeDef       td,
  419.                 LPCWSTR         szName,
  420.                 DWORD           dwMethodFlags,
  421.                 PCCOR_SIGNATURE pvSigBlob,
  422.                 ULONG           cbSigBlob,
  423.                 ULONG           ulCodeRVA,
  424.                 DWORD           dwImplFlags,
  425.                 mdMethodDef *pmd);
  426.  
  427.     COR_IMPORT("CORwrap.dll", "?DefineField@WMetaDataEmit@@QAGHIPBGKPB_EKKPBXKPAI@Z")
  428.     int     __stdcall   DefineField(
  429.                 mdTypeDef       td,
  430.                 LPCWSTR         szName,
  431.                 DWORD           dwFieldFlags,
  432.                 PCCOR_SIGNATURE pvSigBlob,
  433.                 ULONG           cbSigBlob,
  434.                 DWORD           dwCPlusTypeFlag,
  435.                 void const      *pValue,
  436.                 ULONG           cbValue,
  437.                 mdFieldDef      *pmd);
  438.  
  439.     COR_IMPORT("CORwrap.dll", "?DefineProperty@WMetaDataEmit@@QAGHIPBGKPB_EKKPBXKIIQAIIPAI@Z")
  440.     int     __stdcall   DefineProperty(
  441.                 mdTypeDef       td,
  442.                 LPCWSTR         szProperty,
  443.                 DWORD           dwPropFlags,
  444.                 PCCOR_SIGNATURE pvSig,
  445.                 ULONG           cbSig,
  446.                 DWORD           dwCPlusTypeFlag,
  447.                 void const     *pValue,
  448.                 ULONG           cbValue,
  449.                 mdMethodDef     mdSetter,
  450.                 mdMethodDef     mdGetter,
  451.                 mdMethodDef     rmdOtherMethods[],
  452.                 mdFieldDef      fdBackingField,
  453.                 mdProperty     *pmdProp);
  454.  
  455.     COR_IMPORT("CORwrap.dll", "?DefineParam@WMetaDataEmit@@QAGHIKPBGKKPBXKPAI@Z")
  456.     int     __stdcall   DefineParam(
  457.                 mdMethodDef md,
  458.                 ULONG           ulParamSeq,
  459.                 LPCWSTR         szName,
  460.                 DWORD           dwParamFlags,
  461.                 DWORD           dwCPlusTypeFlag,
  462.                 void const      *pValue,
  463.                 ULONG           cbValue,
  464.                 mdParamDef      *ppd);
  465.  
  466.     COR_IMPORT("CORwrap.dll", "?DefineMethodImpl@WMetaDataEmit@@QAGHIII@Z")
  467.     int     __stdcall   DefineMethodImpl(
  468.                 mdTypeDef       td,
  469.                 mdToken         tkBody,
  470.                 mdToken         tkDecl);
  471.  
  472.     COR_IMPORT("CORwrap.dll", "?SetRVA@WMetaDataEmit@@QAGHIK@Z")
  473.     int     __stdcall   SetRVA(
  474.                 mdToken         md,
  475.                 ULONG           ulCodeRVA);
  476.  
  477.     COR_IMPORT("CORwrap.dll", "?SetMethodImplFlags@WMetaDataEmit@@QAGHIK@Z")
  478.     int     __stdcall   SetMethodImplFlags(
  479.                 mdToken         md,
  480.                 DWORD           dwImplFlags);
  481.  
  482.     COR_IMPORT("CORwrap.dll", "?DefineTypeRefByName@WMetaDataEmit@@QAGHIPBGPAI@Z")
  483.     int     __stdcall   DefineTypeRefByName(
  484.                 mdToken         tkResolutionScope,
  485.                 LPCWSTR         szName,
  486.                 mdTypeRef       *ptr);
  487.  
  488.     COR_IMPORT("CORwrap.dll", "?DefineImportType@WMetaDataEmit@@QAGHPAUIMetaDataAssemblyImport@@PBXKIPAUIMetaDataImport@@IPAUIMetaDataAssemblyEmit@@PAI@Z")
  489.     int     __stdcall   DefineImportType(
  490.                 IMetaDataAssemblyImport *pAssemImport,
  491.                 const void      *pbHashValue,
  492.                 ULONG           ulHashValue,
  493.                 mdExecutionLocation tkExec,
  494.                 IMetaDataImport *pImport,
  495.                 mdTypeDef       tdImport,
  496.                 IMetaDataAssemblyEmit *pAssemEmit,
  497.                 mdTypeRef       *ptr);
  498.  
  499.     COR_IMPORT("CORwrap.dll", "?DefineMemberRef@WMetaDataEmit@@QAGHIPBGPB_EKPAI@Z")
  500.     int     __stdcall   DefineMemberRef(
  501.                 mdToken         tkImport,
  502.                 LPCWSTR         szName,
  503.                 PCCOR_SIGNATURE pvSigBlob,
  504.                 ULONG           cbSigBlob,
  505.                 mdMemberRef *pmr);
  506.  
  507.     COR_IMPORT("CORwrap.dll", "?DefineImportMember@WMetaDataEmit@@QAGHPAUIMetaDataAssemblyImport@@PBXKIPAUIMetaDataImport@@IPAUIMetaDataAssemblyEmit@@IPAI@Z")
  508.     int     __stdcall   DefineImportMember(
  509.                 IMetaDataAssemblyImport *pAssemImport,
  510.                 const void      *pbHashValue,
  511.                 ULONG           cbHashValue,
  512.                 mdExecutionLocation tkExec,
  513.                 IMetaDataImport *pImport,
  514.                 mdToken         mbMember,
  515.                 IMetaDataAssemblyEmit *pAssemEmit,
  516.                 mdToken         tkParent,
  517.                 mdMemberRef *pmr);
  518.  
  519.     COR_IMPORT("CORwrap.dll", "?SetClassLayout@WMetaDataEmit@@QAGHIKQAUCOR_FIELD_OFFSET@@K@Z")
  520.     int     __stdcall   SetClassLayout(
  521.                 mdTypeDef       td,
  522.                 DWORD           dwPackSize,
  523.                 COR_FIELD_OFFSET rFieldOffsets[],
  524.                 ULONG           ulClassSize);
  525.  
  526.     COR_IMPORT("CORwrap.dll", "?SetFieldMarshal@WMetaDataEmit@@QAGHIPB_EK@Z")
  527.     int     __stdcall   SetFieldMarshal(
  528.                 mdToken         tk,
  529.                 PCCOR_SIGNATURE pvNativeType,
  530.                 ULONG           cbNativeType);
  531.  
  532.     COR_IMPORT("CORwrap.dll", "?SetFieldRVA@WMetaDataEmit@@QAGHIK@Z")
  533.     int     __stdcall   SetFieldRVA(
  534.                 mdFieldDef      fd,
  535.                 ULONG           ulRVA);
  536.  
  537.     COR_IMPORT("CORwrap.dll", "?DefinePermissionSet@WMetaDataEmit@@QAGHIKPBXKPAI@Z")
  538.     int     __stdcall   DefinePermissionSet(
  539.                 mdToken         tk,
  540.                 DWORD           dwAction,
  541.                 void const     *pvPermission,
  542.                 ULONG           cbPermission,
  543.                 mdPermission   *ppm);
  544.  
  545.     COR_IMPORT("CORwrap.dll", "?GetTokenFromSig@WMetaDataEmit@@QAGHPB_EKPAI@Z")
  546.     int     __stdcall   GetTokenFromSig(
  547.                 PCCOR_SIGNATURE pvSig,
  548.                 ULONG           cbSig,
  549.                 mdSignature *pmsig);
  550.  
  551.     COR_IMPORT("CORwrap.dll", "?DefineModuleRef@WMetaDataEmit@@QAGHPBGPAI@Z")
  552.     int     __stdcall   DefineModuleRef(
  553.                 LPCWSTR         szName,
  554.                 mdModuleRef     *pmur);
  555.  
  556.     COR_IMPORT("CORwrap.dll", "?SetParent@WMetaDataEmit@@QAGHII@Z")
  557.     int     __stdcall   SetParent(
  558.                 mdMemberRef     mr,
  559.                 mdToken         tk);
  560.  
  561.     COR_IMPORT("CORwrap.dll", "?GetSaveSize@WMetaDataEmit@@QAGHW4CorSaveSize@@PAK@Z")
  562.     int     __stdcall   GetSaveSize(CorSaveSize fSave, DWORD *pdwSaveSize);
  563.  
  564.     COR_IMPORT("CORwrap.dll", "?SaveToMemory@WMetaDataEmit@@QAGHPAXK@Z")
  565.     int     __stdcall   SaveToMemory(
  566.                 void           *pbData,
  567.                 ULONG           cbData);
  568.  
  569.     COR_IMPORT("CORwrap.dll", "?DefineUserString@WMetaDataEmit@@QAGHPBGKPAI@Z")
  570.     int     __stdcall   DefineUserString(
  571.                 LPCWSTR         szString,
  572.                 ULONG           cchString,
  573.                 mdString       *pstk);
  574.  
  575.     COR_IMPORT("CORwrap.dll", "?DefinePinvokeMap@WMetaDataEmit@@QAGHIKPBGI@Z")
  576.     int     __stdcall   DefinePinvokeMap(
  577.                 mdToken         tk,
  578.                 DWORD           dwMappingFlags,
  579.                 LPCWSTR         szImportName,
  580.                 mdModuleRef     mrImportDLL);
  581.  
  582.     COR_IMPORT("CORwrap.dll", "?DefineCustomAttribute@WMetaDataEmit@@QAGHIIPBXKPAI@Z")
  583.     int     __stdcall   DefineCustomAttribute(
  584.                 mdToken         tkObj,
  585.                 mdToken         tkType,
  586.                 void const     *pCustomValue,
  587.                 ULONG           cbCustomValue,
  588.                 mdCustomValue  *pcv);
  589.  
  590.     COR_IMPORT("CORwrap.dll", "?GetTokenFromTypeSpec@WMetaDataEmit@@QAGHPB_EKPAI@Z")
  591.     int     __stdcall GetTokenFromTypeSpec(
  592.                 PCCOR_SIGNATURE pvSig,
  593.                 ULONG           cbSig,
  594.                 mdTypeSpec *parrspec);
  595.  
  596.     COR_IMPORT("CORwrap.dll", "?CreateSymbolWriter@WMetaDataEmit@@QAGHPBGPAPAUWSymWriter@@@Z")
  597.     int     __stdcall   CreateSymbolWriter(
  598.                 LPCWSTR         filename,
  599.                 WSymWriter    **dbgWriter);
  600. };
  601.  
  602. struct  WSymWriter : WMetaData
  603. {
  604.     void    *           isw;
  605.  
  606.     COR_IMPORT("CORwrap.dll", "?DefineDocument@WSymWriter@@QAGHPBGPAPAX@Z")
  607.     int     __stdcall DefineDocument(
  608.                 LPCWSTR         wzFileName,
  609.                 void          **pISymUnmanagedDocument);
  610.  
  611.     COR_IMPORT("CORwrap.dll", "?OpenMethod@WSymWriter@@QAGHI@Z")
  612.     int     __stdcall OpenMethod(
  613.                 mdMethodDef     methodToken);
  614.  
  615.     COR_IMPORT("CORwrap.dll", "?CloseMethod@WSymWriter@@QAGHXZ")
  616.     int     __stdcall CloseMethod();
  617.  
  618.     COR_IMPORT("CORwrap.dll", "?SetUserEntryPoint@WSymWriter@@QAGHI@Z")
  619.     int     __stdcall SetUserEntryPoint(
  620.                 mdMethodDef     methodToken);
  621.  
  622.     COR_IMPORT("CORwrap.dll", "?DefineSequencePoints@WSymWriter@@QAGHPAXIPAI1@Z")
  623.     int     __stdcall DefineSequencePoints(
  624.                 void           *document,
  625.                 ULONG32        spCount,
  626.                 unsigned       *offsets,
  627.                 unsigned       *lines);
  628.  
  629.     COR_IMPORT("CORwrap.dll", "?OpenScope@WSymWriter@@QAGHIPAI@Z")
  630.     int     __stdcall OpenScope(
  631.                 unsigned        startOffset,
  632.                 unsigned       *scopeID);
  633.  
  634.     COR_IMPORT("CORwrap.dll", "?CloseScope@WSymWriter@@QAGHI@Z")
  635.     int     __stdcall CloseScope(
  636.                 unsigned        endOffset);
  637.  
  638.     COR_IMPORT("CORwrap.dll", "?SetScopeRange@WSymWriter@@QAGHIII@Z")
  639.     int     __stdcall SetScopeRange(
  640.                 unsigned        scopeID,
  641.                 unsigned        startOffset,
  642.                 unsigned        endOffset);
  643.  
  644.     COR_IMPORT("CORwrap.dll", "?DefineLocalVariable@WSymWriter@@QAGHPBGPB_EII@Z")
  645.     int     __stdcall DefineLocalVariable(
  646.                 LPCWSTR         wzVariableName,
  647.                 PCCOR_SIGNATURE sigPtr,
  648.                 ULONG32         sigLen,
  649.                 unsigned        slot);
  650.  
  651.     COR_IMPORT("CORwrap.dll", "?DefineParameter@WSymWriter@@QAGHPBGI@Z")
  652.     int     __stdcall DefineParameter(
  653.                 LPCWSTR         wzVariableName,
  654.                 unsigned        sequence);
  655.  
  656.     COR_IMPORT("CORwrap.dll", "?GetDebugInfo@WSymWriter@@QAGHPAU_IMAGE_DEBUG_DIRECTORY@@KPAKQAE@Z")
  657.     int     __stdcall GetDebugInfo(IMAGE_DEBUG_DIRECTORY *pIDD,
  658.                                    DWORD cData,
  659.                                    DWORD *pcData,
  660.                                    BYTE data[]);
  661.  
  662.     COR_IMPORT("CORwrap.dll", "?Close@WSymWriter@@QAGHXZ")
  663.     int     __stdcall Close();
  664. };
  665.  
  666. struct  WAssemblyImport : WMetaData
  667. {
  668.     IMetaDataAssemblyImport *iasi;
  669.  
  670.     COR_IMPORT("CORwrap.dll", "?GetAssemblyFromScope@WAssemblyImport@@QAGHPAI@Z")
  671.     int     __stdcall GetAssemblyFromScope(mdAssembly *ptkAssembly);
  672.  
  673.     COR_IMPORT("CORwrap.dll", "?GetAssemblyProps@WAssemblyImport@@QAGHIPAPBXPAK1PAGK1PAUASSEMBLYMETADATA@@2K12K12K11@Z")
  674.     int     __stdcall GetAssemblyProps(
  675.                 mdAssembly      mda,
  676.                 const void    **ppbOriginator,
  677.                 ULONG          *pcbOriginator,
  678.                 ULONG          *pulHashAlgId,
  679.                 LPWSTR          szName,
  680.                 ULONG           cchName,
  681.                 ULONG          *pchName,
  682.                 ASSEMBLYMETADATA *pMetaData,
  683.                 LPWSTR          szTitle,
  684.                 ULONG           cchTitle,
  685.                 ULONG          *pchTitle,
  686.                 LPWSTR          szDescription,
  687.                 ULONG           cchDescription,
  688.                 ULONG          *pchDescription,
  689.                 LPWSTR          szDefaultAlias,
  690.                 ULONG           cchDefaultAlias,
  691.                 ULONG          *pchDefaultAlias,
  692.                 DWORD          *pdwAssemblyFlags);
  693.  
  694.     COR_IMPORT("CORwrap.dll", "?EnumComTypes@WAssemblyImport@@QAGHPAPAXQAIKPAK@Z")
  695.     int     __stdcall EnumComTypes(
  696.                 HCORENUM       *phEnum,
  697.                 mdComType       rComTypes[],
  698.                 ULONG           cMax,
  699.                 ULONG          *pcTokens);
  700.  
  701.     COR_IMPORT("CORwrap.dll", "?GetComTypeProps@WAssemblyImport@@QAGHIPAGKPAK0K1PAI221@Z")
  702.     int     __stdcall GetComTypeProps(
  703.                 mdComType       mdct,
  704.                 LPWSTR          szName,
  705.                 ULONG           cchName,
  706.                 ULONG          *pchName,
  707.                 LPWSTR          szDescription,
  708.                 ULONG           cchDescription,
  709.                 ULONG          *pchDescription,
  710.                 mdToken        *ptkImplementation,
  711.                 mdTypeDef      *ptkTypeDef,
  712.                 mdExecutionLocation *ptkExecutionLocation,
  713.                 DWORD          *pdwComTypeFlags);
  714.  
  715.     COR_IMPORT("CORwrap.dll", "?EnumFiles@WAssemblyImport@@QAGHPAPAXQAIKPAK@Z")
  716.     int     __stdcall EnumFiles(
  717.                 HCORENUM       *phEnum,
  718.                 mdFile          rFiles[],
  719.                 ULONG           cMax,
  720.                 ULONG          *pcTokens);
  721.  
  722.     COR_IMPORT("CORwrap.dll", "?GetFileProps@WAssemblyImport@@QAGHIPAGKPAKPAPBX11@Z")
  723.     int     __stdcall GetFileProps(
  724.                 mdFile          mdf,
  725.                 LPWSTR          szName,
  726.                 ULONG           cchName,
  727.                 ULONG          *pchName,
  728.                 const void    **ppbHashValue,
  729.                 ULONG          *pcbHashValue,
  730.                 DWORD          *pdwFileFlags);
  731.  
  732.     COR_IMPORT("CORwrap.dll", "?CloseEnum@WAssemblyImport@@QAGXPAX@Z")
  733.     void    __stdcall CloseEnum(HCORENUM hEnum);
  734. };
  735.  
  736. struct  WAssemblyEmit   : WMetaData
  737. {
  738.     IMetaDataAssemblyEmit  *iase;
  739.  
  740.     COR_IMPORT("CORwrap.dll", "?DefineAssembly@WAssemblyEmit@@QAGHPBXKKPBGPBUASSEMBLYMETADATA@@111KPAI@Z")
  741.     int     __stdcall DefineAssembly(
  742.                 const void  *pbOriginator,
  743.                 ULONG       cbOriginator,
  744.                 ULONG       ulHashAlgId,
  745.                 LPCWSTR     szName,
  746.                 const ASSEMBLYMETADATA *pMetaData,
  747.                 LPCWSTR     szTitle,
  748.                 LPCWSTR     szDescription,
  749.                 LPCWSTR     szDefaultAlias,
  750.                 DWORD       dwAssemblyFlags,
  751.                 mdAssembly  *pma);
  752.  
  753.     COR_IMPORT("CORwrap.dll", "?DefineAssemblyRef@WAssemblyEmit@@QAGHPBXKPBGPBUASSEMBLYMETADATA@@0KIKPAI@Z")
  754.     int     __stdcall DefineAssemblyRef(
  755.                 const void  *pbOriginator,
  756.                 ULONG       cbOriginator,
  757.                 LPCWSTR     szName,
  758.                 const ASSEMBLYMETADATA *pMetaData,
  759.                 const void  *pbHashValue,
  760.                 ULONG       cbHashValue,
  761.                 mdExecutionLocation tkExecutionLocation,
  762.                 DWORD       dwAssemblyRefFlags,
  763.                 mdAssemblyRef *pmdar);
  764.  
  765.     COR_IMPORT("CORwrap.dll", "?DefineFile@WAssemblyEmit@@QAGHPBGPBXKKPAI@Z")
  766.     int     __stdcall DefineFile(
  767.                 LPCWSTR     szName,
  768.                 const void  *pbHashValue,
  769.                 ULONG       cbHashValue,
  770.                 DWORD       dwFileFlags,
  771.                 mdFile      *pmdf);
  772.  
  773.     COR_IMPORT("CORwrap.dll", "?DefineComType@WAssemblyEmit@@QAGHPBG0IIIKPAI@Z")
  774.     int     __stdcall DefineComType(
  775.                 LPCWSTR     szName,
  776.                 LPCWSTR     szDescription,
  777.                 mdToken     tkImplementation,
  778.                 mdTypeDef   tkTypeDef,
  779.                 mdExecutionLocation tkExecutionLocation,
  780.                 DWORD       dwComTypeFlags,
  781.                 mdComType   *pmdct);
  782.  
  783.     COR_IMPORT("CORwrap.dll", "?DefineManifestResource@WAssemblyEmit@@QAGHPBG0IK00KPAI@Z")
  784.     int     __stdcall DefineManifestResource(
  785.                 LPCWSTR     szName,
  786.                 LPCWSTR     szDescription,
  787.                 mdToken     tkImplementation,
  788.                 DWORD       dwOffset,
  789.                 LPCWSTR     szMIMEType,
  790.                 LPCWSTR     szLocale,
  791.                 DWORD       dwResourceFlags,
  792.                 mdManifestResource  *pmdmr);
  793.  
  794. #if 0
  795.  
  796.     COR_IMPORT("CORwrap.dll", "???????????????????????")
  797.     int     __stdcall DefineExecutionLocation(
  798.                 LPCWSTR     szName,
  799.                 LPCWSTR     szDescription,
  800.                 LPCWSTR     szLocation,
  801.                 DWORD       dwExecutionLocationFlags,
  802.                 mdExecutionLocation *pmdel);
  803.  
  804.     COR_IMPORT("CORwrap.dll", "???????????????????????")
  805.     int     __stdcall SetAssemblyRefProps(
  806.                 mdAssemblyRef ar,
  807.                 const void  *pbOriginator,
  808.                 ULONG       cbOriginator,
  809.                 LPCWSTR     szName,
  810.                 const ASSEMBLYMETADATA *pMetaData,
  811.                 const void  *pbHashValue,
  812.                 ULONG       cbHashValue,
  813.                 mdExecutionLocation tkExecutionLocation,
  814.                 DWORD       dwAssemblyRefFlags);
  815.  
  816.     COR_IMPORT("CORwrap.dll", "???????????????????????")
  817.     int     __stdcall SetFileProps(
  818.                 mdFile      file,
  819.                 const void  *pbHashValue,
  820.                 ULONG       cbHashValue,
  821.                 DWORD       dwFileFlags);
  822.  
  823.     COR_IMPORT("CORwrap.dll", "?????????????????????????????????")
  824.     int     __stdcall SetComTypeProps(
  825.                 mdComType   ct,
  826.                 LPCWSTR     szDescription,
  827.                 mdToken     tkImplementation,
  828.                 mdTypeDef   tkTypeDef,
  829.                 mdExecutionLocation tkExecutionLocation,
  830.                 DWORD       dwComTypeFlags);
  831.  
  832. #endif
  833.  
  834. };
  835.  
  836. struct  WMetaDataDispenser : WMetaData
  837. {
  838.     IMetaDataDispenser *imdd;
  839.  
  840.     COR_IMPORT("CORwrap.dll", "?DefineScope@WMetaDataDispenser@@QAGHPBU_GUID@@K0PAPAUWMetaDataEmit@@@Z")
  841.     int     __stdcall   DefineScope(
  842.                         const CLSID *       rclsid,
  843.                         DWORD               dwCreateFlags,
  844.                         const IID *         riid,
  845.                         WMetaDataEmit   * * intfPtr);
  846.  
  847.     COR_IMPORT("CORwrap.dll", "?DefineAssem@WMetaDataDispenser@@QAGHPAUWMetaDataEmit@@PAPAUWAssemblyEmit@@@Z")
  848.     int     __stdcall   DefineAssem(
  849.                         WMetaDataEmit     * emitPtr,
  850.                         WAssemblyEmit   * * intfPtr);
  851.  
  852.     COR_IMPORT("CORwrap.dll", "?OpenScope@WMetaDataDispenser@@QAGHPBGKPBU_GUID@@PAPAUWMetaDataImport@@@Z")
  853.     int     __stdcall   OpenScope(
  854.                         LPCWSTR             szScope,
  855.                         DWORD               dwOpenFlags,
  856.                         const IID *         riid,
  857.                         WMetaDataImport * * intfPtr);
  858.  
  859.     COR_IMPORT("CORwrap.dll", "?OpenAssem@WMetaDataDispenser@@QAGHPBGKPBU_GUID@@PBDPAIPAPAEPAPAUWAssemblyImport@@@Z")
  860.     int     __stdcall   OpenAssem(
  861.                         LPCWSTR             szScope,
  862.                         DWORD               dwOpenFlags,
  863.                         const IID *         riid,
  864.                         LPCSTR              szFileName,
  865.                         mdAssembly        * assTok,
  866.                         BYTE *            * cookiePtr,
  867.                         WAssemblyImport * * intfPtr);
  868.  
  869.     COR_IMPORT("CORwrap.dll", "?TossAssem@WMetaDataDispenser@@QAGXPAE@Z")
  870.     void    __stdcall   TossAssem(BYTE *cookie);
  871. };
  872.  
  873. COR_IMPORT("CORwrap.dll", "?makeIMDDwrapper@@YGPAUWMetaDataDispenser@@PAUIMetaDataDispenser@@@Z")
  874. WMetaDataDispenser     *__stdcall makeIMDDwrapper(IMetaDataDispenser *intf);
  875. COR_IMPORT("CORwrap.dll", "?makeIMDIwrapper@@YGPAUWMetaDataImport@@PAUIMetaDataImport@@@Z")
  876. WMetaDataImport        *__stdcall makeIMDIwrapper(IMetaDataImport    *intf);
  877. COR_IMPORT("CORwrap.dll", "?makeIMDEwrapper@@YGPAUWMetaDataEmit@@PAUIMetaDataEmit@@@Z")
  878. WMetaDataEmit          *__stdcall makeIMDEwrapper(IMetaDataEmit      *intf);
  879.  
  880. COR_IMPORT("CORwrap.dll", "?makeIASIwrapper@@YGPAUWAssemblyImport@@PAUIMetaDataAssemblyImport@@@Z")
  881. WAssemblyImport        *__stdcall makeIASIwrapper(IMetaDataAssemblyImport *intf);
  882. COR_IMPORT("CORwrap.dll", "?makeIASEwrapper@@YGPAUWAssemblyEmit@@PAUIMetaDataAssemblyEmit@@@Z")
  883. WAssemblyEmit          *__stdcall makeIASEwrapper(IMetaDataAssemblyEmit   *intf);
  884.  
  885. COR_IMPORT("CORwrap.dll", "?makeSYMWwrapper@@YGPAUWSymWriter@@PAX@Z")
  886. WSymWriter             *__stdcall makeSYMWwrapper(void               *intf);
  887.  
  888. COR_IMPORT("CORwrap.dll", "?uwrpIMDDwrapper@@YGPAUIMetaDataDispenser@@PAUWMetaDataDispenser@@@Z")
  889. IMetaDataDispenser     *__stdcall uwrpIMDDwrapper(WMetaDataDispenser *inst);
  890. COR_IMPORT("CORwrap.dll", "?uwrpIMDIwrapper@@YGPAUIMetaDataImport@@PAUWMetaDataImport@@@Z")
  891. IMetaDataImport        *__stdcall uwrpIMDIwrapper(WMetaDataImport    *inst);
  892. COR_IMPORT("CORwrap.dll", "?uwrpIMDEwrapper@@YGPAUIMetaDataEmit@@PAUWMetaDataEmit@@@Z")
  893. IMetaDataEmit          *__stdcall uwrpIMDEwrapper(WMetaDataEmit      *inst);
  894. COR_IMPORT("CORwrap.dll", "?uwrpIASEwrapper@@YGPAUIMetaDataAssemblyEmit@@PAUWAssemblyEmit@@@Z")
  895. IMetaDataAssemblyEmit  *__stdcall uwrpIASEwrapper(WAssemblyEmit      *inst);
  896. COR_IMPORT("CORwrap.dll", "?uwrpIASIwrapper@@YGPAUIMetaDataAssemblyImport@@PAUWAssemblyImport@@@Z")
  897. IMetaDataAssemblyImport*__stdcall uwrpIASIwrapper(WAssemblyImport    *inst);
  898.  
  899. COR_IMPORT("CORwrap.dll", "?initializeIMD@@YGPAUWMetaDataDispenser@@XZ")
  900. WMetaDataDispenser     *__stdcall initializeIMD();
  901.  
  902. /*****************************************************************************/
  903.  
  904. COR_IMPORT("CORwrap.dll", "?getIID_CorMetaDataRuntime@@YGPBU_GUID@@XZ")
  905. const GUID *  __stdcall getIID_CorMetaDataRuntime();
  906.  
  907. COR_IMPORT("CORwrap.dll", "?getIID_IMetaDataImport@@YGPBU_GUID@@XZ")
  908. const GUID *  __stdcall getIID_IMetaDataImport();
  909. COR_IMPORT("CORwrap.dll", "?getIID_IMetaDataEmit@@YGPBU_GUID@@XZ")
  910. const GUID *  __stdcall getIID_IMetaDataEmit();
  911.  
  912. COR_IMPORT("CORwrap.dll", "?getIID_IMetaDataAssemblyImport@@YGPBU_GUID@@XZ")
  913. const GUID *  __stdcall getIID_IMetaDataAssemblyImport();
  914. COR_IMPORT("CORwrap.dll", "?getIID_IMetaDataAssemblyEmit@@YGPBU_GUID@@XZ")
  915. const GUID *  __stdcall getIID_IMetaDataAssemblyEmit();
  916.  
  917. /*****************************************************************************/
  918.  
  919. COR_IMPORT("CORwrap.dll","?WRAPPED_GetHashFromFile@@YGJPBDPAIPAEKPAK@Z")
  920. HRESULT       __stdcall WRAPPED_GetHashFromFile(LPCSTR    szFilePath,
  921.                                                 unsigned *iHashAlg,
  922.                                                 BYTE     *pbHash,
  923.                                                 DWORD     cchHash,
  924.                                                 DWORD    *pchHash);
  925.  
  926. /*****************************************************************************/
  927.  
  928. COR_IMPORT("CORwrap.dll", "?WRAPPED_CorSigCompressData@@YGKKPAX@Z")
  929. ULONG       __stdcall WRAPPED_CorSigCompressData         (ULONG           iLen,  void           *pDataOut);
  930. COR_IMPORT("CORwrap.dll", "?WRAPPED_CorSigCompressToken@@YGKIPAX@Z")
  931. ULONG       __stdcall WRAPPED_CorSigCompressToken        (mdToken         tk,    void           *pDataOut);
  932. COR_IMPORT("CORwrap.dll", "?WRAPPED_CorSigUncompressData@@YGKPB_EPAK@Z")
  933. ULONG       __stdcall WRAPPED_CorSigUncompressData       (PCCOR_SIGNATURE pData, ULONG          *pDataOut);
  934. COR_IMPORT("CORwrap.dll", "?WRAPPED_CorSigUncompressToken@@YGKPB_EPAI@Z")
  935. ULONG       __stdcall WRAPPED_CorSigUncompressToken      (PCCOR_SIGNATURE pData, mdToken        *pToken);
  936. COR_IMPORT("CORwrap.dll", "?WRAPPED_CorSigUncompressElementType@@YGKPB_EPAW4CorElementType@@@Z")
  937. ULONG       __stdcall WRAPPED_CorSigUncompressElementType(PCCOR_SIGNATURE pData, CorElementType *pElementType);
  938.  
  939. /*****************************************************************************/
  940.  
  941. typedef IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT   CLS_EH_FAT;
  942. typedef       COR_ILMETHOD_FAT                  COR_IM_FAT;
  943.  
  944. COR_IMPORT("CORwrap.dll", "?WRAPPED_SectEH_EHClause@@YGPAUIMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT@@PAXIPAU1@@Z")
  945. CLS_EH_FAT* __stdcall WRAPPED_SectEH_EHClause(void *pSectEH, unsigned idx, CLS_EH_FAT* buff);
  946.  
  947. COR_IMPORT("CORwrap.dll", "?WRAPPED_SectEH_Emit@@YGIIIPAUIMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT@@HPAE@Z")
  948. unsigned    __stdcall WRAPPED_SectEH_Emit(unsigned size, unsigned ehCount, CLS_EH_FAT* clauses, BOOL moreSections, BYTE* outBuff);
  949.  
  950. COR_IMPORT("CORwrap.dll", "?WRAPPED_SectEH_SizeExact@@YGIIPAUIMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT@@@Z")
  951. unsigned    __stdcall WRAPPED_SectEH_SizeExact(unsigned ehCount, CLS_EH_FAT* clauses);
  952.  
  953. COR_IMPORT("CORwrap.dll", "?WRAPPED_IlmethodSize@@YGIPAUtagCOR_ILMETHOD_FAT@@H@Z")
  954. unsigned    __stdcall WRAPPED_IlmethodSize(COR_IM_FAT* header, BOOL MoreSections);
  955.  
  956. COR_IMPORT("CORwrap.dll", "?WRAPPED_IlmethodEmit@@YGIIPAUtagCOR_ILMETHOD_FAT@@HPAE@Z")
  957. unsigned    __stdcall WRAPPED_IlmethodEmit(unsigned size, COR_IM_FAT* header, BOOL moreSections, BYTE* outBuff);
  958.  
  959. /*****************************************************************************/
  960. #undef  COR_IMPORT
  961. /*****************************************************************************/
  962. #endif//_CORWRAP_H
  963. /*****************************************************************************/
  964.