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.

178 lines
4.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: aclpriv.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _ACLUI_
  11. #define _ACLUI_
  12. #ifndef UNICODE
  13. #error "No ANSI support yet"
  14. #endif
  15. // For test building NT4
  16. //#undef _WIN32_WINNT
  17. //#define _WIN32_WINNT 0x0400
  18. //BOOL WINAPI ConvertSidToStringSid(PSID pSid, LPTSTR *ppszStringSid);
  19. extern "C"
  20. {
  21. #include <nt.h> // SE_TAKE_OWNERSHIP_PRIVILEGE, etc
  22. #include <ntrtl.h>
  23. #include <nturtl.h>
  24. #include <seopaque.h> // RtlObjectAceSid, etc.
  25. }
  26. #define INC_OLE2
  27. #include <windows.h>
  28. #include <commctrl.h>
  29. #include "resource.h" // resource ID's
  30. #include "idh.h" // help ID's
  31. #ifndef RC_INVOKED
  32. #include <windowsx.h>
  33. #include <atlconv.h> // ANSI/Unicode conversion support
  34. #include <shlobj.h>
  35. #include <shfusion.h>
  36. #include <accctrl.h>
  37. #include <aclui.h>
  38. #include <comctrlp.h> // DPA/DSA
  39. #if(_WIN32_WINNT >= 0x0500)
  40. #include <objsel.h> // DS Object Picker
  41. #else
  42. typedef IUnknown IDsObjectPicker; // dummy placeholder
  43. #endif
  44. #include <htmlhelp.h>
  45. #include <common.h>
  46. #include "misc.h"
  47. #include "pagebase.h"
  48. #include "chklist.h"
  49. #include "ace.h"
  50. #include "perm.h"
  51. #include "cstrings.h"
  52. #include "sidcache.h"
  53. #include "aclbloat.h"
  54. // These are here for NT4 SP4 builds (comctrlp.h added these for NT5)
  55. #ifndef DA_LAST
  56. #define DA_LAST (0x7FFFFFFF)
  57. #endif
  58. #ifndef DPA_AppendPtr
  59. #define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem)
  60. #endif
  61. #ifndef DSA_AppendItem
  62. #define DSA_AppendItem(hdsa, pitem) DSA_InsertItem(hdsa, DA_LAST, pitem)
  63. #endif
  64. extern HINSTANCE hModule;
  65. extern HINSTANCE g_hGetUserLib;
  66. extern UINT UM_SIDLOOKUPCOMPLETE;
  67. extern UINT g_cfDsSelectionList;
  68. extern UINT g_cfSidInfoList;
  69. // Magic debug flags
  70. #define TRACE_PERMPAGE 0x00000001
  71. #define TRACE_PRINCIPAL 0x00000002
  72. #define TRACE_SI 0x00000004
  73. #define TRACE_PERMSET 0x00000008
  74. #define TRACE_ACELIST 0x00000010
  75. #define TRACE_ACEEDIT 0x00000020
  76. #define TRACE_OWNER 0x00000040
  77. #define TRACE_MISC 0x00000080
  78. #define TRACE_CHECKLIST 0x00000100
  79. #define TRACE_SIDCACHE 0x00000200
  80. #define TRACE_EFFPERM 0x00000400
  81. #define TRACE_ACLBLOAT 0x00000800
  82. #define TRACE_ALWAYS 0xffffffff // use with caution
  83. #define MAX_COLUMN_CHARS 100
  84. #define COLUMN_ALLOW 1
  85. #define COLUMN_DENY 2
  86. #define ACE_INHERIT_ALL (CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE)
  87. #define SI_ACCESS_CUSTOM 0x10000000 //This flag is used is SI_ACCESS to indicate
  88. //Custom checkbox which comes in first screen for
  89. //custom permission
  90. #define ACL_BLOAT_LIMIT 8
  91. BOOL
  92. ACLUIAPI
  93. EditSecurityEx(HWND hwndOwner,
  94. LPSECURITYINFO psi,
  95. PPERMPAGE pPermPage,
  96. UINT nStartPage);
  97. BOOL
  98. EditACEEntry(HWND hwndOwner,
  99. LPSECURITYINFO psi,
  100. PACE pAce,
  101. SI_PAGE_TYPE siType,
  102. LPCTSTR pszObjectName,
  103. BOOL bReadOnly,
  104. DWORD *pdwResult,
  105. HDPA *phEntries,
  106. HDPA *phPropertyEntries,
  107. UINT nStartPage = 0);
  108. // EditACEEntry result values. Set if something was edited on the
  109. // corresponding page, otherwise clear.
  110. #define EAE_NEW_OBJECT_ACE 0x0001
  111. #define EAE_NEW_PROPERTY_ACE 0x0002
  112. LPARAM
  113. GetSelectedItemData(HWND hList, int *pIndex);
  114. int
  115. ConfirmAclProtect(HWND hwndParent, BOOL bDacl);
  116. HPROPSHEETPAGE
  117. CreateOwnerPage(LPSECURITYINFO psi, SI_OBJECT_INFO *psiObjectInfo);
  118. HPROPSHEETPAGE
  119. CreateEffectivePermPage(LPSECURITYINFO psi,SI_OBJECT_INFO *psiObjectInfo);
  120. STDMETHODIMP
  121. _InitCheckList(HWND hwndList,
  122. LPSECURITYINFO psi,
  123. const GUID * pguidObjectType,
  124. DWORD dwFlags,
  125. HINSTANCE hInstance,
  126. DWORD dwType,
  127. PSI_ACCESS * ppDefaultAccess);
  128. void
  129. HandleListClick(PNM_CHECKLIST pnmc,
  130. SI_PAGE_TYPE siType,
  131. BOOL bContainerFlags,
  132. HDSA * phAllowUncheckedAccess= NULL,
  133. HDSA * phDenyUncheckedAccess= NULL,
  134. BOOL bCustomPresent = FALSE);
  135. UINT
  136. GetAcesFromCheckList(HWND hChkList,
  137. PSID pSid,
  138. BOOL fPerm,
  139. BOOL fAceFlagsProvided,
  140. UCHAR uAceFlagsNew,
  141. const GUID *pInheritGUID,
  142. HDPA hEntries);
  143. typedef struct _col_for_listview
  144. {
  145. UINT idText; // Resource Id for column name
  146. UINT iPercent; // Percent of width
  147. } COL_FOR_LV;
  148. #endif // RC_INVOKED
  149. #endif // _ACLUI_