From: "Jiajin Cui" Subject: [PATCH 2/2] kernel32: Make GetPrivateProfileIntW() return the correct value. Message-Id: <2020062910475524429928@uniontech.com> Date: Mon, 29 Jun 2020 10:47:55 +0800 From 73b51d27103a4c30282221e5eb9a48279f41b966 Mon Sep 17 00:00:00 2001 From: Jiajin Cui Date: Sun, 28 Jun 2020 18:14:42 +0800 Subject: [PATCH 2/2] kernel32: Make GetPrivateProfileIntW() return the correct value. the function GetPrivateProfileIntW() must return 0 when section and ini filename is NULL, not rerurn default value. Signed-off-by: Jiajin Cui --- dlls/kernel32/profile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index dfda24446c..b48c66321d 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -1198,7 +1198,11 @@ UINT WINAPI GetPrivateProfileIntW( LPCWSTR section, LPCWSTR entry, if (GetPrivateProfileStringW( section, entry, emptystringW, buffer, ARRAY_SIZE( buffer ), filename ) == 0) + { + if(!section && !filename) + return 0; return def_val; + } /* FIXME: if entry can be found but it's empty, then Win16 is * supposed to return 0 instead of def_val ! Difficult/problematic -- 2.20.1