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.

317 lines
14 KiB

  1. #pragma once
  2. /****************************************************************************
  3. MsoDW.h
  4. Owner: MRuhlen
  5. Copyright (c) 1999 Microsoft Corporation
  6. This files contains the handshake structure with which apps will launch
  7. DW (aka OfficeWatson, aka whatever the marketroids call it)
  8. ****************************************************************************/
  9. #ifndef MSODW_H
  10. #define MSODW_H
  11. #pragma pack(push, msodw_h)
  12. #pragma pack(4)
  13. #define DW_TIMEOUT_VALUE 20000
  14. #define DW_MUTEX_TIMEOUT DW_TIMEOUT_VALUE / 2
  15. #define DW_NOTIFY_TIMEOUT 120000 // 2 minutes
  16. #define DW_MAX_ASSERT_CCH 1024
  17. #define DW_MAX_PATH 260
  18. #define DW_APPNAME_LENGTH 56
  19. #define DW_MAX_SERVERNAME DW_MAX_PATH
  20. #define DW_MAX_ERROR_CWC 260 // must be at least max_path
  21. #define DW_MAX_REGSUBPATH 200
  22. #define DW_CMDLINE_RESPONSE "DwResponse="
  23. #define DW_CMDLINE_REPORT "DwReportResponse="
  24. #define DW_ALLMODULES L"*\0"
  25. #define DW_WHISTLER_EVENTLOG_SOURCE L"Application Error"
  26. // the following are the fields that can be specified in a manifest file to
  27. // launch DW in a file based reporting mode
  28. // these are required
  29. #define DW_MANIFEST_TITLENAME L"TitleName="
  30. #define DW_MANIFEST_ERRORTEXT L"ErrorText="
  31. #define DW_MANIFEST_HDRTEXT L"HeaderText="
  32. #define DW_MANIFEST_ERRORSIG L"ErrorSig="
  33. #define DW_MANIFEST_ERRORDETAIL L"ErrorDetail="
  34. #define DW_MANIFEST_SERVERNAME L"Server="
  35. #define DW_MANIFEST_URL2 L"Stage2URL="
  36. #define DW_MANIFEST_LCID L"UI LCID="
  37. #define DW_MANIFEST_DATAFILES L"DataFiles="
  38. // the following are optional, DW has default behavior for all of these
  39. #define DW_MANIFEST_FLAGS L"Flags="
  40. #define DW_MANIFEST_BRAND L"Brand="
  41. #define DW_MANIFEST_EVENTSOURCE L"EventLogSource="
  42. #define DW_MANIFEST_EVENTID L"EventID="
  43. #define DW_MANIFEST_URL1 L"Stage1URL="
  44. #define DW_MANIFEST_ERRORSUBPATH L"ErrorSubPath="
  45. #define DW_MANIFEST_REGSUBPATH L"RegSubPath="
  46. #define DW_MANIFEST_DIGPIDPATH L"DigPidRegPath="
  47. #define DW_MANIFEST_ICONFILE L"IconFile="
  48. #define DW_MANIFEST_CAPTION L"Caption="
  49. #define DW_MANIFEST_REPORTEE L"Reportee="
  50. #define DW_MANIFEST_PLEA L"Plea="
  51. #define DW_MANIFEST_REPORTBTN L"ReportButton="
  52. #define DW_MANIFEST_NOREPORTBTN L"NoReportButton="
  53. // Seperator for file lists (Manifest DataFiles and Exception Additional Files
  54. #define DW_FILESEPA '|'
  55. #define DW_FILESEP_X(X) L##X
  56. #define DW_FILESEP_Y(X) DW_FILESEP_X(X)
  57. #define DW_FILESEP DW_FILESEP_Y(DW_FILESEPA)
  58. #ifdef DEBUG
  59. enum // AssertActionCodes
  60. {
  61. DwAssertActionFail = 0,
  62. DwAssertActionDebug,
  63. DwAssertActionIgnore,
  64. DwAssertActionAlwaysIgnore,
  65. DwAssertActionIgnoreAll,
  66. DwAssertActionQuit,
  67. };
  68. #endif
  69. // Caller is the app that has experienced an exception and launches DW
  70. enum // ECrashTimeDialogStates // msoctds
  71. {
  72. msoctdsNull = 0x00000000,
  73. msoctdsQuit = 0x00000001,
  74. msoctdsRestart = 0x00000002,
  75. msoctdsRecover = 0x00000004,
  76. msoctdsUnused = 0x00000008,
  77. msoctdsDebug = 0x00000010,
  78. };
  79. #define MSODWRECOVERQUIT (msoctdsRecover | msoctdsQuit)
  80. #define MSODWRESTARTQUIT (msoctdsRestart | msoctdsQuit)
  81. #define MSODWRESPONSES (msoctdsQuit | msoctdsRestart | msoctdsRecover)
  82. // THIS IS PHASED OUT -- DON'T USE
  83. enum // EMsoCrashHandlerFlags // msochf
  84. {
  85. msochfNull = 0x00000000,
  86. msochfUnused = msoctdsUnused, // THESE MUST BE THE SAME
  87. msochfCanRecoverDocuments = msoctdsRecover,
  88. msochfObsoleteCanDebug = 0x00010001, // not used anymore
  89. msochfCannotSneakyDebug = 0x00010002, // The "hidden" debug feature won't work
  90. msochfDefaultDontReport = 0x00010004,
  91. msochReportingDisabled = 0x00010008, // User cannot change default reporting choice
  92. };
  93. //
  94. enum // EMsoCrashHandlerResults // msochr
  95. {
  96. msochrNotHandled = msoctdsNull,
  97. msochrUnused = msoctdsUnused,
  98. msochrDebug = msoctdsDebug,
  99. msochrRecoverDocuments = msoctdsRecover,
  100. msochrRestart = msoctdsRestart,
  101. msochrQuit = msoctdsQuit,
  102. };
  103. enum // EDwBehaviorFlags
  104. {
  105. fDwOfficeApp = 0x00000001,
  106. fDwNoReporting = 0x00000002, // don't report
  107. fDwCheckSig = 0x00000004, // checks the signatures of the App/Mod list
  108. fDwGiveAppResponse = 0x00000008, // hands szResponse to app on command line
  109. fDwWhistler = 0x00000010, // Whistler's exception handler is caller
  110. fDwUseIE = 0x00000020, // always launch w/ IE
  111. fDwDeleteFiles = 0x00000040, // delete the additional files after use.
  112. fDwHeadless = 0x00000080, // DW will auto-report. policy required to enable
  113. fDwUseHKLM = 0x00000100, // DW reg from HKLM instead of HKCU
  114. fDwUseLitePlea = 0x00000200, // DW won't suggest product change in report plea
  115. fDwUsePrivacyHTA = 0x00000400, // DW won't suggest product change in report plea
  116. fDwManifestDebug = 0x00000800, // DW will provide a debug button in manifset mode
  117. fDwReportChoice = 0x00001000, // DW will tack on the command line of the user
  118. fDwSkipBucketLog = 0x00002000, // DW won't log at bucket-time
  119. fDwNoDefaultCabLimit = 0x00004000, // DW under CER won't use 5 as the fallback but unlimited instead (policy still overrides)
  120. fDwAllowSuspend = 0x00008000, // DW will allow powersave mode to suspend it, as long as we're not in reporting phase
  121. fDwMiniDumpWithUnloadedModules = 0x00010000, // DW will pass MiniDumpWithUnloadedModules to the minidump API
  122. };
  123. typedef struct _DWSharedMem10
  124. {
  125. DWORD dwSize; // should be set to size of DWSharedMem
  126. DWORD pid; // Process Id of caller
  127. DWORD tid; // Id of excepting thread
  128. DWORD_PTR eip; // EIP of the excepting instruction
  129. PEXCEPTION_POINTERS pep; // Exception pointers given to the callee's
  130. // exception handler
  131. HANDLE hEventDone; // event DW signals when done
  132. // caller will also signal this if it things
  133. // DW has hung and restarts itself
  134. HANDLE hEventNotifyDone; // App sets when it's done w/ notifcation phase
  135. HANDLE hEventAlive; // heartbeat event DW signals per EVENT_TIMEOUT
  136. HANDLE hMutex; // to protect the signaling of EventDone
  137. HANDLE hProc; // handle to the calling process (! in Assert)
  138. DWORD bfDWBehaviorFlags; // controls caller-specific behaviors
  139. DWORD msoctdsResult; // result from crash-time dialog
  140. BOOL fReportProblem; // did user approve reporting?
  141. DWORD bfmsoctdsOffer; // bitfield of user choices to offer
  142. // note that you must specify two of:
  143. // Quit, Restart, Recover, Ignore
  144. // The Debug choice is independent
  145. DWORD bfmsoctdsNotify; // bitfield of user choices for which the
  146. // app wants control back instead of simply being
  147. // terminated by DW. The app will then be
  148. // responsible for pinging DW (if desired) with
  149. // hEventAlive and for notify DW it's ok to
  150. // terminate the app w/ hEventDone
  151. DWORD bfmsoctdsLetRun; // bitfield of user choices for which the
  152. // app wants control back instead of being
  153. // terminated by DW. DW can then safely ignore
  154. // the app and exit.
  155. int iPingCurrent; // current count for the recovery progress bar
  156. int iPingEnd; // index for the end of the recovery progress bar
  157. char szFormalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Microsoft Word")
  158. char szInformalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Word")
  159. char szModuleFileName[DW_MAX_PATH]; // The result of GetModuleFileNameA(NULL)
  160. WCHAR wzErrorMessage[DW_MAX_ERROR_CWC]; // Error message to show user.
  161. char szServer[DW_MAX_SERVERNAME]; // name of server to try by default
  162. char szLCIDKeyValue[DW_MAX_PATH]; // name of key value DWORD containing the
  163. // PlugUI LCID, if this string fails to
  164. // be a valid key-value, DW will use the
  165. // system LCID, and if it can't find
  166. // an intl dll for that, will fall
  167. // back on US English (1033)
  168. char szPIDRegKey[DW_MAX_PATH]; // name of the key that holds the PID
  169. // can be used by the Server for
  170. // spoof-detection
  171. char szRegSubPath[DW_MAX_REGSUBPATH]; // path to the key to contian the DW
  172. // registry hive from both
  173. // HKCU\Software and
  174. // HKCU\Software\Policies (for policy)
  175. WCHAR wzDotDataDlls[DW_MAX_PATH]; // contains the list of DLLs, terminated
  176. // by '\0' characters, that DW will
  177. // collect the .data sections into the
  178. // full minidump version
  179. // e.g. "mso9.dll\0outllib.dll\0"
  180. WCHAR wzAdditionalFile[1024]; // File list, seperated by DW_FILESEP
  181. // each of these files gets added to the
  182. // cab at upload time
  183. char szBrand[DW_APPNAME_LENGTH]; // passed as a param to Privacy Policy link
  184. #ifdef DEBUG
  185. // for Assert communication
  186. DWORD dwTag; // [in] AssertTag
  187. char szFile[DW_MAX_PATH]; // [in] File name of the assert
  188. int line; // [in] Line number of the assert
  189. char szAssert[DW_MAX_ASSERT_CCH]; // [in] Sz from the assert
  190. int AssertActionCode; // [out] action code to take
  191. #endif
  192. } DWSharedMem10;
  193. typedef struct _DWSharedMem15
  194. {
  195. DWORD dwSize; // should be set to size of DWSharedMem
  196. DWORD pid; // Process Id of caller
  197. DWORD tid; // Id of excepting thread
  198. DWORD_PTR eip; // EIP of the excepting instruction
  199. PEXCEPTION_POINTERS pep; // Exception pointers given to the callee's
  200. // exception handler
  201. HANDLE hEventDone; // event DW signals when done
  202. // caller will also signal this if it things
  203. // DW has hung and restarts itself
  204. HANDLE hEventNotifyDone; // App sets when it's done w/ notifcation phase
  205. HANDLE hEventAlive; // heartbeat event DW signals per EVENT_TIMEOUT
  206. HANDLE hMutex; // to protect the signaling of EventDone
  207. HANDLE hProc; // handle to the calling process (! in Assert)
  208. DWORD bfDWBehaviorFlags; // controls caller-specific behaviors
  209. DWORD msoctdsResult; // result from crash-time dialog
  210. BOOL fReportProblem; // did user approve reporting?
  211. DWORD bfmsoctdsOffer; // bitfield of user choices to offer
  212. // note that you must specify two of:
  213. // Quit, Restart, Recover, Ignore
  214. // The Debug choice is independent
  215. DWORD bfmsoctdsNotify; // bitfield of user choices for which the
  216. // app wants control back instead of simply being
  217. // terminated by DW. The app will then be
  218. // responsible for pinging DW (if desired) with
  219. // hEventAlive and for notify DW it's ok to
  220. // terminate the app w/ hEventDone
  221. DWORD bfmsoctdsLetRun; // bitfield of user choices for which the
  222. // app wants control back instead of being
  223. // terminated by DW. DW can then safely ignore
  224. // the app and exit.
  225. int iPingCurrent; // current count for the recovery progress bar
  226. int iPingEnd; // index for the end of the recovery progress bar
  227. WCHAR wzFormalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Microsoft Word")
  228. WCHAR wzModuleFileName[DW_MAX_PATH]; // The result of GetModuleFileName(NULL)
  229. WCHAR wzErrorMessage[DW_MAX_ERROR_CWC]; // (optional) Error details message to show user.
  230. WCHAR wzErrorText[DW_MAX_ERROR_CWC]; // (optional) substitue error text (e.g. "you might have lost information")
  231. WCHAR wzCaption[DW_MAX_ERROR_CWC]; // (optional) substitue caption
  232. WCHAR wzHeader[DW_MAX_ERROR_CWC]; // (optional) substitue main dialog header text
  233. WCHAR wzReportee[DW_APPNAME_LENGTH]; // (optional) on whom's behalf we request the report
  234. WCHAR wzPlea[DW_MAX_ERROR_CWC]; // (optional) substitue report plea text
  235. WCHAR wzReportBtn[DW_APPNAME_LENGTH]; // (optional) substitue "Report Problem" text
  236. WCHAR wzNoReportBtn[DW_APPNAME_LENGTH]; // (optional) substitue "Don't Report" text
  237. char szServer[DW_MAX_SERVERNAME]; // name of server to try by default
  238. char szLCIDKeyValue[DW_MAX_PATH]; // name of key value DWORD containing the
  239. // PlugUI LCID, if this string fails to
  240. // be a valid key-value, DW will use the
  241. // system LCID, and if it can't find
  242. // an intl dll for that, will fall
  243. // back on US English (1033)
  244. char szPIDRegKey[DW_MAX_PATH]; // name of the key that holds the PID
  245. // can be used by the Server for
  246. // spoof-detection
  247. LCID lcidUI; // will try this UI langauge if non-zero
  248. char szRegSubPath[DW_MAX_REGSUBPATH]; // path to the key to contian the DW
  249. // registry hive from both
  250. // HKCU\Software and
  251. // HKCU\Software\Policies (for policy)
  252. WCHAR wzDotDataDlls[DW_MAX_PATH]; // contains the list of DLLs, terminated
  253. // by '\0' characters, that DW will
  254. // collect the .data sections into the
  255. // full minidump version
  256. // e.g. "mso9.dll\0outllib.dll\0"
  257. WCHAR wzAdditionalFile[1024]; // File list, seperated by DW_FILESEP
  258. // each of these files gets added to the
  259. // cab at upload time
  260. char szBrand[DW_APPNAME_LENGTH]; // passed as a param to Privacy Policy link
  261. #ifdef DEBUG
  262. // for Assert communication
  263. DWORD dwTag; // [in] AssertTag
  264. char szFile[DW_MAX_PATH]; // [in] File name of the assert
  265. int line; // [in] Line number of the assert
  266. char szAssert[DW_MAX_ASSERT_CCH]; // [in] Sz from the assert
  267. int AssertActionCode; // [out] action code to take
  268. #endif
  269. } DWSharedMem15, DWSharedMem;
  270. #pragma pack(pop, msodw_h)
  271. #endif // MSODW_H