Commit 12a9547e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

combase: Move CoImpersonateClient().

parent 6d905669
...@@ -547,3 +547,23 @@ HRESULT WINAPI CoQueryClientBlanket(DWORD *authn_service, DWORD *authz_service, ...@@ -547,3 +547,23 @@ HRESULT WINAPI CoQueryClientBlanket(DWORD *authn_service, DWORD *authz_service,
return hr; 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;
}
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
@ stub CoGetStdMarshalEx @ stub CoGetStdMarshalEx
@ stub CoGetSystemSecurityPermissions @ stub CoGetSystemSecurityPermissions
@ stdcall CoGetTreatAsClass(ptr ptr) ole32.CoGetTreatAsClass @ stdcall CoGetTreatAsClass(ptr ptr) ole32.CoGetTreatAsClass
@ stdcall CoImpersonateClient() ole32.CoImpersonateClient @ stdcall CoImpersonateClient()
@ stdcall CoIncrementMTAUsage(ptr) ole32.CoIncrementMTAUsage @ stdcall CoIncrementMTAUsage(ptr) ole32.CoIncrementMTAUsage
@ stdcall CoInitializeEx(ptr long) ole32.CoInitializeEx @ stdcall CoInitializeEx(ptr long) ole32.CoInitializeEx
@ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) ole32.CoInitializeSecurity @ stdcall CoInitializeSecurity(ptr long ptr ptr long long ptr long ptr) ole32.CoInitializeSecurity
......
...@@ -4251,44 +4251,6 @@ HRESULT WINAPI CoSwitchCallContext(IUnknown *pObject, IUnknown **ppOldObject) ...@@ -4251,44 +4251,6 @@ HRESULT WINAPI CoSwitchCallContext(IUnknown *pObject, IUnknown **ppOldObject)
} }
/*********************************************************************** /***********************************************************************
* 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.@] * CoRevertToSelf [OLE32.@]
* *
* Ends the impersonation of the client of the currently executing server * Ends the impersonation of the client of the currently executing server
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
@ stdcall CoGetState(ptr) @ stdcall CoGetState(ptr)
@ stub CoGetTIDFromIPID @ stub CoGetTIDFromIPID
@ stdcall CoGetTreatAsClass(ptr ptr) @ stdcall CoGetTreatAsClass(ptr ptr)
@ stdcall CoImpersonateClient() @ stdcall CoImpersonateClient() combase.CoImpersonateClient
@ stdcall CoIncrementMTAUsage(ptr) @ stdcall CoIncrementMTAUsage(ptr)
@ stdcall CoInitialize(ptr) @ stdcall CoInitialize(ptr)
@ stdcall CoInitializeEx(ptr long) @ stdcall CoInitializeEx(ptr long)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment