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.

179 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name :
  4. ExecDesc.hxx
  5. Abstract:
  6. EXEC_DESCRIPTOR structure
  7. Author:
  8. David Kaplan ( DaveK ) 31-Mar-1997
  9. Environment:
  10. User Mode - Win32
  11. Project:
  12. W3svc DLL
  13. Revision History:
  14. Broke this file out from WamW3.hxx, since WamW3 contains shared stuff
  15. and EXEC_DESCRIPTOR is only used in w3svc.dll
  16. --*/
  17. # ifndef _EXECDESC_HXX_
  18. # define _EXECDESC_HXX_
  19. /************************************************************
  20. * Include Headers
  21. ************************************************************/
  22. //# include "iisextp.h"
  23. /************************************************************
  24. * Forward references
  25. ************************************************************/
  26. enum GATEWAY_TYPE;
  27. class W3_METADATA;
  28. typedef W3_METADATA *PW3_METADATA;
  29. /* EXEC_DESCRIPTOR block
  30. This block is used for all ISAPI and CGI execution. The point is to
  31. remove the hard dependancy on HTTP_REQUEST members when executing a
  32. gateway. This allows for ISAPI apps to also execute gateways.
  33. Instead of referring to HTTP_REQUEST members, when doing an execute,
  34. refer indirectly through the member pointer of this block. (i.e.
  35. _strURLParams.Copy( foo ) becomes pExec->_pstrURLParams->Copy( foo ) ).
  36. For the case of a regular gateway execution by the server, these pointers
  37. refer to the HTTP_REQUEST object (as before). But when an ISAPI app needs
  38. to execute a gateway, the pointers point to local storage so as to not
  39. corrupt the HTTP_REQUEST object.
  40. */
  41. #define EXEC_MAX_NESTED_LEVELS 64
  42. #define EXEC_FLAG_CHILD 0x80000000
  43. #define EXEC_FLAG_REDIRECT_ONLY HSE_EXEC_REDIRECT_ONLY
  44. #define EXEC_FLAG_NO_HEADERS HSE_EXEC_NO_HEADERS
  45. #define EXEC_FLAG_NO_ISA_WILDCARDS HSE_EXEC_NO_ISA_WILDCARDS
  46. #define EXEC_FLAG_CUSTOM_ERROR HSE_EXEC_CUSTOM_ERROR
  47. #define EXEC_FLAG_RUNNING_DAV 0x40000000 // Bypass script/exec access flag check
  48. #define EXEC_FLAG_CGI_NPH 0x20000000 // NPH CGI execution
  49. struct EXEC_DESCRIPTOR
  50. {
  51. STR * _pstrURL;
  52. STR * _pstrPhysicalPath;
  53. STR * _pstrUnmappedPhysicalPath;
  54. STR * _pstrGatewayImage;
  55. STR * _pstrPathInfo;
  56. STR * _pstrURLParams;
  57. DWORD * _pdwScriptMapFlags;
  58. GATEWAY_TYPE * _pGatewayType;
  59. HTTP_REQUEST * _pRequest;
  60. HANDLE _hChildEvent;
  61. BOOL _fMustWaitForChildEvent;
  62. WAM_REQUEST * _pParentWamRequest;
  63. DWORD _dwExecFlags;
  64. PW3_METADATA _pMetaData;
  65. PW3_METADATA _pPathInfoMetaData;
  66. PW3_URI_INFO _pPathInfoURIBlob;
  67. PW3_URI_INFO _pAppPathURIBlob;
  68. EXEC_DESCRIPTOR( VOID )
  69. {
  70. //
  71. // Certain members may need to be preserved across
  72. // Exec.Reset(), so we init them only here, in constructor
  73. //
  74. _dwExecFlags = 0;
  75. _hChildEvent = NULL;
  76. _fMustWaitForChildEvent = FALSE;
  77. _pPathInfoMetaData = NULL;
  78. _pPathInfoURIBlob = NULL;
  79. _pAppPathURIBlob = NULL;
  80. Reset();
  81. }
  82. VOID Reset( VOID );
  83. VOID ReleaseCacheInfo( VOID );
  84. HANDLE QueryImpersonationHandle();
  85. HANDLE QueryPrimaryHandle( HANDLE* phDel );
  86. BOOL CreateChildEvent();
  87. VOID SetMustWaitForChildEvent()
  88. { _fMustWaitForChildEvent = TRUE; }
  89. VOID WaitForChildEvent();
  90. VOID SetChildEvent();
  91. BOOL ImpersonateUser()
  92. {
  93. if (g_fIsWindows95)
  94. {
  95. return TRUE;
  96. }
  97. return ::ImpersonateLoggedOnUser( QueryImpersonationHandle() );
  98. }
  99. VOID RevertUser()
  100. {
  101. if (g_fIsWindows95)
  102. {
  103. return;
  104. }
  105. ::RevertToSelf();
  106. }
  107. PW3_METADATA QueryMetaData( VOID ) const
  108. { return _pMetaData; }
  109. BOOL IsChild( VOID ) const
  110. { return ( _dwExecFlags & EXEC_FLAG_CHILD ); }
  111. BOOL NoHeaders( VOID ) const
  112. { return ( _dwExecFlags & EXEC_FLAG_NO_HEADERS ); }
  113. BOOL RedirectOnly( VOID ) const
  114. { return ( _dwExecFlags & EXEC_FLAG_REDIRECT_ONLY ); }
  115. BOOL NoIsaWildcards( VOID ) const
  116. { return ( _dwExecFlags & EXEC_FLAG_NO_ISA_WILDCARDS ); }
  117. BOOL IsRunningDAV( VOID) const
  118. { return ( _dwExecFlags & EXEC_FLAG_RUNNING_DAV ); }
  119. BOOL IsCustomError( VOID ) const
  120. { return ( _dwExecFlags & EXEC_FLAG_CUSTOM_ERROR ) ; }
  121. BOOL IsNPH( VOID ) const
  122. { return ( _dwExecFlags & EXEC_FLAG_CGI_NPH ) ; }
  123. STR* QueryAppPath( VOID );
  124. };
  125. # endif // _EXECDESC_HXX_
  126. /************************ End of File ***********************/