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.

98 lines
3.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: Hndlrmsg.h
  7. //
  8. // Contents: Handles messages on the Handlers thread
  9. //
  10. // Classes: CHndlrMsg
  11. //
  12. // Notes:
  13. //
  14. // History: 05-Nov-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _HNDLRMSG_
  18. #define _HNDLRMSG_
  19. class CThreadMsgProxy;
  20. class COfflineSynchronizeCallback;
  21. class CHndlrQueue;
  22. typedef struct _tagShowPropertiesThreadArgs {
  23. LPSYNCMGRSYNCHRONIZE lpOneStopHandler;
  24. CLSID ItemId;
  25. HWND hwnd;
  26. } ShowPropertiesThreadArgs;
  27. class CHndlrMsg : public CLockHandler
  28. {
  29. public:
  30. CHndlrMsg(void);
  31. ~CHndlrMsg(void);
  32. //IUnknown members
  33. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  34. STDMETHODIMP_(ULONG) AddRef();
  35. STDMETHODIMP_(ULONG) Release();
  36. // ISYNCMGRSynchronize Methods
  37. STDMETHODIMP Initialize(DWORD dwReserved,DWORD dwSyncFlags,
  38. DWORD cbCookie,const BYTE *lpCooke);
  39. STDMETHODIMP GetHandlerInfo(LPSYNCMGRHANDLERINFO *ppSyncMgrHandlerInfo);
  40. STDMETHODIMP EnumSyncMgrItems(ISyncMgrEnumItems **ppenumOffineItems);
  41. STDMETHODIMP GetItemObject(REFSYNCMGRITEMID ItemID,REFIID riid,void** ppv);
  42. STDMETHODIMP ShowProperties(HWND hwnd,REFSYNCMGRITEMID ItemID);
  43. STDMETHODIMP SetProgressCallback(ISyncMgrSynchronizeCallback *lpCallBack);
  44. STDMETHODIMP PrepareForSync(ULONG cbNumItems,SYNCMGRITEMID *pItemIDs,
  45. HWND hwnd,DWORD dwReserved);
  46. STDMETHODIMP Synchronize(HWND hwnd);
  47. STDMETHODIMP SetItemStatus(REFSYNCMGRITEMID ItemID,DWORD dwSyncMgrStatus);
  48. STDMETHODIMP ShowError(HWND hWndParent,REFSYNCMGRERRORID ErrorID);
  49. // Private proxy messages
  50. STDMETHODIMP CreateServer(const CLSID *pCLSIDServer,
  51. CHndlrQueue *pHndlrQueue,HANDLERINFO *pHandlerId,DWORD dwProxyThreadId);
  52. STDMETHODIMP SetHndlrQueue(CHndlrQueue *pHndlrQueue,HANDLERINFO *pHandlerId,DWORD m_dwProxyThreadId);
  53. STDMETHODIMP AddHandlerItems(HWND hwndList,DWORD *pcbNumItems);
  54. STDMETHODIMP SetupCallback(BOOL fSet);
  55. // Private methods
  56. // STDMETHODIMP privSetCallBack(void);
  57. STDMETHODIMP AddToItemList(LPSYNCMGRITEM poffItem);
  58. STDMETHODIMP SetHandlerInfo();
  59. // private messages called on different thread.
  60. STDMETHODIMP ForceKillHandler();
  61. private:
  62. void GetHndlrQueue(CHndlrQueue **ppHndlrQueue,HANDLERINFO **ppHandlerId,DWORD *pdwProxyThreadId);
  63. void AttachThreadInput(BOOL fAttach); // attach input queue with proxy.
  64. BOOL m_fThreadInputAttached;
  65. DWORD m_cRef;
  66. LPSYNCMGRSYNCHRONIZE m_pOneStopHandler;
  67. LPOLDSYNCMGRSYNCHRONIZE m_pOldOneStopHandler; // old idl, remove if time.
  68. DWORD m_dwSyncFlags;
  69. COfflineSynchronizeCallback *m_pCallBack;
  70. SYNCMGRITEMID m_itemIDShowProperties; // ItemId that was passed to ShowProperties.
  71. CLSID m_CLSIDServer;
  72. CHndlrQueue *m_pHndlrQueue;
  73. HANDLERINFO *m_pHandlerId;
  74. DWORD m_dwProxyThreadId; // threadId of caller.
  75. DWORD m_dwThreadId;
  76. DWORD m_dwNestCount; // keep track of re-entry.
  77. BOOL m_fDead; // object has been released;
  78. BOOL m_fForceKilled; // object was force killed.
  79. friend COfflineSynchronizeCallback;
  80. };
  81. #endif // _HNDLRMSG_