Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key export: bad result on REG_SZ values #75

Open
salsifis opened this issue Apr 12, 2024 · 3 comments
Open

Key export: bad result on REG_SZ values #75

salsifis opened this issue Apr 12, 2024 · 3 comments

Comments

@salsifis
Copy link

Hello

In this code:

https://github.com/zodiacon/TotalRegistry/blob/55d76921a44962a8c21e0f57ee555213841510f4/RegExp/RegExportImport.cpp#L55C5-L55C30

data is a BYTE string. I am under the impression that data() is interpreted as a sequence of char and is converted into wchar_t under the hood.

The consequence is that with a registry value consisting of ASCII text such as Foo, stored in UTF-16le as 0x46, 00, 6F, 00, 6f, 00, the constructor of CString will stop at the first null byte and only export the string F.

@zodiacon
Copy link
Owner

You're right - it's a bug - it should be cast to PCWSTR.
That's because CString has a ctor that works with ASCII
Will fix

@jonathonmckay
Copy link

I noticed the single character outputs in an Export as well, and was about to raise the issue. But I see someone beat me to it.

@Antiever
Copy link

I noticed the single character outputs in an Export as well

True

sublime_text_j2W860EBsg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants