You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This results in the following binary data getting created:
Each character is encoded as two bytes. However, the final null-termination character (required for REG_SZ value types) is only encoded as a single byte.
If you click ok within regedit's binary editor, and then reopen it, you can see that the value has been fixed (the final null termination is encoded with two bytes):
I've noticed that some API and tooling is robust to this slightly malformed data. For example, regedit itself is robust to it. Also, the .NET Registry APIs seem to read the value correctly. However, the Win32 CRegKey::QueryStringValue API returns an error when reading the value.
The text was updated successfully, but these errors were encountered:
dancarrollg
added a commit
to dancarrollg/win32_registry
that referenced
this issue
Sep 12, 2024
I noticed an issue where creating a string registry value results in malformed data being written to the Windows registry
Example code using win32_registry to create a value:
This results in the following binary data getting created:
Each character is encoded as two bytes. However, the final null-termination character (required for REG_SZ value types) is only encoded as a single byte.
If you click ok within regedit's binary editor, and then reopen it, you can see that the value has been fixed (the final null termination is encoded with two bytes):
I've noticed that some API and tooling is robust to this slightly malformed data. For example, regedit itself is robust to it. Also, the .NET Registry APIs seem to read the value correctly. However, the Win32
CRegKey::QueryStringValue
API returns an error when reading the value.The text was updated successfully, but these errors were encountered: