Author: ekohl
Date: Fri Sep 28 22:11:18 2012
New Revision: 57416
URL:
http://svn.reactos.org/svn/reactos?rev=57416&view=rev
Log:
[ADVAPI32]
Implement LsaGetRemoteUserName, LsaQueryDomainInformationPolicy and
LsaSetDomainInformationPolicy.
Modified:
trunk/reactos/dll/win32/advapi32/sec/lsa.c
trunk/reactos/include/reactos/idl/lsa.idl
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] Fri Sep 28 22:11:18 2012
@@ -688,9 +688,38 @@
OUT PLSA_UNICODE_STRING *UserName,
OUT PLSA_UNICODE_STRING *DomainName OPTIONAL)
{
- FIXME("LsaGetUserName(%p %p %p)\n",
- SystemName, UserName, DomainName);
- return STATUS_NOT_IMPLEMENTED;
+ PRPC_UNICODE_STRING UserNameString = NULL;
+ PRPC_UNICODE_STRING DomainNameString = NULL;
+ NTSTATUS Status;
+
+ TRACE("LsaGetRemoteUserName(%s %p %p)\n",
+ SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
+ UserName, DomainName);
+
+ RpcTryExcept
+ {
+ Status = LsarGetUserName((PLSAPR_SERVER_NAME)SystemName,
+ &UserNameString,
+ (DomainName != NULL) ? &DomainNameString : NULL);
+
+ *UserName = (PLSA_UNICODE_STRING)UserNameString;
+
+ if (DomainName != NULL)
+ *DomainName = (PLSA_UNICODE_STRING)DomainNameString;
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ if (UserNameString != NULL)
+ MIDL_user_free(UserNameString);
+
+ if (DomainNameString != NULL)
+ MIDL_user_free(DomainNameString);
+
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
@@ -1227,7 +1256,7 @@
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
@@ -1235,9 +1264,30 @@
IN POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
OUT PVOID *Buffer)
{
- FIXME("LsaQueryDomainInformationPolicy(%p %lu %p) stub\n",
+ PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation = NULL;
+ NTSTATUS Status;
+
+ TRACE("LsaQueryDomainInformationPolicy(%p %lu %p)\n",
PolicyHandle, InformationClass, Buffer);
- return STATUS_NOT_IMPLEMENTED;
+
+ RpcTryExcept
+ {
+ Status = LsarQueryDomainInformationPolicy((LSAPR_HANDLE)PolicyHandle,
+ InformationClass,
+ &PolicyInformation);
+
+ *Buffer = PolicyInformation;
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ if (PolicyInformation != NULL)
+ MIDL_user_free(PolicyInformation);
+
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
@@ -1621,7 +1671,7 @@
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
@@ -1629,9 +1679,24 @@
IN POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
IN PVOID Buffer OPTIONAL)
{
- FIXME("LsaSetDomainInformationPolicy(%p %d %p) stub\n",
+ NTSTATUS Status;
+
+ TRACE("LsaSetDomainInformationPolicy(%p %d %p)\n",
PolicyHandle, InformationClass, Buffer);
- return STATUS_UNSUCCESSFUL;
+
+ RpcTryExcept
+ {
+ Status = LsarSetDomainInformationPolicy((LSAPR_HANDLE)PolicyHandle,
+ InformationClass,
+
(PLSAPR_POLICY_DOMAIN_INFORMATION)Buffer);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
Modified: trunk/reactos/include/reactos/idl/lsa.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/lsa.id…
==============================================================================
--- trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] Fri Sep 28 22:11:18 2012
@@ -936,15 +936,13 @@
NTSTATUS __stdcall LsarQueryDomainInformationPolicy(
[in] LSAPR_HANDLE PolicyHandle,
[in] POLICY_INFORMATION_CLASS InformationClass,
- [out] unsigned long *PolicyInformation);
- /* FIXME: should be [out, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION
*PolicyInformation); */
+ [out, switch_is(InformationClass)] PLSAPR_POLICY_DOMAIN_INFORMATION
*PolicyInformation);
/* Function 54 */
NTSTATUS __stdcall LsarSetDomainInformationPolicy(
[in] LSAPR_HANDLE PolicyHandle,
[in] POLICY_INFORMATION_CLASS InformationClass,
- [in] unsigned long PolicyInformation);
- /* FIXME: should be [in, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION
PolicyInformation); */
+ [in, switch_is(InformationClass)] PLSAPR_POLICY_DOMAIN_INFORMATION
PolicyInformation);
/* Function 55 */
NTSTATUS __stdcall LsarOpenTrustedDomainByName(