Some methods not working in ATL based Windows Explorer Preview Handler

217 views Asked by At

I am writing a Windows Explorer Preview Handler in ATL (no MFC). Its works fine except for the following problems which I believe are related to insufficient privileges:

  1. A CDialogImpl based dialog (Resource based) does not show up after a call to DoModal().
  2. ShellExecute(... "http://www.someurl.com) does not open the default browser.
  3. My Logger::Log() method executes but I do not see anything written to log files.

GetLastError() after DoModal() call returns 5 (ACCESS_DENIED) but I am not sure for what. The call to DoModal() is made from a context-menu handler.

ShellExecute when called displays a "Google Chrome is unresponsive, Relaunch Now?" dialog. Clicking YES will close Chrome but will never launch it, clicking NO does nothing. Same for ShellExecuteEx.

ShellExecute(NULL, _T("open"), _T("http://www.google.com"), NULL, NULL, SW_SHOWNORMAL)

It seems that the problem is related to insufficient privileges to preview handler running inside PREVHOST.EXE. File log is written fine in my Thumbnail Handler but not in this Preview Handler. Are there any limitations to what can be done when running under PREVHOST.EXE? Any Ideas?

Thanks in Advance.

1

There are 1 answers

1
Woodman On BEST ANSWER

In case if some-one else trapped on this. By default prevhost.exe is running in Low Integrity mode

Here you can check the list of limitations

In short words you are very limited in places where you can write:

  • registry : write to and create subkeys under HKEY_CURRENT_USER\Software\AppDataLow
  • filesystem : write and create subfolders under %USER PROFILE%\AppData\LocalLow

Also there are limitations on available ways of IPC.