Solved

Implement IInternetSecurityManager with IWebbrowser2

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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 and use conditional statements in the C programming language.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now