diff --git a/reactos/lib/aclui/Makefile b/reactos/lib/aclui/Makefile index ce1cc269189..77a3d28cca4 100644 --- a/reactos/lib/aclui/Makefile +++ b/reactos/lib/aclui/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.3 2004/08/11 01:21:52 weiden Exp $ +# $Id: Makefile,v 1.4 2004/08/14 11:50:25 weiden Exp $ PATH_TO_TOP = ../.. @@ -16,6 +16,7 @@ TARGET_CFLAGS = \ -DUNICODE \ -D_UNICODE \ -D__REACTOS__ \ + -D_WIN32_IE=0x0500 \ -D_WIN32_WINNT=0x501 \ -DWINVER=0x600 \ -Wall \ diff --git a/reactos/lib/aclui/aclui.c b/reactos/lib/aclui/aclui.c index f8100d37011..798a6f7582c 100644 --- a/reactos/lib/aclui/aclui.c +++ b/reactos/lib/aclui/aclui.c @@ -16,7 +16,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: aclui.c,v 1.5 2004/08/14 00:46:54 weiden Exp $ +/* $Id: aclui.c,v 1.6 2004/08/14 11:50:25 weiden Exp $ * * PROJECT: ReactOS Access Control List Editor * FILE: lib/aclui/aclui.c @@ -28,6 +28,7 @@ */ #define INITGUID #include +#include #include #include #include @@ -36,38 +37,39 @@ HINSTANCE hDllInstance; - - -BOOL STDCALL -DllMain(HINSTANCE hinstDLL, - DWORD dwReason, - LPVOID lpvReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - hDllInstance = hinstDLL; - break; - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - - UINT CALLBACK SecurityPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp) { switch(uMsg) { case PSPCB_CREATE: - return TRUE; - case PSPCB_RELEASE: + { + PSECURITY_PAGE sp; + + sp = LocalAlloc(LHND, sizeof(SECURITY_PAGE)); + if(sp != NULL) + { + /* save the pointer to the ISecurityInformation interface */ + sp->psi = (LPSECURITYINFO)ppsp->lParam; + /* set the lParam to the allocated structure */ + ppsp->lParam = (LPARAM)sp; + return TRUE; + } return FALSE; + } + case PSPCB_RELEASE: + { + if(ppsp->lParam != 0) + { + PSECURITY_PAGE sp = (PSECURITY_PAGE)ppsp->lParam; + if(sp->hiUsrs != NULL) + { + ImageList_Destroy(sp->hiUsrs); + } + LocalFree((HLOCAL)sp); + } + return FALSE; + } } return FALSE; @@ -77,6 +79,42 @@ SecurityPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp) INT_PTR CALLBACK SecurityPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + PSECURITY_PAGE sp; + + switch(uMsg) + { + case WM_INITDIALOG: + { + sp = (PSECURITY_PAGE)lParam; + if(sp != NULL) + { + LV_COLUMN lvc; + RECT rcLvClient; + + sp->hWnd = hwndDlg; + sp->hWndUsrList = GetDlgItem(hwndDlg, IDC_ACELIST); + sp->hiUsrs = ImageList_LoadBitmap(hDllInstance, MAKEINTRESOURCE(IDB_USRGRPIMAGES), 16, 3, 0); + + /* save the pointer to the structure */ + SetWindowLong(hwndDlg, DWL_USER, (LONG)sp); + + GetClientRect(sp->hWndUsrList, &rcLvClient); + + /* setup the listview control */ + ListView_SetExtendedListViewStyleEx(sp->hWndUsrList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); + ListView_SetImageList(sp->hWndUsrList, sp->hiUsrs, LVSIL_SMALL); + + /* add a column to the list view */ + lvc.mask = LVCF_FMT | LVCF_WIDTH; + lvc.fmt = LVCFMT_LEFT; + lvc.cx = rcLvClient.right; + ListView_InsertColumn(sp->hWndUsrList, 0, &lvc); + + /* FIXME - hide controls in case the flags aren't present */ + } + break; + } + } return 0; } @@ -209,3 +247,23 @@ EditSecurity(HWND hwndOwner, LPSECURITYINFO psi) return Ret; } +BOOL STDCALL +DllMain(HINSTANCE hinstDLL, + DWORD dwReason, + LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + hDllInstance = hinstDLL; + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/reactos/lib/aclui/aclui.rc b/reactos/lib/aclui/aclui.rc index 7235e0b0502..dcef81d98f8 100644 --- a/reactos/lib/aclui/aclui.rc +++ b/reactos/lib/aclui/aclui.rc @@ -37,5 +37,6 @@ BEGIN END END +IDB_USRGRPIMAGES BITMAP "res/usrgrp.bmp" #include "aclui_En.rc" diff --git a/reactos/lib/aclui/aclui_En.rc b/reactos/lib/aclui/aclui_En.rc index fca4e1c9b08..8d62a415939 100644 --- a/reactos/lib/aclui/aclui_En.rc +++ b/reactos/lib/aclui/aclui_En.rc @@ -10,7 +10,11 @@ CAPTION "Security" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "&Group or user names:", -1, 7, 7, 105, 8 - CONTROL "", IDC_GRPUSRLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 7, 17, 213, 66, WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE + CONTROL "", IDC_ACELIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 7, 17, 213, 66, WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE + PUSHBUTTON "A&dd...", IDC_ACELIST_ADD, 116, 87, 50, 14 + PUSHBUTTON "&Remove", IDC_ACELIST_REMOVE, 170, 87, 50, 14 + LTEXT "Allow", -1, 135, 107, 32, 8, SS_CENTER + LTEXT "Deny", -1, 176, 107, 32, 8, SS_CENTER END STRINGTABLE DISCARDABLE diff --git a/reactos/lib/aclui/internal.h b/reactos/lib/aclui/internal.h index 62ea36faa88..106d44e9b2b 100644 --- a/reactos/lib/aclui/internal.h +++ b/reactos/lib/aclui/internal.h @@ -6,6 +6,14 @@ ULONG DbgPrint(PCH Format,...); extern HINSTANCE hDllInstance; +typedef struct _SECURITY_PAGE +{ + HWND hWnd; + HWND hWndUsrList; + HIMAGELIST hiUsrs; + LPSECURITYINFO psi; +} SECURITY_PAGE, *PSECURITY_PAGE; + #endif /* __ACLUI_INTERNAL_H */ /* EOF */ diff --git a/reactos/lib/aclui/res/usrgrp.bmp b/reactos/lib/aclui/res/usrgrp.bmp new file mode 100644 index 00000000000..575112c6f7c Binary files /dev/null and b/reactos/lib/aclui/res/usrgrp.bmp differ diff --git a/reactos/lib/aclui/resource.h b/reactos/lib/aclui/resource.h index b858b001876..f1d2934f37c 100644 --- a/reactos/lib/aclui/resource.h +++ b/reactos/lib/aclui/resource.h @@ -1,14 +1,18 @@ #ifndef __ACLUI_RESOURCE_H #define __ACLUI_RESOURCE_H -#define IDD_SECPAGE 101 +#define IDD_SECPAGE 101 -#define IDC_GRPUSRLIST 1001 +#define IDC_ACELIST 1001 +#define IDC_ACELIST_ADD 1002 +#define IDC_ACELIST_REMOVE 1003 #define IDI_DEVMGR 100 #define IDS_PSP_TITLE 1001 +#define IDB_USRGRPIMAGES 1001 + #endif /* __ACLUI_RESOURCE_H */ /* EOF */