<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Improved windirs.GetWindowsSpecialDir is ready:<br>
<a moz-do-not-send="true"
href="https://bugs.freepascal.org/view.php?id=33133">https://bugs.freepascal.org/view.php?id=33133</a><br>
<br>
The submitted patch contains the following changes:<br>
1. Added FOLDERID_* constants, required for SHGetKnownFolderPath.<br>
2. Added mapping of legacy CSIDL_* constants to FOLDERID_*
constants.<br>
3. Overloaded GetWindowsSpecialDir to work with both CSIDL_* or
FOLDERID_* constants.<br>
4. Changed GetWindowsSpecialDir to fallback to an alternative API
(using appropriate remapping of parameters) when the default API
function is not available.<br>
<br>
Existing code that uses GetWindowsSpecialDir(CSIDL_*) should not be
affected, except for an improved forward compatibility when the
deprecated SHGetFolderPath is finally removed from Windows API, in
which case a newer API function will be used automatically.<br>
<br>
Denis<br>
<br>
<br>
<div class="moz-cite-prefix">On 01/02/2018 13:31, Sven Barth via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB9uwVhxRHGA0vQhw=AHc-_hQdQcfXC30_7THeNx8_05iA@mail.gmail.com">
<div dir="auto">
<div>
<div class="gmail_extra">
<div class="gmail_quote">Am 01.02.2018 14:08 schrieb "Denis
Kozlov" <<a href="mailto:dezlov@gmail.com"
moz-do-not-send="true">dezlov@gmail.com</a>>:<br
type="attribution">
<blockquote class="quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">A proposal:<br>
1) Use windirs.GetWindowsSpecialDir in fpttf.pp, which
already uses a more backwards compatible
SHGetFolderPath().<br>
2) Optionally, improve windirs.GetWindowsSpecialDir to
use a newer SHGetKnownFolderPath() when it is
available.<br>
<br>
If this is suitable, I can produce a patch for both.</div>
</blockquote>
</div>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">I would be in favor of this, especially as it
hides the gritty details from fpttf.pp.</div>
<div dir="auto">Report them as two separate issues, please. <br>
</div>
</div>
</blockquote>
</body>
</html>