https://bugs.winehq.org/show_bug.cgi?id=56467
Bug ID: 56467 Summary: Calling the GetPrivateProfileString interface failed Product: Wine Version: 8.0.1 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: csumushu@gmail.com Distribution: ---
I have written a C program to read an INI file, and I found that when a key name contains spaces, it can be read successfully on Windows, but fails to read when the executable program is run using Wine.
//------------------------Here is the code of the program----------------------- #include <Windows.h> #include <stdio.h>
#define MAX_BUFFER_SIZE 260
int main(int argc, char* argv[]) { char iniFile[MAX_BUFFER_SIZE]; GetPrivateProfileString("SYS_PARA_AREA", "VFSRootPath Item", "", iniFile, MAX_BUFFER_SIZE, "CONFIG.INI");
if (iniFile[0] != '\0') { printf("VFSRootPath Item: %s\n", iniFile); } else { printf("Failed to read VFSRootPath Item from ini file.\n"); } return 0; } //-----------------------------------------------------------------------------
//--------------------Here is the content of the INI file--------------------- [SYS_PARA_AREA] VFSRootPath Item=C:\ProgramData\ne1\ //----------------------------------------------------------------------------- On Windows, I compile an executable program using `gcc -o test test.c` and can read content normally. However, when I copy the program to Ubuntu and attempt to run it with Wine, it fails to read content.
Here is my environment information: Operating System: Ubuntu 23.10 Wine: wine-8.0.1 (Ubuntu 8.0.1~repack-3ubuntu2)