Revisão | 516 (tree) |
---|---|
Hora | 2020-10-13 23:16:22 |
Autor | derekwildstar |
Ajuste em GetKeyContainerInfo
Alterada uma diretiva de compilação para incluir GetFileSizeEx também no Delphi 24
@@ -1610,21 +1610,17 @@ | ||
1610 | 1610 | ACryptKeyProvInfo := nil; |
1611 | 1611 | CryptKeyProvInfoSize := 0; |
1612 | 1612 | |
1613 | - if not CertGetCertificateContextProperty(ACertificateContext | |
1614 | - ,CERT_KEY_PROV_INFO_PROP_ID | |
1615 | - ,nil | |
1616 | - ,@CryptKeyProvInfoSize) then | |
1617 | - raise EAdvApi.Create(GetLastError,'CertGetCertificateContextProperty@GetKeyContainerInfo: Não foi possível obter as informações do contêiner de chaves') | |
1618 | - else | |
1613 | + if CertGetCertificateContextProperty(ACertificateContext | |
1614 | + ,CERT_KEY_PROV_INFO_PROP_ID | |
1615 | + ,nil | |
1616 | + ,@CryptKeyProvInfoSize) then | |
1619 | 1617 | begin |
1620 | 1618 | ACryptKeyProvInfo := AllocMem(CryptKeyProvInfoSize); |
1621 | 1619 | |
1622 | - if not CertGetCertificateContextProperty(ACertificateContext | |
1623 | - ,CERT_KEY_PROV_INFO_PROP_ID | |
1624 | - ,ACryptKeyProvInfo | |
1625 | - ,@CryptKeyProvInfoSize) then | |
1626 | - raise EAdvApi.Create(GetLastError,'CertGetCertificateContextProperty@GetKeyContainerInfo: Não foi possível realizar a assinatura') | |
1627 | - else | |
1620 | + if CertGetCertificateContextProperty(ACertificateContext | |
1621 | + ,CERT_KEY_PROV_INFO_PROP_ID | |
1622 | + ,ACryptKeyProvInfo | |
1623 | + ,@CryptKeyProvInfoSize) then | |
1628 | 1624 | Result := True; |
1629 | 1625 | end; |
1630 | 1626 | end; |
@@ -49,7 +49,7 @@ | ||
49 | 49 | {$ENDIF} |
50 | 50 | {$IFEND} |
51 | 51 | |
52 | -{$IF RTLVersion < 30} // Delphi Seattle | |
52 | +{$IF RTLVersion < 32} // Delphi Tokyo | |
53 | 53 | function GetFileSizeEx(hFile: THandle; var lpFileSize: Int64): ByteBool; stdcall; external kernel32 name 'GetFileSizeEx'; |
54 | 54 | {$IFEND} |
55 | 55 |