Source code of Windows XP (NT5)
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.

84 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 2001 - 2001
  5. //
  6. // File: imagehack.h
  7. //
  8. // Contents: "Hacked" version of the imagehlp APIs
  9. //
  10. // Contains a "stripped" down subset of the imagehlp functionality
  11. // necessary to hash a PE file and to extract the
  12. // PKCS #7 Signed Data message.
  13. //
  14. // APIs: imagehack_ImageGetDigestStream
  15. // imagehack_ImageGetCertificateData
  16. //
  17. //----------------------------------------------------------------------------
  18. #ifndef __IMAGEHACK_H__
  19. #define __IMAGEHACK_H__
  20. #if defined (_MSC_VER)
  21. #if ( _MSC_VER >= 800 )
  22. #if _MSC_VER >= 1200
  23. #pragma warning(push)
  24. #endif
  25. #pragma warning(disable:4201) /* Nameless struct/union */
  26. #endif
  27. #if (_MSC_VER > 1020)
  28. #pragma once
  29. #endif
  30. #endif
  31. #include <wincrypt.h>
  32. #include <imagehlp.h>
  33. #include <wintrust.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. BOOL
  38. WINAPI
  39. imagehack_ImageGetDigestStream(
  40. IN PCRYPT_DATA_BLOB pFileBlob,
  41. IN DWORD DigestLevel, // ignored
  42. IN DIGEST_FUNCTION DigestFunction,
  43. IN DIGEST_HANDLE DigestHandle
  44. );
  45. BOOL
  46. WINAPI
  47. imagehack_ImageGetCertificateData(
  48. IN PCRYPT_DATA_BLOB pFileBlob,
  49. IN DWORD CertificateIndex, // should be 0
  50. OUT LPWIN_CERTIFICATE * Certificate
  51. );
  52. #ifdef __cplusplus
  53. } // Balance extern "C" above
  54. #endif
  55. #if defined (_MSC_VER)
  56. #if ( _MSC_VER >= 800 )
  57. #if _MSC_VER >= 1200
  58. #pragma warning(pop)
  59. #else
  60. #pragma warning(default:4201)
  61. #endif
  62. #endif
  63. #endif
  64. #endif // __IMAGEHACK_H__