home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / ivalidator.idl < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.6 KB  |  86 lines

  1. /* ------------------------------------------------------------------------- *
  2.  * COM+ Runtime Verifier / Validator Interace
  3.  *
  4.  * Purpose: IValidator is used to staticly validate COR images.
  5.  *
  6.  * Protocol:
  7.  *
  8.  * Client CoCreates CorHost.Validator, 
  9.  *      Calls Validate()
  10.  *          [optional - passes in IVEHandler for error callbacks on error]
  11.  *
  12.  *      On Error, Validator calls IVEHandler.VEHandler() method. 
  13.  *          (IVEHandler supplied by the client).
  14.  *          VEHandler() could return CONTINUE / STOP ...
  15.  *
  16.  *      VEHandler() can call Validator.FormatEventInfo()  to get a detailed 
  17.  *          error message on any error passed to IVEHandler.
  18.  *
  19.  * Copyright (C) 1999 Microsoft Corporation
  20.  * ------------------------------------------------------------------------- */
  21.  
  22. /* ------------------------------------------------------------------------- *
  23.  * Imported types
  24.  * ------------------------------------------------------------------------- */
  25.  
  26. #ifndef DO_NO_IMPORTS
  27. import "ivehandler.idl";
  28. #endif
  29.  
  30.  
  31. /* ------------------------------------------------------------------------- *
  32.  * Forward declarations
  33.  * ------------------------------------------------------------------------- */
  34.  
  35. interface IValidator;
  36. interface ILoader;
  37.  
  38.  
  39. /* ------------------------------------------------------------------------- *
  40.  * IValidator interface
  41.  * ------------------------------------------------------------------------- */
  42. [
  43.  object,
  44.  uuid(A471523E-B299-4F4F-B184-1E78D4C95A95),
  45.  pointer_default(unique)
  46. ]
  47. interface IValidator : IUnknown
  48. {
  49.     HRESULT Validate(
  50.             [in] IVEHandler        *veh,
  51.             [in] ILoader           *loader,
  52.             [in] unsigned long      ulFlags,
  53.             [in] unsigned long      ulMaxError,
  54.             [in] unsigned long      token,
  55.             [in] LPWSTR             fileName,
  56.             [in, size_is(ulSize)] byte *pe,
  57.             [in] unsigned long      ulSize);
  58.  
  59.     HRESULT FormatEventInfo(
  60.             [in] HRESULT            hVECode,
  61.             [in] VEContext          Context,
  62.             [in, out] LPWSTR        msg,
  63.             [in] unsigned long      ulMaxLength,
  64.             [in] SAFEARRAY(VARIANT) psa);
  65. };
  66.  
  67. /* ------------------------------------------------------------------------- *
  68.  * ILoader interface
  69.  * ------------------------------------------------------------------------- */
  70. [
  71.  object,
  72.  uuid(9C4726CE-4C83-4011-BC22-2823B64CBE81),
  73.  pointer_default(unique)
  74. ]
  75. interface ILoader : IUnknown
  76. {
  77.     HRESULT LoadModule(
  78.             [in]  LPWSTR         fileName,
  79.             [out] byte          *pe,
  80.             [out] unsigned long *pulSize);
  81.     HRESULT UnloadModule(
  82.             [in]  LPWSTR         fileName,
  83.             [in]  byte          *pe);
  84. };
  85.  
  86.