Solved

Implement IInternetSecurityManager with IWebbrowser2

Posted on 2014-01-27
5
765 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

810 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