Author: ekohl
Date: Sat Dec 29 14:44:42 2012
New Revision: 58038
URL:
http://svn.reactos.org/svn/reactos?rev=58038&view=rev
Log:
[SAMSRV]
Store an objects relative id in the database object. This will later be used to protect
pre-defined objects from being deleted.
Modified:
trunk/reactos/dll/win32/samsrv/database.c
trunk/reactos/dll/win32/samsrv/samrpc.c
trunk/reactos/dll/win32/samsrv/samsrv.h
Modified: trunk/reactos/dll/win32/samsrv/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/database.…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/database.c [iso-8859-1] Sat Dec 29 14:44:42 2012
@@ -97,6 +97,7 @@
SampCreateDbObject(IN PSAM_DB_OBJECT ParentObject,
IN LPWSTR ContainerName,
IN LPWSTR ObjectName,
+ IN ULONG RelativeId,
IN SAM_DB_OBJECT_TYPE ObjectType,
IN ACCESS_MASK DesiredAccess,
OUT PSAM_DB_OBJECT *DbObject)
@@ -240,6 +241,7 @@
NewObject->Access = DesiredAccess;
NewObject->KeyHandle = ObjectKeyHandle;
NewObject->MembersKeyHandle = MembersKeyHandle;
+ NewObject->RelativeId = RelativeId;
NewObject->ParentObject = ParentObject;
if (ParentObject != NULL)
@@ -255,6 +257,7 @@
SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject,
IN LPWSTR ContainerName,
IN LPWSTR ObjectName,
+ IN ULONG RelativeId,
IN SAM_DB_OBJECT_TYPE ObjectType,
IN ACCESS_MASK DesiredAccess,
OUT PSAM_DB_OBJECT *DbObject)
@@ -390,6 +393,7 @@
NewObject->Access = DesiredAccess;
NewObject->KeyHandle = ObjectKeyHandle;
NewObject->MembersKeyHandle = MembersKeyHandle;
+ NewObject->RelativeId = RelativeId;
NewObject->ParentObject = ParentObject;
if (ParentObject != NULL)
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sat Dec 29 14:44:42 2012
@@ -88,6 +88,7 @@
Status = SampOpenDbObject(NULL,
NULL,
L"SAM",
+ 0,
SamDbServerObject,
DesiredAccess,
&ServerObject);
@@ -509,6 +510,7 @@
Status = SampOpenDbObject(ServerObject,
L"Domains",
L"Builtin",
+ 0,
SamDbDomainObject,
DesiredAccess,
&DomainObject);
@@ -524,6 +526,7 @@
Status = SampOpenDbObject(ServerObject,
L"Domains",
L"Account",
+ 0,
SamDbDomainObject,
DesiredAccess,
&DomainObject);
@@ -1709,6 +1712,7 @@
Status = SampCreateDbObject(DomainObject,
L"Groups",
szRid,
+ ulRid,
SamDbGroupObject,
DesiredAccess,
&GroupObject);
@@ -2074,6 +2078,7 @@
Status = SampCreateDbObject(DomainObject,
L"Users",
szRid,
+ ulRid,
SamDbUserObject,
DesiredAccess,
&UserObject);
@@ -2527,6 +2532,7 @@
Status = SampCreateDbObject(DomainObject,
L"Aliases",
szRid,
+ ulRid,
SamDbAliasObject,
DesiredAccess,
&AliasObject);
@@ -3464,6 +3470,7 @@
Status = SampOpenDbObject(DomainObject,
L"Groups",
szRid,
+ GroupId,
SamDbGroupObject,
DesiredAccess,
&GroupObject);
@@ -3911,6 +3918,7 @@
Status = SampOpenDbObject(DomainObject,
L"Aliases",
szRid,
+ AliasId,
SamDbAliasObject,
DesiredAccess,
&AliasObject);
@@ -4575,6 +4583,7 @@
Status = SampOpenDbObject(DomainObject,
L"Users",
szRid,
+ UserId,
SamDbUserObject,
DesiredAccess,
&UserObject);
@@ -6335,6 +6344,7 @@
Status = SampCreateDbObject(DomainObject,
L"Users",
szRid,
+ ulRid,
SamDbUserObject,
DesiredAccess,
&UserObject);
Modified: trunk/reactos/dll/win32/samsrv/samsrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.h?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samsrv.h [iso-8859-1] Sat Dec 29 14:44:42 2012
@@ -46,6 +46,7 @@
LPWSTR Name;
HANDLE KeyHandle;
HANDLE MembersKeyHandle; // only used by Aliases and Groups
+ ULONG RelativeId;
struct _SAM_DB_OBJECT *ParentObject;
} SAM_DB_OBJECT, *PSAM_DB_OBJECT;
@@ -117,6 +118,7 @@
SampCreateDbObject(IN PSAM_DB_OBJECT ParentObject,
IN LPWSTR ContainerName,
IN LPWSTR ObjectName,
+ IN ULONG RelativeId,
IN SAM_DB_OBJECT_TYPE ObjectType,
IN ACCESS_MASK DesiredAccess,
OUT PSAM_DB_OBJECT *DbObject);
@@ -125,6 +127,7 @@
SampOpenDbObject(IN PSAM_DB_OBJECT ParentObject,
IN LPWSTR ContainerName,
IN LPWSTR ObjectName,
+ IN ULONG RelativeId,
IN SAM_DB_OBJECT_TYPE ObjectType,
IN ACCESS_MASK DesiredAccess,
OUT PSAM_DB_OBJECT *DbObject);