检查环境变量很容易,但它不是防弹,因为用户可以重新定义该值.
更强大的方法是检查当前的Powerbuilder进程是否在WOW64模式(32位仿真模式)下运行.
[Local external definitions]
FUNCTION long IsWow64Process(long hwnd, ref boolean Wow64Process) &
LIBRARY "Kernel32.DLL"
FUNCTION long GetCurrentProcess () LIBRARY "KERNEL32.DLL"
[Powerscript]
boolean wow64 =false
IsWow64Process(GetCurrentProcess(), wow64)
MessageBox("Running in 64b env", wow64)
Run Code Online (Sandbox Code Playgroud)