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.

113 lines
3.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1997 **/
  4. /**********************************************************************/
  5. /*
  6. sfmutil.h
  7. Misc utility routines for SFM dialogs/property pages
  8. FILE HISTORY:
  9. */
  10. #ifndef _SFMUTIL_H
  11. #define _SFMUTIL_H
  12. // global SFM stuff from the file management snapin
  13. #include "cookie.h" // required for sfm.h
  14. #include "sfm.h" // sfm entry points
  15. #include "DynamLnk.h" // DynamicDLL
  16. // help stuff
  17. #include "sfmhelp.h"
  18. #define IDS_AFPMGR_BASE 22000
  19. #define IDS_AFPMGR_LAST (IDS_AFPMGR_BASE+200)
  20. #define ERROR_ALREADY_REPORTED 0xFFFFFFFF
  21. #define COMPUTERNAME_LEN_MAX 255
  22. //
  23. // Do not change the ID numbers of these strings. AFPERR_*
  24. // map to these string ids via the formula:
  25. // -(AFPERR_*) + IDS_AFPMGR_BASE + AFPERR_BASE + 100 = IDS_*
  26. //
  27. #define AFPERR_TO_STRINGID( AfpErr ) \
  28. \
  29. ((( AfpErr <= AFPERR_BASE ) && ( AfpErr >= AFPERR_MIN )) ? \
  30. (IDS_AFPMGR_BASE+100+AFPERR_BASE-AfpErr) : IDS_ERROR_BASE + AfpErr )
  31. // procedure defines for SFM API entry points
  32. typedef DWORD (*SERVERGETINFOPROC) (AFP_SERVER_HANDLE,LPBYTE*);
  33. typedef DWORD (*SERVERSETINFOPROC) (AFP_SERVER_HANDLE,LPBYTE,DWORD);
  34. typedef DWORD (*ETCMAPASSOCIATEPROC) (AFP_SERVER_HANDLE,PAFP_TYPE_CREATOR,PAFP_EXTENSION);
  35. typedef DWORD (*ETCMAPADDPROC) (AFP_SERVER_HANDLE,PAFP_TYPE_CREATOR);
  36. typedef DWORD (*ETCMAPDELETEPROC) (AFP_SERVER_HANDLE,PAFP_TYPE_CREATOR);
  37. typedef DWORD (*ETCMAPGETINFOPROC) (AFP_SERVER_HANDLE,LPBYTE*);
  38. typedef DWORD (*ETCMAPSETINFOPROC) (AFP_SERVER_HANDLE,PAFP_TYPE_CREATOR);
  39. typedef DWORD (*MESSAGESENDPROC) (AFP_SERVER_HANDLE,PAFP_MESSAGE_INFO);
  40. typedef DWORD (*STATISTICSGETPROC) (AFP_SERVER_HANDLE,LPBYTE*);
  41. typedef void (*SFMBUFFERFREEPROC) (PVOID);
  42. HWND FindMMCMainWindow();
  43. void SFMMessageBox(DWORD dwErrCode);
  44. class CSfmFileServiceProvider;
  45. class CSFMPropertySheet
  46. {
  47. friend class CMacFilesConfiguration;
  48. friend class CMacFilesSessions;
  49. friend class CMacFilesFileAssociation;
  50. public:
  51. CSFMPropertySheet();
  52. ~CSFMPropertySheet();
  53. BOOL FInit(LPDATAOBJECT lpDataObject,
  54. AFP_SERVER_HANDLE hAfpServer,
  55. LPCTSTR pSheetTitle,
  56. SfmFileServiceProvider * pSfmProvider,
  57. LPCTSTR pMachine);
  58. // actions for the property sheet
  59. BOOL DoModelessSheet(LPDATAOBJECT pDataObject);
  60. void CancelSheet();
  61. HWND SetActiveWindow() { return ::SetActiveWindow(m_hSheetWindow); }
  62. // data access
  63. void SetProvider(SfmFileServiceProvider * pSfmProvider) { m_pSfmProvider = pSfmProvider; }
  64. // the first individual property page calls this to set the sheet window
  65. void SetSheetWindow(HWND hWnd);
  66. int AddRef();
  67. int Release();
  68. DWORD IsNT5Machine(LPCTSTR pszMachine, BOOL *pfNt4);
  69. protected:
  70. void Destroy();
  71. public:
  72. AFP_SERVER_HANDLE m_hAfpServer;
  73. HANDLE m_hDestroySync;
  74. CString m_strMachine;
  75. protected:
  76. CMacFilesConfiguration * m_pPageConfig;
  77. CMacFilesSessions * m_pPageSessions;
  78. CMacFilesFileAssociation * m_pPageFileAssoc;
  79. IDataObjectPtr m_spDataObject; // Used for MMCPropertyChangeNotify
  80. HWND m_hSheetWindow;
  81. SfmFileServiceProvider * m_pSfmProvider;
  82. int m_nRefCount;
  83. HANDLE m_hThread;
  84. CString m_strTitle;
  85. CString m_strHelpFilePath;
  86. };
  87. #endif _SFMUTIL_H