Author: ekohl
Date: Sat Oct 16 09:41:47 2010
New Revision: 49164
URL:
http://svn.reactos.org/svn/reactos?rev=49164&view=rev
Log:
[ADVAPI32]
Implement LsaCreateAccount(), LsaOpenAccount() and LsaSetInformationPolicy().
Modified:
trunk/reactos/dll/win32/advapi32/advapi32.spec
trunk/reactos/dll/win32/advapi32/sec/lsa.c
trunk/reactos/include/psdk/ntsecapi.h
Modified: trunk/reactos/dll/win32/advapi32/advapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.spec [iso-8859-1] Sat Oct 16 09:41:47 2010
@@ -348,7 +348,7 @@
@ stub LsaAddPrivilegesToAccount
@ stub LsaClearAuditLog
@ stdcall LsaClose(ptr)
-@ stub LsaCreateAccount
+@ stdcall LsaCreateAccount(ptr ptr long ptr)
@ stub LsaCreateSecret
@ stub LsaCreateTrustedDomain
@ stdcall LsaCreateTrustedDomainEx(ptr ptr ptr long ptr)
@@ -377,8 +377,8 @@
@ stdcall LsaLookupPrivilegeValue(ptr ptr ptr)
@ stdcall LsaLookupSids(ptr long ptr ptr ptr)
@ stdcall LsaNtStatusToWinError(long)
-@ stub LsaOpenAccount
-@ stdcall LsaOpenPolicy(long long long long)
+@ stdcall LsaOpenAccount(ptr ptr long ptr)
+@ stdcall LsaOpenPolicy(ptr ptr long ptr)
@ stub LsaOpenPolicySce
@ stub LsaOpenSecret
@ stub LsaOpenTrustedDomain
Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/lsa…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Sat Oct 16 09:41:47 2010
@@ -155,6 +155,38 @@
return STATUS_OBJECT_NAME_NOT_FOUND;
}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaCreateAccount(IN LSA_HANDLE PolicyHandle,
+ IN PSID AccountSid,
+ IN ULONG Flags,
+ IN OUT PLSA_HANDLE AccountHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, AccountSid, Flags,
AccountHandle);
+
+ RpcTryExcept
+ {
+ Status = LsarCreateAccount((LSAPR_HANDLE)PolicyHandle,
+ AccountSid,
+ Flags,
+ AccountHandle);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
+
/*
* @unimplemented
*/
@@ -499,6 +531,38 @@
TRACE("(%lx)\n", Status);
return RtlNtStatusToDosError(Status);
}
+
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaOpenAccount(IN LSA_HANDLE PolicyHandle,
+ IN PSID AccountSid,
+ IN ULONG Flags,
+ IN OUT PLSA_HANDLE AccountHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,%p,0x%08x,%p)\n", PolicyHandle, AccountSid, Flags,
AccountHandle);
+
+ RpcTryExcept
+ {
+ Status = LsarOpenAccount((LSAPR_HANDLE)PolicyHandle,
+ AccountSid,
+ Flags,
+ AccountHandle);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
/******************************************************************************
* LsaOpenPolicy
@@ -701,19 +765,35 @@
return STATUS_UNSUCCESSFUL;
}
-/*
- * @unimplemented
- */
-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;
-}
+
+/*
+ * @implemented
+ */
+NTSTATUS
+WINAPI
+LsaSetInformationPolicy(IN LSA_HANDLE PolicyHandle,
+ IN POLICY_INFORMATION_CLASS InformationClass,
+ IN PVOID Buffer)
+{
+ NTSTATUS Status;
+
+ TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
+
+ RpcTryExcept
+ {
+ Status = LsarSetInformationPolicy((LSAPR_HANDLE)PolicyHandle,
+ InformationClass,
+ (PLSAPR_POLICY_INFORMATION)Buffer);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
+}
+
/*
* @unimplemented
Modified: trunk/reactos/include/psdk/ntsecapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntsecapi.h?re…
==============================================================================
--- trunk/reactos/include/psdk/ntsecapi.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/ntsecapi.h [iso-8859-1] Sat Oct 16 09:41:47 2010
@@ -675,6 +675,7 @@
PULONG,PNTSTATUS);
NTSTATUS NTAPI LsaClose(LSA_HANDLE);
NTSTATUS NTAPI LsaConnectUntrusted(PHANDLE);
+NTSTATUS NTAPI LsaCreateAccount(LSA_HANDLE, PSID, ULONG, PLSA_HANDLE);
NTSTATUS NTAPI LsaCreateTrustedDomainEx(LSA_HANDLE,
PTRUSTED_DOMAIN_INFORMATION_EX,
PTRUSTED_DOMAIN_AUTH_INFORMATION,ACCESS_MASK,
@@ -703,6 +704,7 @@
NTSTATUS NTAPI LsaLookupSids(LSA_HANDLE,ULONG,PSID*,
PLSA_REFERENCED_DOMAIN_LIST*,PLSA_TRANSLATED_NAME*);
ULONG NTAPI LsaNtStatusToWinError(NTSTATUS);
+NTSTATUS NTAPI LsaOpenAccount(LSA_HANDLE, PSID, ULONG, PLSA_HANDLE);
NTSTATUS NTAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,
ACCESS_MASK,PLSA_HANDLE);
NTSTATUS NTAPI LsaQueryDomainInformationPolicy(LSA_HANDLE,