[PATCH 6/6] combase: Move CoImpersonateClient().
Nikolay Sivov
nsivov at codeweavers.com
Thu Aug 6 01:13:09 CDT 2020
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
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 5af6b3d9ed6..e63cce00dda 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 6d13ea6038e..3122588d7e3 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 c4daeb3b3d9..507cc451e20 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 e08305810fd..049dd0ad616 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)
--
2.27.0
More information about the wine-devel
mailing list