mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
fix some advapi32 lsa winetests
svn path=/trunk/; revision=35958
This commit is contained in:
parent
e941fb914b
commit
a22ce9b036
1 changed files with 79 additions and 80 deletions
|
@ -433,92 +433,91 @@ LsaQueryForestTrustInformation(
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
LsaQueryInformationPolicy(LSA_HANDLE PolicyHandle,
|
LsaQueryInformationPolicy(LSA_HANDLE PolicyHandle,
|
||||||
POLICY_INFORMATION_CLASS pic,
|
POLICY_INFORMATION_CLASS InformationClass,
|
||||||
PVOID *Buffer)
|
PVOID *Buffer)
|
||||||
{
|
{
|
||||||
FIXME("(%p,0x%08x,%p) stub\n",
|
TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
|
||||||
PolicyHandle, pic, Buffer);
|
|
||||||
|
|
||||||
if (!Buffer)
|
if(!Buffer) return STATUS_INVALID_PARAMETER;
|
||||||
return FALSE;
|
switch (InformationClass)
|
||||||
|
{
|
||||||
|
case PolicyAuditEventsInformation: /* 2 */
|
||||||
|
{
|
||||||
|
PPOLICY_AUDIT_EVENTS_INFO p = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
|
sizeof(POLICY_AUDIT_EVENTS_INFO));
|
||||||
|
p->AuditingMode = FALSE; /* no auditing */
|
||||||
|
*Buffer = p;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PolicyPrimaryDomainInformation: /* 3 */
|
||||||
|
case PolicyAccountDomainInformation: /* 5 */
|
||||||
|
{
|
||||||
|
struct di
|
||||||
|
{
|
||||||
|
POLICY_PRIMARY_DOMAIN_INFO ppdi;
|
||||||
|
SID sid;
|
||||||
|
};
|
||||||
|
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
|
||||||
|
|
||||||
switch (pic)
|
struct di * xdi = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
|
||||||
{
|
HKEY key;
|
||||||
case PolicyAuditEventsInformation: /* 2 */
|
BOOL useDefault = TRUE;
|
||||||
{
|
LONG ret;
|
||||||
PPOLICY_AUDIT_EVENTS_INFO p = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(POLICY_AUDIT_EVENTS_INFO));
|
|
||||||
p->AuditingMode = FALSE; /* no auditing */
|
|
||||||
*Buffer = p;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PolicyPrimaryDomainInformation: /* 3 */
|
|
||||||
case PolicyAccountDomainInformation: /* 5 */
|
|
||||||
{
|
|
||||||
struct di
|
|
||||||
{ POLICY_PRIMARY_DOMAIN_INFO ppdi;
|
|
||||||
SID sid;
|
|
||||||
};
|
|
||||||
SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
|
|
||||||
|
|
||||||
struct di * xdi = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
|
if ((ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
||||||
HKEY key;
|
"System\\CurrentControlSet\\Services\\VxD\\VNETSUP", 0,
|
||||||
BOOL useDefault = TRUE;
|
KEY_READ, &key)) == ERROR_SUCCESS)
|
||||||
LONG ret;
|
{
|
||||||
|
DWORD size = 0;
|
||||||
|
WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
|
||||||
|
|
||||||
if ((ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
|
ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
|
||||||
"System\\CurrentControlSet\\Services\\VxD\\VNETSUP", 0,
|
if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
|
||||||
KEY_READ, &key)) == ERROR_SUCCESS)
|
{
|
||||||
{
|
xdi->ppdi.Name.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||||
DWORD size = 0;
|
HEAP_ZERO_MEMORY, size);
|
||||||
WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
|
if ((ret = RegQueryValueExW(key, wg, NULL, NULL,
|
||||||
|
(LPBYTE)xdi->ppdi.Name.Buffer, &size)) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
xdi->ppdi.Name.Length = (USHORT)size;
|
||||||
|
useDefault = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RtlFreeHeap(RtlGetProcessHeap(), 0, xdi->ppdi.Name.Buffer);
|
||||||
|
xdi->ppdi.Name.Buffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RegCloseKey(key);
|
||||||
|
}
|
||||||
|
if (useDefault)
|
||||||
|
RtlCreateUnicodeStringFromAsciiz(&(xdi->ppdi.Name), "DOMAIN");
|
||||||
|
TRACE("setting domain to \n");
|
||||||
|
|
||||||
ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
|
xdi->ppdi.Sid = &(xdi->sid);
|
||||||
if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
|
xdi->sid.Revision = SID_REVISION;
|
||||||
{
|
xdi->sid.SubAuthorityCount = 1;
|
||||||
xdi->ppdi.Name.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
|
xdi->sid.IdentifierAuthority = localSidAuthority;
|
||||||
HEAP_ZERO_MEMORY, size);
|
xdi->sid.SubAuthority[0] = SECURITY_LOCAL_SYSTEM_RID;
|
||||||
if ((ret = RegQueryValueExW(key, wg, NULL, NULL,
|
*Buffer = xdi;
|
||||||
(LPBYTE)xdi->ppdi.Name.Buffer, &size)) == ERROR_SUCCESS)
|
}
|
||||||
{
|
break;
|
||||||
xdi->ppdi.Name.Length = (USHORT)size;
|
case PolicyAuditLogInformation:
|
||||||
useDefault = FALSE;
|
case PolicyPdAccountInformation:
|
||||||
}
|
case PolicyLsaServerRoleInformation:
|
||||||
else
|
case PolicyReplicaSourceInformation:
|
||||||
{
|
case PolicyDefaultQuotaInformation:
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, xdi->ppdi.Name.Buffer);
|
case PolicyModificationInformation:
|
||||||
xdi->ppdi.Name.Buffer = NULL;
|
case PolicyAuditFullSetInformation:
|
||||||
}
|
case PolicyAuditFullQueryInformation:
|
||||||
}
|
case PolicyDnsDomainInformation:
|
||||||
RegCloseKey(key);
|
case PolicyEfsInformation:
|
||||||
}
|
{
|
||||||
if (useDefault)
|
FIXME("category not implemented\n");
|
||||||
RtlCreateUnicodeStringFromAsciiz(&(xdi->ppdi.Name), "DOMAIN");
|
return STATUS_UNSUCCESSFUL;
|
||||||
TRACE("setting domain to \n");
|
}
|
||||||
|
}
|
||||||
xdi->ppdi.Sid = &(xdi->sid);
|
return STATUS_SUCCESS;
|
||||||
xdi->sid.Revision = SID_REVISION;
|
|
||||||
xdi->sid.SubAuthorityCount = 1;
|
|
||||||
xdi->sid.IdentifierAuthority = localSidAuthority;
|
|
||||||
xdi->sid.SubAuthority[0] = SECURITY_LOCAL_SYSTEM_RID;
|
|
||||||
*Buffer = xdi;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case PolicyAuditLogInformation:
|
|
||||||
case PolicyPdAccountInformation:
|
|
||||||
case PolicyLsaServerRoleInformation:
|
|
||||||
case PolicyReplicaSourceInformation:
|
|
||||||
case PolicyDefaultQuotaInformation:
|
|
||||||
case PolicyModificationInformation:
|
|
||||||
case PolicyAuditFullSetInformation:
|
|
||||||
case PolicyAuditFullQueryInformation:
|
|
||||||
case PolicyDnsDomainInformation:
|
|
||||||
case PolicyEfsInformation:
|
|
||||||
{
|
|
||||||
FIXME("category not implemented\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue