|
@@ -1094,16 +1094,16 @@ begin
|
|
if not CryptAcquireContext(CryptProv, nil, nil, PROV_RSA_FULL,
|
|
if not CryptAcquireContext(CryptProv, nil, nil, PROV_RSA_FULL,
|
|
CRYPT_VERIFYCONTEXT) then begin
|
|
CRYPT_VERIFYCONTEXT) then begin
|
|
ErrorCode := GetLastError;
|
|
ErrorCode := GetLastError;
|
|
- raise Exception.CreateFmt('CryptAcquireContext failed with code 0x%.8x: %s',
|
|
|
|
- [ErrorCode, Win32ErrorString(ErrorCode)]);
|
|
|
|
|
|
+ raise Exception.CreateFmt(SCompilerFunctionFailedWithCode,
|
|
|
|
+ ['CryptAcquireContext', ErrorCode, Win32ErrorString(ErrorCode)]);
|
|
end;
|
|
end;
|
|
{ Note: CryptProv is released in the 'finalization' section of this unit }
|
|
{ Note: CryptProv is released in the 'finalization' section of this unit }
|
|
end;
|
|
end;
|
|
FillChar(Buffer, Bytes, 0);
|
|
FillChar(Buffer, Bytes, 0);
|
|
if not CryptGenRandom(CryptProv, Bytes, @Buffer) then begin
|
|
if not CryptGenRandom(CryptProv, Bytes, @Buffer) then begin
|
|
ErrorCode := GetLastError;
|
|
ErrorCode := GetLastError;
|
|
- raise Exception.CreateFmt('CryptGenRandom failed with code 0x%.8x: %s',
|
|
|
|
- [ErrorCode, Win32ErrorString(ErrorCode)]);
|
|
|
|
|
|
+ raise Exception.CreateFmt(SCompilerFunctionFailedWithCode,
|
|
|
|
+ ['CryptGenRandom', ErrorCode, Win32ErrorString(ErrorCode)]);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -8134,7 +8134,7 @@ var
|
|
FT: TFileTime;
|
|
FT: TFileTime;
|
|
SourceFile: TFile;
|
|
SourceFile: TFile;
|
|
SignatureAddress, SignatureSize: Cardinal;
|
|
SignatureAddress, SignatureSize: Cardinal;
|
|
- HdrChecksum: DWORD;
|
|
|
|
|
|
+ HdrChecksum, ErrorCode: DWORD;
|
|
begin
|
|
begin
|
|
if (SetupHeader.CompressMethod in [cmLZMA, cmLZMA2]) and
|
|
if (SetupHeader.CompressMethod in [cmLZMA, cmLZMA2]) and
|
|
(CompressProps.WorkerProcessFilename <> '') then
|
|
(CompressProps.WorkerProcessFilename <> '') then
|
|
@@ -8229,8 +8229,11 @@ var
|
|
FL.ChunkSuboffset := CH.ChunkBytesRead;
|
|
FL.ChunkSuboffset := CH.ChunkBytesRead;
|
|
FL.OriginalSize := SourceFile.Size;
|
|
FL.OriginalSize := SourceFile.Size;
|
|
|
|
|
|
- if not GetFileTime(SourceFile.Handle, nil, nil, @FT) then
|
|
|
|
- AbortCompile('CompressFiles: GetFileTime failed');
|
|
|
|
|
|
+ if not GetFileTime(SourceFile.Handle, nil, nil, @FT) then begin
|
|
|
|
+ ErrorCode := GetLastError;
|
|
|
|
+ AbortCompileFmt(SCompilerFunctionFailedWithCode,
|
|
|
|
+ ['CompressFiles: GetFileTime', ErrorCode, Win32ErrorString(ErrorCode)]);
|
|
|
|
+ end;
|
|
if TimeStampsInUTC then begin
|
|
if TimeStampsInUTC then begin
|
|
FL.SourceTimeStamp := FT;
|
|
FL.SourceTimeStamp := FT;
|
|
Include(FL.Flags, foTimeStampInUTC);
|
|
Include(FL.Flags, foTimeStampInUTC);
|