From: Andreas H. <ah...@us...> - 2004-02-22 22:50:36
|
Update of /cvsroot/jvcl/dev/JVCL3/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15369/qcommon Modified Files: QWindows.pas Log Message: Fixed Mantis #1351 Index: QWindows.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/qcommon/QWindows.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QWindows.pas 13 Feb 2004 14:52:09 -0000 1.1 --- QWindows.pas 22 Feb 2004 22:37:36 -0000 1.2 *************** *** 1236,1240 **** function CopyFileW(lpExistingFileName, lpNewFileName: PWideChar; bFailIfExists: LongBool): LongBool; ! function CopyFile(const source: string; const destination: string; FailIfExists: Boolean): LongBool; overload; --- 1236,1240 ---- function CopyFileW(lpExistingFileName, lpNewFileName: PWideChar; bFailIfExists: LongBool): LongBool; ! function CopyFile(const Source, Destination: string; FailIfExists: Boolean): LongBool; overload; *************** *** 5745,5749 **** end; ! function CopyFile(const source: string; const destination: string; FailIfExists: Boolean): LongBool; const ChunkSize = 8192; --- 5745,5749 ---- end; ! function CopyFile(const Source, Destination: string; FailIfExists: Boolean): LongBool; const ChunkSize = 8192; *************** *** 5790,5797 **** Result := True; finally ! FileClose(Dest); end; finally ! FileClose(Src); end; finally --- 5790,5797 ---- Result := True; finally ! FileClose(Src); end; finally ! FileClose(Dest); end; finally *************** *** 5835,5851 **** S: string; begin try SetLength(S, 255); ! if gethostname(PChar(S), Length(S)) = -1 then ! Result := false ! else begin ! SetLength(S, StrLen(PChar(Result))); Size := Length(S) + 1; ! Result := (S <> ''); ! if Result ! then StrLCopy(Buffer, PChar(S), Size - 1); ! end; except Result := False; --- 5835,5849 ---- S: string; begin + Result := True; try SetLength(S, 255); ! if gethostname(PChar(S), Length(S)) <> -1 then begin ! SetLength(S, StrLen(PChar(S))); Size := Length(S) + 1; ! Result := S <> ''; ! if Result and (Buffer <> nil) then StrLCopy(Buffer, PChar(S), Size - 1); ! end; except Result := False; *************** *** 5858,5870 **** pwdRec: PPasswordRecord; begin ! Result := false; try ! pwd := getpwuid(getuid); // static no need to free ! if pwd <> nil then begin ! S := pwd.pw_gecos; // user's real name? or pwd.pw_name Size := Length(S) + 1; Result := S <> ''; ! if Result then StrLCopy(Buffer, PChar(S), Size - 1); end; --- 5856,5868 ---- pwdRec: PPasswordRecord; begin ! Result := False; try ! pwdRec := getpwuid(getuid); // static no need to free ! if pwdRec <> nil then begin ! S := pwdRec.pw_gecos; // user's real name? or pwd.pw_name Size := Length(S) + 1; Result := S <> ''; ! if Result and (Buffer <> nil) then StrLCopy(Buffer, PChar(S), Size - 1); end; *************** *** 5903,5907 **** begin // (ahuser) I have not found a Libc function for that ! lpflOldProtect^ := PAGE_EXECUTE_READWRITE; end; --- 5901,5905 ---- begin // (ahuser) I have not found a Libc function for that ! PCardinal(lpflOldProtect)^ := PAGE_EXECUTE_READWRITE; end; *************** *** 5910,5914 **** // get the number of needed memory pages ProtectSize := PageSize; ! while Cardinal(BaseAddress) + dwSize > AlignedAddress + ProtectSize do Inc(ProtectSize, PageSize); Result := mprotect(Pointer(AlignedAddress), ProtectSize, flNewProtect) = 0; --- 5908,5912 ---- // get the number of needed memory pages ProtectSize := PageSize; ! while Cardinal(lpAddress) + dwSize > AlignedAddress + ProtectSize do Inc(ProtectSize, PageSize); Result := mprotect(Pointer(AlignedAddress), ProtectSize, flNewProtect) = 0; |