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.

238 lines
9.6 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. stdafx.h
  5. Abstract:
  6. Include file for standard system include files,
  7. or project specific include files that are used frequently,
  8. but are changed infrequently
  9. Revision History:
  10. Ghim-Sim Chua (gschua) 07/07/99
  11. created
  12. ******************************************************************************/
  13. #if !defined(AFX_STDAFX_H__9C155541_7DB5_11D3_A14F_00C04F45E825__INCLUDED_)
  14. #define AFX_STDAFX_H__9C155541_7DB5_11D3_A14F_00C04F45E825__INCLUDED_
  15. #include <module.h>
  16. #include <windows.h>
  17. #include <winbase.h>
  18. #include <conio.h>
  19. #include <fstream.h>
  20. #include <io.h>
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23. #include <string.h>
  24. #include <sys/stat.h>
  25. #include <sys/types.h>
  26. // Trace Stuff
  27. #include <HCP_trace.h>
  28. #include <MPC_main.h>
  29. #include <MPC_utils.h> // Several utility things, also includes Mpc_common.
  30. #include <MPC_xml.h>
  31. #include <MPC_com.h>
  32. #include <MPC_streams.h>
  33. #include <SvcResource.h>
  34. #include <locres.h>
  35. #include <HCAppRes.h>
  36. #include <ProjectConstants.h>
  37. //
  38. // From HelpServiceTypeLib.idl
  39. //
  40. #include <HelpServiceTypeLib.h>
  41. #include <MergedHHK.h>
  42. #include <ContentStoreMgr.h>
  43. #include <SAFLib.h>
  44. #include <NewsLib.h>
  45. #include <seconfig.h>
  46. #include <SearchEngineLib.h>
  47. #include <Service.h>
  48. #include <Utility.h>
  49. #include <SvcUtils.h>
  50. #include <PCHUpdate.h>
  51. ////////////////////////////////////////////////////////////////////////////////
  52. //
  53. // Define macros
  54. //
  55. #define PCH_MACRO_CHECK_STRINGW(hr, szString, uErrorMsg) \
  56. if(szString == NULL || wcslen(szString) == 0) \
  57. { \
  58. HCUpdate::Engine::WriteLog( hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), uErrorMsg ); \
  59. __MPC_FUNC_LEAVE; \
  60. }
  61. #define PCH_MACRO_CHECK_STRINGA(hr, szString, uErrorMsg) \
  62. if(szString == NULL || strlen(szString) == 0) \
  63. { \
  64. HCUpdate::Engine::WriteLog( hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), uErrorMsg ); \
  65. __MPC_FUNC_LEAVE; \
  66. }
  67. #define PCH_MACRO_CHECK_STRING(hr, szString, uErrorMsg) \
  68. if(szString.size() == 0) \
  69. { \
  70. HCUpdate::Engine::WriteLog( hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), uErrorMsg ); \
  71. __MPC_FUNC_LEAVE; \
  72. }
  73. #if DEBUG
  74. #define PCH_MACRO_DEBUG( str ) WriteLog( S_OK, str )
  75. #define PCH_MACRO_DEBUG2( str, arg ) WriteLog( S_OK, str, arg )
  76. #else
  77. #define PCH_MACRO_DEBUG( str )
  78. #define PCH_MACRO_DEBUG2( str, arg )
  79. #endif
  80. #define PCH_MACRO_CHECK_ABORT(hr) if(IsAborted()) __MPC_SET_ERROR_AND_EXIT(hr, E_ABORT)
  81. ////////////////////////////////////////////////////////////////////////////////
  82. #define PCH_SAFETYMARGIN (20*1024*1024)
  83. #define PCH_STR_TRUE L"true"
  84. #define PCH_STR_FALSE L"false"
  85. #define PCH_MSFT_DN HC_MICROSOFT_DN
  86. #define PCH_STR_VENDOR_PATH HC_ROOT_HELPSVC_VENDORS
  87. #define PCH_STR_SYS_PATH HC_ROOT_HELPSVC_SYSTEM
  88. #define PCH_STR_VENDOR_URL L"hcp://%s/%s"
  89. #define PCH_STR_SCOPE_DEFAULT L"<SYSTEM>"
  90. ////////////////////////////////////////////////////////////////////////////////
  91. #define PCH_TAG_ACTION L"ACTION"
  92. #define PCH_TAG_FILE L"FILE"
  93. #define PCH_TAG_SOURCE L"SOURCE"
  94. #define PCH_TAG_URI L"URI"
  95. #define PCH_TAG_SYS L"SYS"
  96. #define PCH_TAG_SYSHELP L"SYSHELP"
  97. #define PCH_XQL_SAF L"./CONFIG/SAF"
  98. #define PCH_XQL_INSTALLFILE L"./INSTALL_CONTENT/FILE"
  99. #define PCH_XQL_TRUSTED L"./TRUSTED_CONTENT/TRUSTED"
  100. #define PCH_XQL_HHT L"./METADATA/HHT"
  101. #define PCH_XQL_SE L"./SEARCHENGINES/WRAPPER"
  102. #define PCH_TAG_SE_ID L"ID"
  103. #define PCH_TAG_SE_CLSID L"CLSID"
  104. #define PCH_TAG_SE_DATA L"DATA"
  105. ////////////////////////////////////////////////////////////////////////////////
  106. #define PCH_XQL_OEM L"./NODEOWNERS/OWNER"
  107. #define PCH_TAG_OEM_DN L"DN"
  108. #define PCH_XQL_SCOPES L"./SCOPE_DEFINITION/SCOPE"
  109. #define PCH_TAG_SCOPE_ID L"ID"
  110. #define PCH_TAG_SCOPE_NAME L"DISPLAYNAME"
  111. #define PCH_TAG_SCOPE_CATEGORY L"CATEGORY"
  112. #define PCH_XQL_FTS L"./FTS/HELPFILE"
  113. #define PCH_XQL_INDEX L"./INDEX/HELPFILE"
  114. #define PCH_XQL_HELPIMAGE L"./HELPIMAGE/HELPFILE"
  115. #define PCH_TAG_HELPFILE_CHM L"CHM"
  116. #define PCH_TAG_HELPFILE_CHQ L"CHQ"
  117. #define PCH_TAG_HELPFILE_HHK L"HHK"
  118. #define PCH_TAG_HELPFILE_SCOPE L"SCOPE"
  119. #define PCH_TAG_HELPFILE_OTHER L"OTHER"
  120. #define PCH_XQL_STOPSIGN L"./STOPSIGN_ENTRIES/STOPSIGN"
  121. #define PCH_TAG_STOPSIGN_CONTEXT L"CONTEXT"
  122. #define PCH_TAG_STOPSIGN_STOPSIGN L"STOPSIGN"
  123. #define PCH_XQL_STOPWORD L"./STOPWORD_ENTRIES/STOPWORD"
  124. #define PCH_TAG_STOPWORD_STOPWORD L"STOPWORD"
  125. #define PCH_XQL_OPERATOR L"./OPERATOR_ENTRIES/OPERATOR"
  126. #define PCH_TAG_OPERATOR_OPERATION L"OPERATION"
  127. #define PCH_TAG_OPERATOR_OPERATOR L"OPERATOR"
  128. #define PCH_XQL_SYNSET L"./SYNTABLE/SYNSET"
  129. #define PCH_TAG_SYNSET_ID L"ID"
  130. #define PCH_XQL_SYNONYM L"./SYNONYM"
  131. #define PCH_XQL_TAXONOMY L"./TAXONOMY_ENTRIES/TAXONOMY_ENTRY"
  132. #define PCH_TAG_TAXONOMY_CATEGORY L"CATEGORY"
  133. #define PCH_TAG_TAXONOMY_ENTRY L"ENTRY"
  134. #define PCH_TAG_TAXONOMY_URI L"URI"
  135. #define PCH_TAG_TAXONOMY_ICONURI L"ICONURI"
  136. #define PCH_TAG_TAXONOMY_TITLE L"TITLE"
  137. #define PCH_TAG_TAXONOMY_DESCRIPTION L"DESCRIPTION"
  138. #define PCH_TAG_TAXONOMY_TYPE L"TYPE"
  139. #define PCH_TAG_TAXONOMY_VISIBLE L"VISIBLE"
  140. #define PCH_TAG_TAXONOMY_SUBSITE L"SUBSITE"
  141. #define PCH_TAG_TAXONOMY_NAVMODEL L"NAVIGATIONMODEL"
  142. #define PCH_TAG_TAXONOMY_INSERTMODE L"INSERTMODE"
  143. #define PCH_TAG_TAXONOMY_INSERTLOCATION L"INSERTLOCATION"
  144. #define PCH_XQL_TOPIC_KEYWORDS L"./KEYWORD"
  145. #define PCH_TAG_KEYWORD_PRIORITY L"PRIORITY"
  146. #define PCH_TAG_KEYWORD_HHK L"HHK"
  147. ////////////////////////////////////////////////////////////////////////////////
  148. #define PCH_XQL_NEWSROOT L"./UPDATEHEADLINES/HEADLINE"
  149. #define PCH_TAG_NEWS_ICON L"ICON"
  150. #define PCH_TAG_NEWS_TITLE L"TITLE"
  151. #define PCH_TAG_NEWS_LINK L"LINK"
  152. #define PCH_TAG_NEWS_DESCRIPTION L"DESCRIPTION"
  153. #define PCH_TAG_NEWS_TIMEOUT L"TIMEOUT"
  154. #define PCH_TAG_NEWS_EXPIRYDATE L"EXPIRYDATE"
  155. ////////////////////////////////////////////////////////////////////////////////
  156. #define HCUPDATE_GETATTRIBUTE(hr,xml,name,var,fFound,node) \
  157. if(FAILED(hr = xml.GetAttribute( NULL, name, var, fFound, node )) || fFound == false) \
  158. { \
  159. if(fFound == false) hr = E_INVALIDARG; \
  160. WriteLog( hr, L"Error getting attribute '%s'", name ); __MPC_FUNC_LEAVE; \
  161. }
  162. #define HCUPDATE_GETATTRIBUTE_OPT(hr,xml,name,var,fFound,node) \
  163. if(FAILED(hr = xml.GetAttribute( NULL, name, var, fFound, node ))) \
  164. { \
  165. PCH_MACRO_DEBUG2( L"Error getting attribute '%s'", name ); \
  166. }
  167. #define HCUPDATE_BEGIN_TRANSACTION(hr,trans) \
  168. if(FAILED(hr = trans.Begin( m_sess ))) \
  169. { \
  170. WriteLog(hr, L"Error beginning transaction" ); __MPC_FUNC_LEAVE; \
  171. }
  172. #define HCUPDATE_COMMIT_TRANSACTION(hr,trans) \
  173. if(FAILED(hr = trans.Commit())) \
  174. { \
  175. WriteLog(hr, L"Error committing transaction" ); __MPC_FUNC_LEAVE; \
  176. }
  177. ////////////////////////////////////////////////////////////////////////////////
  178. //{{AFX_INSERT_LOCATION}}
  179. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  180. #endif // !defined(AFX_STDAFX_H__9C155541_7DB5_11D3_A14F_00C04F45E825__INCLUDED)