WCHAR szAccountKeyName[32];
HANDLE hAccountKey = NULL;
HANDLE hNamesKey = NULL;
+ PSECURITY_DESCRIPTOR Sd = NULL;
+ ULONG SdSize = 0;
NTSTATUS Status;
swprintf(szAccountKeyName, L"Aliases\\%08lX", ulRelativeId);
if (!NT_SUCCESS(Status))
goto done;
+ /* Create the server SD */
+ Status = SampCreateAliasSD(&Sd,
+ &SdSize);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+ /* Set SecDesc attribute*/
+ Status = SampRegSetValue(hAccountKey,
+ L"SecDesc",
+ REG_BINARY,
+ Sd,
+ SdSize);
+ if (!NT_SUCCESS(Status))
+ goto done;
Status = SampRegOpenKey(hDomainKey,
L"Aliases\\Names",
done:
SampRegCloseKey(&hNamesKey);
+ if (Sd != NULL)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Sd);
+
if (hAccountKey != NULL)
{
SampRegCloseKey(&hAccountKey);
WCHAR szAccountKeyName[32];
HANDLE hAccountKey = NULL;
HANDLE hNamesKey = NULL;
+ PSECURITY_DESCRIPTOR Sd = NULL;
+ ULONG SdSize = 0;
NTSTATUS Status;
/* Initialize fixed group data */
if (!NT_SUCCESS(Status))
goto done;
+ /* Create the security descriptor */
+ Status = SampCreateGroupSD(&Sd,
+ &SdSize);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+ /* Set the SecDesc attribute*/
+ Status = SampRegSetValue(hAccountKey,
+ L"SecDesc",
+ REG_BINARY,
+ Sd,
+ SdSize);
+ if (!NT_SUCCESS(Status))
+ goto done;
+
Status = SampRegOpenKey(hDomainKey,
L"Groups\\Names",
KEY_ALL_ACCESS,
done:
SampRegCloseKey(&hNamesKey);
+ if (Sd != NULL)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, Sd);
+
if (hAccountKey != NULL)
{
SampRegCloseKey(&hAccountKey);
if (!NT_SUCCESS(Status))
goto done;
+ /* Set PrivateData attribute*/
+ Status = SampRegSetValue(hAccountKey,
+ L"PrivateData",
+ REG_SZ,
+ (LPVOID)lpEmptyString,
+ sizeof(WCHAR));
+ if (!NT_SUCCESS(Status))
+ goto done;
+
+
/* FIXME: Set SecDesc attribute*/