术语 | iswow64process |
释义 | IsWow64Process 语法: C++ BOOL WINAPI IsWow64Process( __in HANDLE hProcess, __out PBOOL Wow64Process ); IsWow64Process功能 确定指定的进程在WOW64下运行。 参数 hProcess [in] 句柄的进程。句柄必须有PROCESS_QUERY_INFORMATION或PROCESS_QUERY_LIMITED_INFORMATION访问权限。有关更多信息,请参见过程的安全性和访问权限。 Windows Server 2003和Windows XP中:在处理必须有PROCESS_QUERY_INFORMATION访问权。 Wow64Process [out] 一个设置为TRUE,如果该进程在WOW64下运行的价值指针。如果进程是运行在32位Windows,该值设置为FALSE。如果该进程是一个64位应用程序运行在64位Windows时,该值也设置为FALSE。 返回值 如果函数成功,返回值是一个非零值。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0501或更高版本。有关详细信息,请参阅使用Windows头。 实例 对于操作系统不支持此功能,兼容性调用GetProcAddress来检测是否IsWow64Process是在Kernel32.dll中实施。如果调用GetProcAddress成功,它是安全的调用此函数。否则,WOW64是不存在。请注意,这种方法并不是一个可靠的方法来检测操作系统是否是64位版本的Windows,因为在目前32个版本的Kernel32.dll位Windows还包含这一功能。 #include #include typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); LPFN_ISWOW64PROCESS fnIsWow64Process; BOOL IsWow64() { BOOL bIsWow64 = FALSE; fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress( GetModuleHandle(TEXT("kernel32")),"IsWow64Process"); if (NULL != fnIsWow64Process) { if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { // handle error } } return bIsWow64; } void main() { if(IsWow64()) printf("Running on WOW64\\n"); else printf("Running on 32-bit Windows\\n"); } 要求: 最低支持clientWindows SP2的景色时,Windows XP 最低支持serverWindows Server 2008中时,Windows Server 2003 SP1的 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 GetNativeSystemInfo IsWow64Message 在WOW 64 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==IsWow64Process Function Determines whether the specified process is running under WOW64 . Syntax C++ BOOL WINAPI IsWow64Process( __in HANDLE hProcess, __out PBOOL Wow64Process ); Parameters hProcess [in] A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights . Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right. Wow64Process [out] A pointer to a value that is set to TRUE if the process is running under WOW64. If the process is running under 32-bit Windows, the value is set to FALSE. If the process is a 64-bit application running under 64-bit Windows, the value is also set to FALSE. Return Value If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call GetLastError . Remarks To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers . Examples For compatibility with operating systems that do not support this function, call GetProcAddress to detect whether IsWow64Process is implemented in Kernel32.dll. If GetProcAddress succeeds, it is safe to call this function. Otherwise, WOW64 is not present. Note that this technique is not a reliable way to detect whether the operating system is a 64-bit version of Windows because the Kernel32.dll in current versions of 32-bit Windows also contains this function. #include #include typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); LPFN_ISWOW64PROCESS fnIsWow64Process; BOOL IsWow64() { BOOL bIsWow64 = FALSE; fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress( GetModuleHandle(TEXT("kernel32")),"IsWow64Process"); if (NULL != fnIsWow64Process) { if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { // handle error } } return bIsWow64; } void main() { if(IsWow64()) printf("Running on WOW64\\n"); else printf("Running on 32-bit Windows\\n"); } Requirements Minimum supported clientWindows Vista, Windows XP with SP2 Minimum supported serverWindows Server 2008, Windows Server 2003 with SP1 HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also GetNativeSystemInfo IsWow64Message WOW64 Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms684139(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。