windows - RtlQueryRegistryValues read REG_DWORD -
i'm writing uart16550 driver, , 1 of things have read registry initialization parameters using rtlqueryregistryvalues.
(a lot of code skipped...)
rtl_query_registry_table table[2];
and
table[1].queryroutine = null; table[1].name = null;
the parameter stored in registry reg_dword , i'm trying set table with:
unsigned long buffer;
(because dword not defined in ntddk.h , i'm not sure if break including windef.h) and
table[0].entrycontext = &buffer;
the status of call rtlqueryregistryvalues status_success
status = rtlqueryregistryvalues( rtl_registry_absolute, path, table, null, null);
but when try to
dbgprint("registry: %lu", buffer)
i way big numbers (i expected result 1 or 2).
am doing wrong dbgprint, or parameters aren't set correctly query table?
and red_dword data type defined?
edit:
wchar keyname[20] = "parameter"; char def[20] = "parameter"; wchar path[100] = l"\\registry\\machine\\system\\currentcontrolset\\services\\hello\\parameters"; unsigned long buffer; table[0].queryroutine = null; table[0].name = keyname; table[0].flags = rtl_query_registry_direct; table[0].entrycontext = &buffer; table[0].defaulttype = reg_dword; table[0].defaultdata = def; table[0].defaultlength = strlen(def) + 1;
table[0].defaultdata
should pointer unsigned long.
table[0].defaultlength
should sizeof(unsigned long).
otherwise may 1634886000 default value converted long ('para'). else looks should work (assuming key , value exists).
reg_dword defined in winnt.h
#define reg_dword ( 4 ) // 32-bit number #define reg_dword_little_endian ( 4 ) // 32-bit number (same reg_dword) #define reg_dword_big_endian ( 5 ) // 32-bit number