-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add internal registry implementation for win32 #11137
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular, when is this error expected? Is it an unexpected failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.