pp_SYSINFO()

Determines operating environment

Applies to:

Win32, Win64

Syntax-VB:

Declare Function pp_sysinfo (ByVal flags As Long) As Long

Syntax-C:

LONG pp_sysinfo(LONG flags)

Arguments:

<flags> is system type you want to detect:

Flag

Value

Description

PP_TERMSERV

1

Test for running on Windows Terminal Server.

PP_VMWARE

2

Virtual machine test for running on a VMWare guest.

PP_VIRTUALPC

4

Virtual machine test for running on a Microsoft Virtual PC guest.

PP_64BIT

8

Test for running on Windows 64-bit platform.

PP_HYPERV

32

Virtual machine test for running on a Microsoft Hyper-V guest. With WMI available also detects Microsoft Virtual PC guests.

SYSINFO_NO_WMI

64

Used in conjunction with the PP_VIRTUALPC (32-bit static library only), PP_HYPERV, PP_PARALLELS, PP_VIRTUALBOX, and PP_XENSERVER flags to suppress use of WMI data if this causes the application to hang, such as when called from DllMain.

PP_VIRTUALBOX

128

Virtual machine test for running on a VirtualBox guest.

PP_PARALLELS

1024

Virtual machine test for running on a Parallels guest.

PP_XENSERVER

2048

Virtual machine test for running on a Xen Server guest.

 

Returns:

If the environment is detected, PP_TRUE [1] will be returned. Otherwise, PP_FALSE [0] will be returned.

Description:

This function tests to see if the current system is running in one of the specified environments. If it does, then it will return TRUE, else it will return FALSE.  Multiple flags can be added together to detect multiple environments.

Example:

' See if running in a virtual machine

If pp_sysinfo( PP_VMWARE + PP_VIRTUALPC ) <> 0 Then

MsgBox "This program is running on a VMWare or Virtual PC!"

End If