And if so, why some Win32 headers use it?
For instance:
BOOL APIENTRY VerQueryValueA( const LPVOID pBlock,
LPSTR lpSubBlock,
LPVOID * lplpBuffer,
PUINT puLen
);
A bit more elaboration: If the API never uses references (or any other C++-only constructs) but only pointers and values, what is the point of having const LPVOID
vs. LPCVOID
.
Should I treat every place I see const LPVOID
as some place where the real meaning is LPCVOID
? (and thus it is safe to add a cast)
Further clarification: It appears that const LPVOID pBlock
was indeed a mistake in this case. Windows 2008 SDK replaces it to LPCVOID
in VerQueryValue
signature. Wine did so quite some time ago.