Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#58 problem win32api when consulting the registry Reg_MULTI_SZ

closed-wont-fix
nobody
None
5
2007-07-22
2007-03-03
wowberk
No

hello,
First, I hope that they pardon the English to me, since I am Spanish and am using the tool of google. The problem takes place when consulting registry keys type reg_MULTI_SZ with several values, the turn out to give several values and single it shows one. Example:
[pendientes.reg]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]
"PendingFileRenameOperations"=hex(7):5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,\ 41,00,72,00,63,00,68,00,69,00,76,00,6f,00,73,00,20,00,64,00,65,00,20,00,70,\ 00,72,00,6f,00,67,00,72,00,61,00,6d,00,61,00,5c,00,47,00,6f,00,6f,00,67,00,\ 6c,00,65,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,54,00,6f,00,6f,00,6c,\ 00,62,00,61,00,72,00,4e,00,6f,00,74,00,69,00,66,00,69,00,65,00,72,00,5c,00,\ 31,00,2e,00,32,00,2e,00,39,00,30,00,38,00,2e,00,35,00,30,00,30,00,38,00,5c,\ 00,73,00,77,00,67,00,33,00,2e,00,74,00,6d,00,70,00,00,00,00,00,5c,00,3f,00,\ 3f,00,5c,00,43,00,3a,00,5c,00,41,00,72,00,63,00,68,00,69,00,76,00,6f,00,73,\ 00,20,00,64,00,65,00,20,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,61,00,\ 5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,5c,00,47,00,6f,00,6f,00,67,00,6c,\ 00,65,00,54,00,6f,00,6f,00,6c,00,62,00,61,00,72,00,4e,00,6f,00,74,00,69,00,\ 66,00,69,00,65,00,72,00,5c,00,31,00,2e,00,32,00,2e,00,39,00,30,00,38,00,2e,\ 00,35,00,30,00,30,00,38,00,5c,00,47,00,6f,00,6f,00,34,00,2e,00,74,00,6d,00,\ 70,00,00,00,00,00,5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,41,00,72,00,63,\ 00,68,00,69,00,76,00,6f,00,73,00,20,00,64,00,65,00,20,00,70,00,72,00,6f,00,\ 67,00,72,00,61,00,6d,00,61,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,5c,\ 00,47,00,6f,00,6f,00,67,00,6c,00,65,00,54,00,6f,00,6f,00,6c,00,62,00,61,00,\ 72,00,4e,00,6f,00,74,00,69,00,66,00,69,00,65,00,72,00,5c,00,31,00,2e,00,32,\ 00,2e,00,39,00,30,00,38,00,2e,00,35,00,30,00,30,00,38,00,5c,00,72,00,65,00,\ 73,00,35,00,2e,00,74,00,6d,00,70,00,00,00,00,00,5c,00,3f,00,3f,00,5c,00,43,\ 00,3a,00,5c,00,41,00,72,00,63,00,68,00,69,00,76,00,6f,00,73,00,20,00,64,00,\ 65,00,20,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,61,00,5c,00,47,00,6f,\ 00,6f,00,67,00,6c,00,65,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,54,00,\ 6f,00,6f,00,6c,00,62,00,61,00,72,00,4e,00,6f,00,74,00,69,00,66,00,69,00,65,\ 00,72,00,5c,00,31,00,2e,00,32,00,2e,00,39,00,30,00,38,00,2e,00,35,00,30,00,\ 30,00,38,00,00,00,00,00,5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,41,00,72,\ 00,63,00,68,00,69,00,76,00,6f,00,73,00,20,00,64,00,65,00,20,00,70,00,72,00,\ 6f,00,67,00,72,00,61,00,6d,00,61,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,\ 00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,54,00,6f,00,6f,00,6c,00,62,00,\ 61,00,72,00,4e,00,6f,00,74,00,69,00,66,00,69,00,65,00,72,00,00,00,00,00,5c,\ 00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,41,00,72,00,63,00,68,00,69,00,76,00,\ 6f,00,73,00,20,00,64,00,65,00,20,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,\ 00,61,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,5c,00,47,00,6f,00,6f,00,\ 67,00,6c,00,65,00,54,00,6f,00,6f,00,6c,00,62,00,61,00,72,00,32,00,2e,00,64,\ 00,6c,00,6c,00,00,00,00,00,5c,00,3f,00,3f,00,5c,00,43,00,3a,00,5c,00,41,00,\ 72,00,63,00,68,00,69,00,76,00,6f,00,73,00,20,00,64,00,65,00,20,00,70,00,72,\ 00,6f,00,67,00,72,00,61,00,6d,00,61,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,\ 65,00,5c,00,47,00,6f,00,6f,00,67,00,6c,00,65,00,54,00,6f,00,6f,00,6c,00,62,\ 00,61,00,72,00,4e,00,6f,00,74,00,69,00,66,00,69,00,65,00,72,00,5c,00,31,00,\ 2e,00,32,00,2e,00,39,00,30,00,38,00,2e,00,35,00,30,00,30,00,38,00,00,00,00,\ 00,5c,00,3f,00,3f,00,5c,00,63,00,3a,00,5c,00,61,00,72,00,63,00,68,00,69,00,\ 76,00,6f,00,73,00,20,00,64,00,65,00,20,00,70,00,72,00,6f,00,67,00,72,00,61,\ 00,6d,00,61,00,5c,00,67,00,6f,00,6f,00,67,00,6c,00,65,00,5c,00,67,00,6f,00,\ 6f,00,67,00,6c,00,65,00,74,00,6f,00,6f,00,6c,00,62,00,61,00,72,00,32,00,2e,\ 00,64,00,6c,00,6c,00,00,00,00,00,00,00

