Solved

Implement IInternetSecurityManager with IWebbrowser2

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.

930 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

10 Experts available now in Live!

Get 1:1 Help Now