Problem with 'GetPrivateProfileString'

Lionel Ulmer lionel.ulmer at free.fr
Wed Jul 18 18:07:53 CDT 2001


Hi all,

I have an installer crashing in 'GetPrivateProfileString' because of an NULL
section pointer :

3 0x40076161 (GetPrivateProfileStringA+0x31(section=0x0, entry=0x40391efc, 
                                            def_val=0x4039a394, buffer=0x403b0410, 
					    len=0x3e7, filename=0x4039a4e8)
              [profile.c:1232] in libntdll.so) (ebp=40586748)

When looking at the code, there is the following comment (and code) :

/*
 * undoc_feature means:
 * return section names string list if both section and entry are NULL.
 */
(...)
    if ((undoc_feature) && (section == NULL) && (entry == NULL))
       /* undocumented; both section and entry are NULL */

But if I look at the entry for 'GetPrivateProfileString' in the MSDN, I get
this :

pAppName
[in] Pointer to a null-terminated string that specifies the name of the
     section containing the key name. If this parameter is NULL, the
     GetPrivateProfileString function copies all section names in the file to the
     supplied buffer. 
     
lpKeyName
[in] Pointer to the null-terminated string specifying the name of the key
     whose associated string is to be retrieved. If this parameter is NULL, all
     key names in the section specified by the lpAppName parameter are copied to
     the buffer specified by the lpReturnedString parameter.  

This is not in sync. with what Wine does.... It seems that only pAppName
needs to be NULL to return a section name list.

And there is another behaviour not done by Wine yet : copy all the keys of a
section to the output buffer.

So who is the author of this 'undocumented' feature in the Wine code ? Do
you all agree that I should code it according to the (now) documented
feature ?

                       Lionel

-- 
		 Lionel Ulmer - http://www.bbrox.org/




More information about the wine-devel mailing list