Ich habe das dementsprechend umgestellt. So sollte das dann doch jetzt in Ordnung sein
Delphi-Quellcode:
function DirExistsA(const aDirectory: string): Boolean;
var
Code: Integer;
LastError: Cardinal;
begin
Code := GetFileAttributesW(PChar(aDirectory));
if (Code <> -1) then
Result := (FILE_ATTRIBUTE_DIRECTORY and Code <> 0)
else
begin
LastError := GetLastError;
Result := (LastError <> ERROR_FILE_NOT_FOUND) and (LastError <> ERROR_PATH_NOT_FOUND) and (LastError <> ERROR_BAD_PATHNAME) and (LastError <> ERROR_INVALID_NAME) and
(LastError <> ERROR_BAD_NETPATH) and (LastError <> ERROR_NOT_READY) and (LastError <> ERROR_BAD_NET_NAME);
end;
end;
ich bleibe letzten Endes aber dennoch beim Delphi eigenen Code