Disable SSH tunnel connections on Windows 10 S, as a requirement for publishing HeidiSQL in the Windows App store, #60.

This commit is contained in:
Ansgar Becker
2018-01-31 18:25:12 +01:00
parent a26d68d23c
commit 3d698f9f68
4 changed files with 46 additions and 4 deletions

View File

@ -338,7 +338,8 @@ type
procedure Help(Sender: TObject; Anchor: String);
function PortOpen(Port: Word): Boolean;
function IsValidFilePath(FilePath: String): Boolean;
function GetProductInfo(dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, dwSpMinorVersion: DWORD; out pdwReturnedProductType: DWORD): BOOL stdcall; external kernel32 delayed;
function RunningOnWindows10S: Boolean;
var
AppSettings: TAppSettings;
@ -2834,6 +2835,22 @@ begin
end;
function RunningOnWindows10S: Boolean;
const
PRODUCT_CLOUD = $000000B2; //* Windows 10 S
PRODUCT_CLOUDN = $000000B3; //* Windows 10 S N
PRODUCT_CORE = $00000065; //* Windows 10 Home
var
pdwReturnedProductType: DWORD;
begin
// Detect if we're running on Windows 10 S
// Taken from https://forums.embarcadero.com/message.jspa?messageID=900804
Result := False;
if GetProductInfo(10, 10, 0, 0, pdwReturnedProductType) then begin
Result := (pdwReturnedProductType = PRODUCT_CLOUD) OR (pdwReturnedProductType = PRODUCT_CLOUDN);
end;
end;
{ Threading stuff }