mirror of
https://github.com/debauchee/barrier.git
synced 2025-08-06 10:09:28 +02:00
Auto elevate for Windows UAC and screen lock #4130
This commit is contained in:
parent
4d3fd14ada
commit
d2191b6b93
12 changed files with 352 additions and 54 deletions
|
@ -171,3 +171,21 @@ CMSWindowsSession::nextProcessEntry(HANDLE snapshot, LPPROCESSENTRY32 entry)
|
|||
|
||||
return gotEntry;
|
||||
}
|
||||
|
||||
CString
|
||||
CMSWindowsSession::getActiveDesktopName()
|
||||
{
|
||||
CString result;
|
||||
|
||||
HDESK hd = OpenInputDesktop(0, TRUE, GENERIC_READ);
|
||||
if (hd != NULL) {
|
||||
DWORD size;
|
||||
GetUserObjectInformation(hd, UOI_NAME, NULL, 0, &size);
|
||||
TCHAR* name = (TCHAR*)alloca(size + sizeof(TCHAR));
|
||||
GetUserObjectInformation(hd, UOI_NAME, name, size, &size);
|
||||
result = name;
|
||||
CloseDesktop(hd);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue