From e47b526c333ee23c6e6fa7b8e4385c128cbab07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20D=C3=ADaz=20Fau?= Date: Sat, 9 May 2020 11:41:20 +0200 Subject: [PATCH] Fix for issue #277 - Added attribution links to other projects in the readme file. --- README.md | 5 +++++ source/uCEFMiscFunctions.pas | 36 ++++++++++++++++++++++++++++-------- update_CEF4Delphi.json | 2 +- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7e4a7d5c..7c344805 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,11 @@ Additional: Delphinus-Support ## Attribution +Other projects : +* [DCEF3](https://github.com/hgourvest/dcef3) +* [CEF](https://bitbucket.org/chromiumembedded/cef/) +* [DCPcrypt](http://www.cityinthesky.co.uk/opensource/dcpcrypt/) +* [Chromium](https://chromium.googlesource.com/chromium/src/) Some icons used in this project belong to these icon packages : * [Fugue & Diagona icons](http://yusukekamiyamane.com/) * [FatCow Farm-Fresh Web Icons](https://www.fatcow.com/free-icons) diff --git a/source/uCEFMiscFunctions.pas b/source/uCEFMiscFunctions.pas index 99fc2071..78a37544 100644 --- a/source/uCEFMiscFunctions.pas +++ b/source/uCEFMiscFunctions.pas @@ -170,7 +170,6 @@ function PathIsUNCAnsi(pszPath: LPCSTR): BOOL; stdcall; external SHLWAPIDLL name function PathIsUNCUnicode(pszPath: LPCWSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsUNCW'; function PathIsURLAnsi(pszPath: LPCSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsURLA'; function PathIsURLUnicode(pszPath: LPCWSTR): BOOL; stdcall; external SHLWAPIDLL name 'PathIsURLW'; -function CustomRtlGetVersion(var lpVersionInformation : TOSVersionInfoEx): LongInt; stdcall; external NTDLL name 'RtlGetVersion'; {$IFNDEF DELPHI12_UP} const @@ -2129,21 +2128,42 @@ begin end; function GetWindowsMajorMinorVersion(var wMajorVersion, wMinorVersion : DWORD) : boolean; +type + TRtlGetVersionFunc = function(var lpVersionInformation : TOSVersionInfoEx): LongInt; stdcall; var + TempHandle : THandle; TempInfo : TOSVersionInfoEx; + TempRtlGetVersionFunc : TRtlGetVersionFunc; begin Result := False; wMajorVersion := 0; wMinorVersion := 0; - ZeroMemory(@TempInfo, SizeOf(TOSVersionInfoEx)); + try + TempHandle := LoadLibrary(NTDLL); - if (CustomRtlGetVersion(TempInfo) = 0) then - begin - Result := True; - wMajorVersion := TempInfo.dwMajorVersion; - wMinorVersion := TempInfo.dwMinorVersion; - end; + if (TempHandle <> 0) then + try + {$IFDEF FPC}Pointer({$ENDIF}TempRtlGetVersionFunc{$IFDEF FPC}){$ENDIF} := GetProcAddress(TempHandle, 'RtlGetVersion'); + + if assigned(TempRtlGetVersionFunc) then + begin + ZeroMemory(@TempInfo, SizeOf(TOSVersionInfoEx)); + + if (TempRtlGetVersionFunc(TempInfo) = 0) then + begin + Result := True; + wMajorVersion := TempInfo.dwMajorVersion; + wMinorVersion := TempInfo.dwMinorVersion; + end; + end; + finally + FreeLibrary(TempHandle); + end; + except + on e : exception do + if CustomExceptionHandler('GetWindowsMajorMinorVersion', e) then raise; + end; end; function GetDefaultCEFUserAgent : string; diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index aa5f25bd..4357d543 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,7 +2,7 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 134, + "InternalVersion" : 135, "Name" : "cef4delphi_lazarus.lpk", "Version" : "81.3.2.0" }