[pywin32-checkins] /hgroot/pywin32/pywin32: Bug #3531456 - RegQueryValueEx should r...
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <pyw...@li...> - 2012-06-04 22:48:39
|
changeset 58aabb12a580 in /hgroot/pywin32/pywin32 details: http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/hgroot/pywin32/pywin32?cmd=changeset;node=58aabb12a580 summary: Bug #3531456 - RegQueryValueEx should return an empty list for blank REG_MULTI_SZ diffstat: win32/src/win32apimodule.cpp | 3 ++- win32/test/test_win32api.py | 1 + 2 files changed, 3 insertions(+), 1 deletions(-) diffs (24 lines): diff -r b8c62cf04c5a -r 58aabb12a580 win32/src/win32apimodule.cpp --- a/win32/src/win32apimodule.cpp Sun May 13 17:42:31 2012 -0400 +++ b/win32/src/win32apimodule.cpp Mon Jun 04 18:43:08 2012 -0400 @@ -3613,7 +3613,8 @@ } case REG_MULTI_SZ:{ obData = PyList_New(0); - if ((obData==NULL) || (retDataSize==0)) + if ((obData==NULL) || (retDataSize==0) || + (retDataSize == sizeof(TCHAR) && *(TCHAR *)retDataBuf == 0)) break; TCHAR *curr_str, *curr_char, *end_char; curr_str=(TCHAR *)retDataBuf; diff -r b8c62cf04c5a -r 58aabb12a580 win32/test/test_win32api.py --- a/win32/test/test_win32api.py Sun May 13 17:42:31 2012 -0400 +++ b/win32/test/test_win32api.py Mon Jun 04 18:43:08 2012 -0400 @@ -69,6 +69,7 @@ ('REG_EXPAND_SZ', win32con.REG_EXPAND_SZ, '%systemdir%'), ## REG_MULTI_SZ value needs to be a list since strings are returned as a list ('REG_MULTI_SZ', win32con.REG_MULTI_SZ, ['string 1','string 2','string 3','string 4']), + ('REG_MULTI_SZ_empty', win32con.REG_MULTI_SZ, []), ('REG_DWORD', win32con.REG_DWORD, 666), ('REG_BINARY', win32con.REG_BINARY, str2bytes('\x00\x01\x02\x03\x04\x05\x06\x07\x08\x01\x00')), ) |