update cswin32

This commit is contained in:
ppc
2025-06-17 18:23:55 +01:00
parent f0125be89d
commit 435dbad3a5
2 changed files with 10 additions and 3 deletions
+8 -1
View File
@@ -50,8 +50,15 @@ internal static class Config
// +1 for null terminator
var buffer = stackalloc char[(int)maxLength + 1];
var bufferStr = new PWSTR(buffer);
fixed (char* pSection = section)
fixed (char* pKey = key)
fixed (char* pDefault = @default ?? string.Empty)
fixed (char* pDefaultPath = ConfigFilePath)
{
PInvoke.GetPrivateProfileString(new PCWSTR(pSection), new PCWSTR(pKey), new PCWSTR(pDefault), bufferStr, maxLength + 1, new PCWSTR(pDefaultPath));
}
PInvoke.GetPrivateProfileString(section, key, @default ?? string.Empty, bufferStr, maxLength + 1, ConfigFilePath);
return bufferStr.ToString();
}
}