Commit fb469988 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

Branch the LSA functions from security.c to lsa.c.

parent c787b146
......@@ -17,6 +17,7 @@ C_SRCS = \
crypt_md5.c \
crypt_sha.c \
eventlog.c \
lsa.c \
registry.c \
security.c \
service.c
......
......@@ -103,17 +103,6 @@ static inline BOOL set_ntstatus( NTSTATUS status )
return !status;
}
static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa )
{
if (oa)
{
TRACE("\n\tlength=%lu, rootdir=%p, objectname=%s\n\tattr=0x%08lx, sid=%p qos=%p\n",
oa->Length, oa->RootDirectory,
oa->ObjectName?debugstr_w(oa->ObjectName->Buffer):"null",
oa->Attributes, oa->SecurityDescriptor, oa->SecurityQualityOfService);
}
}
#define WINE_SIZE_OF_WORLD_ACCESS_ACL (sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + sizeof(sidWorld) - sizeof(DWORD))
static void GetWorldAccessACL(PACL pACL)
......@@ -157,14 +146,6 @@ static BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
return Result;
}
#define ADVAPI_ForceLocalComputer(ServerName, FailureCode) \
if (!ADVAPI_IsLocalComputer(ServerName)) \
{ \
FIXME("Action Implemented for local computer only. " \
"Requested for server %s\n", debugstr_w(ServerName)); \
return FailureCode; \
}
/* ##############################
###### TOKEN FUNCTIONS ######
##############################
......@@ -1616,233 +1597,6 @@ SynchronizeWindows31FilesAndWindowsNTRegistry( DWORD x1, DWORD x2, DWORD x3,
return TRUE;
}
NTSTATUS WINAPI
LsaEnumerateTrustedDomains(
LSA_HANDLE PolicyHandle,
PLSA_ENUMERATION_HANDLE EnumerationContext,
PVOID* Buffer,
ULONG PreferedMaximumLength,
PULONG CountReturned)
{
FIXME("(%p,%p,%p,0x%08lx,%p):stub\n", PolicyHandle, EnumerationContext,
Buffer, PreferedMaximumLength, CountReturned);
if (CountReturned) *CountReturned = 0;
return STATUS_SUCCESS;
}
NTSTATUS WINAPI
LsaLookupNames(
LSA_HANDLE PolicyHandle,
ULONG Count,
PLSA_UNICODE_STRING Names,
PLSA_REFERENCED_DOMAIN_LIST* ReferencedDomains,
PLSA_TRANSLATED_SID* Sids)
{
FIXME("(%p,0x%08lx,%p,%p,%p):stub\n", PolicyHandle, Count, Names,
ReferencedDomains, Sids);
return STATUS_NONE_MAPPED;
}
/******************************************************************************
* LsaOpenPolicy [ADVAPI32.@]
*
* PARAMS
* SystemName [I]
* ObjectAttributes [I]
* DesiredAccess [I]
* PolicyHandle [I/O]
*/
NTSTATUS WINAPI
LsaOpenPolicy(
IN PLSA_UNICODE_STRING SystemName,
IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
IN ACCESS_MASK DesiredAccess,
IN OUT PLSA_HANDLE PolicyHandle)
{
FIXME("(%s,%p,0x%08lx,%p):stub\n",
SystemName?debugstr_w(SystemName->Buffer):"null",
ObjectAttributes, DesiredAccess, PolicyHandle);
ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL,
STATUS_ACCESS_VIOLATION);
dumpLsaAttributes(ObjectAttributes);
if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
return STATUS_SUCCESS;
}
/******************************************************************************
* LsaQueryInformationPolicy [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaQueryInformationPolicy(
IN LSA_HANDLE PolicyHandle,
IN POLICY_INFORMATION_CLASS InformationClass,
OUT PVOID *Buffer)
{
FIXME("(%p,0x%08x,%p):stub\n",
PolicyHandle, InformationClass, Buffer);
if(!Buffer) return FALSE;
switch (InformationClass)
{
case PolicyAuditEventsInformation: /* 2 */
{
PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), 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 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(xdi));
HKEY key;
BOOL useDefault = TRUE;
LONG ret;
if ((ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"System\\CurrentControlSet\\Services\\VxD\\VNETSUP", 0,
KEY_READ, &key)) == ERROR_SUCCESS)
{
DWORD size = 0;
static const WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
{
xdi->ppdi.Name.Buffer = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, size);
if ((ret = RegQueryValueExW(key, wg, NULL, NULL,
(LPBYTE)xdi->ppdi.Name.Buffer, &size)) == ERROR_SUCCESS)
{
xdi->ppdi.Name.Length = (USHORT)size;
useDefault = FALSE;
}
else
{
HeapFree(GetProcessHeap(), 0, xdi->ppdi.Name.Buffer);
xdi->ppdi.Name.Buffer = NULL;
}
}
RegCloseKey(key);
}
if (useDefault)
RtlCreateUnicodeStringFromAsciiz(&(xdi->ppdi.Name), "DOMAIN");
TRACE("setting domain to %s\n", debugstr_w(xdi->ppdi.Name.Buffer));
xdi->ppdi.Sid = &(xdi->sid);
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:
{
FIXME("category not implemented\n");
return FALSE;
}
}
return TRUE;
}
/******************************************************************************
* LsaSetInformationPolicy [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaSetInformationPolicy(
LSA_HANDLE PolicyHandle,
POLICY_INFORMATION_CLASS InformationClass,
PVOID Buffer)
{
FIXME("(%p,0x%08x,%p):stub\n", PolicyHandle, InformationClass, Buffer);
return STATUS_UNSUCCESSFUL;
}
/******************************************************************************
* LsaLookupSids [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaLookupSids(
IN LSA_HANDLE PolicyHandle,
IN ULONG Count,
IN PSID *Sids,
OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
OUT PLSA_TRANSLATED_NAME *Names )
{
FIXME("%p %lu %p %p %p\n",
PolicyHandle, Count, Sids, ReferencedDomains, Names);
return FALSE;
}
/******************************************************************************
* LsaFreeMemory [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaFreeMemory(IN PVOID Buffer)
{
TRACE("(%p)\n",Buffer);
return HeapFree(GetProcessHeap(), 0, Buffer);
}
/******************************************************************************
* LsaClose [ADVAPI32.@]
*/
NTSTATUS WINAPI
LsaClose(IN LSA_HANDLE ObjectHandle)
{
FIXME("(%p):stub\n",ObjectHandle);
return 0xc0000000;
}
/******************************************************************************
* LsaStorePrivateData [ADVAPI32.@]
*/
NTSTATUS WINAPI LsaStorePrivateData( LSA_HANDLE PolicyHandle,
PLSA_UNICODE_STRING KeyName, PLSA_UNICODE_STRING PrivateData)
{
FIXME("%p %p %p\n", PolicyHandle, KeyName, PrivateData);
return STATUS_OBJECT_NAME_NOT_FOUND;
}
/******************************************************************************
* LsaRetrievePrivateData [ADVAPI32.@]
*/
NTSTATUS WINAPI LsaRetrievePrivateData( LSA_HANDLE PolicyHandle,
PLSA_UNICODE_STRING KeyName, PLSA_UNICODE_STRING* PrivateData)
{
FIXME("%p %p %p\n", PolicyHandle, KeyName, PrivateData);
return STATUS_OBJECT_NAME_NOT_FOUND;
}
/******************************************************************************
* LsaNtStatusToWinError [ADVAPI32.@]
*
* PARAMS
* Status [I]
*/
ULONG WINAPI
LsaNtStatusToWinError(NTSTATUS Status)
{
return RtlNtStatusToDosError(Status);
}
/******************************************************************************
* NotifyBootConfigStatus [ADVAPI32.@]
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment