enumerate the permission names and display them Modified: trunk/reactos/lib/aclui/aclui.c Modified: trunk/reactos/lib/aclui/aclui_De.rc Modified: trunk/reactos/lib/aclui/aclui_En.rc Modified: trunk/reactos/lib/aclui/aclui_Sv.rc Modified: trunk/reactos/lib/aclui/acluilib.h Modified: trunk/reactos/lib/aclui/checklist.c Modified: trunk/reactos/lib/aclui/resource.h _____
Modified: trunk/reactos/lib/aclui/aclui.c --- trunk/reactos/lib/aclui/aclui.c 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/aclui.c 2005-07-02 01:34:18 UTC (rev 16375) @@ -460,7 +460,78 @@
pt.x); }
+static VOID +LoadPermissionsList(IN PSECURITY_PAGE sp, + IN GUID *GuidObjectType, + IN DWORD dwFlags, + OUT SI_ACCESS *DefaultAccess) +{ + HRESULT hRet; + PSI_ACCESS AccessList; + ULONG nAccessList, DefaultAccessIndex; + + /* clear the permissions list */ + + SendMessage(sp->hAceCheckList, + CLM_CLEAR, + 0, + 0); + + /* query the access rights from the server */ + hRet = sp->psi->lpVtbl->GetAccessRights(sp->psi, + GuidObjectType, + dwFlags, + &AccessList, + &nAccessList, + &DefaultAccessIndex); + if (SUCCEEDED(hRet) && nAccessList != 0) + { + LPCWSTR NameStr; + PSI_ACCESS CurAccess, LastAccess; + WCHAR NameBuffer[MAX_PATH]; + + /* save the default access rights to be used when adding ACEs later */ + if (DefaultAccess != NULL) + { + *DefaultAccess = AccessList[DefaultAccessIndex]; + } + + LastAccess = AccessList + nAccessList; + for (CurAccess = &AccessList[0]; + CurAccess != LastAccess; + CurAccess++) + { + if (CurAccess->dwFlags & dwFlags) + { + /* get the permission name, load it from a string table if necessary */ + if (IS_INTRESOURCE(CurAccess->pszName)) + { + if (!LoadString(sp->ObjectInfo.hInstance, + (UINT)((ULONG_PTR)CurAccess->pszName), + NameBuffer, + sizeof(NameBuffer) / sizeof(NameBuffer[0]))) + { + LoadString(hDllInstance, + IDS_UNKNOWN, + NameBuffer, + sizeof(NameBuffer) / sizeof(NameBuffer[0])); + } + NameStr = NameBuffer; + } + else + { + NameStr = CurAccess->pszName; + }
+ SendMessage(sp->hAceCheckList, + CLM_ADDITEM, + CIS_DISABLED | CIS_NONE, + (LPARAM)NameStr); + } + } + } +} + static INT_PTR CALLBACK SecurityPageProc(IN HWND hwndDlg, IN UINT uMsg, @@ -547,6 +618,12 @@ GetDlgItem(hwndDlg, IDC_LABEL_DENY));
/* FIXME - hide controls in case the flags aren't present */ + + LoadPermissionsList(sp, + NULL, + SI_ACCESS_GENERAL | + ((sp->ObjectInfo.dwFlags & SI_CONTAINER) ? SI_ACCESS_CONTAINER : 0), + &sp->DefaultAccess); } break; } @@ -607,6 +684,8 @@ sPage->psi = psi; sPage->ObjectInfo = ObjectInfo;
+ ZeroMemory(&psp, sizeof(psp)); + psp.dwSize = sizeof(PROPSHEETPAGE); psp.dwFlags = PSP_USECALLBACK; psp.hInstance = hDllInstance; @@ -683,6 +762,7 @@ { /* Set the page title if the flag is present and the string isn't empty */ psh.pszCaption = ObjectInfo.pszPageTitle; + psh.dwFlags |= PSH_PROPTITLE; lpCaption = NULL; } else _____
Modified: trunk/reactos/lib/aclui/aclui_De.rc --- trunk/reactos/lib/aclui/aclui_De.rc 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/aclui_De.rc 2005-07-02 01:34:18 UTC (rev 16375) @@ -17,4 +17,5 @@
STRINGTABLE DISCARDABLE { IDS_PSP_TITLE "Berechtigungen f³r %1" + IDS_UNKNOWN "Unbekannt" } _____
Modified: trunk/reactos/lib/aclui/aclui_En.rc --- trunk/reactos/lib/aclui/aclui_En.rc 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/aclui_En.rc 2005-07-02 01:34:18 UTC (rev 16375) @@ -17,5 +17,6 @@
STRINGTABLE DISCARDABLE { IDS_PSP_TITLE "Permissions for %1" + IDS_UNKNOWN "Unknown" }
_____
Modified: trunk/reactos/lib/aclui/aclui_Sv.rc --- trunk/reactos/lib/aclui/aclui_Sv.rc 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/aclui_Sv.rc 2005-07-02 01:34:18 UTC (rev 16375) @@ -35,5 +35,6 @@
STRINGTABLE DISCARDABLE { IDS_PSP_TITLE "Beh÷righeter f÷r %1" + IDS_UNKNOWN "Unknown" }
_____
Modified: trunk/reactos/lib/aclui/acluilib.h --- trunk/reactos/lib/aclui/acluilib.h 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/acluilib.h 2005-07-02 01:34:18 UTC (rev 16375) @@ -44,6 +44,8 @@
LPSECURITYINFO psi; SI_OBJECT_INFO ObjectInfo; + + SI_ACCESS DefaultAccess; } SECURITY_PAGE, *PSECURITY_PAGE;
/* MISC ***********************************************************************/ @@ -68,10 +70,11 @@
/* CHECKLIST CONTROL **********************************************************/
-#define CIS_DISABLED (0x2) +#define CIS_DISABLED (0x4) #define CIS_ENABLED (0x0) -#define CIS_ALLOW (0x1) -#define CIS_DENY (0x0) +#define CIS_ALLOW (0x2) +#define CIS_DENY (0x1) +#define CIS_NONE (0x0)
#define CLB_ALLOW (0x1) #define CLB_DENY (0x0) _____
Modified: trunk/reactos/lib/aclui/checklist.c --- trunk/reactos/lib/aclui/checklist.c 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/checklist.c 2005-07-02 01:34:18 UTC (rev 16375) @@ -281,12 +281,11 @@
ScrollPos + VisibleFirstIndex); if (FirstItem != NULL) { - RECT TextRect, ItemRect; + RECT TextRect, ItemRect, CheckBox; HFONT hOldFont; DWORD CurrentIndex; COLORREF OldTextColor; BOOL Enabled, PrevEnabled; - POINT ptOld;
Enabled = IsWindowEnabled(infoPtr->hSelf); PrevEnabled = Enabled; @@ -299,11 +298,6 @@ TextRect.right = ItemRect.right - 6; TextRect.top = ItemRect.top + 2;
- MoveToEx(hDC, - infoPtr->CheckBoxLeft[CLB_ALLOW], - ItemRect.top, - &ptOld); - OldTextColor = SetTextColor(hDC, infoPtr->TextColor[Enabled]);
@@ -324,27 +318,35 @@ infoPtr->TextColor[PrevEnabled]); }
+ /* draw the text */ DrawText(hDC, Item->Name, -1, &TextRect, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
- MoveToEx(hDC, - infoPtr->CheckBoxLeft[CLB_ALLOW], - TextRect.top - 6, - NULL); - LineTo(hDC, - infoPtr->CheckBoxLeft[CLB_ALLOW], - TextRect.bottom - 6); - MoveToEx(hDC, - infoPtr->CheckBoxLeft[CLB_DENY], - TextRect.top - 6, - NULL); - LineTo(hDC, - infoPtr->CheckBoxLeft[CLB_DENY], - TextRect.bottom - 6); + /* draw the Allow checkbox */ + CheckBox.left = infoPtr->CheckBoxLeft[CLB_ALLOW] - ((TextRect.bottom - TextRect.top) / 2); + CheckBox.right = CheckBox.left + (TextRect.bottom - TextRect.top) - 4; + CheckBox.top = TextRect.top; + CheckBox.bottom = CheckBox.top + (TextRect.bottom - TextRect.top) - 4; + DrawFrameControl(hDC, + &CheckBox, + DFC_BUTTON, + DFCS_BUTTONCHECK | DFCS_FLAT | + ((Item->State & CIS_DISABLED) && Enabled ? DFCS_INACTIVE : 0) | + ((Item->State & CIS_ALLOW) ? DFCS_CHECKED : 0));
+ /* draw the Deny checkbox */ + CheckBox.left = infoPtr->CheckBoxLeft[CLB_DENY] - ((TextRect.bottom - TextRect.top) / 2); + CheckBox.right = CheckBox.left + (TextRect.bottom - TextRect.top) - 4; + DrawFrameControl(hDC, + &CheckBox, + DFC_BUTTON, + DFCS_BUTTONCHECK | DFCS_FLAT | + ((Item->State & CIS_DISABLED) && Enabled ? DFCS_INACTIVE : 0) | + ((Item->State & CIS_DENY) ? DFCS_CHECKED : 0)); + TextRect.top += infoPtr->ItemHeight; }
@@ -353,11 +355,6 @@
SetTextColor(hDC, OldTextColor); - - MoveToEx(hDC, - ptOld.x, - ptOld.y, - NULL); } }
_____
Modified: trunk/reactos/lib/aclui/resource.h --- trunk/reactos/lib/aclui/resource.h 2005-07-01 23:33:34 UTC (rev 16374) +++ trunk/reactos/lib/aclui/resource.h 2005-07-02 01:34:18 UTC (rev 16375) @@ -13,6 +13,7 @@
#define IDI_DEVMGR 100
#define IDS_PSP_TITLE 1001 +#define IDS_UNKNOWN 1002
#define IDB_USRGRPIMAGES 1001