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.

313 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_BLUEPATH "blue"
  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. };
  119. typedef struct _DWSharedMem10
  120. {
  121. DWORD dwSize; // should be set to size of DWSharedMem
  122. DWORD pid; // Process Id of caller
  123. DWORD tid; // Id of excepting thread
  124. DWORD_PTR eip; // EIP of the excepting instruction
  125. PEXCEPTION_POINTERS pep; // Exception pointers given to the callee's
  126. // exception handler
  127. HANDLE hEventDone; // event DW signals when done
  128. // caller will also signal this if it things
  129. // DW has hung and restarts itself
  130. HANDLE hEventNotifyDone; // App sets when it's done w/ notifcation phase
  131. HANDLE hEventAlive; // heartbeat event DW signals per EVENT_TIMEOUT
  132. HANDLE hMutex; // to protect the signaling of EventDone
  133. HANDLE hProc; // handle to the calling process (! in Assert)
  134. DWORD bfDWBehaviorFlags; // controls caller-specific behaviors
  135. DWORD msoctdsResult; // result from crash-time dialog
  136. BOOL fReportProblem; // did user approve reporting?
  137. DWORD bfmsoctdsOffer; // bitfield of user choices to offer
  138. // note that you must specify two of:
  139. // Quit, Restart, Recover, Ignore
  140. // The Debug choice is independent
  141. DWORD bfmsoctdsNotify; // bitfield of user choices for which the
  142. // app wants control back instead of simply being
  143. // terminated by DW. The app will then be
  144. // responsible for pinging DW (if desired) with
  145. // hEventAlive and for notify DW it's ok to
  146. // terminate the app w/ hEventDone
  147. DWORD bfmsoctdsLetRun; // bitfield of user choices for which the
  148. // app wants control back instead of being
  149. // terminated by DW. DW can then safely ignore
  150. // the app and exit.
  151. int iPingCurrent; // current count for the recovery progress bar
  152. int iPingEnd; // index for the end of the recovery progress bar
  153. char szFormalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Microsoft Word")
  154. char szInformalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Word")
  155. char szModuleFileName[DW_MAX_PATH]; // The result of GetModuleFileNameA(NULL)
  156. WCHAR wzErrorMessage[DW_MAX_ERROR_CWC]; // Error message to show user.
  157. char szServer[DW_MAX_SERVERNAME]; // name of server to try by default
  158. char szLCIDKeyValue[DW_MAX_PATH]; // name of key value DWORD containing the
  159. // PlugUI LCID, if this string fails to
  160. // be a valid key-value, DW will use the
  161. // system LCID, and if it can't find
  162. // an intl dll for that, will fall
  163. // back on US English (1033)
  164. char szPIDRegKey[DW_MAX_PATH]; // name of the key that holds the PID
  165. // can be used by the Server for
  166. // spoof-detection
  167. char szRegSubPath[DW_MAX_REGSUBPATH]; // path to the key to contian the DW
  168. // registry hive from both
  169. // HKCU\Software and
  170. // HKCU\Software\Policies (for policy)
  171. WCHAR wzDotDataDlls[DW_MAX_PATH]; // contains the list of DLLs, terminated
  172. // by '\0' characters, that DW will
  173. // collect the .data sections into the
  174. // full minidump version
  175. // e.g. "mso9.dll\0outllib.dll\0"
  176. WCHAR wzAdditionalFile[1024]; // File list, seperated by DW_FILESEP
  177. // each of these files gets added to the
  178. // cab at upload time
  179. char szBrand[DW_APPNAME_LENGTH]; // passed as a param to Privacy Policy link
  180. #ifdef DEBUG
  181. // for Assert communication
  182. DWORD dwTag; // [in] AssertTag
  183. char szFile[DW_MAX_PATH]; // [in] File name of the assert
  184. int line; // [in] Line number of the assert
  185. char szAssert[DW_MAX_ASSERT_CCH]; // [in] Sz from the assert
  186. int AssertActionCode; // [out] action code to take
  187. #endif
  188. } DWSharedMem10;
  189. typedef struct _DWSharedMem15
  190. {
  191. DWORD dwSize; // should be set to size of DWSharedMem
  192. DWORD pid; // Process Id of caller
  193. DWORD tid; // Id of excepting thread
  194. DWORD_PTR eip; // EIP of the excepting instruction
  195. PEXCEPTION_POINTERS pep; // Exception pointers given to the callee's
  196. // exception handler
  197. HANDLE hEventDone; // event DW signals when done
  198. // caller will also signal this if it things
  199. // DW has hung and restarts itself
  200. HANDLE hEventNotifyDone; // App sets when it's done w/ notifcation phase
  201. HANDLE hEventAlive; // heartbeat event DW signals per EVENT_TIMEOUT
  202. HANDLE hMutex; // to protect the signaling of EventDone
  203. HANDLE hProc; // handle to the calling process (! in Assert)
  204. DWORD bfDWBehaviorFlags; // controls caller-specific behaviors
  205. DWORD msoctdsResult; // result from crash-time dialog
  206. BOOL fReportProblem; // did user approve reporting?
  207. DWORD bfmsoctdsOffer; // bitfield of user choices to offer
  208. // note that you must specify two of:
  209. // Quit, Restart, Recover, Ignore
  210. // The Debug choice is independent
  211. DWORD bfmsoctdsNotify; // bitfield of user choices for which the
  212. // app wants control back instead of simply being
  213. // terminated by DW. The app will then be
  214. // responsible for pinging DW (if desired) with
  215. // hEventAlive and for notify DW it's ok to
  216. // terminate the app w/ hEventDone
  217. DWORD bfmsoctdsLetRun; // bitfield of user choices for which the
  218. // app wants control back instead of being
  219. // terminated by DW. DW can then safely ignore
  220. // the app and exit.
  221. int iPingCurrent; // current count for the recovery progress bar
  222. int iPingEnd; // index for the end of the recovery progress bar
  223. WCHAR wzFormalAppName[DW_APPNAME_LENGTH]; // the app name for display to user (ie "Microsoft Word")
  224. WCHAR wzModuleFileName[DW_MAX_PATH]; // The result of GetModuleFileName(NULL)
  225. WCHAR wzErrorMessage[DW_MAX_ERROR_CWC]; // (optional) Error details message to show user.
  226. WCHAR wzErrorText[DW_MAX_ERROR_CWC]; // (optional) substitue error text (e.g. "you might have lost information")
  227. WCHAR wzCaption[DW_MAX_ERROR_CWC]; // (optional) substitue caption
  228. WCHAR wzHeader[DW_MAX_ERROR_CWC]; // (optional) substitue main dialog header text
  229. WCHAR wzReportee[DW_APPNAME_LENGTH]; // (optional) on whom's behalf we request the report
  230. WCHAR wzPlea[DW_MAX_ERROR_CWC]; // (optional) substitue report plea text
  231. WCHAR wzReportBtn[DW_APPNAME_LENGTH]; // (optional) substitue "Report Problem" text
  232. WCHAR wzNoReportBtn[DW_APPNAME_LENGTH]; // (optional) substitue "Don't Report" text
  233. char szServer[DW_MAX_SERVERNAME]; // name of server to try by default
  234. char szLCIDKeyValue[DW_MAX_PATH]; // name of key value DWORD containing the
  235. // PlugUI LCID, if this string fails to
  236. // be a valid key-value, DW will use the
  237. // system LCID, and if it can't find
  238. // an intl dll for that, will fall
  239. // back on US English (1033)
  240. char szPIDRegKey[DW_MAX_PATH]; // name of the key that holds the PID
  241. // can be used by the Server for
  242. // spoof-detection
  243. LCID lcidUI; // will try this UI langauge if non-zero
  244. char szRegSubPath[DW_MAX_REGSUBPATH]; // path to the key to contian the DW
  245. // registry hive from both
  246. // HKCU\Software and
  247. // HKCU\Software\Policies (for policy)
  248. WCHAR wzDotDataDlls[DW_MAX_PATH]; // contains the list of DLLs, terminated
  249. // by '\0' characters, that DW will
  250. // collect the .data sections into the
  251. // full minidump version
  252. // e.g. "mso9.dll\0outllib.dll\0"
  253. WCHAR wzAdditionalFile[1024]; // File list, seperated by DW_FILESEP
  254. // each of these files gets added to the
  255. // cab at upload time
  256. char szBrand[DW_APPNAME_LENGTH]; // passed as a param to Privacy Policy link
  257. #if 0
  258. // for Assert communication
  259. DWORD dwTag; // [in] AssertTag
  260. char szFile[DW_MAX_PATH]; // [in] File name of the assert
  261. int line; // [in] Line number of the assert
  262. char szAssert[DW_MAX_ASSERT_CCH]; // [in] Sz from the assert
  263. int AssertActionCode; // [out] action code to take
  264. #endif
  265. } DWSharedMem15, DWSharedMem;
  266. #pragma pack(pop, msodw_h)
  267. #endif // MSODW_H