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.

109 lines
3.9 KiB

  1. #ifndef _INC_DSKQUOTA_OWNERDLG_H
  2. #define _INC_DSKQUOTA_OWNERDLG_H
  3. #ifndef _INC_DSKQUOTA_PRIVATE_H
  4. # include "private.h"
  5. #endif
  6. #ifndef _INC_DSKQUOTA_OWNERLST_H
  7. # include "ownerlst.h"
  8. #endif
  9. class CFileOwnerDialog
  10. {
  11. public:
  12. CFileOwnerDialog(HINSTANCE hInstance,
  13. HWND hwndParent,
  14. LPCTSTR pszVolumeRoot,
  15. const CArray<IDiskQuotaUser *>& rgpOwners);
  16. ~CFileOwnerDialog(void);
  17. INT_PTR Run(void);
  18. private:
  19. //
  20. // Code in ownerdlg.cpp relies on the values and order of these
  21. // enumerated constants.
  22. //
  23. enum { iLVSUBITEM_FILE = 0,
  24. iLVSUBITEM_FOLDER,
  25. iLVSUBITEM_OWNER
  26. };
  27. HINSTANCE m_hInstance;
  28. HWND m_hwndParent;
  29. HWND m_hwndDlg;
  30. HWND m_hwndLV;
  31. HWND m_hwndOwnerCombo;
  32. HWND m_hwndEditMoveTo;
  33. int m_iLastColSorted;
  34. CPath m_strVolumeRoot;
  35. const CArray<IDiskQuotaUser *>& m_rgpOwners; // Ref to existing list.
  36. COwnerList m_OwnerList;
  37. bool m_bSortAscending;
  38. bool m_bAbort;
  39. HANDLE m_hOwnerListThread;
  40. static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. INT_PTR OnInitDialog(HWND hwnd);
  42. INT_PTR OnDestroy(HWND hwnd);
  43. INT_PTR OnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam);
  44. INT_PTR OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam);
  45. INT_PTR OnSetCursor(HWND hwnd);
  46. INT_PTR OnContextMenu(HWND hwndItem, int xPos, int yPos);
  47. void OnLVN_GetDispInfo(LV_DISPINFO *plvdi);
  48. void OnLVN_ColumnClick(NM_LISTVIEW *pnmlv);
  49. void OnLVN_ItemChanged(NM_LISTVIEW *pnmlv);
  50. void OnLVN_KeyDown(NMLVKEYDOWN *plvkd);
  51. void InitializeList(const COwnerList& fol, HWND hwndList);
  52. void FillListView(const COwnerList& fol, HWND hwndList, int iOwner = -1);
  53. void InitializeOwnerCombo(const COwnerList& fol, HWND hwndCombo);
  54. void CreateListColumns(HWND hwndList, bool bShowOwner = true);
  55. HRESULT IsSameVolume(LPCTSTR pszRoot1, LPCTSTR pszRoot2);
  56. bool BrowseForFolder(HWND hwndParent, CString *pstrFolder);
  57. bool ShouldEnableControl(UINT idCtl);
  58. void RemoveListViewItems(HWND hwndLV, const CArray<COwnerListItemHandle>& rgItemHandles);
  59. void BuildListOfSelectedFiles(HWND hwndLV, DblNulTermList *pList, CArray<COwnerListItemHandle> *prgItemHandles);
  60. void MoveSelectedFiles(HWND hwndLV, LPCTSTR pszDest);
  61. void DeleteSelectedFiles(HWND hwndLV);
  62. void FocusOnSomethingInListview(HWND hwndLV);
  63. void OnOwnerListComplete(void);
  64. int FindItemFromHandle(HWND hwndLV, const COwnerListItemHandle& handle);
  65. HRESULT TakeOwnershipOfSelectedFiles(HWND hwndLV);
  66. HRESULT GetOwnershipSid(array_autoptr<BYTE> *ptrSid);
  67. DWORD GetAllowedActions(HWND hwndLV);
  68. static int CALLBACK CompareLVItems(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  69. static int CALLBACK BrowseForFolderCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  70. static DWORD OwnerListThreadProc(LPVOID pvParam);
  71. HRESULT
  72. BuildFileOwnerList(
  73. LPCTSTR pszVolumeRoot,
  74. const CArray<IDiskQuotaUser *>& rgpOwners,
  75. COwnerList *pOwnerList);
  76. HRESULT
  77. AddFilesToOwnerList(
  78. LPCTSTR pszVolumeRoot,
  79. HANDLE hVolumeRoot,
  80. IDiskQuotaUser *pOwner,
  81. COwnerList *pOwnerList);
  82. NTSTATUS
  83. OpenNtObject (
  84. LPCWSTR pszFile,
  85. HANDLE RelatedObject,
  86. ULONG CreateOptions,
  87. ULONG DesiredAccess,
  88. ULONG ShareAccess,
  89. ULONG CreateDisposition,
  90. HANDLE *ph);
  91. };
  92. #endif // _INC_DSKQUOTA_OWNERDLG_H