#include <advapi32.h>
-WINE_DEFAULT_DEBUG_CHANNEL(advapi);
+#include <lsa_c.h>
+WINE_DEFAULT_DEBUG_CHANNEL(advapi);
static
BOOL
RpcTryExcept
{
- Status = LsarEnmuerateAccountRights((LSAPR_HANDLE)PolicyHandle,
+ Status = LsarEnumerateAccountRights((LSAPR_HANDLE)PolicyHandle,
AccountSid,
&UserRightsSet);
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;
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
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;
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
IN PLSA_UNICODE_STRING TrustedDomainName,
OUT PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo)
{
- FIXME("LsaQueryForestTrustInformation(%p %p %p) stub\n",
+ NTSTATUS Status;
+
+ TRACE("LsaQueryForestTrustInformation(%p %p %p)\n",
PolicyHandle, TrustedDomainName, ForestTrustInfo);
- return STATUS_NOT_IMPLEMENTED;
+
+ RpcTryExcept
+ {
+ Status = LsarQueryForestTrustInformation((LSAPR_HANDLE)PolicyHandle,
+ TrustedDomainName,
+ ForestTrustDomainInfo,
+ ForestTrustInfo);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
Status = LsarQueryTrustedDomainInfoByName((LSAPR_HANDLE)PolicyHandle,
(PRPC_UNICODE_STRING)TrustedDomainName,
InformationClass,
- (unsigned long *)Buffer); // Shuld be: (PLSAPR_POLICY_INFORMATION *)Buffer
+ (PLSAPR_TRUSTED_DOMAIN_INFO *)Buffer);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
}
-/*
- * @unimplemented
- */
-NTSTATUS
-WINAPI
-LsaRegisterPolicyChangeNotification(IN POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass,
- IN HANDLE NotificationEventHandle)
-{
- FIXME("LsaRegisterPolicyChangeNotification(%d %p) stub\n",
- InformationClass, NotificationEventHandle);
- return STATUS_UNSUCCESSFUL;
-}
-
-
/*
* @implemented
*/
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
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;
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
WINAPI
IN BOOL CheckOnly,
OUT PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
{
- FIXME("LsaSetForestTrustInformation(%p %p %p %d %p) stub\n",
+ NTSTATUS Status;
+
+ TRACE("LsaSetForestTrustInformation(%p %p %p %d %p)\n",
PolicyHandle, TrustedDomainName, ForestTrustInfo, CheckOnly, CollisionInfo);
- return STATUS_NOT_IMPLEMENTED;
+
+ RpcTryExcept
+ {
+ Status = LsarSetForestTrustInformation((LSAPR_HANDLE)PolicyHandle,
+ TrustedDomainName,
+ ForestTrustDomainInfo,
+ ForestTrustInfo,
+ CheckOnly,
+ CollisionInfo);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return Status;
}
return STATUS_OBJECT_NAME_NOT_FOUND;
}
-
-/*
- * @unimplemented
- */
-NTSTATUS
-WINAPI
-LsaUnregisterPolicyChangeNotification(IN POLICY_NOTIFICATION_INFORMATION_CLASS InformationClass,
- IN HANDLE NotificationEventHandle)
-{
- FIXME("(%d %p) stub\n",
- InformationClass, NotificationEventHandle);
- return STATUS_SUCCESS;
-}
-
/* EOF */