X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2Fwin32%2Fsamsrv%2Fuser.c;h=a442780992a1ee85600e9af466d714bfb6d8b655;hp=04ca49f99123ece04f5a7be2c4b5685234e7c55e;hb=6342a92b2862a8d95ac5bd09d52551464f7e9721;hpb=0c86291749a512b2e91eabb4f43c900f61dd247e diff --git a/reactos/dll/win32/samsrv/user.c b/reactos/dll/win32/samsrv/user.c index 04ca49f9912..a442780992a 100644 --- a/reactos/dll/win32/samsrv/user.c +++ b/reactos/dll/win32/samsrv/user.c @@ -361,6 +361,8 @@ SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject) Status = SampRemoveMemberFromGroup(GroupObject, UserObject->RelativeId); + if (Status == STATUS_MEMBER_NOT_IN_GROUP) + Status = STATUS_SUCCESS; SampCloseDbObject(GroupObject); @@ -370,6 +372,13 @@ SampRemoveUserFromAllGroups(IN PSAM_DB_OBJECT UserObject) } } + /* Remove all groups from the Groups attribute */ + Status = SampSetObjectAttribute(UserObject, + L"Groups", + REG_BINARY, + NULL, + 0); + done: if (GroupsBuffer != NULL) midl_user_free(GroupsBuffer);