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.

89 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 2001 - 2001
  5. //
  6. // File: fileutil.h
  7. //
  8. // Contents: File utility functions used by the minimal cryptographic
  9. // APIs.
  10. //
  11. // APIs:
  12. // I_MinCryptMapFile
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __MINCRYPT_FILEUTIL_H__
  16. #define __MINCRYPT_FILEUTIL_H__
  17. #if defined (_MSC_VER)
  18. #if ( _MSC_VER >= 800 )
  19. #if _MSC_VER >= 1200
  20. #pragma warning(push)
  21. #endif
  22. #pragma warning(disable:4201) /* Nameless struct/union */
  23. #endif
  24. #if (_MSC_VER > 1020)
  25. #pragma once
  26. #endif
  27. #endif
  28. #include <wincrypt.h>
  29. #include <mincrypt.h>
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. //+-------------------------------------------------------------------------
  34. // Maps the file into memory.
  35. //
  36. // According to dwFileType, pvFile can be a pwszFilename, hFile or pFileBlob.
  37. // Only READ access is required.
  38. //
  39. // dwFileType:
  40. // MINCRYPT_FILE_NAME : pvFile - LPCWSTR pwszFilename
  41. // MINCRYPT_FILE_HANDLE : pvFile - HANDLE hFile
  42. // MINCRYPT_FILE_BLOB : pvFile - PCRYPT_DATA_BLOB pFileBlob
  43. //
  44. // *pFileBlob is updated with pointer to and length of the mapped file. For
  45. // MINCRYPT_FILE_NAME and MINCRYPT_FILE_HANDLE, UnmapViewOfFile() must
  46. // be called to free pFileBlob->pbData.
  47. //
  48. // All accesses to this mapped memory must be within __try / __except's.
  49. //--------------------------------------------------------------------------
  50. LONG
  51. WINAPI
  52. I_MinCryptMapFile(
  53. IN DWORD dwFileType,
  54. IN const VOID *pvFile,
  55. OUT PCRYPT_DATA_BLOB pFileBlob
  56. );
  57. #ifdef __cplusplus
  58. } // Balance extern "C" above
  59. #endif
  60. #if defined (_MSC_VER)
  61. #if ( _MSC_VER >= 800 )
  62. #if _MSC_VER >= 1200
  63. #pragma warning(pop)
  64. #else
  65. #pragma warning(default:4201)
  66. #endif
  67. #endif
  68. #endif
  69. #endif // __MINCRYPT_FILEUTIL_H__