svn path=/trunk/boinc/; revision=18588

This commit is contained in:
David Anderson 2009-07-08 19:33:27 +00:00
parent ad613d8451
commit 43231a8dbb
2 changed files with 21 additions and 0 deletions

View File

@ -829,3 +829,23 @@ void chdir_to_data_dir() {
if (hkSetupHive) RegCloseKey(hkSetupHive);
if (lpszRegistryValue) free(lpszRegistryValue);
}
// return true if running under remote desktop
// (in which case CUDA apps don't work)
//
bool is_remote_desktop() {
LPTSTR *buf;
DWORD len;
if (WTSQuerySessionInformation(
WTS_CURRENT_SERVER_HANDLE,
WTS_CURRENT_SESSION,
WTSClientProtocolType,
&buf,
&len
)) {
USHORT prot = *(USHORT*) buf;
WTSFreeMemory(buf);
if (prot == 2) return true;
}
return false;
}

View File

@ -30,3 +30,4 @@ extern BOOL GetAccountSid(
);
extern int suspend_or_resume_threads(DWORD pid, bool resume);
extern void chdir_to_data_dir();
extern bool is_remote_desktop();