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.

456 lines
14 KiB

  1. // emsvc.idl : IDL source for emsvc.dll
  2. //
  3. // This file will be processed by the MIDL tool to
  4. // produce the type library (emsvc.tlb) and marshalling code.
  5. #define EM_MAX_PATH 256
  6. import "oaidl.idl";
  7. import "ocidl.idl";
  8. [
  9. uuid(93409732-67DE-4B5F-BCEA-ADEF6D8F5596),
  10. version(1.0),
  11. helpstring("emsvc 1.0 Type Library")
  12. ]
  13. library EMSVCLib
  14. {
  15. importlib("stdole2.tlb");
  16. //
  17. // Debug Session Types
  18. //
  19. typedef enum SessionType {
  20. SessType_Automatic,
  21. // SessType_Recursive,
  22. SessType_Manual
  23. } SessionType;
  24. enum DebugExLParams {
  25. // When this flag is set, Automatic session will
  26. // be started in recursive mode.
  27. RECURSIVE_MODE = 1 << 0,
  28. // If this flag is set, mini dump will be
  29. // generated soon after the session gets started.
  30. PRODUCE_MINI_DUMP = 1 << 1,
  31. // User dump will be generated soon after the
  32. // session gets started.
  33. PRODUCE_USER_DUMP = 1 << 2,
  34. //
  35. BLOCK_INCOMING_IPCALLS = 1 << 3,
  36. };
  37. //
  38. // Objects in the EM System
  39. //
  40. typedef enum EmObjectType {
  41. // invalid object
  42. EMOBJ_UNKNOWNOBJECT = 0,
  43. // Services registered in the system
  44. EMOBJ_SERVICE = 1<<0,
  45. // Running processes (precludes Services)
  46. EMOBJ_PROCESS = 1<<1,
  47. // Log files created by dbgengine
  48. EMOBJ_LOGFILE = 1<<2,
  49. // Mini Dump files created by dbgengine
  50. EMOBJ_MINIDUMP = 1<<3,
  51. // User Dump files created by dbgengine
  52. EMOBJ_USERDUMP = 1<<4,
  53. // ecx files
  54. EMOBJ_CMDSET = 1<<5,
  55. // msinfo files
  56. EMOBJ_MSINFO = 1<<6
  57. } EmObjectType;
  58. //
  59. // EmObject Fields
  60. //
  61. typedef enum EmObjectFields {
  62. // "type" of the EmObject
  63. EMOBJ_FLD_TYPE = 1<<0,
  64. // "type2" of the EmObject
  65. EMOBJ_FLD_TYPE2 = 1<<1,
  66. // "guidstream" of the EmObject
  67. EMOBJ_FLD_GUIDSTREAM = 1<<2,
  68. // "nId" of the EmObject
  69. EMOBJ_FLD_NID = 1<<3,
  70. // "szName" of the EmObject
  71. EMOBJ_FLD_SZNAME = 1<<4,
  72. // "szSecName" of the EmObject
  73. EMOBJ_FLD_SZSECNAME = 1<<5,
  74. // "nStatus" of the EmObject
  75. EMOBJ_FLD_NSTATUS = 1<<6,
  76. // "dateStart" of the EmObject
  77. EMOBJ_FLD_DATESTART = 1<<7,
  78. // "dateEnd" of the EmObject
  79. EMOBJ_FLD_DATEEND = 1<<8,
  80. // "szBucket1" of the EmObject
  81. EMOBJ_FLD_SZBUCKET1 = 1<<9,
  82. // "dwBucket1" of the EmObject
  83. EMOBJ_FLD_DWBUCKET1 = 1<<10,
  84. // "hr" of the EmObject
  85. EMOBJ_FLD_HR = 1<<11,
  86. // all the members of EmObject
  87. EMOBJ_FLD_ALL = 0xffff,
  88. // none of the members of EmObject
  89. EMOBJ_FLD_NONE = 0x0
  90. } EmObjectFields;
  91. //
  92. // EmObject layout
  93. //
  94. typedef struct EmObject {
  95. // EmObjectType
  96. short type;
  97. // type2
  98. short type2;
  99. // GUID
  100. unsigned char guidstream [ 16 ];
  101. // numeric id
  102. LONG nId;
  103. // Basic name of this object
  104. TCHAR szName [ EM_MAX_PATH ];
  105. // Secondary name
  106. TCHAR szSecName [ EM_MAX_PATH ];
  107. // Status of this object
  108. LONG nStatus;
  109. // Start time
  110. DATE dateStart;
  111. // End time
  112. DATE dateEnd;
  113. // general purpose storage
  114. TCHAR szBucket1 [64];
  115. // general purpose storage
  116. DWORD dwBucket1;
  117. // error value recorded when an error occurs
  118. HRESULT hr;
  119. } EmObject, *PEmObject, **PPEmObject;
  120. //
  121. // Column definition
  122. // - EMOBJ_SERVICE
  123. // - EMOBJ_PROCESS
  124. //
  125. enum {
  126. EXE_COL_TYPE,
  127. EXE_COL_ID,
  128. EXE_COL_NAME,
  129. EXE_COL_DESCRIPTION,
  130. EXE_COL_STATUS,
  131. EXE_COL_STARTDATE,
  132. EXE_COL_ENDDATE,
  133. };
  134. //
  135. // Column definition
  136. // - EMOBJ_LOGFILE
  137. // - EMOBJ_USERDUMP
  138. // - EMOBJ_MINIDUMP
  139. // - EMOBJ_CMDSET
  140. enum {
  141. FILE_COL_TYPE,
  142. FILE_COL_NAME,
  143. FILE_COL_SIZE,
  144. FILE_COL_DESCRIPTION,
  145. };
  146. //
  147. // Object Status - EmStatusHiWord + EmStatusLoWord
  148. // CAUTION : EmStatusLoWord should not exceed 16 bits.
  149. //
  150. typedef enum EmStatusHiWord {
  151. //
  152. STAT_SESS_NONE = 1 << 16,
  153. // The session has not yet started..
  154. STAT_SESS_NOT_STARTED = 1 << 17,
  155. // Debug session has been started and is in progress
  156. STAT_SESS_DEBUG_IN_PROGRESS = 1 << 18,
  157. // Debug session has stopped.
  158. STAT_SESS_STOPPED = 1 << 19,
  159. } EmStatusHiWord;
  160. typedef enum EmStatusLoWord {
  161. //
  162. STAT_NONE = 0,
  163. //
  164. // This state is applicable to sessions that have been
  165. // started but the master is dead without calling
  166. // CloseSession..
  167. // CAUTION !!! Take care to see that any new state added
  168. // do this item is with in 0 to 14th bit of the lo word.
  169. //
  170. STAT_ORPHAN = 1 << 15,
  171. //
  172. // The following 2 states are valid only when the
  173. // hi word is STAT_SESS_NOT_STARTED
  174. //
  175. // The debuggee is not running.
  176. STAT_NOTRUNNING = 1 << 0,
  177. // The debuggee is running.
  178. STAT_RUNNING = 1 << 1,
  179. //
  180. // The following 2 states are valid only when the
  181. // hi word is STAT_SESS_DEBUG_IN_PROGRESS
  182. //
  183. // The requested file was created successfully
  184. STAT_FILECREATED_SUCCESSFULLY = 1 << 2,
  185. // The file creation process failed.
  186. STAT_FILECREATION_FAILED = 1 << 3,
  187. //
  188. // The follwing states are valid only when the
  189. // hi word is STAT_SESS_STOPPED
  190. //
  191. //
  192. STAT_SUCCESS = 1 << 4,
  193. //
  194. STAT_FAILED = 1 << 5,
  195. // The debuggee in a debugging session was killed externally
  196. STAT_DEBUGGEE_KILLED = 1 << 6,
  197. // The debuggee exited.
  198. STAT_DEBUGGEE_EXITED = 1 << 7,
  199. // The debuggee caused an exception to occur.
  200. STAT_EXCEPTION_OCCURED = 1 << 8,
  201. // The debuggee caused an access violation.
  202. STAT_ACCESSVIOLATION_OCCURED = 1 << 9,
  203. } EmStatusLoWord;
  204. typedef enum EmSessionStatus {
  205. // Session status NONE
  206. STAT_SESS_NONE_STAT_NONE = STAT_SESS_NONE + STAT_NONE,
  207. // Session is not started and the process is not running.
  208. STAT_SESS_NOT_STARTED_NOTRUNNING = STAT_SESS_NOT_STARTED + STAT_NOTRUNNING,
  209. // Session is not started and the process is running.
  210. STAT_SESS_NOT_STARTED_RUNNING = STAT_SESS_NOT_STARTED + STAT_RUNNING,
  211. // Session is not started and the file got create successfully.
  212. STAT_SESS_NOT_STARTED_FILECREATED_SUCCESSFULLY = STAT_SESS_NOT_STARTED + STAT_FILECREATED_SUCCESSFULLY,
  213. // Session is not started and the file creation failed.
  214. STAT_SESS_NOT_STARTED_FILECREATION_FAILED = STAT_SESS_NOT_STARTED + STAT_FILECREATION_FAILED,
  215. // Debug session is proceeding without events but the session has been orphaned.
  216. STAT_SESS_DEBUG_IN_PROGRESS_ORPHAN_NONE = STAT_SESS_DEBUG_IN_PROGRESS + STAT_ORPHAN + STAT_NONE,
  217. // Debug session is active and the file was created successfully but the session has been orphaned.
  218. STAT_SESS_DEBUG_IN_PROGRESS_ORPHAN_FILECREATED_SUCESSFULLY = STAT_SESS_DEBUG_IN_PROGRESS + STAT_ORPHAN + STAT_FILECREATED_SUCCESSFULLY,
  219. // Debug sessoin is active but the file did not get created successfully and the session has been orphaned.
  220. STAT_SESS_DEBUG_IN_PROGRESS_ORPHAN_FILECREATION_FAILED = STAT_SESS_DEBUG_IN_PROGRESS + STAT_ORPHAN + STAT_FILECREATION_FAILED,
  221. // Session has been stopped successfully, but the session has been orphaned
  222. STAT_SESS_STOPPED_ORPHAN_SUCCESS = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_SUCCESS,
  223. // Session could not be stopped successfully and the session has been orphaned
  224. STAT_SESS_STOPPED_ORPHAN_FAILED = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_FAILED,
  225. // Debug session is stopped because the debuggee was killed and the session has been orphaned.
  226. STAT_SESS_STOPPED_ORPHAN_DEBUGGEE_KILLED = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_DEBUGGEE_KILLED,
  227. // Debug session is stopped because the debuggee exited and the session has been orphaned.
  228. STAT_SESS_STOPPED_ORPHAN_DEBUGGEE_EXITED = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_DEBUGGEE_EXITED,
  229. // Debug session is stopped because the debuggee caused an exception and the session has been orphaned.
  230. STAT_SESS_STOPPED_ORPHAN_EXCEPTION_OCCURED = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_EXCEPTION_OCCURED,
  231. // Debug session is stopped because the debuggee caused an access violation and the session has been orphaned.
  232. STAT_SESS_STOPPED_ORPHAN_ACCESSVIOLATION_OCCURED = STAT_SESS_STOPPED + STAT_ORPHAN + STAT_ACCESSVIOLATION_OCCURED,
  233. // Debug session is proceeding without events.
  234. STAT_SESS_DEBUG_IN_PROGRESS_NONE = STAT_SESS_DEBUG_IN_PROGRESS + STAT_NONE,
  235. // Debug session is active and the file was created successfully.
  236. STAT_SESS_DEBUG_IN_PROGRESS_FILECREATED_SUCESSFULLY = STAT_SESS_DEBUG_IN_PROGRESS + STAT_FILECREATED_SUCCESSFULLY,
  237. // Debug sessoin is active but the file did not get created successfully.
  238. STAT_SESS_DEBUG_IN_PROGRESS_FILECREATION_FAILED = STAT_SESS_DEBUG_IN_PROGRESS + STAT_FILECREATION_FAILED,
  239. //
  240. STAT_SESS_STOPPED_SUCCESS = STAT_SESS_STOPPED + STAT_SUCCESS,
  241. //
  242. STAT_SESS_STOPPED_FAILED = STAT_SESS_STOPPED + STAT_FAILED,
  243. // Debug session is stopped because the debuggee was killed.
  244. STAT_SESS_STOPPED_DEBUGGEE_KILLED = STAT_SESS_STOPPED + STAT_DEBUGGEE_KILLED,
  245. // Debug session is stopped because the debuggee exited.
  246. STAT_SESS_STOPPED_DEBUGGEE_EXITED = STAT_SESS_STOPPED + STAT_DEBUGGEE_EXITED,
  247. // Debug session is stopped because the debuggee caused an exception.
  248. STAT_SESS_STOPPED_EXCEPTION_OCCURED = STAT_SESS_STOPPED + STAT_EXCEPTION_OCCURED,
  249. // Debug session is stopped because the debuggee caused an access violation.
  250. STAT_SESS_STOPPED_ACCESSVIOLATION_OCCURED = STAT_SESS_STOPPED + STAT_ACCESSVIOLATION_OCCURED,
  251. } EmSessionStatus;
  252. [
  253. object,
  254. uuid(74FA475F-492D-406E-B267-BBCB28AF262A),
  255. dual,
  256. helpstring("IEmDebugSession Interface"),
  257. pointer_default(unique)
  258. ]
  259. interface IEmDebugSession : IDispatch
  260. {
  261. [id(1), helpstring("method Debug")] HRESULT Debug([in, out] BSTR bstrEmObj, [in] SessionType eSessType);
  262. [id(2), helpstring("method StopDebug")] HRESULT StopDebug([in] BOOL bForceStop);
  263. [id(3), helpstring("method GenerateDumpFile")] HRESULT GenerateDumpFile([in] UINT nDumpType);
  264. [id(4), helpstring("method GetStatus")] HRESULT GetStatus([in, out] BSTR bstrEmObj);
  265. [id(5), helpstring("method DebugEx")] HRESULT DebugEx([in, out] BSTR bstrEmObj, [in] SessionType eSessType, [in] BSTR bstrEcxFilePath, [in] LONG lParam, [in, optional] VARIANT vtUserName, [in, optional] VARIANT vtPassword, [in, optional] VARIANT vtPort, [in, optional] VARIANT vtNotifyAdmin, [in, optional] VARIANT vtAltSymPath);
  266. [id(6), helpstring("method CancelDebug")] HRESULT CancelDebug([in] BOOL bForceCancel);
  267. [id(7), helpstring("method TakeOwnerShip")] HRESULT AdoptOrphan();
  268. };
  269. [
  270. object,
  271. uuid(1B60057D-B15A-4A30-A1FC-905B6AF24FB4),
  272. dual,
  273. helpstring("IEmManager Interface"),
  274. pointer_default(unique)
  275. ]
  276. interface IEmManager : IDispatch
  277. {
  278. [id(1), helpstring("method EnumObjects")] HRESULT EnumObjects([in] EmObjectType eObjectType, [out] VARIANT *lpVariant);
  279. [id(2), helpstring("method OpenSession")] HRESULT OpenSession([in, out] BSTR bstrEmObj, [out]IEmDebugSession **ppEmDebugSession);
  280. [id(3), helpstring("method DeleteSession")] HRESULT DeleteSession([in] BSTR bstrEmObj);
  281. [id(4), helpstring("method EnumObjectsEx")] HRESULT EnumObjectsEx([in] BSTR bstrEmObj, [out] VARIANT *lpVariant);
  282. [id(5), helpstring("method GetEmFileInterface")] HRESULT GetEmFileInterface([in] BSTR bstrEmObj, [out] IStream **ppstrm);
  283. [id(6), helpstring("method GenerateDumpFile")] HRESULT GenerateDumpFile(BSTR bstrEmObj, UINT nDumpType);
  284. [id(7), helpstring("method DeleteFile")] HRESULT DeleteFile([in, out] BSTR bstrEmObj);
  285. [id(8), helpstring("method MakeNFO")] HRESULT MakeNFO([in] BSTR bstrPath, [in] BSTR bstrMachineName, [in] BSTR bstrCategories);
  286. };
  287. [
  288. uuid(32305ED8-359D-45C9-B996-74A97858B048),
  289. helpstring("_IEmManagerEvents Interface")
  290. ]
  291. dispinterface _IEmManagerEvents
  292. {
  293. properties:
  294. methods:
  295. };
  296. [
  297. uuid(8424B9F5-6682-44D8-8D73-9BFEDE59DDC5),
  298. helpstring("EmManager Class")
  299. ]
  300. coclass EmManager
  301. {
  302. [default] interface IEmManager;
  303. [default, source] dispinterface _IEmManagerEvents;
  304. };
  305. [
  306. uuid(8E2EE030-5E0C-481B-974D-510CA090F100),
  307. helpstring("_IEmDebugSessionEvents Interface")
  308. ]
  309. dispinterface _IEmDebugSessionEvents
  310. {
  311. properties:
  312. methods:
  313. };
  314. [
  315. object,
  316. uuid(3939636C-5C12-44F6-A7F8-8FE5ECF46672),
  317. dual,
  318. helpstring("IEmFile Interface"),
  319. pointer_default(unique)
  320. ]
  321. interface IEmFile : IDispatch
  322. {
  323. [id(1), helpstring("method Read")] HRESULT Read([out] void *pv, [in] ULONG cb, [out] ULONG *pcbRead);
  324. [id(2), helpstring("method Write")] HRESULT Write([in] void const *pv, [in] ULONG cb, [out] ULONG *pcbWritten);
  325. [id(3), helpstring("method Seek")] HRESULT Seek([in] LARGE_INTEGER dlibMove, [in] DWORD dwOrigin, [out] ULARGE_INTEGER *plibNewPosition);
  326. [id(4), helpstring("method SetSize")] HRESULT SetSize([in] ULARGE_INTEGER libNewSize);
  327. [id(5), helpstring("method CopyTo")] HRESULT CopyTo([in] IStream *pstm, [in] ULARGE_INTEGER cb, [out] ULARGE_INTEGER *pcbRead, [out] ULARGE_INTEGER *pcbWritten);
  328. [id(6), helpstring("method Commit")] HRESULT Commit([in] DWORD grfCommitFlags);
  329. [id(7), helpstring("method Revert")] HRESULT Revert(void);
  330. [id(8), helpstring("method LockRegion")] HRESULT LockRegion([in] ULARGE_INTEGER libOffset, [in] ULARGE_INTEGER cb, [in] DWORD dwLockType);
  331. [id(9), helpstring("method UnlockRegion")] HRESULT UnlockRegion([in] ULARGE_INTEGER libOffset, [in] ULARGE_INTEGER cb, [in] DWORD dwLockType);
  332. [id(10), helpstring("method Stat")] HRESULT Stat([out] STATSTG *pstatstg, DWORD grfStatFlag);
  333. [id(11), helpstring("method Clone")] HRESULT Clone([out] IStream **ppstm);
  334. [id(12), helpstring("method InitFile")] HRESULT InitFile(BSTR bstrFileName);
  335. };
  336. [
  337. uuid(AB959592-B2DC-4F57-B3F1-8D8116F74BAF),
  338. helpstring("EmDebugSession Class")
  339. ]
  340. coclass EmDebugSession
  341. {
  342. [default] interface IEmDebugSession;
  343. [default, source] dispinterface _IEmDebugSessionEvents;
  344. };
  345. [
  346. uuid(30A533DF-9885-472E-8F8B-94AD3A6C6DE6),
  347. helpstring("EmFile Class")
  348. ]
  349. coclass EmFile
  350. {
  351. [default] interface IEmFile;
  352. };
  353. };