helperfunctions.cpp
来自「VC++串口通信设。本书详细说明讲解了在VC++环境下编写串口通信得过程。值得一」· C++ 代码 · 共 67 行
CPP
67 行
HRESULT CoQueryProxyBlanket( IUnknown * pProxy,
DWORD * pAuthnSvc,
DWORD * pAuthzSvc,
OLECHAR ** pServerPrincName,
DWORD * pAuthnLevel,
DWORD * pImpLevel,
RPC_AUTH_IDENTITY_HANDLE * ppAuthInfo,
DWORD * pCapabilities )
{
pProxy->QueryInterface(IID_IClientSecurity, (void**)&pcs);
pcs->QueryBlanket(pProxy, pAuthnSvc, pAuthzSvc,
pServerPrincName, pAuthnLevel, pImpLevel, ppAuthInfo,
pCapabilities);
pcs->Release();
}
HRESULT CoSetProxyBlanket( IUnknown * pProxy,
DWORD dwAuthnSvc,
DWORD dwAuthzSvc,
WCHAR * pServerPrincName,
DWORD dwAuthnLevel,
DWORD dwImpLevel,
RPC_AUTH_IDENTITY_HANDLE pAuthInfo,
DWORD dwCapabilities )
{
pProxy->QueryInterface(IID_IClientSecurity, (void**)&pcs);
pcs->SetBlanket(pProxy, dwAuthnSvc, dwAuthzSvc,
pServerPrincName, dwAuthnLevel, dwImpLevel, pAuthInfo,
dwCapabilities);
pcs->Release();
}
HRESULT CoCopyProxy( IUnknown * pProxy,
IUnknown ** ppCopy )
{
pProxy->QueryInterface(IID_IClientSecurity, (void**)&pcs);
pcs->CopyProxy(punkProxy, ppunkCopy);
pcs->Release();
}
HRESULT CoQueryClientBlanket( IUnknown * pProxy,
DWORD * pAuthnSvc,
DWORD * pAuthzSvc,
OLECHAR ** pServerPrincName,
DWORD * pAuthnLevel,
DWORD * pImpLevel,
RPC_AUTHZ_HANDLE * pPrivs,
DWORD ** pCapabilities )
{
CoGetCallContext(IID_IServerSecurity, (void**)&pss);
pss->QueryBlanket(pAuthnSvc, pAuthzSvc, pServerPrincName,
pAuthnLevel, pImpLevel, pPrivs, pCapabilities);
pss->Release();
}
CoImpersonateClient()
{
CoGetCallContext(IID_IServerSecurity, (void **)&pss);
pss->ImpersonateClient();
pss->Release();
}
CoRevertToSelf()
{
CoGetCallContext(IID_IServerSecurity, (void **)&pss);
pss->RevertToSelf();
pss->Release();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?