I've recently found an issue with importing registry file using wine-staging-9.12 regedit.
It looks like it no longer accepts (silently ignores) a registry string value that contains null characters (the original one had null characters enough to fill to 259 characters or so):
[code]
REGEDIT4
; heavygear.reg
[HKEY_LOCAL_MACHINE\Software\Activision\Heavy Gear]
"EXE"="HG_exe\0\0\0\0"
[/code]
run regedit heavygear.reg once, then run regedit by itself and look at that registry entry. It doesn't get imported.
I would like to know if there is a comprehensive documentation on registry file format for wine that I should adhere to, since it seems like wine regedit has additional format not found in mswin regedit. I'm specifically interested in reg9x format (as seen with REGEDIT4 above) since I get to easily edit the file in utf8, and convert to cp1252 just before regedit import.
For example, it looks like there is str(7) value type corresponding to REG_MULTI_SZ which does require null characters, but wine regedit just converts '\0' to '0' instead of null character. I think this is a bug, but I'm wondering if I should just use hex value for str type that contains null characters to avoid any issues with future changes, or whether it breaks applications that require string rather than binary values.
Q: registry file (.reg) format for string vlaue with null character
- DarkShadow44
- Level 9
- Posts: 1338
- Joined: Tue Nov 22, 2016 5:39 pm
Re: Q: registry file (.reg) format for string vlaue with null character
This regedit file doesn't work on windows either, so Wine behavior here is correct. If you find a difference between formats on windows and wine, feel free to report that as a bug. If it works on windows, i should work on wine.
Re: Q: registry file (.reg) format for string vlaue with null character
I don't have ms windows to test, but I'm pretty sure the registry file was generated by windows application Winstall LE when they released it for free before it was discontinued a long time ago, so it must have worked in windows at one time.DarkShadow44 wrote: ↑Mon Jul 08, 2024 3:55 pm This regedit file doesn't work on windows either, so Wine behavior here is correct.
I think the bigger issue is the str(7) type (REG_MULTI_SZ). Isn't this a form that only wine regedit can parse? How does ms windows regedit parse that type, and how does one add null characters to delimit each string in the list, and the final null to indicate the end of the list? I really need some documentation on both mswin regedit (including any hidden formats) and wine regedit file format.
I don't think it's a good idea for wine regedit to mimic ms windows regedit faithfully, since it is running in a different environment, and if there are any hidden features, we'll not be able to mimic 100% fully.
Anyway, that third issue where '\0' is replaced with '0' seems to be a bug, so I'll verify further and create a bug report.
Thank you for the response.
Re: Q: registry file (.reg) format for string vlaue with null character
Ok, after some extensive research, I came to realize that wine-9.12 regedit does not recognize str or str() value type at all. I have to use hex type for REG_MULTI_SZ or any string that contains null characters.
I don't know if earlier versions of wine regedit was able to parse it, or whether that entry was from Winstall LE and only Winstall LE could parse it.
It's unfortunate that wine regedit will not flag an unrecognized data type as error, and just ignore it instead. that includes null characters. It seems counter-productive to mimic even the flaws and lack of features of original ms windows regedit.
I'm beginning to suspect this may be the reason for the intermittent crash and bug I had with Half-Gear game.
Replacing '\0' with '0' is a new thing in wine regedit though. Anyway, I have enough information now to proceed to fix my reg files.
I don't know if earlier versions of wine regedit was able to parse it, or whether that entry was from Winstall LE and only Winstall LE could parse it.
It's unfortunate that wine regedit will not flag an unrecognized data type as error, and just ignore it instead. that includes null characters. It seems counter-productive to mimic even the flaws and lack of features of original ms windows regedit.
I'm beginning to suspect this may be the reason for the intermittent crash and bug I had with Half-Gear game.
Replacing '\0' with '0' is a new thing in wine regedit though. Anyway, I have enough information now to proceed to fix my reg files.