From ca0c109ceced31682748bbcce9a0da6eaad6ebca Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 11 Aug 2004 01:21:53 +0000 Subject: [PATCH] Implemented CreateSecurityPage() to create an empty property sheet. svn path=/trunk/; revision=10492 --- reactos/lib/aclui/Makefile | 4 +- reactos/lib/aclui/aclui.c | 77 ++++++++++++++++++++++++++++++++++- reactos/lib/aclui/aclui_En.rc | 9 ++++ reactos/lib/aclui/resource.h | 4 ++ reactos/lib/aclui/stubs.c | 29 ------------- 5 files changed, 91 insertions(+), 32 deletions(-) delete mode 100644 reactos/lib/aclui/stubs.c diff --git a/reactos/lib/aclui/Makefile b/reactos/lib/aclui/Makefile index 3e372d2836b..ce1cc269189 100644 --- a/reactos/lib/aclui/Makefile +++ b/reactos/lib/aclui/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 2004/08/10 15:47:54 weiden Exp $ +# $Id: Makefile,v 1.3 2004/08/11 01:21:52 weiden Exp $ PATH_TO_TOP = ../.. @@ -32,7 +32,7 @@ TARGET_PCH = TARGET_CLEAN = -TARGET_OBJECTS = aclui.o stubs.o +TARGET_OBJECTS = aclui.o DEP_OBJECTS = $(TARGET_OBJECTS) diff --git a/reactos/lib/aclui/aclui.c b/reactos/lib/aclui/aclui.c index b26b46981e4..d8dfd9f4773 100644 --- a/reactos/lib/aclui/aclui.c +++ b/reactos/lib/aclui/aclui.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: aclui.c,v 1.3 2004/08/10 15:47:54 weiden Exp $ +/* $Id: aclui.c,v 1.4 2004/08/11 01:21:53 weiden Exp $ * * PROJECT: ReactOS Access Control List Editor * FILE: lib/aclui/aclui.c @@ -58,6 +58,81 @@ DllMain(HINSTANCE hinstDLL, return TRUE; } + +UINT CALLBACK +SecurityPageCallback(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp) +{ + switch(uMsg) + { + case PSPCB_CREATE: + return TRUE; + case PSPCB_RELEASE: + return FALSE; + } + + return FALSE; +} + + +INT_PTR CALLBACK +SecurityPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + return 0; +} + + +/* + * CreateSecurityPage EXPORTED + * + * @implemented + */ +HPROPSHEETPAGE +WINAPI +CreateSecurityPage(LPSECURITYINFO psi) +{ + PROPSHEETPAGE psp; + SI_OBJECT_INFO ObjectInfo; + HRESULT hRet; + + if(psi == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + + DPRINT("No ISecurityInformation class passed!\n"); + return NULL; + } + + /* get the object information from the client interface */ + hRet = psi->lpVtbl->GetObjectInformation(psi, &ObjectInfo); + + if(FAILED(hRet)) + { + SetLastError(hRet); + + DPRINT("CreateSecurityPage() failed!\n"); + return NULL; + } + + psp.dwSize = sizeof(PROPSHEETPAGE); + psp.dwFlags = PSP_DEFAULT | PSP_USECALLBACK; + psp.hInstance = hDllInstance; + psp.pszTemplate = MAKEINTRESOURCE(IDD_SECPAGE); + psp.pfnDlgProc = SecurityPageProc; + psp.lParam = (LPARAM)psi; + psp.pfnCallback = SecurityPageCallback; + + if((ObjectInfo.dwFlags & SI_PAGE_TITLE) != 0 && + ObjectInfo.pszPageTitle != NULL && ObjectInfo.pszPageTitle[0] != L'\0') + { + /* Set the page title if the flag is present and the string isn't empty */ + psp.pszTitle = ObjectInfo.pszPageTitle; + psp.dwFlags |= PSP_USETITLE; + } + + return CreatePropertySheetPage(&psp); +} + + /* * EditSecurity EXPORTED * diff --git a/reactos/lib/aclui/aclui_En.rc b/reactos/lib/aclui/aclui_En.rc index 392d65a4643..fca4e1c9b08 100644 --- a/reactos/lib/aclui/aclui_En.rc +++ b/reactos/lib/aclui/aclui_En.rc @@ -4,6 +4,15 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT +IDD_SECPAGE DIALOGEX 0, 0, 227, 215 +STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION +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 +END + STRINGTABLE DISCARDABLE { IDS_PSP_TITLE "Permissions for %1" diff --git a/reactos/lib/aclui/resource.h b/reactos/lib/aclui/resource.h index 7899f65293a..b858b001876 100644 --- a/reactos/lib/aclui/resource.h +++ b/reactos/lib/aclui/resource.h @@ -1,6 +1,10 @@ #ifndef __ACLUI_RESOURCE_H #define __ACLUI_RESOURCE_H +#define IDD_SECPAGE 101 + +#define IDC_GRPUSRLIST 1001 + #define IDI_DEVMGR 100 #define IDS_PSP_TITLE 1001 diff --git a/reactos/lib/aclui/stubs.c b/reactos/lib/aclui/stubs.c deleted file mode 100644 index 4bb9fc99de4..00000000000 --- a/reactos/lib/aclui/stubs.c +++ /dev/null @@ -1,29 +0,0 @@ -/* $Id: stubs.c,v 1.3 2004/08/10 15:47:54 weiden Exp $ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Access Control List Editor - * FILE: lib/aclui/stubs.c - * PURPOSE: aclui.dll stubs - * PROGRAMMER: Thomas Weidenmueller - * NOTES: If you implement a function, remove it from this file - * - * UPDATE HISTORY: - * 08/10/2004 Created - */ -#include -#include -#include "internal.h" - -#define UNIMPLEMENTED \ - DbgPrint("ACLUI: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__) - - -HPROPSHEETPAGE -WINAPI -CreateSecurityPage(LPSECURITYINFO psi) -{ - UNIMPLEMENTED; - return NULL; -} - -/* EOF */