Solved

Implement IInternetSecurityManager with IWebbrowser2

Posted on 2014-01-27
5
785 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
  • 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
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…

828 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