[1/2] rpcrt4: Implement RpcBindingInqAuthInfo{, Ex}.
Hans Leidekker
hans at codeweavers.com
Thu Nov 12 07:45:49 CST 2009
---
dlls/rpcrt4/rpc_binding.c | 60 +++++++++++++++++++++++++++++++++++++-------
1 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c
index 622918d..b264b9a 100644
--- a/dlls/rpcrt4/rpc_binding.c
+++ b/dlls/rpcrt4/rpc_binding.c
@@ -1450,9 +1450,22 @@ RpcBindingInqAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName,
ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc,
ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS )
{
- FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel,
+ RPC_STATUS status;
+ RPC_WSTR principal;
+
+ TRACE("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel,
AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
- return RPC_S_INVALID_BINDING;
+
+ status = RpcBindingInqAuthInfoExW(Binding, ServerPrincName ? &principal : NULL, AuthnLevel,
+ AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
+ if (status == RPC_S_OK && ServerPrincName)
+ {
+ *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
+ RpcStringFreeW(&principal);
+ if (!*ServerPrincName) return ERROR_OUTOFMEMORY;
+ }
+
+ return status;
}
/***********************************************************************
@@ -1463,9 +1476,38 @@ RpcBindingInqAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName,
ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc,
ULONG RpcQosVersion, RPC_SECURITY_QOS *SecurityQOS )
{
- FIXME("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel,
+ RpcBinding *bind = Binding;
+
+ TRACE("%p %p %p %p %p %p %u %p\n", Binding, ServerPrincName, AuthnLevel,
AuthnSvc, AuthIdentity, AuthzSvc, RpcQosVersion, SecurityQOS);
- return RPC_S_INVALID_BINDING;
+
+ if (!bind->AuthInfo) return RPC_S_BINDING_HAS_NO_AUTH;
+
+ if (SecurityQOS)
+ {
+ FIXME("QOS not implemented\n");
+ return RPC_S_INVALID_BINDING;
+ }
+
+ if (ServerPrincName)
+ {
+ if (bind->AuthInfo->server_principal_name)
+ {
+ *ServerPrincName = RPCRT4_strdupW(bind->AuthInfo->server_principal_name);
+ if (!*ServerPrincName) return ERROR_OUTOFMEMORY;
+ }
+ else *ServerPrincName = NULL;
+ }
+ if (AuthnLevel) *AuthnLevel = bind->AuthInfo->AuthnLevel;
+ if (AuthnSvc) *AuthnSvc = bind->AuthInfo->AuthnSvc;
+ if (AuthIdentity) *AuthIdentity = bind->AuthInfo->identity;
+ if (AuthzSvc)
+ {
+ FIXME("authorization service not implemented\n");
+ *AuthzSvc = RPC_C_AUTHZ_NONE;
+ }
+
+ return RPC_S_OK;
}
/***********************************************************************
@@ -1475,9 +1517,8 @@ RPCRTAPI RPC_STATUS RPC_ENTRY
RpcBindingInqAuthInfoA( RPC_BINDING_HANDLE Binding, RPC_CSTR *ServerPrincName, ULONG *AuthnLevel,
ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc )
{
- FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel,
- AuthnSvc, AuthIdentity, AuthzSvc);
- return RPC_S_INVALID_BINDING;
+ return RpcBindingInqAuthInfoExA(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
+ AuthzSvc, 0, NULL);
}
/***********************************************************************
@@ -1487,9 +1528,8 @@ RPCRTAPI RPC_STATUS RPC_ENTRY
RpcBindingInqAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, ULONG *AuthnLevel,
ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc )
{
- FIXME("%p %p %p %p %p %p\n", Binding, ServerPrincName, AuthnLevel,
- AuthnSvc, AuthIdentity, AuthzSvc);
- return RPC_S_INVALID_BINDING;
+ return RpcBindingInqAuthInfoExW(Binding, ServerPrincName, AuthnLevel, AuthnSvc, AuthIdentity,
+ AuthzSvc, 0, NULL);
}
/***********************************************************************
--
1.6.3.3
More information about the wine-patches
mailing list