?
Solved

Implement IInternetSecurityManager with IWebbrowser2

Posted on 2014-01-27
5
Medium Priority
?
862 Views
Last Modified: 2014-02-06
I have a solution, in C,  using IWebBrowser2 that loads an html page from a stream. The html page uses websockets, and the default IE security is denying the websocket creation, so I would like to implement IInternetSecurityManager to override the security settings. I am using vtables, and my IInternetSecurityManager vtable looks like this:

static IInternetSecurityManagerVtbl InetSecMgr_vtable =
{
      InetSecMgr_QueryInterface,
      InetSecMgr_AddRef,
      InetSecMgr_Release,
      InetSecMgr_SetSecuritySite,
      InetSecMgr_GetSecuritySite,
      InetSecMgr_MapUrlToZone,
      InetSecMgr_GetSecurityId,
      InetSecMgr_ProcessUrlAction,
      InetSecMgr_QueryCustomPolicy,
      InetSecMgr_SetZoneMapping,
      InetSecMgr_GetZoneMappings
};

I created stubbed out methods for all of the above.
I am not sure how to hook it up to my browser instance(?)

Thanks!
Amy
0
Comment
Question by:AmyL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 39815543
Even MSDN has only sparse information about that whole thing. But, there is an article that describes what to implement and how to use all that, see http://msdn.microsoft.com/en-us/library/ie/ms537182%28v=vs.85%29.aspx ("Implementing a Custom Security Manager").

Also, there is a MFC sample available at http://support.microsoft.com/kb/246227 ("SAMPLE: Secumgr.exe Overrides Security Manager for WebBrowser Host") that might be helpful fot that task, since it shows how to connect that to your browser.
0
 

Author Comment

by:AmyL
ID: 39825639
I'm just updating this, since it has been sitting cold for a while. The first link from above didn't look like it had an example (just an exe)....correct me if I'm wrong. The second link didn't give the information I was looking for.
0
 

Author Comment

by:AmyL
ID: 39825643
Oops, I got that reversed: the second link is just an exe, the first doesn't contain the info I needed.
0
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 39825823
The exe is a sef-extracting executable that contains the code ;o)

You can easily open it with any (un-)packer you use without even running it, sorry for not mentioning that in the first place.
0
 

Author Closing Comment

by:AmyL
ID: 39839965
This example is C++ with MFC, and I am using C with no MFC, but it is still the closest thing I've found to an example. Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question