[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2016-06-01 Thread Tony Grue

Tony Grue added the comment:

I see this was closed,though it sounds like it's because a work around is 
found, not because the code now handles multiple null values in a row.

Looking at code from the github mirror (pasted below); it looks like the issue 
is that the countStrings function breaks out of iterating in the for loop, even 
if it hasn't reached the end of the buffer.

File PC/winreg.c:

static int
countStrings(wchar_t *data, int len)
{
int strings;
wchar_t *P;
wchar_t *Q = data + len;

for (P = data, strings = 0; P < Q && *P != '\0'; P++, strings++)
for (; P < Q && *P != '\0'; P++)
;
return strings;
}

--
nosy: +Tony Grue
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2010-08-03 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
resolution:  - wont fix
status: open - closed
type: behavior - feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

The double null is supposed to mark the end of the whole sequence; the
content you show under PendingFileRenameOperations is a invalid
REG_MULTI_SZ value to me.
How does regedit display it?

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

It seems that regedit itself cannot handle these values, see how users
have to edit data in binary mode to enter empty strings:
http://www.pcreview.co.uk/forums/thread-1715654.php

Here is a script that shows the problem: the value is returned truncated
before the empty string.

from _winreg import *
test_key_name = SOFTWARE\\Python Registry Test Key - Delete Me
hkey = CreateKey(HKEY_CURRENT_USER, test_key_name)
SetValueEx(hkey, Multi, 0, REG_MULTI_SZ,
   ['test', 'with', '', 'an', 'empty', 'line'])
print QueryValueEx(hkey, Multi)

--
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Andrew Ziem

Andrew Ziem ahz...@gmail.com added the comment:

Attached screenshot shows regedit handles \x00\x00 by showing all the
invalid values (each \x00 becomes a line break).  More importantly,
Windows apparently reads all the invalid value when processing
FileRenameOperations, so my Python program must be able to read invalid
value to append new instructions.

--
Added file: http://bugs.python.org/file14478/regedit_screenshot.PNG

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Yes, but did you try to press OK? Regedit displays a warning that empty 
lines are not allowed, and *removes* them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Andrew Ziem

Andrew Ziem ahz...@gmail.com added the comment:

Yes, regedit does remove the blanks, but this bug report is about
QueryValueEx---not about SetValueEx :).  There must be a way to read all
the values compatible with Windows

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-09 Thread Andrew Ziem

Andrew Ziem ahz...@gmail.com added the comment:

Well, I no longer need QueryValueEx because I found out
win32file.MoveFileEx() does more easily what I need, but MoveFileEx (see
attachment for working example) shows that the Microsoft Window API
itself creates these invalid values

--
Added file: http://bugs.python.org/file14480/delete_locked_file.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-08 Thread Andrew Ziem

New submission from Andrew Ziem ahz...@gmail.com:

QueryValueEx only returns one string when the contents are double null
terminated, yet QueryValueEx works when the string is singly null
terminated.

In Python 2.5.4 on Windows XP Sp3, the first key-value only returns the
first part up to \0\0.
---
C:\reg query HKLM\SYSTEM\CurrentControlSet\Control\Session Manager /v
Pending
FileRenameOperations

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
PendingFileRenameOperations REG_MULTI_SZ\??\C:\Documents and
Settings\All Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Program
Files\Google\GoogleToolbarNotifier\5.2.4204.1700\0\0\??\C:\Documents and
Settings\All Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Documents and Settings\All
Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Documents and Settings\All
Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Documents and Settings\All
Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Documents and Settings\All
Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\??\C:\Documents and Settings\All Users\A
pplication Data\McAfee\Common Framework\UpdateDir\0\0\??\C:\Documents
and Settings\All Users\Application Data\McAfee\Common
Framework\UpdateDir\0\0\0

C:\reg query HKLM\SYSTEM\CurrentControlSet\Services\Browser /v 
DependOnService

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser
DependOnService REG_MULTI_SZLanmanWorkstation\0LanmanServer\0\0

--
components: Windows
messages: 90300
nosy: AndrewZiem
severity: normal
status: open
title: _winreg.QueryValueEx confused on double null terminated strings
type: behavior
versions: Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6443] _winreg.QueryValueEx confused on double null terminated strings

2009-07-08 Thread Andrew Ziem

Andrew Ziem ahz...@gmail.com added the comment:

The bug is noted in the Python source code in file PC/_winreg.c in in
function fixupMultiSZ() where it admits Python does not mimic Microsoft
regedit.exe

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6443
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com