vb .net, registry, HKLM\System\CurrentControlSet, Security

  • Thread starter Thread starter DuboisP
  • Start date Start date
D

DuboisP

Hello

I'm writing a small program un vb.net 2005, and i need a read access to
the keys of HKLM\System\ControlSet\Enum.
It's working under Windows2000 and probably XP, but not with Vista and
Seven, where the securities are stronger.
It must work for regular users

Here the piece of code, and i have a security violation

Dim regPermission As RegistryPermission
regPermission = New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")
regPermission.SetPathList(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")

oCurrentKey = Registry.LocalMachine
oCurrentKey = oCurrentKey.OpenSubKey("SYSTEM\CurrentControlSet\Enum")
oSubKeyNames = oCurrentKey.GetSubKeyNames()

What's wrong ?
Is it possible ?

Thanks

Patrick
 
Le Fri, 02 Jul 2010 19:37:46 +0200, DuboisP
Hello

I'm writing a small program un vb.net 2005, and i need a read access to
the keys of HKLM\System\ControlSet\Enum.
It's working under Windows2000 and probably XP, but not with Vista and
Seven, where the securities are stronger.
It must work for regular users

Here the piece of code, and i have a security violation

Dim regPermission As RegistryPermission
regPermission = New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")
regPermission.SetPathList(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")

oCurrentKey = Registry.LocalMachine
oCurrentKey = oCurrentKey.OpenSubKey("SYSTEM\CurrentControlSet\Enum")
oSubKeyNames = oCurrentKey.GetSubKeyNames()

What's wrong ?
Is it possible ?

Thanks

Patrick

no answer ?
 
Back
Top