a few fixes.
authorThomas Bluemel <thomas@reactsoft.com>
Sat, 14 Aug 2004 11:50:25 +0000 (11:50 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Sat, 14 Aug 2004 11:50:25 +0000 (11:50 +0000)
I'm not going to continue working on this due to a lack of knowledge of the security api, so someone else who knows a bit more about them should step in...

svn path=/trunk/; revision=10529

reactos/lib/aclui/Makefile
reactos/lib/aclui/aclui.c
reactos/lib/aclui/aclui.rc
reactos/lib/aclui/aclui_En.rc
reactos/lib/aclui/internal.h
reactos/lib/aclui/res/usrgrp.bmp [new file with mode: 0644]
reactos/lib/aclui/resource.h

index ce1cc26..77a3d28 100644 (file)
@@ -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 \
index f8100d3..798a6f7 100644 (file)
@@ -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 <windows.h>
+#include <commctrl.h>
 #include <prsht.h>
 #include <aclui.h>
 #include <rosrtl/resstr.h>
 
 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;
+    {
+      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;
+}
+
index 7235e0b..dcef81d 100644 (file)
@@ -37,5 +37,6 @@ BEGIN
     END
 END
 
+IDB_USRGRPIMAGES BITMAP "res/usrgrp.bmp"
 #include "aclui_En.rc"
 
index fca4e1c..8d62a41 100644 (file)
@@ -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
index 62ea36f..106d44e 100644 (file)
@@ -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 (file)
index 0000000..575112c
Binary files /dev/null and b/reactos/lib/aclui/res/usrgrp.bmp differ
index b858b00..f1d2934 100644 (file)
@@ -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 */