Discussion:
[Bitpim-devel] Any Windows registry API experts?
Roger Binns
2003-12-16 10:12:25 UTC
Permalink
Are there any Windows registry API experts on this list?

I am having some difficulty with Windows doing something
stupid and I can't figure out why.

RegQueryInfoKey tells me there are 22 children of the key I
am interested in.

Regedit shows 22 children.

RegEnumKey returns strings for the first 18 index values,
and then returns error 234 (More data available) for the
next 4, and then returns 259 (No more data).

Why is more data available returned and how do I actually
get it give me the last 4 children? Nothing I have tried
works. And howcome regedit can show the last 4?

Roger
Jim
2003-12-16 14:23:47 UTC
Permalink
Roger,

Which key? or can you give me the tree (export from regedit) and I'll look
at it. I've done some registry stuff from both C++ and Python. It's a beast
at best.

Jim West
www.jameswest.com

The box said Windows 95 or better, so I installed Linux.


---------- Original Message -----------
From: "Roger Binns" <***@rogerbinns.com>
To: <bitpim-***@lists.sourceforge.net>
Sent: Tue, 16 Dec 2003 02:12:25 -0800
Subject: [Bitpim-devel] Any Windows registry API experts?
Post by Roger Binns
Are there any Windows registry API experts on this list?
I am having some difficulty with Windows doing something
stupid and I can't figure out why.
RegQueryInfoKey tells me there are 22 children of the key I
am interested in.
Regedit shows 22 children.
RegEnumKey returns strings for the first 18 index values,
and then returns error 234 (More data available) for the
next 4, and then returns 259 (No more data).
Why is more data available returned and how do I actually
get it give me the last 4 children? Nothing I have tried
works. And howcome regedit can show the last 4?
Roger
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------- End of Original Message -------
Roger Binns
2003-12-16 18:08:59 UTC
Permalink
Post by Jim
Which key? or can you give me the tree (export from regedit) and I'll look
at it. I've done some registry stuff from both C++ and Python. It's a beast
at best.
I am enumerating the children of HKLM\System\CurrentControlSet\Enum\USB

It returns up to the first Vid_1004&Pid_6000 but nothing
beyond that.

Roger
Jim
2003-12-16 18:41:44 UTC
Permalink
Roger,

Do you need something "generic" or will something specific with regards to
this key tree be acceptable?

Generic being recursive starting from USB key getting/printing everything.

Specific being just the value set from the ID key under each Vendor/Product
key sans ROOT_HUB.

Jim West
www.jameswest.com

The box said Windows 95 or better, so I installed Linux.


---------- Original Message -----------
From: "Roger Binns" <***@rogerbinns.com>
To: <bitpim-***@lists.sourceforge.net>
Sent: Tue, 16 Dec 2003 10:08:59 -0800
Subject: Re: [Bitpim-devel] Any Windows registry API experts?
Post by Roger Binns
Post by Jim
Which key? or can you give me the tree (export from regedit) and I'll look
at it. I've done some registry stuff from both C++ and Python. It's a beast
at best.
I am enumerating the children of HKLM\System\CurrentControlSet\Enum\USB
It returns up to the first Vid_1004&Pid_6000 but nothing
beyond that.
Roger
------- End of Original Message -------
Roger Binns
2003-12-16 21:26:03 UTC
Permalink
Post by Jim
Do you need something "generic" or will something specific with regards to
this key tree be acceptable?
The code already exists. Look for the 'safegetchildren' method in comscan.py.
The problem is that for the last 4 out of 22 child entries of a particular
key on my machine, it returns 234 - More data available.

The current code uses _winreg. I also tried using the win32api from win32all
and got the same result.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumkey.asp

That shows the only way ERROR_MORE_DATA can be returned is if the buffer
supplied is too small. However the keys it is falling over on are
tiny in length so something else is actually happening. It affecting
both win32api and _winreg is wierd.

Roger
Jim
2003-12-16 21:48:33 UTC
Permalink
Ok, will have to look at codebase when I get home.

Just sent you a code example which works here (at work).

If you get a chance, would you send me an export of your USB registry tree for
me to test against?

My lunch break is over now...must get back to "work". :)

Jim West
www.jameswest.com

The box said Windows 95 or better, so I installed Linux.


---------- Original Message -----------
From: "Roger Binns" <***@rogerbinns.com>
To: <bitpim-***@lists.sourceforge.net>
Sent: Tue, 16 Dec 2003 13:26:03 -0800
Subject: Re: [Bitpim-devel] Any Windows registry API experts?
Post by Roger Binns
Post by Jim
Do you need something "generic" or will something specific with regards to
this key tree be acceptable?
The code already exists. Look for the 'safegetchildren' method in comscan.py.
The problem is that for the last 4 out of 22 child entries of a particular
key on my machine, it returns 234 - More data available.
The current code uses _winreg. I also tried using the win32api from
win32all and got the same result.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumkey.asp
Post by Roger Binns
That shows the only way ERROR_MORE_DATA can be returned is if the buffer
supplied is too small. However the keys it is falling over on are
tiny in length so something else is actually happening. It affecting
both win32api and _winreg is wierd.
Roger
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------- End of Original Message -------

Loading...