[/prendientes.reg]

[CODE]

pendingFileRename=time.strftime("%A %d-%m-%Y %H:%M", time.localtime())
def getPendingFileRenameOperations():

aKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,r"SYSTEM\CurrentControlSet\Control\Session Manager")
try:
try: values = _winreg.QueryValueEx(aKey, "PendingFileRenameOperations")[0]
except WindowsError: values = ("No Existen Datos")
finally:
_winreg.CloseKey(aKey)

return values

pendingFileRename=pendingFileRename+"\n\n"+str(getPendingFileRenameOperations())

pendingFileRename=pendingFileRename+"\n\n--------------------"
pendingFileRename=pendingFileRename+"\nRecuerda que aun es una versión DEMO.\nDebes de usar programas testeados como puede ser:\npendmoves.exe de sysinternals."
self.txm373c.SetValue(pendingFileRename)

RESULTADO WIN32API=
[u'\\??\\C:\\Archivos de programa\\Google\\GoogleToolbarNotifier\\1.2.908.5008\\swg3.tmp']

RESULTADO OK=
[u'\\??\\C:\\Archivos de programa\\Google\\GoogleToolbarNotifier\\1.2.908.5008\\swg3.tmp',u'\\??\\C:\\Archivos de programa\\Google\\GoogleToolbarNotifier\\1.2.908.5008\\res5.tmp',u'\\??\\C:\\Archivos de programa\\Google\\GoogleToolbarNotifier\\1.2.908.5008\\goo4.tmp',u'\\??\\C:\\Archivos de programa\\Google\\GoogleToolbarNotifier\\1.2.908.5008',etc]

Discussion

  • wowberk
    wowberk
    2007-03-03

    registry keys type reg_MULTI_SZ

     
    Attachments
  • Roger Upole
    Roger Upole
    2007-03-03

    Logged In: YES
    user_id=771074
    Originator: NO

    It appears the paths in the data are separated by double NULLs, which are used as a terminator
    for REG_MULTI_SZ values. According to the docs here:
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/58499.mspx?mfr=true
    this key shouldn't be manipulated directly (probably for this very same reason).
    You should be able to use win32file.MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT instead.

    Roger

     
  • Roger Upole
    Roger Upole
    2007-07-22

    • status: open --> closed-wont-fix
     
  • Roger Upole
    Roger Upole
    2007-07-22

    Logged In: YES
    user_id=771074
    Originator: NO

    Since there is an api specifically for this, closing as 'won't fix'