Retrive the path of the Windows directory

uses
Windows, StrUtils;
...
function GetWinDir: string;
var
buffer: array[0..MAX_PATH] of char;;
begin
GetWindowsDirectory(buffer, MAX_PATH);
result := string(buffer);
if RightStr(