Re: Interface method vs QueryInterface()
It helps if you know how the proxy is organized. All
interfaces except for IUnknown are implemented in
so called stublets loaded by the proxy manager. When
you set an interface blanket, you only do it on the stublet.
IUnknown is the only interface implemented on the
proxy manager itself. Thus a blanket for any other
interface does not apply to it. E.g. calling IUnknown
methods through any interface uses the blanket you set
for IUnknown and not the blanket for that interface (if
it calls the object's IUnknown instead of resolving it
at the proxy manager of course). Is that clearer now?
In practical terms, you need to QI for IUnknown (which
does not incur an IUnknown call to the object) and set
a blanket before you can QI for any other interface on
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
"H Xia" <email@example.com> wrote in message
On Dec 19, 7:00 pm, "Alexander Nickolov" <agnicko...@mvps.org> wrote:
IUnknown is special in that it sets the blanket for all
remote IUnknown methods.
My understanding: API CoSetProxyBlanket is used to set client side
proxy blanket, so that when client calls the interface methods, the
credential with the method call is different from the logged on user.
Then server will check to determine whether the call is allowed or not.
With that in mind, the interface got from CoCreateInstanceEx should
have good credential bound, it should be able to be used to query any
other interfaces. Why it can be used to Query IUnknown only
When you say "it sets the blanket for all remote IUnknown methods.", so
I'm wondering the blanket is for client side or remote? for interface
or method? I must have some misunderstanding there.