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.

156 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: filesp.h
  7. //
  8. // Contents: File Scheme Provider definitions
  9. //
  10. // History: 08-Aug-97 kirtd Created
  11. // 01-Jan-02 philh Changed to internally use UNICODE Urls
  12. //
  13. //----------------------------------------------------------------------------
  14. #if !defined(__FILESP_H__)
  15. #define __FILESP_H__
  16. #include <orm.h>
  17. #include <winhttp.h>
  18. //
  19. // File scheme provider entry points
  20. //
  21. #define FILE_SCHEME "file"
  22. #define FILE_SCHEME_PLUSPLUS L"file://"
  23. BOOL WINAPI FileRetrieveEncodedObject (
  24. IN LPCWSTR pwszUrl,
  25. IN LPCSTR pszObjectOid,
  26. IN DWORD dwRetrievalFlags,
  27. IN DWORD dwTimeout,
  28. OUT PCRYPT_BLOB_ARRAY pObject,
  29. OUT PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeObject,
  30. OUT LPVOID* ppvFreeContext,
  31. IN HCRYPTASYNC hAsyncRetrieve,
  32. IN PCRYPT_CREDENTIALS pCredentials,
  33. IN PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  34. );
  35. VOID WINAPI FileFreeEncodedObject (
  36. IN LPCSTR pszObjectOid,
  37. IN PCRYPT_BLOB_ARRAY pObject,
  38. IN LPVOID pvFreeContext
  39. );
  40. BOOL WINAPI FileCancelAsyncRetrieval (
  41. IN HCRYPTASYNC hAsyncRetrieve
  42. );
  43. //
  44. // File Synchronous Object Retriever
  45. //
  46. class CFileSynchronousRetriever : public IObjectRetriever
  47. {
  48. public:
  49. //
  50. // Construction
  51. //
  52. CFileSynchronousRetriever ();
  53. ~CFileSynchronousRetriever ();
  54. //
  55. // IRefCountedObject methods
  56. //
  57. virtual VOID AddRef ();
  58. virtual VOID Release ();
  59. //
  60. // IObjectRetriever methods
  61. //
  62. virtual BOOL RetrieveObjectByUrl (
  63. LPCWSTR pwszUrl,
  64. LPCSTR pszObjectOid,
  65. DWORD dwRetrievalFlags,
  66. DWORD dwTimeout,
  67. LPVOID* ppvObject,
  68. PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeObject,
  69. LPVOID* ppvFreeContext,
  70. HCRYPTASYNC hAsyncRetrieve,
  71. PCRYPT_CREDENTIALS pCredentials,
  72. LPVOID pvVerify,
  73. PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  74. );
  75. virtual BOOL CancelAsyncRetrieval ();
  76. private:
  77. //
  78. // Reference count
  79. //
  80. ULONG m_cRefs;
  81. };
  82. //
  83. // File Scheme Provider support API
  84. //
  85. #define FILE_MAPPING_THRESHOLD 20*4096
  86. typedef struct _FILE_BINDINGS {
  87. HANDLE hFile;
  88. DWORD dwSize;
  89. BOOL fMapped;
  90. HANDLE hFileMap;
  91. LPVOID pvMap;
  92. } FILE_BINDINGS, *PFILE_BINDINGS;
  93. BOOL
  94. FileGetBindings (
  95. LPCWSTR pwszUrl,
  96. DWORD dwRetrievalFlags,
  97. PCRYPT_CREDENTIALS pCredentials,
  98. PFILE_BINDINGS* ppfb,
  99. PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  100. );
  101. VOID
  102. FileFreeBindings (
  103. PFILE_BINDINGS pfb
  104. );
  105. BOOL
  106. FileSendReceiveUrlRequest (
  107. PFILE_BINDINGS pfb,
  108. PCRYPT_BLOB_ARRAY pcba
  109. );
  110. BOOL
  111. FileConvertMappedBindings (
  112. PFILE_BINDINGS pfb,
  113. PCRYPT_BLOB_ARRAY pcba
  114. );
  115. VOID
  116. FileFreeCryptBlobArray (
  117. PCRYPT_BLOB_ARRAY pcba,
  118. BOOL fFreeBlobs
  119. );
  120. BOOL
  121. FileIsUncUrl (
  122. LPCWSTR pwszUrl
  123. );
  124. #endif