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.

143 lines
4.2 KiB

  1. /**************************************************************************
  2. THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright 1998 Microsoft Corporation. All Rights Reserved.
  7. **************************************************************************/
  8. /**************************************************************************
  9. File: PropSheet.h
  10. Description:
  11. **************************************************************************/
  12. #ifndef SHELLEXT_H
  13. #define SHELLEXT_H
  14. //#include "tchar.h"
  15. #include "windows.h"
  16. #include "shlobj.h"
  17. #include "crtdbg.h"
  18. #include "chklst.h"
  19. #include "Comdef.h"
  20. #include "ObjBase.h"
  21. #include "CHString.h"
  22. #include "lmaccess.h"
  23. #include "resource.h"
  24. #include "olectl.h"
  25. #include "ShellApi.h"
  26. #include "ShlWapi.h"
  27. #include "ISAUsInf.h"
  28. // Constants
  29. #define STRING_SECURITY_WORLD_SID_AUTHORITY "S-1-1-0"
  30. #define DOMAIN_NAME "SMELLY" //KIBBLESNBITS
  31. #define DOMAIN_SERVER "Domination" //L"ALPO"
  32. #define DOCUMENTS_FOLDER "D:\\Yuri" // "D:\\\\Documents\\\\"
  33. #define CHAMELEON_SHARE "\\\\Domination\\Yuri" // "\\\\ALPO\\Documents"
  34. /**************************************************************************
  35. global variables and definitions
  36. **************************************************************************/
  37. #ifndef ListView_SetCheckState
  38. // #ifndef is important because this macro (well, a
  39. // slightly fixed-up version of this macro) will be going into the
  40. // next version of commctrl.h
  41. #define ListView_SetCheckState(hwndLV, i, fCheck) \
  42. ListView_SetItemState(hwndLV, i, \
  43. INDEXTOSTATEIMAGEMASK((fCheck)?2:1), LVIS_STATEIMAGEMASK)
  44. #endif
  45. #define IDM_DISPLAY 0
  46. extern PSID g_pSidEverybody;
  47. extern LONG g_pSidEverybodyLenght;
  48. extern PSID g_pSidAdmins;
  49. extern LONG g_pSidAdminsLenght;
  50. /**************************************************************************
  51. CClassFactory class definition
  52. **************************************************************************/
  53. class CClassFactory : public IClassFactory
  54. {
  55. protected:
  56. DWORD m_ObjRefCount;
  57. public:
  58. CClassFactory();
  59. ~CClassFactory();
  60. //IUnknown methods
  61. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  62. STDMETHODIMP_(DWORD) AddRef();
  63. STDMETHODIMP_(DWORD) Release();
  64. //IClassFactory methods
  65. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
  66. STDMETHODIMP LockServer(BOOL);
  67. };
  68. /**************************************************************************
  69. CShellPropSheetExt class definition
  70. **************************************************************************/
  71. class CShellPropSheetExt : public IShellExtInit, IShellPropSheetExt
  72. {
  73. protected:
  74. DWORD m_ObjRefCount;
  75. CCheckList m_CheckList;
  76. BOOL m_fEveryone;
  77. UINT m_uiUser;
  78. ISAUserInfo *m_pSAUserInfo;// IWbemServices *m_pIWbemServices;
  79. TCHAR m_szPath[MAX_PATH];
  80. _bstr_t m_bsPath;
  81. BOOL m_fChanged;
  82. // PSID m_pSidEverybody;
  83. // LONG m_pSidEverybodyLenght;
  84. BOOL m_fHasAccess;
  85. // System info
  86. TCHAR m_tszDomainServer[MAX_PATH];
  87. TCHAR m_tszShare[MAX_PATH];
  88. TCHAR m_tszDocuments[MAX_PATH];
  89. public:
  90. CShellPropSheetExt();
  91. ~CShellPropSheetExt();
  92. //IUnknown methods
  93. STDMETHOD(QueryInterface)(REFIID, LPVOID FAR *);
  94. STDMETHOD_(DWORD, AddRef)();
  95. STDMETHOD_(DWORD, Release)();
  96. //IShellExtInit methods
  97. STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
  98. //IShellPropSheetExt methods
  99. STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE, LPARAM);
  100. STDMETHOD(ReplacePage)(UINT, LPFNADDPROPSHEETPAGE, LPARAM);
  101. private:
  102. static BOOL CALLBACK PageDlgProc(HWND, UINT, WPARAM, LPARAM);
  103. static UINT CALLBACK PageCallbackProc(HWND, UINT, LPPROPSHEETPAGE);
  104. BOOL IsChamelon(LPTSTR);
  105. BOOL Connect();
  106. void EnumUsers(HWND hWndList);
  107. void Save(HWND hWnd);
  108. void CleanUp();
  109. void NoAccessUpdateView(HWND);
  110. void AccessUpdateView(HWND);
  111. HRESULT GetFilePermissions(HWND hWnd);
  112. HRESULT SetFilePermissions(HWND hWnd);
  113. }
  114. ;
  115. #endif //SHELLEXT_H