DELPHI判断是否64位操作系统
2013-12-29 20:29
316 查看
function IsWin64: Boolean;
var
Kernel32Handle: THandle;
IsWow64Process: function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL;
stdcall;
GetNativeSystemInfo :
procedure(var lpSystemInfo: TSystemInfo); stdcall; 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;
var
Kernel32Handle: THandle;
IsWow64Process: function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL;
stdcall;
GetNativeSystemInfo :
procedure(var lpSystemInfo: TSystemInfo); stdcall; 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;
相关文章推荐
- DELPHI判断是否64位操作系统
- How to:Installshield判断操作系统是否为64位,并且为操作注册表进行设置
- How to:Installshield判断操作系统是否为64位,并且为操作注册表进行设置
- delphi 判断是64位系统还是32为操作系统
- 如何在安装程序中判断操作系统是否是64位 inno
- 判断CPU是否64位,以及linux操作系统是否64位
- Delphi判断系统是否64位
- How to:Installshield判断操作系统是否为64位,并且为操作注册表进行设置
- inno 判断进程是否记录(win7 64位操作系统等可用)
- Delphi判断系统是否64位
- 判断是否是64位操作系统
- c#判断是否是64位操作系统方法
- 判断是否是64位操作系统
- delphi 中判断windows系统是否是64位系统
- Delphi中判断操作系统是否是Windows7
- 如何在安装程序中判断操作系统是否是64位 inno
- c#中判断操作系统是否为64位还是32位
- How to:Installshield判断操作系统是否为64位,并且为操作注册表进行设置
- delphi 判断是64位系统还是32为操作系统
- 如何判断操作系统是64位还是32位(GetNativeSystemInfo和IsWow64Process两种方法)