mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
implemented TreeResetNamedSecurityInfo and forward it to the MARTA provider
svn path=/trunk/; revision=16823
This commit is contained in:
parent
42a3e034f8
commit
71a12f48d0
8 changed files with 173 additions and 11 deletions
|
@ -632,8 +632,8 @@ SystemFunction041@12
|
||||||
;TraceEventInstance
|
;TraceEventInstance
|
||||||
;TraceMessage
|
;TraceMessage
|
||||||
;TraceMessageVa
|
;TraceMessageVa
|
||||||
;TreeResetNamedSecurityInfoA
|
TreeResetNamedSecurityInfoA@44
|
||||||
;TreeResetNamedSecurityInfoW
|
TreeResetNamedSecurityInfoW@44
|
||||||
;TrusteeAccessToObjectA
|
;TrusteeAccessToObjectA
|
||||||
;TrusteeAccessToObjectW
|
;TrusteeAccessToObjectW
|
||||||
;UninstallApplication
|
;UninstallApplication
|
||||||
|
|
|
@ -18,6 +18,13 @@
|
||||||
#define NTOS_MODE_USER
|
#define NTOS_MODE_USER
|
||||||
#include <ndk/ntndk.h>
|
#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 **************************************************/
|
/* Interface to ntmarta.dll **************************************************/
|
||||||
|
|
||||||
typedef struct _NTMARTA
|
typedef struct _NTMARTA
|
||||||
|
@ -71,7 +78,17 @@ typedef struct _NTMARTA
|
||||||
PULONG pcCountOfExplicitEntries,
|
PULONG pcCountOfExplicitEntries,
|
||||||
PEXPLICIT_ACCESS_W* pListOfExplicitEntries);
|
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,
|
DWORD (STDCALL *GetInheritanceSource)(LPWSTR pObjectName,
|
||||||
SE_OBJECT_TYPE ObjectType,
|
SE_OBJECT_TYPE ObjectType,
|
||||||
|
|
|
@ -609,7 +609,7 @@ SetEntriesInAclA(
|
||||||
|
|
||||||
ErrorCode = GetLastError();
|
ErrorCode = GetLastError();
|
||||||
|
|
||||||
while (i != 0)
|
do
|
||||||
{
|
{
|
||||||
if (ListOfExplicitEntriesW[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME &&
|
if (ListOfExplicitEntriesW[i].Trustee.TrusteeForm == TRUSTEE_IS_NAME &&
|
||||||
ListOfExplicitEntriesW[i].Trustee.ptstrName != NULL)
|
ListOfExplicitEntriesW[i].Trustee.ptstrName != NULL)
|
||||||
|
@ -618,9 +618,7 @@ SetEntriesInAclA(
|
||||||
0,
|
0,
|
||||||
ListOfExplicitEntriesW[i].Trustee.ptstrName);
|
ListOfExplicitEntriesW[i].Trustee.ptstrName);
|
||||||
}
|
}
|
||||||
|
} while (i-- != 0);
|
||||||
i--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free the allocated array */
|
/* free the allocated array */
|
||||||
HeapFree(GetProcessHeap(),
|
HeapFree(GetProcessHeap(),
|
||||||
|
|
|
@ -60,9 +60,7 @@ LoadAndInitializeNtMarta(VOID)
|
||||||
FindNtMartaProc(RewriteSetHandleRights);
|
FindNtMartaProc(RewriteSetHandleRights);
|
||||||
FindNtMartaProc(RewriteSetEntriesInAcl);
|
FindNtMartaProc(RewriteSetEntriesInAcl);
|
||||||
FindNtMartaProc(RewriteGetExplicitEntriesFromAcl);
|
FindNtMartaProc(RewriteGetExplicitEntriesFromAcl);
|
||||||
#if 0
|
|
||||||
FindNtMartaProc(TreeResetNamedSecurityInfo);
|
FindNtMartaProc(TreeResetNamedSecurityInfo);
|
||||||
#endif
|
|
||||||
FindNtMartaProc(GetInheritanceSource);
|
FindNtMartaProc(GetInheritanceSource);
|
||||||
FindNtMartaProc(FreeIndexArray);
|
FindNtMartaProc(FreeIndexArray);
|
||||||
|
|
||||||
|
@ -1840,4 +1838,99 @@ SetPrivateObjectSecurity(SECURITY_INFORMATION SecurityInformation,
|
||||||
return TRUE;
|
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 */
|
/* EOF */
|
||||||
|
|
|
@ -173,6 +173,29 @@ AccRewriteGetExplicitEntriesFromAcl(PACL pacl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* 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
|
BOOL STDCALL
|
||||||
DllMain(IN HINSTANCE hinstDLL,
|
DllMain(IN HINSTANCE hinstDLL,
|
||||||
IN DWORD dwReason,
|
IN DWORD dwReason,
|
||||||
|
|
|
@ -3,14 +3,14 @@ LIBRARY ntmarta.dll
|
||||||
EXPORTS
|
EXPORTS
|
||||||
AccFreeIndexArray@12
|
AccFreeIndexArray@12
|
||||||
AccGetInheritanceSource@40
|
AccGetInheritanceSource@40
|
||||||
;AccProvHandleGrantAccessRights;
|
;AccProvHandleGrantAccessRights
|
||||||
AccRewriteGetExplicitEntriesFromAcl@12
|
AccRewriteGetExplicitEntriesFromAcl@12
|
||||||
AccRewriteGetHandleRights@32
|
AccRewriteGetHandleRights@32
|
||||||
AccRewriteGetNamedRights@32
|
AccRewriteGetNamedRights@32
|
||||||
AccRewriteSetEntriesInAcl@16
|
AccRewriteSetEntriesInAcl@16
|
||||||
AccRewriteSetHandleRights@16
|
AccRewriteSetHandleRights@16
|
||||||
AccRewriteSetNamedRights@16
|
AccRewriteSetNamedRights@16
|
||||||
;AccTreeResetNamedSecurityInfo
|
AccTreeResetNamedSecurityInfo@44
|
||||||
;AccConvertAccessMaskToActrlAccess
|
;AccConvertAccessMaskToActrlAccess
|
||||||
;AccConvertAccessToSD
|
;AccConvertAccessToSD
|
||||||
;AccConvertAccessToSecurityDescriptor
|
;AccConvertAccessToSecurityDescriptor
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <accctrl.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,...);
|
ULONG DbgPrint(PCH Format,...);
|
||||||
|
|
||||||
extern HINSTANCE hDllInstance;
|
extern HINSTANCE hDllInstance;
|
||||||
|
|
|
@ -352,6 +352,26 @@ typedef struct _FN_OBJECT_MGR_FUNCTIONS
|
||||||
ULONG Placeholder;
|
ULONG Placeholder;
|
||||||
} FN_OBJECT_MGR_FUNCTS, *PFN_OBJECT_MGR_FUNCTS;
|
} 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
|
#ifdef UNICODE
|
||||||
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
|
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
|
||||||
typedef TRUSTEE_W TRUSTEE_, *PTRUSTEE_;
|
typedef TRUSTEE_W TRUSTEE_, *PTRUSTEE_;
|
||||||
|
@ -368,6 +388,8 @@ typedef TRUSTEE_ACCESSW TRUSTEE_ACCESS, *PTRUSTEE_ACCESS;
|
||||||
typedef OBJECTS_AND_NAME_W OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
|
typedef OBJECTS_AND_NAME_W OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
|
||||||
#if (_WIN32_WINNT >= 0x0501)
|
#if (_WIN32_WINNT >= 0x0501)
|
||||||
typedef INHERITED_FROMW INHERITED_FROM, *PINHERITED_FROM;
|
typedef INHERITED_FROMW INHERITED_FROM, *PINHERITED_FROM;
|
||||||
|
typedef FN_PROGRESSW FN_PROGRESS;
|
||||||
|
#define HAS_FN_PROGRESSW
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA
|
#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA
|
||||||
|
@ -385,6 +407,8 @@ typedef TRUSTEE_ACCESSA TRUSTEE_ACCESS, *PTRUSTEE_ACCESS;
|
||||||
typedef OBJECTS_AND_NAME_A OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
|
typedef OBJECTS_AND_NAME_A OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
|
||||||
#if (_WIN32_WINNT >= 0x0501)
|
#if (_WIN32_WINNT >= 0x0501)
|
||||||
typedef INHERITED_FROMA INHERITED_FROM, *PINHERITED_FROM;
|
typedef INHERITED_FROMA INHERITED_FROM, *PINHERITED_FROM;
|
||||||
|
typedef FN_PROGRESSA FN_PROGRESS;
|
||||||
|
#define HAS_FN_PROGRESSA
|
||||||
#endif
|
#endif
|
||||||
#endif /* UNICODE */
|
#endif /* UNICODE */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue