Hans Leidekker : rpcrt4: Implement RpcBindingInqAuthInfo{, Ex}.

Alexandre Julliard julliard at winehq.org
Thu Nov 12 10:22:11 CST 2009


Module: wine
Branch: master
Commit: 8abe95ddfad8787d9c950fa7061bdb5512f307b6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8abe95ddfad8787d9c950fa7061bdb5512f307b6

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Nov 12 14:45:49 2009 +0100

rpcrt4: Implement RpcBindingInqAuthInfo{, Ex}.

---

 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);
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list