tiny patch for dlls/kernel32/profile.c (PROFILE_Find, PROFILE_GetString)

Claudio Fontana claudio.fontana at gmail.com
Thu Dec 21 22:52:04 CST 2006


Hello,

this patch fixes an issue I encountered trying to get the freeware game
"The Spirit Engine" to run correctly.

It is downloadable from
http://www.thespiritengine.com/Files/TSE104.exe

The Spirit Engine is built with MultiMedia Fusion, and relies on the
INI object to
correctly save/load data from three .ini files.

Running the program under wine causes settings to be lost, and makes
it impossible
to load previously saved games.

Analyzing the issue revealed that two separate problems cause the
program to malfunction:

1) values in the INI unnamed section are not fetched correctly using
GetPrivateProfileString
   and the function returns 0 (buffer = "") even though the value for
that key is available.
   Discovered using WINEDEBUG=+profile

2) KEY=VALUE pairs where KEY is the empty string are not retrieved.
    This appears to be due to a modification meant to be used only
under windows 95,
    but no check has been made to ensure proper operation under other versions.

The following patch fixes both issues and restores full functionality
to the program
(provided the version used is not windows 95, of course).

ChangeLog entry:

2006-12-22  Claudio Fontana <claudio.fontana at gmail.com>

        * dlls/kernel32/profile.c (PROFILE_Find, PROFILE_GetString):
        kernel32: do not skip INI keys/values in the outer (unnamed) section,
        and consider keys of zero length as valid keys except on Windows 95.

Patch as a p0 unified diff is attached.

Bye,

Claudio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile-fix.diff
Type: text/x-diff
Size: 667 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20061222/358ee929/profile-fix.bin


More information about the wine-patches mailing list