Native DLL used by ASP.NET app needs registry access

B

Boris

I created a .NET DLL which calls functions in a native DLL which again
accesses the Windows registry. Everything works fine when the .NET DLL is
used in a stand-alone application. When the .NET DLL is however used in a
ASP.NET application access to the registry doesn't seem to be permitted. The
question is where do I set what security settings? Do I have to look into
IIS, ASP.NET, the .NET framework or the Windows registry?

The .NET DLL is part of a program which was installed under the
administrator account. The native DLL tries to read values from HKCU which
as far as I know can't be read by ASP.NET applications which run under the
ASPNET account. For now I would be happy if the ASP.NET application would
then run under the administrator account at all. When I understand how this
is done I have at least a clue where to look for the security settings.

Thanks in advance,
Boris
 
D

David Wang [Msft]

The native DLL must be run on a thread whose user token is granted Read
permissions on the Registry node.

They are not matching right now so it fails by-design. Synchronize them in a
way that matches your security requirements. You have to decide this.

When stand-alone it is that user's token, so that user obviously had Read
permissions to the Registry node. When run via ASP.Net on IIS, the user
token depends on:
1. Authentication protocol actually negotiated between client and server
(depends on server and client settings)
2. ASP.Net's <identity> settings

On IIS6, ASP.Net code does not run using the ASPNET user unless in IIS5
Compatibility Mode (which is how ASP.Net works on IIS5).

http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS_User_Identity_to_Run_Code_Part_2.aspx

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
I created a .NET DLL which calls functions in a native DLL which again
accesses the Windows registry. Everything works fine when the .NET DLL is
used in a stand-alone application. When the .NET DLL is however used in a
ASP.NET application access to the registry doesn't seem to be permitted. The
question is where do I set what security settings? Do I have to look into
IIS, ASP.NET, the .NET framework or the Windows registry?

The .NET DLL is part of a program which was installed under the
administrator account. The native DLL tries to read values from HKCU which
as far as I know can't be read by ASP.NET applications which run under the
ASPNET account. For now I would be happy if the ASP.NET application would
then run under the administrator account at all. When I understand how this
is done I have at least a clue where to look for the security settings.

Thanks in advance,
Boris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top