Guest User

Untitled

a guest
Oct 17th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. #include <Urlmon.h>
  5.  
  6.  
  7. int main(int argc, char **argv)
  8. {
  9. IInternetSecurityManager *pSecurityManager = NULL;
  10. HRESULT hResult = S_OK;
  11.  
  12. CoInitialize(NULL);
  13. hResult=CoCreateInstance( CLSID_InternetSecurityManager, NULL,
  14. CLSCTX_INPROC_SERVER, IID_IInternetSecurityManager,
  15. (void **)&pSecurityManager );
  16.  
  17. if (SUCCEEDED(hResult))
  18. {
  19. hResult=pSecurityManager->SetZoneMapping(
  20. URLZONE_INTRANET, L"https://example.com", SZM_CREATE
  21. );
  22.  
  23. if(SUCCEEDED(hResult)) wprintf(L"Done!n",(UINT)hResult);
  24. else wprintf(L"SetZoneMapping failed: 0x%xn",(UINT)hResult);
  25.  
  26. pSecurityManager->Release();
  27. }
  28. else{
  29. wprintf(L"CoCreateInstance failed: 0x%xn",(UINT)hResult);
  30. }
  31.  
  32.  
  33. getchar();
  34. return 0;
  35. }
Add Comment
Please, Sign In to add comment