to mark activex control dlls as safety
其实也是老生常谈的问题了,很简单但是要用到的时候却不一定记得。无非就是实现一下IObjectSafety接口。
接口名字我今天就忘了,查了好几下才查到。
这个接口只有两个函数,实现可如下:
STDMETHODIMP GetInterfaceSafetyOptions( REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions ) { DWORD dwFlags = INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA; if (pdwSupportedOptions) *pdwSupportedOptions = dwFlags; if (pdwEnabledOptions) *pdwEnabledOptions = dwFlags; return S_OK; } STDMETHODIMP SetInterfaceSafetyOptions(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) { return S_OK; } |