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.

538 lines
15 KiB

  1. //****************************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: syncmgr.idl
  6. //
  7. // Contents: Interfaces for Synchronization Manager
  8. //
  9. //****************************************************************************
  10. #ifndef DO_NO_IMPORTS
  11. import "objidl.idl";
  12. import "oleidl.idl";
  13. import "mstask.idl";
  14. #endif
  15. interface ISyncMgrSynchronize;
  16. interface ISyncMgrSynchronizeCallback;
  17. interface ISyncMgrEnumItems;
  18. interface ISyncMgrSynchronizeInvoke;
  19. interface ISyncMgrRegister;
  20. interface ISyncScheduleMgr;
  21. interface IEnumSyncSchedules;
  22. interface ISyncSchedule;
  23. interface IEnumSyncItems;
  24. typedef GUID SYNCMGRITEMID;
  25. typedef REFGUID REFSYNCMGRITEMID;
  26. typedef GUID SYNCMGRERRORID;
  27. typedef REFGUID REFSYNCMGRERRORID;
  28. typedef GUID SYNCSCHEDULECOOKIE;
  29. // {6295DF27-35EE-11d1-8707-00C04FD93327}
  30. cpp_quote("DEFINE_GUID(CLSID_SyncMgr,0x6295df27, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  31. // {6295DF29-35EE-11d1-8707-00C04FD93327}
  32. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronize,0x6295df28, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  33. // {6295DF28-35EE-11d1-8707-00C04FD93327}
  34. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronizeCallback,0x6295df29, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  35. // {6295DF2A-35EE-11d1-8707-00C04FD93327}
  36. cpp_quote("DEFINE_GUID(IID_ISyncMgrEnumItems,0x6295df2a, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  37. // {6295DF2C-35EE-11d1-8707-00C04FD93327}
  38. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronizeInvoke,0x6295df2c, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  39. // {894D8C55-BDDF-11d1-B85D-00C04FB93981}
  40. cpp_quote("DEFINE_GUID(IID_ISyncMgrRegister,0x894d8c55, 0xbddf, 0x11d1, 0xb8, 0x5d, 0x0, 0xc0, 0x4f, 0xb9, 0x39, 0x81);")
  41. // {F0E15897-A700-11d1-9831-00C04FD910DD}
  42. cpp_quote("DEFINE_GUID(IID_ISyncScheduleMgr,0xf0e15897, 0xa700, 0x11d1, 0x98, 0x31, 0x0, 0xc0, 0x4f, 0xd9, 0x10, 0xdd);")
  43. // {F0E15898-A700-11d1-9831-00C04FD910DD}
  44. cpp_quote("DEFINE_GUID(IID_IEnumSyncSchedules,0xf0e15898, 0xa700, 0x11d1, 0x98, 0x31, 0x0, 0xc0, 0x4f, 0xd9, 0x10, 0xdd);")
  45. // {F0E15899-A700-11d1-9831-00C04FD910DD}
  46. cpp_quote("DEFINE_GUID(IID_ISyncSchedule,0xf0e15899, 0xa700, 0x11d1, 0x98, 0x31, 0x0, 0xc0, 0x4f, 0xd9, 0x10, 0xdd);")
  47. // {F0E1589A-A700-11d1-9831-00C04FD910DD}
  48. cpp_quote("DEFINE_GUID(IID_IEnumSyncItems,0xf0e1589a, 0xa700, 0x11d1, 0x98, 0x31, 0x0, 0xc0, 0x4f, 0xd9, 0x10, 0xdd);")
  49. // Success codes specific to SyncMgr interfaces
  50. cpp_quote("#define S_SYNCMGR_MISSINGITEMS MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0201)")
  51. cpp_quote("#define S_SYNCMGR_RETRYSYNC MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0202)")
  52. cpp_quote("#define S_SYNCMGR_CANCELITEM MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0203)")
  53. cpp_quote("#define S_SYNCMGR_CANCELALL MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0204)")
  54. // Error codes specific to SyncMgr interfaces
  55. cpp_quote("#define SYNCMGR_E_NAME_IN_USE MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x0201)")
  56. cpp_quote("#define SYNCMGR_E_ITEM_UNREGISTERED MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x0202)")
  57. [
  58. local,
  59. object,
  60. uuid(6295DF28-35EE-11d1-8707-00C04FD93327) // IID_ISyncMgrSynchronize
  61. ]
  62. interface ISyncMgrSynchronize: IUnknown
  63. {
  64. typedef [unique] ISyncMgrSynchronize *LPSYNCMGRSYNCHRONIZE;
  65. typedef enum _tagSYNCMGRFLAG { // flags for Synchronization Event
  66. SYNCMGRFLAG_CONNECT = 0x0001, // Sync was invoked by a network connect
  67. SYNCMGRFLAG_PENDINGDISCONNECT = 0x0002, // Sync was invoked by a pending network disconnect
  68. SYNCMGRFLAG_MANUAL = 0x0003, // Sync was invoked manually
  69. SYNCMGRFLAG_IDLE = 0x0004, // Sync was programmatically invokd
  70. SYNCMGRFLAG_INVOKE = 0x0005, // Sync was programmatically invokd
  71. SYNCMGRFLAG_SCHEDULED = 0x0006, // Sync was invoked by a scheduled update
  72. SYNCMGRFLAG_EVENTMASK = 0x00FF,
  73. SYNCMGRFLAG_SETTINGS = 0x0100, // Sync was invoked for configuration only
  74. SYNCMGRFLAG_MAYBOTHERUSER = 0x0200, // Interaction with the user is permitted
  75. } SYNCMGRFLAG;
  76. const USHORT MAX_SYNCMGRHANDLERNAME = 32;
  77. typedef enum _tagSYNCMGRHANDLERFLAGS { // flags that apply to this handler.
  78. SYNCMGRHANDLER_HASPROPERTIES = 0x01, // have a properties dialog for this handler
  79. } SYNCMGRHANDLERFLAGS;
  80. typedef struct _tagSYNCMGRHANDLERINFO {
  81. DWORD cbSize;
  82. HICON hIcon;
  83. DWORD SyncMgrHandlerFlags;
  84. WCHAR wszHandlerName[MAX_SYNCMGRHANDLERNAME];
  85. } SYNCMGRHANDLERINFO, *LPSYNCMGRHANDLERINFO;
  86. cpp_quote("#define SYNCMGRITEMSTATE_UNCHECKED 0x0000")
  87. cpp_quote("#define SYNCMGRITEMSTATE_CHECKED 0x0001")
  88. cpp_quote("")
  89. typedef enum _tagSYNCMGRSTATUS {
  90. SYNCMGRSTATUS_STOPPED = 0x0000,
  91. SYNCMGRSTATUS_SKIPPED = 0x0001,
  92. SYNCMGRSTATUS_PENDING = 0x0002,
  93. SYNCMGRSTATUS_UPDATING = 0x0003,
  94. SYNCMGRSTATUS_SUCCEEDED = 0x0004,
  95. SYNCMGRSTATUS_FAILED = 0x0005,
  96. SYNCMGRSTATUS_PAUSED = 0x0006,
  97. SYNCMGRSTATUS_RESUMING = 0x0007,
  98. } SYNCMGRSTATUS;
  99. HRESULT Initialize(
  100. [in] DWORD dwReserved,
  101. [in] DWORD dwSyncMgrFlags,
  102. [in] DWORD cbCookie,
  103. [in] BYTE const*lpCookie);
  104. HRESULT GetHandlerInfo(
  105. [out] LPSYNCMGRHANDLERINFO *ppSyncMgrHandlerInfo);
  106. HRESULT EnumSyncMgrItems(
  107. [out] ISyncMgrEnumItems **ppSyncMgrEnumItems);
  108. HRESULT GetItemObject(
  109. [in] REFSYNCMGRITEMID ItemID,
  110. [in] REFIID riid,
  111. [out] void** ppv);
  112. HRESULT ShowProperties(
  113. [in] HWND hWndParent,
  114. [in] REFSYNCMGRITEMID ItemID);
  115. HRESULT SetProgressCallback(
  116. [in] ISyncMgrSynchronizeCallback *lpCallBack);
  117. HRESULT PrepareForSync(
  118. [in] ULONG cbNumItems,
  119. [in] SYNCMGRITEMID* pItemIDs,
  120. [in] HWND hWndParent,
  121. [in] DWORD dwReserved);
  122. HRESULT Synchronize(
  123. [in] HWND hWndParent);
  124. HRESULT SetItemStatus(
  125. [in] REFSYNCMGRITEMID pItemID,
  126. [in] DWORD dwSyncMgrStatus);
  127. HRESULT ShowError(
  128. [in] HWND hWndParent,
  129. [in] REFSYNCMGRERRORID ErrorID,
  130. [out] ULONG *pcbNumItems,
  131. [out] SYNCMGRITEMID **ppItemIDs);
  132. }
  133. [
  134. local,
  135. object,
  136. uuid(6295DF29-35EE-11d1-8707-00C04FD93327) // IID_ISyncMgrSynchronizeCallback
  137. ]
  138. interface ISyncMgrSynchronizeCallback: IUnknown
  139. {
  140. typedef [unique] ISyncMgrSynchronizeCallback *LPSYNCMGRSYNCHRONIZECALLBACK;
  141. cpp_quote("#define SYNCMGRPROGRESSITEM_STATUSTEXT 0x0001")
  142. cpp_quote("#define SYNCMGRPROGRESSITEM_STATUSTYPE 0x0002")
  143. cpp_quote("#define SYNCMGRPROGRESSITEM_PROGVALUE 0x0004")
  144. cpp_quote("#define SYNCMGRPROGRESSITEM_MAXVALUE 0x0008")
  145. cpp_quote("")
  146. typedef struct _tagSYNCMGRPROGRESSITEM {
  147. DWORD cbSize;
  148. UINT mask;
  149. const WCHAR* lpcStatusText;
  150. DWORD dwStatusType;
  151. INT iProgValue;
  152. INT iMaxValue;
  153. } SYNCMGRPROGRESSITEM, *LPSYNCMGRPROGRESSITEM;
  154. typedef enum _tagSYNCMGRLOGLEVEL {
  155. SYNCMGRLOGLEVEL_INFORMATION = 0x0001,
  156. SYNCMGRLOGLEVEL_WARNING = 0x0002,
  157. SYNCMGRLOGLEVEL_ERROR = 0x0003,
  158. } SYNCMGRLOGLEVEL;
  159. cpp_quote("#define SYNCMGRLOGERROR_ERRORFLAGS 0x0001")
  160. cpp_quote("#define SYNCMGRLOGERROR_ERRORID 0x0002")
  161. cpp_quote("#define SYNCMGRLOGERROR_ITEMID 0x0004")
  162. cpp_quote("")
  163. typedef enum _tagSYNCMGRERRORFLAGS { // flags that apply to the error.
  164. SYNCMGRERRORFLAG_ENABLEJUMPTEXT = 0x01, // ShowErrors should be called on this item.
  165. } SYNCMGRERRORFLAGS;
  166. typedef struct _tagSYNCMGRLOGERRORINFO {
  167. DWORD cbSize;
  168. DWORD mask;
  169. DWORD dwSyncMgrErrorFlags;
  170. SYNCMGRERRORID ErrorID;
  171. SYNCMGRITEMID ItemID;
  172. } SYNCMGRLOGERRORINFO, *LPSYNCMGRLOGERRORINFO;
  173. HRESULT Progress(
  174. [in] REFSYNCMGRITEMID pItemID,
  175. [in] LPSYNCMGRPROGRESSITEM lpSyncProgressItem);
  176. HRESULT PrepareForSyncCompleted(HRESULT hr);
  177. HRESULT SynchronizeCompleted(HRESULT hr);
  178. HRESULT EnableModeless(
  179. [in] BOOL fEnable);
  180. HRESULT LogError(
  181. [in] DWORD dwErrorLevel,
  182. [in] const WCHAR *lpcErrorText,
  183. [in] LPSYNCMGRLOGERRORINFO lpSyncLogError);
  184. HRESULT DeleteLogError(
  185. [in] REFSYNCMGRERRORID ErrorID,
  186. [in] DWORD dwReserved);
  187. }
  188. [
  189. local,
  190. object,
  191. uuid(6295DF2A-35EE-11d1-8707-00C04FD93327), // IID_ISyncMgrEnumItems
  192. pointer_default(unique)
  193. ]
  194. interface ISyncMgrEnumItems : IUnknown
  195. {
  196. typedef [unique] ISyncMgrEnumItems *LPSYNCMGRENUMITEMS;
  197. const USHORT MAX_SYNCMGRITEMNAME = 128;
  198. const USHORT MAX_SYNCMGRITEMSTATUS = 128;
  199. typedef enum _tagSYNCMGRITEMFLAGS { // flags for this SyncMgr Item
  200. SYNCMGRITEM_HASPROPERTIES = 0x01, // have a properties dialog for this item
  201. SYNCMGRITEM_TEMPORARY = 0x02, // remove any stored preferences for this item
  202. SYNCMGRITEM_ROAMINGUSER = 0x04, // This item should roam with the User
  203. } SYNCMGRITEMFLAGS;
  204. typedef struct _tagSYNCMGRITEM {
  205. DWORD cbSize;
  206. DWORD dwFlags;
  207. SYNCMGRITEMID ItemID;
  208. DWORD dwItemState;
  209. HICON hIcon;
  210. WCHAR wszItemName[MAX_SYNCMGRITEMNAME];
  211. WCHAR wszStatus[MAX_SYNCMGRITEMSTATUS];
  212. } SYNCMGRITEM, *LPSYNCMGRITEM;
  213. HRESULT Next(
  214. [in] ULONG celt,
  215. [out, size_is(celt), length_is(*pceltFetched)]
  216. LPSYNCMGRITEM rgelt,
  217. [out] ULONG *pceltFetched);
  218. HRESULT Skip(
  219. [in] ULONG celt);
  220. HRESULT Reset();
  221. HRESULT Clone(
  222. [out] ISyncMgrEnumItems **ppenum);
  223. }
  224. [
  225. local,
  226. object,
  227. uuid(6295DF2C-35EE-11d1-8707-00C04FD93327), // IID_ISyncMgrSynchronizeInvoke
  228. pointer_default(unique)
  229. ]
  230. interface ISyncMgrSynchronizeInvoke : IUnknown
  231. {
  232. typedef [unique] ISyncMgrSynchronizeInvoke *LPSYNCMGRSYNCHRONIZEINVOKE;
  233. typedef enum _tagSYNCMGRINVOKEFLAGS { // flags for how SyncMgr should be invoked.
  234. SYNCMGRINVOKE_STARTSYNC = 0x02, // Immediately start the sync without displaying choices
  235. SYNCMGRINVOKE_MINIMIZED = 0x04, // Dialog should be minimized by default
  236. } SYNCMGRINVOKEFLAGS;
  237. HRESULT UpdateItems(
  238. [in] DWORD dwInvokeFlags,
  239. [in] REFCLSID rclsid,
  240. [in] DWORD cbCookie,
  241. [in, unique, size_is(cbCookie)] const BYTE *lpCookie);
  242. HRESULT UpdateAll();
  243. }
  244. [
  245. local,
  246. object,
  247. uuid(894D8C55-BDDF-11d1-B85D-00C04FB93981), // IID_ISyncMgrSynchronizeRegister
  248. pointer_default(unique)
  249. ]
  250. interface ISyncMgrRegister : IUnknown
  251. {
  252. typedef [unique] ISyncMgrRegister *LPSYNCMGRREGISTER;
  253. HRESULT RegisterSyncMgrHandler(
  254. [in] REFCLSID rclsidHandler,
  255. [in] DWORD dwReserved);
  256. HRESULT UnregisterSyncMgrHandler(
  257. [in] REFCLSID rclsidHandler,
  258. [in] DWORD dwReserved);
  259. }
  260. [
  261. uuid(6295DF27-35EE-11d1-8707-00C04FD93327),
  262. helpstring("Common Synchronization UI service")
  263. ]
  264. coclass SyncMgr
  265. {
  266. [default, source] interface ISyncMgrSynchronizeInvoke;
  267. };
  268. cpp_quote("#define SYNCSCHEDINFO_FLAGS_MASK 0x0FFF")
  269. cpp_quote("#define SYNCSCHEDINFO_FLAGS_READONLY 0x0001")
  270. cpp_quote("#define SYNCSCHEDINFO_FLAGS_AUTOCONNECT 0x0002")
  271. cpp_quote("#define SYNCSCHEDINFO_FLAGS_HIDDEN 0x0004")
  272. cpp_quote("#define SYNCSCHEDWIZARD_SHOWALLHANDLERITEMS 0x1000")
  273. cpp_quote("")
  274. [
  275. local,
  276. object,
  277. uuid(F0E15897-A700-11d1-9831-00C04FD910DD), // IID_ISyncScheduleMgr
  278. pointer_default(unique)
  279. ]
  280. interface ISyncScheduleMgr : IUnknown
  281. {
  282. typedef [unique] ISyncScheduleMgr *LPSYNCSCHEDULEMGR;
  283. HRESULT CreateSchedule(
  284. [in] LPCWSTR pwszScheduleName,
  285. [in] DWORD dwFlags,
  286. [in,out] SYNCSCHEDULECOOKIE *pSyncSchedCookie,
  287. [out] ISyncSchedule **ppSyncSchedule);
  288. HRESULT LaunchScheduleWizard(
  289. [in] HWND hParent,
  290. [in] DWORD dwFlags,
  291. [in, out] SYNCSCHEDULECOOKIE *pSyncSchedCookie,
  292. [out] ISyncSchedule ** ppSyncSchedule);
  293. HRESULT OpenSchedule(
  294. [in] SYNCSCHEDULECOOKIE *pSyncSchedCookie,
  295. [in] DWORD dwFlags,
  296. [out] ISyncSchedule **ppSyncSchedule);
  297. HRESULT RemoveSchedule(
  298. [in] SYNCSCHEDULECOOKIE *pSyncSchedCookie);
  299. HRESULT EnumSyncSchedules(
  300. [out] IEnumSyncSchedules **ppEnumSyncSchedules);
  301. }
  302. cpp_quote("#define SYNCSCHEDINFO_FLAGS_CONNECTION_LAN 0x0000")
  303. cpp_quote("#define SYNCSCHEDINFO_FLAGS_CONNECTION_WAN 0x0001")
  304. [
  305. local,
  306. object,
  307. uuid(F0E15898-A700-11d1-9831-00C04FD910DD), // IID_IEnumSyncSchedules
  308. pointer_default(unique)
  309. ]
  310. interface IEnumSyncSchedules : IUnknown
  311. {
  312. HRESULT Next(
  313. [in] ULONG celt,
  314. [out, size_is(celt), length_is(*pceltFetched)]
  315. SYNCSCHEDULECOOKIE *pSyncSchedCookie,
  316. [out] ULONG *pceltFetched);
  317. HRESULT Skip(
  318. [in] ULONG celt);
  319. HRESULT Reset(void);
  320. HRESULT Clone(
  321. [out] IEnumSyncSchedules **ppEnumSyncSchedules);
  322. }
  323. typedef struct _tagSYNC_HANDLER_ITEM_INFO
  324. {
  325. GUID handlerID;
  326. SYNCMGRITEMID itemID;
  327. HICON hIcon;
  328. WCHAR wszItemName[MAX_SYNCMGRITEMNAME];
  329. DWORD dwCheckState;
  330. } SYNC_HANDLER_ITEM_INFO, *LPSYNC_HANDLER_ITEM_INFO;
  331. [
  332. local,
  333. object,
  334. uuid(F0E15899-A700-11d1-9831-00C04FD910DD), // IID_ISyncSchedule
  335. pointer_default(unique)
  336. ]
  337. interface ISyncSchedule : IUnknown
  338. {
  339. HRESULT GetFlags(
  340. [out] DWORD *pdwFlags);
  341. HRESULT SetFlags(
  342. [in] DWORD dwFlags);
  343. HRESULT GetConnection(
  344. [in, out] DWORD *pcbSize,
  345. [out] LPWSTR pwszConnectionName,
  346. [out] DWORD *pdwConnType);
  347. HRESULT SetConnection(
  348. [in] LPCWSTR pwszConnectionName,
  349. [in] DWORD dwConnType);
  350. HRESULT GetScheduleName(
  351. [in, out] DWORD *pcbSize,
  352. [out] LPWSTR pwszScheduleName);
  353. HRESULT SetScheduleName(
  354. [in] LPCWSTR pwszScheduleName);
  355. HRESULT GetScheduleCookie(
  356. [out] SYNCSCHEDULECOOKIE *pSyncSchedCookie);
  357. HRESULT SetAccountInformation(
  358. [in] LPCWSTR pwszAccountName,
  359. [in] LPCWSTR pwszPassword);
  360. HRESULT GetAccountInformation(
  361. [in, out] DWORD *pcbSize,
  362. [out] LPWSTR pwszAccountName);
  363. HRESULT GetTrigger(
  364. [out] ITaskTrigger ** ppTrigger);
  365. HRESULT GetNextRunTime(
  366. [out] SYSTEMTIME * pstNextRun);
  367. HRESULT GetMostRecentRunTime(
  368. [out] SYSTEMTIME * pstRecentRun);
  369. HRESULT EditSyncSchedule(
  370. [in] HWND hParent,
  371. [in] DWORD dwReserved);
  372. HRESULT AddItem(
  373. [in] LPSYNC_HANDLER_ITEM_INFO pHandlerItemInfo);
  374. HRESULT RegisterItems(
  375. [in] REFCLSID pHandlerID,
  376. [in] SYNCMGRITEMID *pItemID);
  377. HRESULT UnregisterItems(
  378. [in] REFCLSID pHandlerID,
  379. [in] SYNCMGRITEMID *pItemID);
  380. HRESULT SetItemCheck(
  381. [in] REFCLSID pHandlerID,
  382. [in] SYNCMGRITEMID *pItemID,
  383. [in] DWORD dwCheckState);
  384. HRESULT GetItemCheck(
  385. [in] REFCLSID pHandlerID,
  386. [in] SYNCMGRITEMID *pItemID,
  387. [out] DWORD *pdwCheckState);
  388. HRESULT EnumItems(
  389. [in] REFCLSID pHandlerID,
  390. [in] IEnumSyncItems **ppEnumItems);
  391. HRESULT Save();
  392. HRESULT GetITask(
  393. [out] ITask ** ppITask);
  394. }
  395. [
  396. local,
  397. object,
  398. uuid(F0E1589A-A700-11d1-9831-00C04FD910DD), // IID_IEnumSyncItems
  399. pointer_default(unique)
  400. ]
  401. interface IEnumSyncItems : IUnknown
  402. {
  403. HRESULT Next(
  404. [in] ULONG celt,
  405. [out, size_is(celt), length_is(*pceltFetched)]
  406. LPSYNC_HANDLER_ITEM_INFO rgelt,
  407. [out] ULONG * pceltFetched);
  408. HRESULT Skip(
  409. [in] ULONG celt);
  410. HRESULT Reset(void);
  411. HRESULT Clone(
  412. [out] IEnumSyncItems ** ppEnumSyncItems);
  413. }