Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote an ISAPI Extension for IIS in standard C. I would like to be able to record error messages to the system event log but when I call RegisterEventSource, it returns 5 - Access Denied.

What I have tried:

The value passed to RegisterEventSource for sourcename is valid. I have another program which is a Windows Service that is registered with EventLog and works great. I am passing the name it uses and I am trying to use one of it's messages. If I can get it to work from the ISAPI Extension, I can add the messages to it.
Posted
Updated 5-Dec-19 9:01am
v2

1 solution

Event sources can only be registered from an elevated application. ISAPI extensions don't - and shouldn't - run elevated.

You'll need to create the source as part of the installation.
 
Share this answer
 
Comments
Roland M Smith 5-Dec-19 19:48pm    
I said right in the 'What I have tried' that I already created the source.
Richard Deeming 6-Dec-19 6:39am    
Either the user your ISAPI extension is running as doesn't have read permissions to one of the keys in the HKLM\SYSTEM\CCS\Services\EventLog tree, or the source you're trying to register doesn't match the source you've already registered.
Roland M Smith 7-Dec-19 20:48pm    
I'll try giving IUSR read permissions to the registry key. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900