Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: SIPObjPE.hxx (Portable Executable)
  8. //
  9. // Contents: Microsoft SIP Provider
  10. //
  11. // History: 15-Feb-1997 pberkman created
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef SIPOBJPE_HXX
  15. #define SIPOBJPE_HXX
  16. #include "sipobj.hxx"
  17. class SIPObjectPE_ : public SIPObject_
  18. {
  19. public:
  20. SIPObjectPE_(DWORD id);
  21. virtual ~SIPObjectPE_(void) { ; }
  22. BOOL CreateIndirectData(SIP_SUBJECTINFO *pSI,DWORD *pdwDLen,
  23. SIP_INDIRECT_DATA *psData);
  24. BOOL VerifyIndirectData(SIP_SUBJECTINFO *pSI,
  25. SIP_INDIRECT_DATA *psData);
  26. virtual BOOL RemoveSignedDataMsg(SIP_SUBJECTINFO *pSI,DWORD dwIdx);
  27. virtual char *GetDataObjectID(void) { return(SPC_PE_IMAGE_DATA_OBJID); }
  28. virtual char *GetDataOIDHint(void) { return((char *)SPC_PE_IMAGE_DATA_STRUCT); }
  29. protected:
  30. DWORD GetDigestFlags(SIP_SUBJECTINFO *pSI)
  31. { return(this->ConvertSPCFlags(pSI->dwFlags)); }
  32. void *GetMyStructure(SIP_SUBJECTINFO *pSI) { return(&PeInfo); }
  33. DWORD GetMyStructureSize(void) { return(sizeof(SPC_PE_IMAGE_DATA)); }
  34. virtual BOOL PutMessageInFile(SIP_SUBJECTINFO *pSI,
  35. WIN_CERTIFICATE *pWinCert,DWORD *pdwIndex);
  36. virtual BOOL GetMessageFromFile(SIP_SUBJECTINFO *pSI,
  37. WIN_CERTIFICATE *pWinCert,DWORD dwIndex,
  38. DWORD *pcbCert)
  39. { return(ImageGetCertificateData(this->hFile,dwIndex,pWinCert,pcbCert)); }
  40. virtual BOOL GetDigestStream(DIGEST_DATA *pDigestData,
  41. DIGEST_FUNCTION pfnCallBack, DWORD dwFlags);
  42. virtual DWORD ConvertSPCFlags(DWORD InFlags);
  43. private:
  44. SPC_PE_IMAGE_DATA PeInfo;
  45. };
  46. //
  47. // code is in peimage2.cpp
  48. //
  49. extern BOOL imagehack_IsImagePEOnly(IN HANDLE FileHandle);
  50. extern BOOL imagehack_AuImageGetDigestStream( IN HANDLE FileHandle,
  51. IN DWORD DigestLevel,
  52. IN DIGEST_FUNCTION DigestFunction,
  53. IN DIGEST_HANDLE DigestHandle);
  54. #endif // SIPOBJPE_HXX