News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

reset a buffer

Started by 5k3l3t0r, July 30, 2007, 09:39:33 AM

Previous topic - Next topic

5k3l3t0r

they are all----REG_MULTI_SZ... what i have to modifi?

ramguru

This will take a while ... apparently you have to change REG_DWORD to REG_MULTI_SZ and no need for dwtoa...

ramguru

OK I have some code now:

      .elseif eax==1005   
invoke GetRegKeysz , addr szBigBuffer, addr key, addr subkey2, addr dwBBufLength
mov    esi, OFFSET szBigBuffer
invoke SetDlgItemText,hWnd,1007,addr szBigBuffer
@@:
inc    esi
cmp    BYTE PTR [esi],0
jnz    @B
inc    esi
invoke SetDlgItemText,hWnd,1008,esi
@@:
inc    esi
cmp    BYTE PTR [esi],0
jnz    @B
inc    esi
invoke SetDlgItemText,hWnd,1009,esi
      .endif
   .elseif   uMsg==WM_CLOSE
      invoke   EndDialog,hWnd,0     
   .endif
   xor   eax,eax
   ret
DlgProc endp

GetRegKeysz PROC lpszBuffer:DWORD, lpszKeyName:DWORD, lpszValueName:DWORD, dwStringLength:DWORD
    LOCAL TType  :DWORD
    LOCAL pKey  :DWORD
    mov TType, REG_SZ
   
invoke RegCreateKeyEx, HKEY_CURRENT_USER, lpszKeyName, NULL, NULL, REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS, NULL,addr pKey, addr TType
.if eax == ERROR_SUCCESS
mov eax, REG_MULTI_SZ
mov TType, eax
invoke RegQueryValueEx, pKey, lpszValueName,NULL, ADDR TType, lpszBuffer, dwStringLength
invoke RegCloseKey, pKey
    .endif
    ret
GetRegKeysz ENDP



Now it's obvious that you need only one call to get all values (if these are in one multi_string)