[PATCH 2/2] kernel32/tests: Test Get/SetUserGeoID, GetUserDefaultGeoName, SetUserGeoName.

João Diogo Ferreira devilj at outlook.pt
Thu Oct 3 07:52:44 CDT 2019


A quinta-feira, 3 de outubro de 2019 06:37:56 WEST Nikolay Sivov escreveu:

> Please check function pointer first and return if it's unavailable, 
> instead of creating large outer nesting block.
> 
> Regarding string buffers, for this test it should be enough to use fixed 
> size local buffer, but if you must allocate, please use kernel32 heap 
> functions.
> 

There is no reason to do the first alloc (other than tiredness :)).
The second alloc is only there to make sure we succeed in the unlikely case
that the implementation allows unbounded name strings, but I'll "hide" it
behind an if block in case the local buffer isn't enough.

> My understanding is that setting geoid is not something regular 
> application would do.

Yes, general applications shouldn't do it, and it's not entirely reversible
as we can only make a best guess at what the values were before testing;
and even then, this relies heavily on undocumented behavior (such as which ID
to set last to restore the proper geo name, or that it writes a name at all).

I only wrote those because I intend to write some Wine-internal functions
that made use of that behavior (and it is useful behavior). In honesty,
we don't even need to guarantee Windows behaves the same way;
it's only there so Wine behaves the same unless we need to change it.

If you think it's best, these tests can be removed.





More information about the wine-devel mailing list