Re:Microsoft_craziness.h (2018)
by malft on Wednesday November 24, 2021 @12:32PM
(#29332597)
Pray tell, what is the size of a wchar_t on your system?
[ Parent
| on HN ]
hah, more than 1 byte for sure, I missed that detail ...
EDIT: I develop on unix systems, not windows, so I'm rusty here ... looking up RegQueryValueExW() the `length` ("lpcbData") is in bytes so everything goes fine until `value[length]` which is indexing by wchar_t (16-bit on windows I guess, 32-bit on linux systems) so it's double the byte offset intended, that's way out.