Add internal registry implementation for win32#11137
Conversation
|
I had to do some incremental debugging in CI to get the time spec to work (it seems the CI runners have UTC as their default timezone which requires a complete time zone setup). This should now be ready for reviews. |
beta-ziliani
left a comment
There was a problem hiding this comment.
I left some comments to help understand a bit some edge cases, but in the overall it looks good.
| elsif small_buf && length > 0 | ||
| next length | ||
| else | ||
| raise "RegQueryValueExW retry buffer" |
There was a problem hiding this comment.
In particular, when is this error expected? Is it an unexpected failure?
There was a problem hiding this comment.
It's never expected. The block runs maximal two times, the first time it either succeeds directly or returns the buffer size to be allocated. On the second run, the buffer should be approriately sized. If it's not that's points to an error in the lib function or a race condition.
This is a minimal internal implementation to provide registry access on win32. It is necessary for looking up time zone names and file extensions for the MIME database. Both these use cases are already included.
It is an alternative to the more feature complete, public implementation in #6698 and implements only the minimal required parts and exposes no platform-specific APIs.