i trie don 50 thousand keys and it doesnt return data in the buffer
heres my code. i dont know whats wrong!!!, nothing but 0's in the buffer!!!
long Equ <:DWORD>
GetSettingString Proc, phKey :DWORD, pstrPathSTRPTR :DWORD,pstrValueSTRPTR :DWORD,lpBuffer long
Local lValueType :DWORD
Local lBuffer :DWORD
.data
hcurkey1 dd 0
lDataBufferSize1 dd 0
.code
pushad;sav regs
Invoke RegOpenKey,phKey, pstrPathSTRPTR,Addr hcurkey1
Invoke RegQueryValueEx,hcurkey1,pstrValueSTRPTR ,0,0, lpBuffer,Addr lDataBufferSize1
Invoke GetLastError
int 3
Invoke RegCloseKey,hcurkey1
mov ebx,lpBuffer
;int 3
popad
ret
GetSettingString EndP
returns 126 The specified module could not be found. ERROR_MOD_NOT_FOUND
heres my code. i dont know whats wrong!!!, nothing but 0's in the buffer!!!
long Equ <:DWORD>
GetSettingString Proc, phKey :DWORD, pstrPathSTRPTR :DWORD,pstrValueSTRPTR :DWORD,lpBuffer long
Local lValueType :DWORD
Local lBuffer :DWORD
.data
hcurkey1 dd 0
lDataBufferSize1 dd 0
.code
pushad;sav regs
Invoke RegOpenKey,phKey, pstrPathSTRPTR,Addr hcurkey1
Invoke RegQueryValueEx,hcurkey1,pstrValueSTRPTR ,0,0, lpBuffer,Addr lDataBufferSize1
Invoke GetLastError
int 3
Invoke RegCloseKey,hcurkey1
mov ebx,lpBuffer
;int 3
popad
ret
GetSettingString EndP
returns 126 The specified module could not be found. ERROR_MOD_NOT_FOUND
You must initialize lDataBufferSize1 with the size of buffer pointed to by lpBuffer BEFORE calling RegQueryValueEx. In your code, you initialized IDataBufferSize1 to 0 which told Windows that your buffer is 0 byte in size.
Have a look at my platsdk addin for RadASM(the updated version). I use the registry to retrieve the path to the Platform SDK base directory.
The SDK recomends the use of RegOpenKeyEx over RegOpenKey
The SDK recomends the use of RegOpenKeyEx over RegOpenKey