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.

106 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995 - 1995.
  5. //
  6. // File: share.hxx
  7. //
  8. // Contents: CShare class definition to handle Sharing context menu
  9. // and property sheet shell extensions.
  10. //
  11. // History: 4-Apr-95 BruceFo Created
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef _SHARE_HXX_
  15. #define _SHARE_HXX_
  16. class CShare
  17. : public IShellExtInit,
  18. public IShellPropSheetExt,
  19. public IContextMenu
  20. {
  21. DECLARE_SIG;
  22. public:
  23. CShare();
  24. ~CShare();
  25. //
  26. // IUnknown methods
  27. //
  28. STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppvObj);
  29. STDMETHOD_(ULONG,AddRef)();
  30. STDMETHOD_(ULONG,Release)();
  31. //
  32. // IShellExtInit methods
  33. //
  34. STDMETHOD(Initialize)(
  35. LPCITEMIDLIST pidlFolder,
  36. LPDATAOBJECT pDataObject,
  37. HKEY hkeyProgID);
  38. //
  39. // IShellPropSheetExt methods
  40. //
  41. STDMETHOD(AddPages)(
  42. LPFNADDPROPSHEETPAGE lpfnAddPage,
  43. LPARAM lParam);
  44. STDMETHOD(ReplacePage)(
  45. UINT uPageID,
  46. LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  47. LPARAM lParam);
  48. //
  49. // IContextMenu methods
  50. //
  51. STDMETHOD(QueryContextMenu)(
  52. HMENU hmenu,
  53. UINT indexMenu,
  54. UINT idCmdFirst,
  55. UINT idCmdLast,
  56. UINT uFlags);
  57. STDMETHOD(InvokeCommand)(
  58. LPCMINVOKECOMMANDINFO lpici);
  59. STDMETHOD(GetCommandString)(
  60. UINT_PTR idCmd,
  61. UINT uType,
  62. UINT* pwReserved,
  63. LPSTR pszName,
  64. UINT cchMax);
  65. private:
  66. HRESULT
  67. _GetFSObject(
  68. LPWSTR lpPath,
  69. UINT cbMaxPath
  70. );
  71. BOOL
  72. _IsShareableDrive(
  73. VOID
  74. );
  75. BOOL
  76. _OKToShare(
  77. VOID
  78. );
  79. ULONG _uRefs; // OLE reference count
  80. TCHAR _szPath[MAX_PATH];
  81. BOOL _fPathChecked;
  82. BOOL _fOkToSharePath;
  83. BOOL _fMultipleSharesSelected;
  84. };
  85. #endif // _SHARE_HXX_