* 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
*/
#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;
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;
}
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;
+}
+
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