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

Alexandre Julliard julliard at winehq.org
Wed Nov 11 08:33:26 CST 2009


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Nov 11 11:22:53 2009 +0100

rpcrt4: Implement RpcBindingInqAuthClient{, Ex}.

---

 dlls/rpcrt4/rpc_binding.c |   84 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/rpcrt4/rpcrt4.spec   |    8 ++--
 include/rpcdce.h          |   22 ++++++++++++
 3 files changed, 110 insertions(+), 4 deletions(-)

diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c
index 29e0709..622918d 100644
--- a/dlls/rpcrt4/rpc_binding.c
+++ b/dlls/rpcrt4/rpc_binding.c
@@ -1493,6 +1493,90 @@ RpcBindingInqAuthInfoW( RPC_BINDING_HANDLE Binding, RPC_WSTR *ServerPrincName, U
 }
 
 /***********************************************************************
+ *             RpcBindingInqAuthClientA (RPCRT4.@)
+ */
+RPCRTAPI RPC_STATUS RPC_ENTRY
+RpcBindingInqAuthClientA( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                          RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                          ULONG *AuthzSvc )
+{
+    return RpcBindingInqAuthClientExA(ClientBinding, Privs, ServerPrincName, AuthnLevel,
+                                      AuthnSvc, AuthzSvc, 0);
+}
+
+/***********************************************************************
+ *             RpcBindingInqAuthClientW (RPCRT4.@)
+ */
+RPCRTAPI RPC_STATUS RPC_ENTRY
+RpcBindingInqAuthClientW( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                          RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                          ULONG *AuthzSvc )
+{
+    return RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName, AuthnLevel,
+                                      AuthnSvc, AuthzSvc, 0);
+}
+
+/***********************************************************************
+ *             RpcBindingInqAuthClientExA (RPCRT4.@)
+ */
+RPCRTAPI RPC_STATUS RPC_ENTRY
+RpcBindingInqAuthClientExA( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                            RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                            ULONG *AuthzSvc, ULONG Flags )
+{
+    RPC_STATUS status;
+    RPC_WSTR principal;
+
+    TRACE("%p %p %p %p %p %p 0x%x\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
+          AuthnSvc, AuthzSvc, Flags);
+
+    status = RpcBindingInqAuthClientExW(ClientBinding, Privs, ServerPrincName ? &principal : NULL,
+                                        AuthnLevel, AuthnSvc, AuthzSvc, Flags);
+    if (status == RPC_S_OK && ServerPrincName)
+    {
+        *ServerPrincName = (RPC_CSTR)RPCRT4_strdupWtoA(principal);
+        RpcStringFreeW(&principal);
+        if (!*ServerPrincName) return ERROR_OUTOFMEMORY;
+    }
+
+    return status;
+}
+
+/***********************************************************************
+ *             RpcBindingInqAuthClientExW (RPCRT4.@)
+ */
+RPCRTAPI RPC_STATUS RPC_ENTRY
+RpcBindingInqAuthClientExW( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                            RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                            ULONG *AuthzSvc, ULONG Flags )
+{
+    RpcBinding *bind = ClientBinding;
+
+    TRACE("%p %p %p %p %p %p 0x%x\n", ClientBinding, Privs, ServerPrincName, AuthnLevel,
+          AuthnSvc, AuthzSvc, Flags);
+
+    if (!bind->AuthInfo) return RPC_S_BINDING_HAS_NO_AUTH;
+
+    if (Privs) *Privs = (RPC_AUTHZ_HANDLE)bind->AuthInfo->identity;
+    if (ServerPrincName)
+    {
+        *ServerPrincName = RPCRT4_strdupW(bind->AuthInfo->server_principal_name);
+        if (!*ServerPrincName) return ERROR_OUTOFMEMORY;
+    }
+    if (AuthnLevel) *AuthnLevel = bind->AuthInfo->AuthnLevel;
+    if (AuthnSvc) *AuthnSvc = bind->AuthInfo->AuthnSvc;
+    if (AuthzSvc)
+    {
+        FIXME("authorization service not implemented\n");
+        *AuthzSvc = RPC_C_AUTHZ_NONE;
+    }
+    if (Flags)
+        FIXME("flags 0x%x not implemented\n", Flags);
+
+    return RPC_S_OK;
+}
+
+/***********************************************************************
  *             RpcBindingSetAuthInfoExA (RPCRT4.@)
  */
 RPCRTAPI RPC_STATUS RPC_ENTRY
diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec
index 0a04769..6ce9401 100644
--- a/dlls/rpcrt4/rpcrt4.spec
+++ b/dlls/rpcrt4/rpcrt4.spec
@@ -341,10 +341,10 @@
 @ stdcall RpcBindingFree(ptr)
 @ stdcall RpcBindingFromStringBindingA(str  ptr)
 @ stdcall RpcBindingFromStringBindingW(wstr ptr)
-@ stub RpcBindingInqAuthClientA
-@ stub RpcBindingInqAuthClientExA
-@ stub RpcBindingInqAuthClientExW
-@ stub RpcBindingInqAuthClientW
+@ stdcall RpcBindingInqAuthClientA(ptr ptr ptr ptr ptr ptr)
+@ stdcall RpcBindingInqAuthClientExA(ptr ptr ptr ptr ptr ptr long)
+@ stdcall RpcBindingInqAuthClientExW(ptr ptr ptr ptr ptr ptr long)
+@ stdcall RpcBindingInqAuthClientW(ptr ptr ptr ptr ptr ptr)
 @ stdcall RpcBindingInqAuthInfoA(ptr ptr ptr ptr ptr ptr)
 @ stdcall RpcBindingInqAuthInfoExA(ptr ptr ptr ptr ptr ptr long ptr)
 @ stdcall RpcBindingInqAuthInfoExW(ptr ptr ptr ptr ptr ptr long ptr)
diff --git a/include/rpcdce.h b/include/rpcdce.h
index de30561..dc2c8de 100644
--- a/include/rpcdce.h
+++ b/include/rpcdce.h
@@ -509,6 +509,28 @@ RPCRTAPI RPC_STATUS RPC_ENTRY
                           ULONG *AuthnSvc, RPC_AUTH_IDENTITY_HANDLE *AuthIdentity, ULONG *AuthzSvc );
 #define RpcBindingInqAuthInfo WINELIB_NAME_AW(RpcBindingInqAuthInfo)
 
+RPCRTAPI RPC_STATUS RPC_ENTRY
+  RpcBindingInqAuthClientA( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                            RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                            ULONG *AuthzSvc );
+
+RPCRTAPI RPC_STATUS RPC_ENTRY
+  RpcBindingInqAuthClientW( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                            RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                            ULONG *AuthzSvc );
+#define RpcBindingInqAuthClient WINELIB_NAME_AW(RpcBindingInqAuthClient)
+
+RPCRTAPI RPC_STATUS RPC_ENTRY
+  RpcBindingInqAuthClientExA( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                              RPC_CSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                              ULONG *AuthzSvc, ULONG Flags );
+
+RPCRTAPI RPC_STATUS RPC_ENTRY
+  RpcBindingInqAuthClientExW( RPC_BINDING_HANDLE ClientBinding, RPC_AUTHZ_HANDLE *Privs,
+                              RPC_WSTR *ServerPrincName, ULONG *AuthnLevel, ULONG *AuthnSvc,
+                              ULONG *AuthzSvc, ULONG Flags );
+#define RpcBindingInqAuthClientEx WINELIB_NAME_AW(RpcBindingInqAuthClientEx)
+
 RPCRTAPI RPC_STATUS RPC_ENTRY RpcCancelThread(void*);
 RPCRTAPI RPC_STATUS RPC_ENTRY RpcCancelThreadEx(void*,LONG);
 




More information about the wine-cvs mailing list