mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.0 KiB
65 lines
2.0 KiB
|
|
#if !defined(_INETSMGR_H_)
|
|
#define _INETSMGR_H_
|
|
|
|
// whoever inherits this class must implement _IsSafeSite
|
|
class CInternetSecurityMgrImpl : public IInternetSecurityManager
|
|
{
|
|
public:
|
|
// *** IUnknown ***
|
|
// (client must provide!)
|
|
|
|
// *** IInternetSecurityManager methods ***
|
|
virtual STDMETHODIMP MapUrlToZone(LPCWSTR pwszUrl, DWORD *pdwZone, DWORD dwReserved)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP GetSecurityId(LPCWSTR pwszUrl, BYTE* pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP ProcessUrlAction(LPCWSTR pwszUrl, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy,
|
|
BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
|
|
{
|
|
HRESULT hres = INET_E_DEFAULT_ACTION;
|
|
|
|
if (_IsSafeUrl(pwszUrl))
|
|
{
|
|
if (cbPolicy >= SIZEOF(DWORD))
|
|
{
|
|
*(DWORD *)pPolicy = URLPOLICY_ALLOW;
|
|
hres = S_OK;
|
|
}
|
|
else
|
|
hres = S_FALSE;
|
|
}
|
|
|
|
return hres;
|
|
}
|
|
virtual STDMETHODIMP QueryCustomPolicy(LPCWSTR pwszUrl, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy,
|
|
BYTE *pContext, DWORD cbContext, DWORD dwReserved)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP SetSecuritySite(IInternetSecurityMgrSite *pSite)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP GetSecuritySite(IInternetSecurityMgrSite **ppSite)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP SetZoneMapping(DWORD dwZone, LPCWSTR lpszPattern, DWORD dwFlags)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
virtual STDMETHODIMP GetZoneMappings(DWORD dwZone, IEnumString **ppEnumString, DWORD dwFlags)
|
|
{
|
|
return INET_E_DEFAULT_ACTION;
|
|
}
|
|
|
|
protected:
|
|
virtual BOOL _IsSafeUrl(LPCWSTR pwszUrl) = 0;
|
|
};
|
|
|
|
#endif
|