Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4624390
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:07:22+00:00 2026-05-22T03:07:22+00:00

In a BHO running within Internet Explorer on Windows 7 with Protected Mode On,

  • 0

In a BHO running within Internet Explorer on Windows 7 with Protected Mode On, I’m trying to write to the windows event log. I’m writing to a source that already exists, and it’s in the Application Log so I don’t see why this would be blocked. However, my call to System.Diagnostics.EventLog.WriteEntry("MySource", "Some message") fails with an InvalidOperationException, with message “Cannot open log for source ‘XXX’. You may not have write access.”. The stack trace indicates it’s at EventLog.OpenForWrite(String currentMachineName).

Turning Protected Mode Off makes it work fine.

Any reason this would not be allowed within Protected Mode, and any way I can register my BHO as being allowed to write to the event log, or otherwise make it work?

According to this post the call to OpenForWrite() results in a call to UnsafeNativeMethods.RegisterEventSource(this.machineName, this.sourceName);, but the docs for that didn’t get me any further.

I’m using .net 2.0

thanks.

Cross-posted here: msdn_microsoft_ieextensiondevelopment

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:07:23+00:00Added an answer on May 22, 2026 at 3:07 am

    If you really need to write to the system log I would either:

    • Create a service and send messages to it – if you will be logging something with any regularity I would do this. But who writes a bunch of messages to the system log?
    • Launch a tiny application silently that is elevated to medium trust as a broker process

    Let’s go with option two. A few ways to do this but I will give you one idea. Write the data to be logged to a file or the registry in a low integrity location. Then launch a little application elevated to medium trust that picks up the data and writes it. Is this efficient? No. But if writing to the system log is a very rare event then this will yield the least overhead over time.

    The service approach will be less obvious to the user but will take a little sliver of pie away from the computer’s resources.

    See Starting Processes from Protected Mode in Understanding and Working in Protected Mode Internet Explorer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a [ComRegisterFunction] that I am using to register a BHO Internet explorer
I am trying to write a Browser Helper Object (BHO) in C# that manipulates
I am developing a Browser Helper Object running inside Internet Explorer. I am writing
I'm trying to develop an Internet Explorer 7 addon using Browser Helper Objects (BHO).
I have an Internet Explorer BHO that can execute a script on the current
i have developed an internet explorer toolbar or BHO that i would like to
I'm writing a Browser Helper Object (BHO) for Internet Explorer in C#! I want
I have written a BHO and a toolbar for Internet Explorer in C#. They
I am registering my BHO this way: public static string RegistryKeyLocation = Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper
I'm writing a BHO add-on for Internet Explore (8 and 9). And I followed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.