Open topic with navigation
Detects whether or not the protected application is being run in a virtual machine guest environment.
Reference the SK_VirtualMachineTypes enumeration for a list of hypervisors this function is designed to detect.
Failure to detect a virtual machine guest environment does not guarantee that the application is not running in one. This function simply makes an effort to detect the most common hypervisors while avoiding the possibility of running into false-positives. The guest environments this can detect include:
If calling this function causes a long or indefinite hang in your application, you may need to pass the SK_FLAGS_DISABLE_WMI flag to prevent this function from using WMI queries. While this kind of issue is not very common, it is especially possible to encounter when the protected application is a service that starts automatically, and does not have the Windows Management Instrumentation (WMI) service configured as a dependency.
All possible return values are included in the SK_ResultCode enumeration. Return codes to expect include:
|SK_ResultCode.SK_ERROR_INVALID_ARGUMENTS||Some or all of the arguments are invalid.|
|SK_ResultCode.SK_ERROR_PLATFORM_ERROR||Platform specific API or system call fails.|
|SK_ResultCode.SK_ERROR_MEMORY_ALLOCATION||Memory could not be allocated.|
|SK_ResultCode.SK_ERROR_LIBRARY_FUNCTION_UNAVAILABLE||Required library function is missing.|