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.

158 lines
4.4 KiB

  1. /*===================================================================
  2. Microsoft Denali
  3. Microsoft Confidential.
  4. Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. Component: Hit Manager
  6. File: Denali.h
  7. Owner: PramodD
  8. This is the Hit (Request) Manager header file.
  9. ===================================================================*/
  10. #ifndef DENALI_H
  11. #define DENALI_H
  12. //#define LOG_FCNOTIFICATIONS // logs file change notifications to a file
  13. #include "Hitobj.h"
  14. #include "CacheMgr.h"
  15. #include "Request.h"
  16. extern BOOL g_fShutDownInProgress;
  17. inline IsShutDownInProgress()
  18. {
  19. return g_fShutDownInProgress;
  20. }
  21. // de-comment the following line to build with no perfmon counters
  22. //#define PERF_DISABLE
  23. DWORD HandleHit(CIsapiReqInfo *pIReq);
  24. //void InitODBC( void );
  25. //void UnInitODBC( void );
  26. extern BOOL g_fOOP;
  27. /* inlines to implement ISA per-thread bracketing in OOP case
  28. */
  29. inline HRESULT StartISAThreadBracket(CIsapiReqInfo *pIReq)
  30. {
  31. if (g_fOOP && pIReq)
  32. {
  33. HRESULT hr = pIReq->ISAThreadNotify(TRUE);
  34. if (FAILED(hr))
  35. return hr;
  36. }
  37. return S_OK;
  38. }
  39. inline void EndISAThreadBracket(CIsapiReqInfo *pIReq)
  40. {
  41. if (g_fOOP && pIReq)
  42. {
  43. pIReq->ISAThreadNotify(FALSE);
  44. }
  45. }
  46. extern HINSTANCE g_hinstDLL;
  47. /* intrinsic object names (bug 164)
  48. NOTE to add an intrinsic object to denali, follow these steps:
  49. 1. add both sz and wsz versions of the object name below
  50. 2. add a check for the sz version of the object name in CTemplate::FValidObjectName
  51. */
  52. #define CONCAT(a, b) a ## b
  53. #define WSZ(x) CONCAT(L, x)
  54. #define SZ_OBJ_APPLICATION "Application"
  55. #define SZ_OBJ_REQUEST "Request"
  56. #define SZ_OBJ_RESPONSE "Response"
  57. #define SZ_OBJ_SERVER "Server"
  58. #define SZ_OBJ_CERTIFICATE "Certificate"
  59. #define SZ_OBJ_SESSION "Session"
  60. #define SZ_OBJ_SCRIPTINGNAMESPACE "ScriptingNamespace"
  61. #define SZ_OBJ_OBJECTCONTEXT "ObjectContext"
  62. #define SZ_OBJ_ASPPAGETLB "ASPPAGETLB"
  63. #define SZ_OBJ_ASPGLOBALTLB "ASPGLOBALTLB"
  64. #define WSZ_OBJ_APPLICATION WSZ(SZ_OBJ_APPLICATION)
  65. #define WSZ_OBJ_REQUEST WSZ(SZ_OBJ_REQUEST)
  66. #define WSZ_OBJ_RESPONSE WSZ(SZ_OBJ_RESPONSE)
  67. #define WSZ_OBJ_SERVER WSZ(SZ_OBJ_SERVER)
  68. #define WSZ_OBJ_CERTIFICATE WSZ(SZ_OBJ_CERTIFICATE)
  69. #define WSZ_OBJ_SESSION WSZ(SZ_OBJ_SESSION)
  70. #define WSZ_OBJ_SCRIPTINGNAMESPACE WSZ(SZ_OBJ_SCRIPTINGNAMESPACE)
  71. #define WSZ_OBJ_OBJECTCONTEXT WSZ(SZ_OBJ_OBJECTCONTEXT)
  72. #define WSZ_OBJ_ASPPAGETLB WSZ(SZ_OBJ_ASPPAGETLB)
  73. #define WSZ_OBJ_ASPGLOBALTLB WSZ(SZ_OBJ_ASPGLOBALTLB)
  74. #define BSTR_OBJ_APPLICATION g_bstrApplication
  75. #define BSTR_OBJ_REQUEST g_bstrRequest
  76. #define BSTR_OBJ_RESPONSE g_bstrResponse
  77. #define BSTR_OBJ_SERVER g_bstrServer
  78. #define BSTR_OBJ_CERTIFICATE g_bstrCertificate
  79. #define BSTR_OBJ_SESSION g_bstrSession
  80. #define BSTR_OBJ_SCRIPTINGNAMESPACE g_bstrScriptingNamespace
  81. #define BSTR_OBJ_OBJECTCONTEXT g_bstrObjectContext
  82. // Cached BSTRs
  83. extern BSTR g_bstrApplication;
  84. extern BSTR g_bstrRequest;
  85. extern BSTR g_bstrResponse;
  86. extern BSTR g_bstrServer;
  87. extern BSTR g_bstrCertificate;
  88. extern BSTR g_bstrSession;
  89. extern BSTR g_bstrScriptingNamespace;
  90. extern BSTR g_bstrObjectContext;
  91. // Session ID Cookie
  92. // consist of 12 char literal constant and 8 hex process ID
  93. #define CCH_SESSION_ID_COOKIE 20
  94. #define CCH_SESSION_ID_COOKIE_PREFIX 12
  95. #define SZ_SESSION_ID_COOKIE_PREFIX "ASPSESSIONID"
  96. extern char g_szSessionIDCookieName[];
  97. // CLIENT DEBUG (flag) Cookie
  98. #define SZ_CLIENT_DEBUG_COOKIE "ASPCLIENTDEBUG"
  99. // Dll name
  100. #define ASP_DLL_NAME "ASP.DLL"
  101. // Max # of bytes we will allocate before we assume an attack by a malicious browser
  102. #define REQUEST_ALLOC_MAX (100 * 1024)
  103. #define SZ_GLOBAL_ASA _T("GLOBAL.ASA")
  104. #define CCH_GLOBAL_ASA 10
  105. /*
  106. * InitializeCriticalSection can throw. Use this macro instead
  107. */
  108. #define ErrInitCriticalSection( cs, hr ) \
  109. do { \
  110. hr = S_OK; \
  111. __try \
  112. { \
  113. INITIALIZE_CRITICAL_SECTION(cs); \
  114. } \
  115. __except(1) \
  116. { \
  117. hr = E_UNEXPECTED; \
  118. } \
  119. } while (0)
  120. #ifdef LOG_FCNOTIFICATIONS
  121. void LfcnCreateLogFile();
  122. void LfcnCopyAdvance(char** ppchDest, const char* sz);
  123. void LfcnAppendLog(const char* sz);
  124. void LfcnLogNotification(char* szFile);
  125. void LfcnLogHandleCreation(int i, char* szApp);
  126. void LfcnUnmapLogFile();
  127. #endif //LOG_FCNOTIFICATIONS
  128. #endif // DENALI_H