zoukankan      html  css  js  c++  java
  • Delphi 判断当前系统是否64位

    uses Winapi.Windows;
    function IsWin64: Boolean;
    var
    IsWow64Process: function(Handle:  THandle; var Res:  BOOL): BOOL; stdcall;
      GetNativeSystemInfo: procedure(var lpSystemInfo: TSystemInfo); stdcall;
      Kernel32Handle: THandle;
    
      isWoW64: Bool;
      SystemInfo: TSystemInfo;
    const
      PROCESSOR_ARCHITECTURE_AMD64 = 9;
      PROCESSOR_ARCHITECTURE_IA64 = 6;
    begin
      Kernel32Handle := GetModuleHandle('KERNEL32.DLL');
      if Kernel32Handle = 0 then
        Kernel32Handle := LoadLibrary('KERNEL32.DLL');
      if Kernel32Handle <> 0 then
      begin
        IsWOW64Process := GetProcAddress(Kernel32Handle,'IsWow64Process');
        GetNativeSystemInfo := GetProcAddress(Kernel32Handle,'GetNativeSystemInfo');
        if Assigned(IsWow64Process) then
        begin
          IsWow64Process(GetCurrentProcess,isWoW64);
          Result := isWoW64 and Assigned(GetNativeSystemInfo);
          if Result then
          begin
            GetNativeSystemInfo(SystemInfo);
            Result := (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64) or
                      (SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64);
          end;
        end
        else Result := False;
      end
      else Result := False;
    end;
  • 相关阅读:
    Python3---常见函数---super()
    Python3---常见函数---type()
    Python3---面对对象
    Python3---BeautifulSoup---节点选择器
    Python3---Beautiful Soup
    0X01应用程序黑客技术
    Python3---标准库---re
    (trie) UVA
    (trie)UVALive
    (平方分割)POJ 2104 K-th Number
  • 原文地址:https://www.cnblogs.com/windson/p/12562364.html
Copyright © 2011-2022 走看看