summaryrefslogtreecommitdiff
path: root/vdservice
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2011-03-16 17:09:35 +0200
committerArnon Gilboa <agilboa@agilboa.usersys.redhat.com>2011-04-28 11:08:57 +0300
commit0d43d537c6abac743c12a1eb84541ef28fc24550 (patch)
treea7e6e70e6ed6dcc4265deac3552d46192d6158fc /vdservice
parentbc74bd6e7983e94a1e0da773b6a4e288426ec5b2 (diff)
vdservice: support w2k3 32/64/r2, w2k8 32/64/r2 (rhbz#683166)
Diffstat (limited to 'vdservice')
-rw-r--r--vdservice/vdservice.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
index 85fa182..32c0ca5 100644
--- a/vdservice/vdservice.cpp
+++ b/vdservice/vdservice.cpp
@@ -132,8 +132,8 @@ VDService* VDService::get()
enum SystemVersion {
SYS_VER_UNSUPPORTED,
- SYS_VER_WIN_XP,
- SYS_VER_WIN_7,
+ SYS_VER_WIN_XP_CLASS, // also Server 2003/R2
+ SYS_VER_WIN_7_CLASS, // also Server 2008/R2 & Vista
};
int supported_system_version()
@@ -146,11 +146,10 @@ int supported_system_version()
vd_printf("GetVersionEx() failed: %u", GetLastError());
return 0;
}
- if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) {
- return SYS_VER_WIN_XP;
- } else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 &&
- osvi.wProductType == VER_NT_WORKSTATION) {
- return SYS_VER_WIN_7;
+ if (osvi.dwMajorVersion == 5 && (osvi.dwMinorVersion == 1 || osvi.dwMinorVersion == 2)) {
+ return SYS_VER_WIN_XP_CLASS;
+ } else if (osvi.dwMajorVersion == 6 && (osvi.dwMinorVersion == 0 || osvi.dwMinorVersion == 1)) {
+ return SYS_VER_WIN_7_CLASS;
}
return 0;
}
@@ -535,9 +534,9 @@ bool VDService::execute()
default:
if (wait_ret == WAIT_OBJECT_0 + _events_count - 1) {
vd_printf("Agent killed");
- if (_system_version == SYS_VER_WIN_XP) {
+ if (_system_version == SYS_VER_WIN_XP_CLASS) {
restart_agent(false);
- } else if (_system_version == SYS_VER_WIN_7) {
+ } else if (_system_version == SYS_VER_WIN_7_CLASS) {
kill_agent();
}
} else {
@@ -805,7 +804,7 @@ bool VDService::launch_agent()
startup_info.cb = sizeof(startup_info);
startup_info.lpDesktop = TEXT("Winsta0\\winlogon");
ZeroMemory(&_agent_proc_info, sizeof(_agent_proc_info));
- if (_system_version == SYS_VER_WIN_XP) {
+ if (_system_version == SYS_VER_WIN_XP_CLASS) {
if (_session_id == 0) {
ret = CreateProcess(_agent_path, _agent_path, NULL, NULL, FALSE, 0, NULL, NULL,
&startup_info, &_agent_proc_info);
@@ -821,7 +820,7 @@ bool VDService::launch_agent()
Sleep(CREATE_PROC_INTERVAL_MS);
}
}
- } else if (_system_version == SYS_VER_WIN_7) {
+ } else if (_system_version == SYS_VER_WIN_7_CLASS) {
startup_info.lpDesktop = TEXT("Winsta0\\default");
ret = create_process_as_user(_session_id, _agent_path, _agent_path, NULL, NULL, FALSE, 0,
NULL, NULL, &startup_info, &_agent_proc_info);