"More data is available" Error With _winreg Module

John Abel johnfabel at btinternet.com
Sun Feb 9 15:14:37 CET 2003


Hi,

I've had a little more time to look at this.  As documentation is a 
little scarce for _winreg, I downloaded the Python source from CVS, to 
have a look at _winreg.c.  From what I can tell, PyQueryValueEx, and 
PyEnumValue don't seem to allow for extending the buffer passed to 
RegQueryValueEx.  When RegQueryValueEx is called on 
HKEY_PERFORMANCE_DATA, it can/will return ERROR_MORE_DATA if the buffer 
is too small, as would seem to be the case with my error message.

Just as an aside, I've been playing with modifying _winreg.c, but for 
some reason I can't compile it.  When I build the pythoncore, the linker 
fails with "unresolved external symbol _inititertools".  Anyone seen 
that, or is it something I'm doing?  I'm using VisualStudio6.

Thanks

John

John Abel wrote:

> Hi,
>
> I'm trying to query the registry (HKEY_PERFORMANCE_DATA) with the 
> following code:
>
> regHandle = _winreg.ConnectRegistry( None,
>                     _winreg.HKEY_PERFORMANCE_DATA )
> for valInd in range( _winreg.QueryInfoKey( regHandle )[1] ):
>     (valOne, valTwo, valThree) =  _winreg.EnumValue( regHandle, valInd )
>
> However, I keep getting :
>
> WindowsError: [Errno 234] More data is available
>
> Has anyone come across this before?  I've an idea, that the return 
> data is bigger than expected, something not unusual with 
> HKEY_PERFORMANCE_DATA.  With _winreg being a library, it's a bit hard 
> to see what it's expecting.
>
> Thanks.
>
> John
>
>






More information about the Python-list mailing list