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.

194 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name :
  4. isapidll.hxx
  5. Abstract:
  6. This module declares all the classes and functions associated with
  7. ISAPI Application DLLs
  8. Author:
  9. Murali R. Krishnan ( MuraliK ) 07-Feb-1997
  10. Environment:
  11. User Mode - Win32
  12. Project:
  13. W3 Services DLL
  14. Revision History:
  15. --*/
  16. # ifndef _ISAPIDLL_HXX_
  17. # define _ISAPIDLL_HXX_
  18. /************************************************************
  19. * Include Headers
  20. ************************************************************/
  21. # include "isapi.hxx"
  22. //
  23. // If the request doesn't specify an entry point, default to using
  24. // this
  25. //
  26. #define SE_DEFAULT_ENTRY "HttpExtensionProc"
  27. #define SE_INIT_ENTRY "GetExtensionVersion"
  28. #define SE_TERM_ENTRY "TerminateExtension"
  29. /************************************************************
  30. * Forward References
  31. ************************************************************/
  32. class WAM;
  33. /************************************************************
  34. * Type Definitions
  35. ************************************************************/
  36. /*++
  37. class HSE_APPDLL:
  38. Defines the class for the object containing information about an extension.
  39. The Server extension sits in an application DLL and exports the standard
  40. ISAPI (legacy) "C" entry points.
  41. --*/
  42. class HSE_APPDLL : public HSE_BASE
  43. {
  44. public:
  45. HSE_APPDLL( const CHAR * pszModuleName,
  46. HMODULE hMod,
  47. PFN_HTTPEXTENSIONPROC pfnEntryPoint,
  48. PFN_TERMINATEEXTENSION pfnTerminate,
  49. BOOL fCache )
  50. : HSE_BASE( pszModuleName, fCache),
  51. _hMod ( hMod ),
  52. _pfnEntryPoint( pfnEntryPoint ),
  53. _pfnTerminate ( pfnTerminate ),
  54. _hLastUser ( NULL )
  55. {
  56. //
  57. // We expect the first call to GetFileSecurity to fail
  58. //
  59. if ( !LoadAcl() )
  60. {
  61. SetValid( FALSE);
  62. }
  63. }
  64. ~HSE_APPDLL(VOID);
  65. virtual DWORD ExecuteRequest( IN WAM_EXEC_INFO * pWamExecInfo );
  66. virtual BOOL Cleanup(VOID);
  67. virtual BOOL IsMatch( IN const char * pchModuleName,
  68. IN DWORD cchModuleName) const
  69. {
  70. return ( (cchModuleName == m_strModuleName.QueryCCH()) &&
  71. #if 1 // DBCS enabling for ISAPI module Name
  72. !lstrcmpi( pchModuleName, m_strModuleName.QueryStr())
  73. #else
  74. !_stricmp( pchModuleName, m_strModuleName.QueryStr())
  75. #endif
  76. );
  77. }
  78. BOOL LoadAcl( VOID );
  79. DWORD Unload(VOID);
  80. virtual BOOL AccessCheck( HANDLE hImpersonation,
  81. BOOL fCacheImpersonation);
  82. PFN_HTTPEXTENSIONPROC QueryEntryPoint( VOID ) const
  83. { return _pfnEntryPoint; }
  84. PSECURITY_DESCRIPTOR QuerySecDesc( VOID ) const
  85. { return (PSECURITY_DESCRIPTOR) _buffSD.QueryPtr(); }
  86. HMODULE QueryHMod( VOID ) const
  87. { return _hMod; }
  88. HANDLE QueryLastSuccessfulUser( VOID ) const
  89. { return _hLastUser; }
  90. VOID SetLastSuccessfulUser( HANDLE hLastUser )
  91. { _hLastUser = hLastUser; }
  92. private:
  93. PFN_HTTPEXTENSIONPROC _pfnEntryPoint;
  94. PFN_TERMINATEEXTENSION _pfnTerminate;
  95. HMODULE _hMod;
  96. HANDLE _hLastUser; // Last successful access
  97. BUFFER _buffSD; // Security descriptor on the DLL
  98. WAM * _pWam;
  99. public:
  100. // loads an ISAPI app dll
  101. static PHSE LoadModule( IN const char * pchModule,
  102. IN HANDLE hImpersonation,
  103. IN BOOL fCache);
  104. }; // class HSE_APPDLL
  105. typedef HSE_APPDLL * PHSE_APPDLL;
  106. /************************************************************
  107. * ISAPI Application DLL Specific Call back functions
  108. ************************************************************/
  109. BOOL
  110. WINAPI
  111. GetServerVariable(
  112. HCONN hConn,
  113. LPSTR lpszVariableName,
  114. LPVOID lpvBuffer,
  115. LPDWORD lpdwSize
  116. );
  117. BOOL
  118. WINAPI
  119. WriteClient(
  120. HCONN hConn,
  121. LPVOID Buffer,
  122. LPDWORD lpdwBytes,
  123. DWORD dwReserved
  124. );
  125. BOOL
  126. WINAPI
  127. ReadClient(
  128. HCONN hConn,
  129. LPVOID Buffer,
  130. LPDWORD lpdwBytes
  131. );
  132. BOOL
  133. WINAPI
  134. ServerSupportFunction(
  135. HCONN hConn,
  136. DWORD dwRequest,
  137. LPVOID lpvBuffer,
  138. LPDWORD lpdwSize,
  139. LPDWORD lpdwDataType
  140. );
  141. # endif // _ISAPIDLL_HXX_
  142. /************************ End of File ***********************/