T
2020-01-02 17:30:18 UTC
Hi All,
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw
I am confused as to what lpType is and does.
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw
LSTATUS RegQueryValueExW(
HKEY hKey,
LPCWSTR lpValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData
);
According to the link above:
lpType
A pointer to a variable that receives a code indicating
the type of data stored in the specified value. For a
list of the possible type codes, see Registry Value
Types. The lpType parameter can be NULL if the type
code is not required.
What exactly is lpType?
"Receives"? Them or me?
Is it incoming (I tell it something I want) or outgoing
(its tell me something) or both?
And if it is telling me something, what is it telling me?
Why does it only work if I "give" it a NULL? Give it
anything else and you get back "code 87 Invalid Parameter".
If I read it back after both a REG_SZ and REG_DWORD read,
I get a zero.
It would be nice if I got told what type of data I was reading back.
Your in confusion,
-T
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw
I am confused as to what lpType is and does.
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw
LSTATUS RegQueryValueExW(
HKEY hKey,
LPCWSTR lpValueName,
LPDWORD lpReserved,
LPDWORD lpType,
LPBYTE lpData,
LPDWORD lpcbData
);
According to the link above:
lpType
A pointer to a variable that receives a code indicating
the type of data stored in the specified value. For a
list of the possible type codes, see Registry Value
Types. The lpType parameter can be NULL if the type
code is not required.
What exactly is lpType?
"Receives"? Them or me?
Is it incoming (I tell it something I want) or outgoing
(its tell me something) or both?
And if it is telling me something, what is it telling me?
Why does it only work if I "give" it a NULL? Give it
anything else and you get back "code 87 Invalid Parameter".
If I read it back after both a REG_SZ and REG_DWORD read,
I get a zero.
It would be nice if I got told what type of data I was reading back.
Your in confusion,
-T