mirror of https://github.com/BOINC/boinc.git
svn path=/trunk/boinc/; revision=18588
This commit is contained in:
parent
ad613d8451
commit
43231a8dbb
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue