I’m totally confused by the function RegQueryInfoKey now. can anyone give me a hand?
In this function, there is a parameter named “lpClass”, in MSDN, it is declared to be “A pointer to a buffer that receives the user-defined class of the key.” Also it can be null, but I really want to know the usage of this parameter.
1.How can I define a “user-defined class” for this function and when should I do it?
2.How can I get the values of the these parameters – “lpcMaxSubKeyLen”, “lpcMaxValueNameLen” and “lpcMaxValueLen” by simply looking at the specified key using the regedit.exe instead of calling the function?
Any answers from you will be appreciated. thanks
The class is a string with no real meaning and setting it is pointless (It is not used by any other API). Less than 1% of keys have it set and when it is set it is usually just a string like “Shell” or “Setup” or even the string “class”.
The information is not really useful in regedit, it is used by applications if they want to allocate memory before enumerating the child entries (But there is a threading issue here so you should always be prepared to allocate a bigger buffer if required)