3 * Copyright (C) 2004 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: aclui.c,v 1.3 2004/08/10 15:47:54 weiden Exp $
21 * PROJECT: ReactOS Access Control List Editor
22 * FILE: lib/aclui/aclui.c
23 * PURPOSE: Access Control List Editor
24 * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
33 #include <rosrtl/resstr.h>
37 HINSTANCE hDllInstance
;
42 DllMain(HINSTANCE hinstDLL
,
48 case DLL_PROCESS_ATTACH
:
49 hDllInstance
= hinstDLL
;
51 case DLL_THREAD_ATTACH
:
53 case DLL_THREAD_DETACH
:
55 case DLL_PROCESS_DETACH
:
62 * EditSecurity EXPORTED
68 EditSecurity(HWND hwndOwner
, LPSECURITYINFO psi
)
71 SI_OBJECT_INFO ObjectInfo
;
73 HPROPSHEETPAGE hPages
[1];
79 SetLastError(ERROR_INVALID_PARAMETER
);
81 DPRINT("No ISecurityInformation class passed!\n");
85 /* get the object information from the client interface */
86 hRet
= psi
->lpVtbl
->GetObjectInformation(psi
, &ObjectInfo
);
92 DPRINT("GetObjectInformation() failed!\n");
97 hPages
[0] = CreateSecurityPage(psi
);
100 DPRINT("CreateSecurityPage(), couldn't create property sheet!\n");
104 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
105 psh
.dwFlags
= PSH_DEFAULT
;
106 psh
.hwndParent
= hwndOwner
;
107 psh
.hInstance
= hDllInstance
;
108 if((ObjectInfo
.dwFlags
& SI_PAGE_TITLE
) != 0 &&
109 ObjectInfo
.pszPageTitle
!= NULL
&& ObjectInfo
.pszPageTitle
[0] != L
'\0')
111 /* Set the page title if the flag is present and the string isn't empty */
112 psh
.pszCaption
= ObjectInfo
.pszPageTitle
;
117 /* Set the page title to the object name, make sure the format string
118 has "%1" NOT "%s" because it uses FormatMessage() to automatically
119 allocate the right amount of memory. */
120 RosLoadAndFormatStr(hDllInstance
, IDS_PSP_TITLE
, &lpCaption
, ObjectInfo
.pszObjectName
);
121 psh
.pszCaption
= lpCaption
;
123 psh
.nPages
= sizeof(hPages
) / sizeof(HPROPSHEETPAGE
);
127 Ret
= (PropertySheet(&psh
) != -1);
129 if(lpCaption
!= NULL
)
131 LocalFree((HLOCAL
)lpCaption
);