Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: _winreg error on open key (64bit) - proper usage of_winreg.DisableReflectionKey

Reply
Thread Tools

Re: _winreg error on open key (64bit) - proper usage of_winreg.DisableReflectionKey

 
 
Mark Hammond
Guest
Posts: n/a
 
      11-18-2009
On 18/11/2009 6:29 AM, Randall Walls wrote:
> I don't believe so, but it seems like I'm in a catch 22, where I need to
> _winreg.OpenKey the key first before I can pass it to
> _winreg.DisableReflectionKey, but it doesn't exist, so I can't open it.
>
> I did find out that I can open the key using:
> hKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\ODBC\ODBC.INI\
> DRSQL2000_mu0100\\", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)
>
> The 'trick' was adding _winreg.KEY_WOW64_64KEY, which apparently tells
> the system to look in the 64bit key area, and not under the Wow6432Node.
> That brings up problem #2, though... I can't seem to CREATE a key in the
> above path, and _winreg.CreateKey doesn't accept _winreg.KEY_WOW64_64KEY
> (in fact it doesn't accept any options other than key, sub_key).
> _winreg.CreateKey does work, it just puts the key in
> SOFTWARE\Wow6432Node\ODBC\ODBC.INI. So I'm in a quandry... I'd like to
> use one or the other, and not have to account for both.


It looks like _winreg needs to be enhanced to make the RegCreateKeyEx
API function available. It can be called via the win32api module of
pywin32, or could also be called via ctypes.

HTH,

Mark
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: _winreg error on open key (64bit) - proper usage of_winreg.DisableReflectionKey Nick Stinemates Python 0 11-17-2009 07:18 PM
WindowsError: [Error 5] Access is denied With _winreg.enum black_13 Python 2 11-28-2007 04:30 PM
env variable set using _winreg.SetValueEx() doesn't show w/ os.environ Erick Bodine Python 1 12-16-2003 09:16 PM
import _winreg does not work. How do I fix? John Sellers Python 3 11-26-2003 07:28 AM
RE: import _winreg does not work. How do I fix? Jimmy Retzlaff Python 0 11-25-2003 12:18 PM



Advertisments