Ben wrote:
>> I have generally been getting better results using winreg than using WMI,
>> but even Winreg (or config problems on our server) are causing me
>> problems.  For example I'd use this code to find out if a certain
>>
>>     
>
> I'm beginning to think this is because of 32 vs 64 bit, because the server 
> running the
> script is 32-bit, and (I haven't checked all), but it seems that it works on 
> 32 bit
> servers but not 64-bit ones.  Is this possible, and if so, is there any way 
> around the
> problem? 
>   

Absolutely.  In one of the stupidest moves Microsoft has made in the
last decade, they implemented an incredibly bizarre scheme called
"registry redirection" and "file system redirection" which redirects
registry and file system requests for a 32-bit process running on
Win64.  For example, if a 32-bit process tries to open
\Windows\System32\xxx.xxx, it will instead open
\Windows\SysWow64\xxx.xxx.  The same thing happens to many keys within
HKEY_LOCAL_MACHINE.  They apparently felt we were all too STUPID to
correctly handle the 32-to-64 transition, even though we all managed to
handle the exact same issues during the 16-to-32 transition 15 years ago.

You can suppress this redirection by calling RegDisableReflectionKey for
the key you want to talk to.  I do not know if this is exposed in _winreg.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to