Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect IE Protected Mode using c#

I am building an IE Extension, and I need to keep my Access Database file in the Appdata folder. It's working fine. But in many systems where IE IE Protected Mode is ON, it crashes, I guess this is because IE Protected Mode doesn't allow Extensions to access Appdata. I was trying to find a way out so that I can detect if IE is in Protected Mode through my extension. Please give some code snippets and some links to get me out of this issue.

Regards

I am attaching a screenshot of error as well. alt text

like image 875
sumit_programmer Avatar asked Jan 03 '11 06:01

sumit_programmer


2 Answers

I would use IEIsProtectedModeProcess(), but you're on your own for interop.

like image 193
i_am_jorf Avatar answered Oct 09 '22 14:10

i_am_jorf


You're looking for the IE process "Integrity Level". See the official doc here: Determining Process Integrity Levels with a sample in C++, and you will find a sample written in C# here: Getting Process Integrity Level in Vista using Pinvoke

like image 44
Simon Mourier Avatar answered Oct 09 '22 14:10

Simon Mourier