EDN Admin
Well-known member
Hi All:
I have made a COM service, I have written InitializeSecurity() as below.
HRESULT InitializeSecurity() throw()<br/>
{<br/>
// TODO : Call CoInitializeSecurity and provide the appropriate security settings for
<br/>
// your service<br/>
// Suggested - PKT Level Authentication, <br/>
// Impersonation Level of RPC_C_IMP_LEVEL_IDENTIFY <br/>
// and an appropiate Non NULL Security Descriptor.<br/>
CSecurityDescriptor cSecDesc;<br/>
cSecDesc.InitializeFromThreadToken();<br/>
HRESULT hResult = ::CoInitializeSecurity(cSecDesc/*NULL*/, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);<br/>
if(FAILED(hResult)){<br/>
return(hResult);<br/>
}
Currently, when I call CoCreateInstance from a user privilege in Win7, it is ok. however, when I build a IE BHO, and As IE8(Default is protected mode), in BHO, I use CoCreateInstance() to create com service interface, it will fail with error
code 0x80070005, In this case, What should I modify the code to fix this problem? Thanks for your help!
return S_OK;<br/>
} <hr class="sig Rejoice, I Desire!
View the full article
I have made a COM service, I have written InitializeSecurity() as below.
HRESULT InitializeSecurity() throw()<br/>
{<br/>
// TODO : Call CoInitializeSecurity and provide the appropriate security settings for
<br/>
// your service<br/>
// Suggested - PKT Level Authentication, <br/>
// Impersonation Level of RPC_C_IMP_LEVEL_IDENTIFY <br/>
// and an appropiate Non NULL Security Descriptor.<br/>
CSecurityDescriptor cSecDesc;<br/>
cSecDesc.InitializeFromThreadToken();<br/>
HRESULT hResult = ::CoInitializeSecurity(cSecDesc/*NULL*/, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);<br/>
if(FAILED(hResult)){<br/>
return(hResult);<br/>
}
Currently, when I call CoCreateInstance from a user privilege in Win7, it is ok. however, when I build a IE BHO, and As IE8(Default is protected mode), in BHO, I use CoCreateInstance() to create com service interface, it will fail with error
code 0x80070005, In this case, What should I modify the code to fix this problem? Thanks for your help!
return S_OK;<br/>
} <hr class="sig Rejoice, I Desire!
View the full article