implemented TreeResetNamedSecurityInfo and forward it to the MARTA
provider
Modified: trunk/reactos/lib/advapi32/advapi32.def
Modified: trunk/reactos/lib/advapi32/advapi32.h
Modified: trunk/reactos/lib/advapi32/sec/ac.c
Modified: trunk/reactos/lib/advapi32/sec/misc.c
Modified: trunk/reactos/lib/ntmarta/ntmarta.c
Modified: trunk/reactos/lib/ntmarta/ntmarta.def
Modified: trunk/reactos/lib/ntmarta/ntmarta.h
Modified: trunk/reactos/w32api/include/accctrl.h
_____
Modified: trunk/reactos/lib/advapi32/advapi32.def
--- trunk/reactos/lib/advapi32/advapi32.def 2005-07-27 21:48:47 UTC
(rev 16822)
+++ trunk/reactos/lib/advapi32/advapi32.def 2005-07-27 23:11:38 UTC
(rev 16823)
@@ -632,8 +632,8 @@
;TraceEventInstance
;TraceMessage
;TraceMessageVa
-;TreeResetNamedSecurityInfoA
-;TreeResetNamedSecurityInfoW
+TreeResetNamedSecurityInfoA@44
+TreeResetNamedSecurityInfoW@44
;TrusteeAccessToObjectA
;TrusteeAccessToObjectW
;UninstallApplication
_____
Modified: trunk/reactos/lib/advapi32/advapi32.h
--- trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 21:48:47 UTC
(rev 16822)
+++ trunk/reactos/lib/advapi32/advapi32.h 2005-07-27 23:11:38 UTC
(rev 16823)
@@ -18,6 +18,13 @@
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
+#ifndef HAS_FN_PROGRESSW
+#define FN_PROGRESSW FN_PROGRESS
+#endif
+#ifndef HAS_FN_PROGRESSA
+#define FN_PROGRESSA FN_PROGRESS
+#endif
+
/* Interface to ntmarta.dll
**************************************************/
typedef struct _NTMARTA
@@ -71,7 +78,17 @@
PULONG
pcCountOfExplicitEntries,
PEXPLICIT_ACCESS_W* pListOfExplicitEntries);
- PVOID TreeResetNamedSecurityInfo;
+ DWORD (STDCALL *TreeResetNamedSecurityInfo)(LPWSTR pObjectName,
+ SE_OBJECT_TYPE
ObjectType,
+ SECURITY_INFORMATION
SecurityInfo,
+ PSID pOwner,
+ PSID pGroup,
+ PACL pDacl,
+ PACL pSacl,
+ BOOL KeepExplicit,
+ FN_PROGRESSW
fnProgress,
+ PROG_INVOKE_SETTING
ProgressInvokeSetting,
+ PVOID Args);
DWORD (STDCALL *GetInheritanceSource)(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
_____
Modified: trunk/reactos/lib/advapi32/sec/ac.c
--- trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 21:48:47 UTC (rev
16822)
+++ trunk/reactos/lib/advapi32/sec/ac.c 2005-07-27 23:11:38 UTC (rev
16823)
@@ -609,7 +609,7 @@
ErrorCode = GetLastError();
- while (i != 0)
+ do
{
if
(ListOfExplicitEntriesW[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME &&
ListOfExplicitEntriesW[i].Trustee.ptstrName != NULL)
@@ -618,10 +618,8 @@
0,
ListOfExplicitEntriesW[i].Trustee.ptstrName);
}
+ } while (i-- != 0);
- i--;
- }
-
/* free the allocated array */
HeapFree(GetProcessHeap(),
0,
_____
Modified: trunk/reactos/lib/advapi32/sec/misc.c
--- trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 21:48:47 UTC
(rev 16822)
+++ trunk/reactos/lib/advapi32/sec/misc.c 2005-07-27 23:11:38 UTC
(rev 16823)
@@ -60,9 +60,7 @@
FindNtMartaProc(RewriteSetHandleRights);
FindNtMartaProc(RewriteSetEntriesInAcl);
FindNtMartaProc(RewriteGetExplicitEntriesFromAcl);
-#if 0
FindNtMartaProc(TreeResetNamedSecurityInfo);
-#endif
FindNtMartaProc(GetInheritanceSource);
FindNtMartaProc(FreeIndexArray);
@@ -1840,4 +1838,99 @@
return TRUE;
}
+
+/*
+ * @implemented
+ */
+DWORD STDCALL
+TreeResetNamedSecurityInfoW(LPWSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID pOwner,
+ PSID pGroup,
+ PACL pDacl,
+ PACL pSacl,
+ BOOL KeepExplicit,
+ FN_PROGRESSW fnProgress,
+ PROG_INVOKE_SETTING ProgressInvokeSetting,
+ PVOID Args)
+{
+ DWORD ErrorCode;
+
+ if (pObjectName != NULL)
+ {
+ ErrorCode = CheckNtMartaPresent();
+ if (ErrorCode == ERROR_SUCCESS)
+ {
+ switch (ObjectType)
+ {
+ case SE_FILE_OBJECT:
+ case SE_REGISTRY_KEY:
+ {
+ /* check the SecurityInfo flags for sanity (both,
the protected
+ and unprotected dacl/sacl flag must not be
passed together */
+ if (((SecurityInfo & DACL_SECURITY_INFORMATION) &&
+ (SecurityInfo &
(PROTECTED_DACL_SECURITY_INFORMATION |
UNPROTECTED_DACL_SECURITY_INFORMATION)) ==
+ (PROTECTED_DACL_SECURITY_INFORMATION |
UNPROTECTED_DACL_SECURITY_INFORMATION))
+
+ ||
+
+ ((SecurityInfo & SACL_SECURITY_INFORMATION) &&
+ (SecurityInfo &
(PROTECTED_SACL_SECURITY_INFORMATION |
UNPROTECTED_SACL_SECURITY_INFORMATION)) ==
+ (PROTECTED_SACL_SECURITY_INFORMATION |
UNPROTECTED_SACL_SECURITY_INFORMATION)))
+ {
+ ErrorCode = ERROR_INVALID_PARAMETER;
+ break;
+ }
+
+ /* call the MARTA provider */
+ ErrorCode =
AccTreeResetNamedSecurityInfo(pObjectName,
+
ObjectType,
+
SecurityInfo,
+ pOwner,
+ pGroup,
+ pDacl,
+ pSacl,
+
KeepExplicit,
+
fnProgress,
+
ProgressInvokeSetting,
+ Args);
+ break;
+ }
+
+ default:
+ /* object type not supported */
+ ErrorCode = ERROR_INVALID_PARAMETER;
+ break;
+ }
+ }
+ }
+ else
+ ErrorCode = ERROR_INVALID_PARAMETER;
+
+ return ErrorCode;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD STDCALL
+TreeResetNamedSecurityInfoA(LPSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID pOwner,
+ PSID pGroup,
+ PACL pDacl,
+ PACL pSacl,
+ BOOL KeepExplicit,
+ FN_PROGRESSA fnProgress,
+ PROG_INVOKE_SETTING ProgressInvokeSetting,
+ PVOID Args)
+{
+ /* That's all this function does, at least up to w2k3... Even MS
was too
+ lazy to implement it... */
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
/* EOF */
_____
Modified: trunk/reactos/lib/ntmarta/ntmarta.c
--- trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 21:48:47 UTC (rev
16822)
+++ trunk/reactos/lib/ntmarta/ntmarta.c 2005-07-27 23:11:38 UTC (rev
16823)
@@ -173,6 +173,29 @@
}
+/**********************************************************************
+ * AccTreeResetNamedSecurityInfo EXPORTED
+ *
+ * @unimplemented
+ */
+DWORD STDCALL
+AccTreeResetNamedSecurityInfo(LPWSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID pOwner,
+ PSID pGroup,
+ PACL pDacl,
+ PACL pSacl,
+ BOOL KeepExplicit,
+ FN_PROGRESSW fnProgress,
+ PROG_INVOKE_SETTING
ProgressInvokeSetting,
+ PVOID Args)
+{
+ UNIMPLEMENTED;
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+
BOOL STDCALL
DllMain(IN HINSTANCE hinstDLL,
IN DWORD dwReason,
_____
Modified: trunk/reactos/lib/ntmarta/ntmarta.def
--- trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 21:48:47 UTC
(rev 16822)
+++ trunk/reactos/lib/ntmarta/ntmarta.def 2005-07-27 23:11:38 UTC
(rev 16823)
@@ -3,14 +3,14 @@
EXPORTS
AccFreeIndexArray@12
AccGetInheritanceSource@40
-;AccProvHandleGrantAccessRights;
+;AccProvHandleGrantAccessRights
AccRewriteGetExplicitEntriesFromAcl@12
AccRewriteGetHandleRights@32
AccRewriteGetNamedRights@32
AccRewriteSetEntriesInAcl@16
AccRewriteSetHandleRights@16
AccRewriteSetNamedRights@16
-;AccTreeResetNamedSecurityInfo
+AccTreeResetNamedSecurityInfo@44
;AccConvertAccessMaskToActrlAccess
;AccConvertAccessToSD
;AccConvertAccessToSecurityDescriptor
_____
Modified: trunk/reactos/lib/ntmarta/ntmarta.h
--- trunk/reactos/lib/ntmarta/ntmarta.h 2005-07-27 21:48:47 UTC (rev
16822)
+++ trunk/reactos/lib/ntmarta/ntmarta.h 2005-07-27 23:11:38 UTC (rev
16823)
@@ -1,6 +1,13 @@
#include <windows.h>
#include <accctrl.h>
+#ifndef HAS_FN_PROGRESSW
+#define FN_PROGRESSW FN_PROGRESS
+#endif
+#ifndef HAS_FN_PROGRESSA
+#define FN_PROGRESSA FN_PROGRESS
+#endif
+
ULONG DbgPrint(PCH Format,...);
extern HINSTANCE hDllInstance;
_____
Modified: trunk/reactos/w32api/include/accctrl.h
--- trunk/reactos/w32api/include/accctrl.h 2005-07-27 21:48:47 UTC
(rev 16822)
+++ trunk/reactos/w32api/include/accctrl.h 2005-07-27 23:11:38 UTC
(rev 16823)
@@ -352,6 +352,26 @@
ULONG Placeholder;
} FN_OBJECT_MGR_FUNCTS, *PFN_OBJECT_MGR_FUNCTS;
+typedef enum _PROG_INVOKE_SETTING
+{
+ ProgressInvokeNever = 1,
+ ProgressInvokeEveryObject,
+ ProgressInvokeOnError,
+ ProgressCancelOperation,
+ ProgressRetryOperation
+} PROG_INVOKE_SETTING, *PPROG_INVOKE_SETTING;
+
+typedef VOID (STDCALL *FN_PROGRESSW)(LPWSTR pObjectName,
+ DWORD Status,
+ PPROG_INVOKE_SETTING
pInvokeSetting,
+ PVOID Args,
+ BOOL SecuritySet);
+typedef VOID (STDCALL *FN_PROGRESSA)(LPSTR pObjectName,
+ DWORD Status,
+ PPROG_INVOKE_SETTING
pInvokeSetting,
+ PVOID Args,
+ BOOL SecuritySet);
+
#ifdef UNICODE
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
typedef TRUSTEE_W TRUSTEE_, *PTRUSTEE_;
@@ -368,6 +388,8 @@
typedef OBJECTS_AND_NAME_W OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
#if (_WIN32_WINNT >= 0x0501)
typedef INHERITED_FROMW INHERITED_FROM, *PINHERITED_FROM;
+typedef FN_PROGRESSW FN_PROGRESS;
+#define HAS_FN_PROGRESSW
#endif
#else
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA
@@ -385,6 +407,8 @@
typedef OBJECTS_AND_NAME_A OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
#if (_WIN32_WINNT >= 0x0501)
typedef INHERITED_FROMA INHERITED_FROM, *PINHERITED_FROM;
+typedef FN_PROGRESSA FN_PROGRESS;
+#define HAS_FN_PROGRESSA
#endif
#endif /* UNICODE */