<div class="gmail_quote">On Tue, Nov 17, 2009 at 19:59, Mark Hammond <span dir="ltr"><<a href="mailto:skippy.hammond@gmail.com">skippy.hammond@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On 18/11/2009 6:29 AM, Randall Walls wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I don't believe so, but it seems like I'm in a catch 22, where I need to<br>
_winreg.OpenKey the key first before I can pass it to<br>
_winreg.DisableReflectionKey, but it doesn't exist, so I can't open it.<br>
<br>
I did find out that I can open the key using:<br>
hKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\ODBC\ODBC.INI\<br>
DRSQL2000_mu0100\\", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)<br>
<br>
The 'trick' was adding _winreg.KEY_WOW64_64KEY, which apparently tells<br>
the system to look in the 64bit key area, and not under the Wow6432Node.<br>
That brings up problem #2, though... I can't seem to CREATE a key in the<br>
above path, and _winreg.CreateKey doesn't accept _winreg.KEY_WOW64_64KEY<br>
(in fact it doesn't accept any options other than key, sub_key).<br>
_winreg.CreateKey does work, it just puts the key in<br>
SOFTWARE\Wow6432Node\ODBC\ODBC.INI. So I'm in a quandry... I'd like to<br>
use one or the other, and not have to account for both.<br>
</blockquote>
<br></div>
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.<br>
<br>
HTH,<br>
<br>
Mark<font color="#888888"></font><br></blockquote></div><br>Created <a href="http://bugs.python.org/issue7347">http://bugs.python.org/issue7347</a> and added a patch which I think will solve the problem moving forward.<br>