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.

154 lines
3.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: inetsp.h
  7. //
  8. // Contents: Inet (HTTP, HTTPS) scheme provider definitions
  9. //
  10. // History: 05-Aug-97 kirtd Created
  11. // 01-Jan-02 philh Moved from wininet to winhttp
  12. //
  13. //----------------------------------------------------------------------------
  14. #if !defined(__INETSP_H__)
  15. #define __INETSP_H__
  16. #include <orm.h>
  17. #include <winhttp.h>
  18. //
  19. // Inet scheme provider entry points
  20. //
  21. #define HTTP_SCHEME "http"
  22. extern HCRYPTTLS hCryptNetCancelTls;
  23. typedef struct _CRYPTNET_CANCEL_BLOCK {
  24. PFN_CRYPT_CANCEL_RETRIEVAL pfnCancel;
  25. void *pvArg;
  26. } CRYPTNET_CANCEL_BLOCK, *PCRYPTNET_CANCEL_BLOCK;
  27. BOOL WINAPI InetRetrieveEncodedObject (
  28. IN LPCWSTR pwszUrl,
  29. IN LPCSTR pszObjectOid,
  30. IN DWORD dwRetrievalFlags,
  31. IN DWORD dwTimeout,
  32. OUT PCRYPT_BLOB_ARRAY pObject,
  33. OUT PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeObject,
  34. OUT LPVOID* ppvFreeContext,
  35. IN HCRYPTASYNC hAsyncRetrieve,
  36. IN PCRYPT_CREDENTIALS pCredentials,
  37. IN PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  38. );
  39. VOID WINAPI InetFreeEncodedObject (
  40. IN LPCSTR pszObjectOid,
  41. IN PCRYPT_BLOB_ARRAY pObject,
  42. IN LPVOID pvFreeContext
  43. );
  44. BOOL WINAPI InetCancelAsyncRetrieval (
  45. IN HCRYPTASYNC hAsyncRetrieve
  46. );
  47. //
  48. // Inet Synchronous Object Retriever
  49. //
  50. class CInetSynchronousRetriever : public IObjectRetriever
  51. {
  52. public:
  53. //
  54. // Construction
  55. //
  56. CInetSynchronousRetriever ();
  57. ~CInetSynchronousRetriever ();
  58. //
  59. // IRefCountedObject methods
  60. //
  61. virtual VOID AddRef ();
  62. virtual VOID Release ();
  63. //
  64. // IObjectRetriever methods
  65. //
  66. virtual BOOL RetrieveObjectByUrl (
  67. LPCWSTR pwszUrl,
  68. LPCSTR pszObjectOid,
  69. DWORD dwRetrievalFlags,
  70. DWORD dwTimeout,
  71. LPVOID* ppvObject,
  72. PFN_FREE_ENCODED_OBJECT_FUNC* ppfnFreeObject,
  73. LPVOID* ppvFreeContext,
  74. HCRYPTASYNC hAsyncRetrieve,
  75. PCRYPT_CREDENTIALS pCredentials,
  76. LPVOID pvVerify,
  77. PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  78. );
  79. virtual BOOL CancelAsyncRetrieval ();
  80. private:
  81. //
  82. // Reference count
  83. //
  84. ULONG m_cRefs;
  85. };
  86. //
  87. // Inet Scheme Provider Support API
  88. //
  89. #define INET_INITIAL_DATA_BUFFER_SIZE 4096
  90. #define INET_GROW_DATA_BUFFER_SIZE 4096
  91. BOOL
  92. InetGetBindings (
  93. LPCWSTR pwszUrl,
  94. DWORD dwRetrievalFlags,
  95. DWORD dwTimeout,
  96. HINTERNET* phInetSession
  97. );
  98. VOID
  99. InetFreeBindings (
  100. HINTERNET hInetSession
  101. );
  102. BOOL
  103. InetSendReceiveUrlRequest (
  104. HINTERNET hInetSession,
  105. LPCWSTR pwszUrl,
  106. DWORD dwRetrievalFlags,
  107. PCRYPT_CREDENTIALS pCredentials,
  108. PCRYPT_BLOB_ARRAY pcba,
  109. PCRYPT_RETRIEVE_AUX_INFO pAuxInfo
  110. );
  111. VOID
  112. InetFreeCryptBlobArray (
  113. PCRYPT_BLOB_ARRAY pcba
  114. );
  115. VOID WINAPI
  116. InetAsyncStatusCallback (
  117. HINTERNET hInet,
  118. DWORD dwContext,
  119. DWORD dwInternetStatus,
  120. LPVOID pvStatusInfo,
  121. DWORD dwStatusLength
  122. );
  123. #endif