Nikolay Sivov : combase: Move CoImpersonateClient().

Alexandre Julliard julliard at winehq.org
Thu Aug 6 16:33:43 CDT 2020


Module: wine
Branch: master
Commit: 12a9547e4f5a50248f112aadd50e1bcdeb9dff7d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=12a9547e4f5a50248f112aadd50e1bcdeb9dff7d

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Aug  6 09:13:09 2020 +0300

combase: Move CoImpersonateClient().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/combase/combase.c    | 20 ++++++++++++++++++++
 dlls/combase/combase.spec |  2 +-
 dlls/ole32/compobj.c      | 38 --------------------------------------
 dlls/ole32/ole32.spec     |  2 +-
 4 files changed, 22 insertions(+), 40 deletions(-)

diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c
index 5af6b3d9ed..e63cce00dd 100644
--- a/dlls/combase/combase.c
+++ b/dlls/combase/combase.c
@@ -547,3 +547,23 @@ HRESULT WINAPI CoQueryClientBlanket(DWORD *authn_service, DWORD *authz_service,
 
     return hr;
 }
+
+/***********************************************************************
+ *           CoImpersonateClient        (combase.@)
+ */
+HRESULT WINAPI CoImpersonateClient(void)
+{
+    IServerSecurity *server_security;
+    HRESULT hr;
+
+    TRACE("\n");
+
+    hr = CoGetCallContext(&IID_IServerSecurity, (void **)&server_security);
+    if (SUCCEEDED(hr))
+    {
+        hr = IServerSecurity_ImpersonateClient(server_security);
+        IServerSecurity_Release(server_security);
+    }
+
+    return hr;
+}
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
index 6d13ea6038..3122588d7e 100644
--- a/dlls/combase/combase.spec
+++ b/dlls/combase/combase.spec
@@ -120,7 +120,7 @@
 @ stub CoGetStdMarshalEx
 @ stub CoGetSystemSecurityPermissions
 @ stdcall CoGetTreatAsClass(ptr ptr) ole32.CoGetTreatAsClass
-@ stdcall CoImpersonateClient() ole32.CoImpersonateClient
+@ stdcall CoImpersonateClient()
 @ stdcall CoIncrementMTAUsage(ptr) ole32.CoIncrementMTAUsage
 @ stdcall CoInitializeEx(ptr long) ole32.CoInitializeEx
 @ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) ole32.CoInitializeSecurity
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index c4daeb3b3d..507cc451e2 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -4250,44 +4250,6 @@ HRESULT WINAPI CoSwitchCallContext(IUnknown *pObject, IUnknown **ppOldObject)
     return S_OK;
 }
 
-/***********************************************************************
- *           CoImpersonateClient [OLE32.@]
- *
- * Impersonates the client of the currently executing server call in the
- * current thread.
- *
- * PARAMS
- *  None.
- *
- * RETURNS
- *  Success: S_OK.
- *  Failure: HRESULT code.
- *
- * NOTES
- *  If this function fails then the current thread will not be impersonating
- *  the client and all actions will take place on behalf of the server.
- *  Therefore, it is important to check the return value from this function.
- *
- * SEE ALSO
- *  CoRevertToSelf, CoQueryClientBlanket, CoGetCallContext.
- */
-HRESULT WINAPI CoImpersonateClient(void)
-{
-    IServerSecurity *pSrvSec;
-    HRESULT hr;
-
-    TRACE("\n");
-
-    hr = CoGetCallContext(&IID_IServerSecurity, (void **)&pSrvSec);
-    if (SUCCEEDED(hr))
-    {
-        hr = IServerSecurity_ImpersonateClient(pSrvSec);
-        IServerSecurity_Release(pSrvSec);
-    }
-
-    return hr;
-}
-
 /***********************************************************************
  *           CoRevertToSelf [OLE32.@]
  *
diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec
index e08305810f..049dd0ad61 100644
--- a/dlls/ole32/ole32.spec
+++ b/dlls/ole32/ole32.spec
@@ -47,7 +47,7 @@
 @ stdcall CoGetState(ptr)
 @ stub CoGetTIDFromIPID
 @ stdcall CoGetTreatAsClass(ptr ptr)
-@ stdcall CoImpersonateClient()
+@ stdcall CoImpersonateClient() combase.CoImpersonateClient
 @ stdcall CoIncrementMTAUsage(ptr)
 @ stdcall CoInitialize(ptr)
 @ stdcall CoInitializeEx(ptr long)




More information about the wine-cvs mailing list