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.

212 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1998-2001 Microsoft Corporation
  3. Module Name:
  4. misc.c
  5. Abstract:
  6. User-mode interface to HTTP.SYS.
  7. Author:
  8. Keith Moore (keithmo) 15-Dec-1998
  9. Revision History:
  10. --*/
  11. #include "precomp.h"
  12. //
  13. // Private macros.
  14. //
  15. //
  16. // Private prototypes.
  17. //
  18. //
  19. // Public functions.
  20. //
  21. /***************************************************************************++
  22. Routine Description:
  23. Performs global initialization.
  24. Arguments:
  25. Reserved - Must be zero. May be used in future for interface version
  26. negotiation.
  27. Return Value:
  28. ULONG - Completion status.
  29. --***************************************************************************/
  30. ULONG
  31. WINAPI
  32. HttpInitialize(
  33. IN ULONG Reserved
  34. )
  35. {
  36. ULONG result;
  37. if( Reserved == 0 ) {
  38. result = HttpApiInitializeEventCache();
  39. } else {
  40. result = ERROR_INVALID_PARAMETER;
  41. }
  42. return result;
  43. } // HttpInitialize
  44. /***************************************************************************++
  45. Routine Description:
  46. Performs global termination.
  47. --***************************************************************************/
  48. VOID
  49. WINAPI
  50. HttpTerminate(
  51. VOID
  52. )
  53. {
  54. ULONG result;
  55. result = HttpApiTerminateEventCache();
  56. } // HttpTerminate
  57. /***************************************************************************++
  58. Routine Description:
  59. Flushes the response cache.
  60. Arguments:
  61. AppPoolHandle - Supplies a handle to a application pool.
  62. pFullyQualifiedUrl - Supplies the fully qualified URL to flush.
  63. Flags - Supplies behavior control flags.
  64. pOverlapped - Supplies an OVERLAPPED structure.
  65. Return Value:
  66. ULONG - Completion status.
  67. --***************************************************************************/
  68. ULONG
  69. WINAPI
  70. HttpFlushResponseCache(
  71. IN HANDLE AppPoolHandle,
  72. IN PCWSTR pFullyQualifiedUrl,
  73. IN ULONG Flags,
  74. IN LPOVERLAPPED pOverlapped
  75. )
  76. {
  77. NTSTATUS status;
  78. HTTP_FLUSH_RESPONSE_CACHE_INFO flushInfo;
  79. //
  80. // Initialize the input structure.
  81. //
  82. RtlInitUnicodeString( &flushInfo.FullyQualifiedUrl, pFullyQualifiedUrl );
  83. flushInfo.Flags = Flags;
  84. //
  85. // Make the request.
  86. //
  87. status = HttpApiDeviceControl(
  88. AppPoolHandle, // FileHandle
  89. pOverlapped, // pOverlapped
  90. IOCTL_HTTP_FLUSH_RESPONSE_CACHE, // IoControlCode
  91. &flushInfo, // pInputBuffer
  92. sizeof(flushInfo), // InputBufferLength
  93. NULL, // pOutputBuffer
  94. 0, // OutputBufferLength
  95. NULL // pBytesTransferred
  96. );
  97. return HttpApiNtStatusToWin32Status( status );
  98. } // HttpFlushResponseCache
  99. /***************************************************************************++
  100. Routine Description:
  101. Wait for a demand start notification.
  102. Arguments:
  103. AppPoolHandle - Supplies a handle to a application pool.
  104. pBuffer - Unused, must be NULL.
  105. BufferLength - Unused, must be zero.
  106. pBytesReceived - Unused, must be NULL.
  107. pOverlapped - Supplies an OVERLAPPED structure.
  108. Return Value:
  109. ULONG - Completion status.
  110. --***************************************************************************/
  111. ULONG
  112. WINAPI
  113. HttpWaitForDemandStart(
  114. IN HANDLE AppPoolHandle,
  115. IN OUT PVOID pBuffer OPTIONAL,
  116. IN ULONG BufferLength OPTIONAL,
  117. IN PULONG pBytesReceived OPTIONAL,
  118. IN LPOVERLAPPED pOverlapped OPTIONAL
  119. )
  120. {
  121. NTSTATUS status;
  122. //
  123. // Make the request.
  124. //
  125. status = HttpApiDeviceControl(
  126. AppPoolHandle, // FileHandle
  127. pOverlapped, // pOverlapped
  128. IOCTL_HTTP_WAIT_FOR_DEMAND_START, // IoControlCode
  129. pBuffer, // pInputBuffer
  130. BufferLength, // InputBufferLength
  131. pBuffer, // pOutputBuffer
  132. BufferLength, // OutputBufferLength
  133. pBytesReceived // pBytesTransferred
  134. );
  135. return HttpApiNtStatusToWin32Status( status );
  136. } // HttpWaitForDemandStart
  137. //
  138. // Private functions.
  139. //