- Fix MSVC build warnings.
- Implement SamrAddMultipeMembersToAlias.
- Add missing user attributes to the user setup code.

svn path=/trunk/; revision=57626
This commit is contained in:
Eric Kohl
2012-10-27 19:38:12 +00:00
parent 9ee3916cee
commit bd8c5df1b0
3 changed files with 92 additions and 12 deletions
+2 -2
View File
@@ -764,8 +764,8 @@ SampGetObjectAttributeString(PSAM_DB_OBJECT DbObject,
goto done;
}
String->Length = Length - sizeof(WCHAR);
String->MaximumLength = Length;
String->Length = (USHORT)(Length - sizeof(WCHAR));
String->MaximumLength = (USHORT)Length;
String->Buffer = midl_user_allocate(Length);
if (String->Buffer == NULL)
{
+33 -10
View File
@@ -17,6 +17,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
static SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY};
/* FUNCTIONS ***************************************************************/
VOID
@@ -3051,6 +3052,8 @@ done:
Use->Count = 0;
}
TRACE("Returned Status %lx\n", Status);
return Status;
}
@@ -3145,8 +3148,8 @@ SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle,
if (NT_SUCCESS(Status))
{
Names->Element[i].MaximumLength = DataLength;
Names->Element[i].Length = DataLength - sizeof(WCHAR);
Names->Element[i].MaximumLength = (USHORT)DataLength;
Names->Element[i].Length = (USHORT)(DataLength - sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -3201,8 +3204,8 @@ SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle,
if (NT_SUCCESS(Status))
{
Names->Element[i].MaximumLength = DataLength;
Names->Element[i].Length = DataLength - sizeof(WCHAR);
Names->Element[i].MaximumLength = (USHORT)DataLength;
Names->Element[i].Length = (USHORT)(DataLength - sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -3259,8 +3262,8 @@ SamrLookupIdsInDomain(IN SAMPR_HANDLE DomainHandle,
if (NT_SUCCESS(Status))
{
Names->Element[i].MaximumLength = DataLength;
Names->Element[i].Length = DataLength - sizeof(WCHAR);
Names->Element[i].MaximumLength = (USHORT)DataLength;
Names->Element[i].Length = (USHORT)(DataLength - sizeof(WCHAR));
Status = SampRegQueryValue(AccountKeyHandle,
L"Name",
@@ -4319,6 +4322,7 @@ done:
return Status;
}
/* Function 34 */
NTSTATUS
NTAPI
@@ -4367,6 +4371,7 @@ SamrOpenUser(IN SAMPR_HANDLE DomainHandle,
return STATUS_SUCCESS;
}
/* Function 35 */
NTSTATUS
NTAPI
@@ -4678,8 +4683,6 @@ done:
}
static
NTSTATUS
SampQueryUserAccount(PSAM_DB_OBJECT UserObject,
@@ -6283,6 +6286,7 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
return Status;
}
/* Function 51 */
NTSTATUS
NTAPI
@@ -6299,16 +6303,35 @@ SamrQueryDisplayInformation3(IN SAMPR_HANDLE DomainHandle,
return STATUS_NOT_IMPLEMENTED;
}
/* Function 52 */
NTSTATUS
NTAPI
SamrAddMultipleMembersToAlias(IN SAMPR_HANDLE AliasHandle,
IN PSAMPR_PSID_ARRAY MembersBuffer)
{
UNIMPLEMENTED;
return STATUS_NOT_IMPLEMENTED;
ULONG i;
NTSTATUS Status = STATUS_SUCCESS;
TRACE("SamrAddMultipleMembersToAlias(%p %p)\n",
AliasHandle, MembersBuffer);
for (i = 0; i < MembersBuffer->Count; i++)
{
Status = SamrAddMemberToAlias(AliasHandle,
((PSID *)MembersBuffer->Sids)[i]);
if (Status == STATUS_MEMBER_IN_ALIAS)
Status = STATUS_SUCCESS;
if (!NT_SUCCESS(Status))
break;
}
return Status;
}
/* Function 53 */
NTSTATUS
NTAPI
+57
View File
@@ -224,6 +224,7 @@ SampCreateUserAccount(HKEY hDomainKey,
ULONG ulRelativeId)
{
SAM_USER_FIXED_DATA FixedUserData;
LPWSTR lpEmptyString = L"";
DWORD dwDisposition;
WCHAR szAccountKeyName[32];
HKEY hAccountKey = NULL;
@@ -261,6 +262,62 @@ SampCreateUserAccount(HKEY hDomainKey,
(LPVOID)lpAccountName,
(wcslen(lpAccountName) + 1) * sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"FullName",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"HomeDirectory",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"HomeDirectoryDrive",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"ScriptPath",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"ProfilePath",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"AdminComment",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"UserComment",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegSetValueEx(hAccountKey,
L"WorkStations",
0,
REG_SZ,
(LPVOID)lpEmptyString,
sizeof(WCHAR));
RegCloseKey(hAccountKey);
}