Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <windows.h>
- #include <Urlmon.h>
- int main(int argc, char **argv)
- {
- IInternetSecurityManager *pSecurityManager = NULL;
- HRESULT hResult = S_OK;
- CoInitialize(NULL);
- hResult=CoCreateInstance( CLSID_InternetSecurityManager, NULL,
- CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager,
- (void **)&pSecurityManager );
- if (SUCCEEDED(hResult))
- {
- hResult=pSecurityManager->SetZoneMapping(
- URLZONE_INTRANET, L"https://example.com", SZM_CREATE
- );
- if(SUCCEEDED(hResult)) wprintf(L"Done!n",(UINT)hResult);
- else wprintf(L"SetZoneMapping failed: 0x%xn",(UINT)hResult);
- pSecurityManager->Release();
- }
- else{
- wprintf(L"CoCreateInstance failed: 0x%xn",(UINT)hResult);
- }
- getchar();
- return 0;
- }
Add Comment
Please, Sign In to add comment