mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
[SAMSRV]
SAM Setup: Set the UserAccountControl flags when user accounts are created. svn path=/trunk/; revision=58128
This commit is contained in:
parent
40d30b8b21
commit
e31ab5ce32
1 changed files with 7 additions and 3 deletions
|
@ -221,7 +221,8 @@ SampCreateAliasAccount(HKEY hDomainKey,
|
||||||
static BOOL
|
static BOOL
|
||||||
SampCreateUserAccount(HKEY hDomainKey,
|
SampCreateUserAccount(HKEY hDomainKey,
|
||||||
LPCWSTR lpAccountName,
|
LPCWSTR lpAccountName,
|
||||||
ULONG ulRelativeId)
|
ULONG ulRelativeId,
|
||||||
|
ULONG UserAccountControl)
|
||||||
{
|
{
|
||||||
SAM_USER_FIXED_DATA FixedUserData;
|
SAM_USER_FIXED_DATA FixedUserData;
|
||||||
LPWSTR lpEmptyString = L"";
|
LPWSTR lpEmptyString = L"";
|
||||||
|
@ -235,6 +236,7 @@ SampCreateUserAccount(HKEY hDomainKey,
|
||||||
FixedUserData.Version = 1;
|
FixedUserData.Version = 1;
|
||||||
|
|
||||||
FixedUserData.UserId = ulRelativeId;
|
FixedUserData.UserId = ulRelativeId;
|
||||||
|
FixedUserData.UserAccountControl = UserAccountControl;
|
||||||
|
|
||||||
swprintf(szAccountKeyName, L"Users\\%08lX", ulRelativeId);
|
swprintf(szAccountKeyName, L"Users\\%08lX", ulRelativeId);
|
||||||
|
|
||||||
|
@ -673,11 +675,13 @@ SampInitializeSAM(VOID)
|
||||||
{
|
{
|
||||||
SampCreateUserAccount(hDomainKey,
|
SampCreateUserAccount(hDomainKey,
|
||||||
L"Administrator",
|
L"Administrator",
|
||||||
DOMAIN_USER_RID_ADMIN);
|
DOMAIN_USER_RID_ADMIN,
|
||||||
|
USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT);
|
||||||
|
|
||||||
SampCreateUserAccount(hDomainKey,
|
SampCreateUserAccount(hDomainKey,
|
||||||
L"Guest",
|
L"Guest",
|
||||||
DOMAIN_USER_RID_GUEST);
|
DOMAIN_USER_RID_GUEST,
|
||||||
|
USER_ACCOUNT_DISABLED | USER_DONT_EXPIRE_PASSWORD | USER_NORMAL_ACCOUNT);
|
||||||
|
|
||||||
RegCloseKey(hDomainKey);
|
RegCloseKey(hDomainKey);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue