Skip to content

Instantly share code, notes, and snippets.

@owlsperspective
Last active February 26, 2016 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owlsperspective/91d195ef67befadbe01d to your computer and use it in GitHub Desktop.
Save owlsperspective/91d195ef67befadbe01d to your computer and use it in GitHub Desktop.
Windowsがサーバ版かどうかを調べる
function IsWindowsServer: Boolean;
var
OSVI: TOSVersionInfoEx;
ConditionMask: UInt64;
begin
FillChar(OSVI,SizeOf(TOSVersionInfoEX),0);
OSVI.dwOSVersionInfoSize := SizeOf(OSVI);
OSVI.wProductType := VER_NT_WORKSTATION;
ConditionMask := VerSetConditionMask(0,VER_PRODUCT_TYPE,VER_EQUAL);
Result := not (VerifyVersionInfo(OSVI,VER_PRODUCT_TYPE,ConditionMask));
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment