mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
20 lines
436 B
C++
20 lines
436 B
C++
|
|
#include "naming.h"
|
||
|
|
|
||
|
|
#include "username.h"
|
||
|
|
|
||
|
|
std::wstring ObtainStableGlobalNameForKernelObject(const std::wstring_view name, const bool restricted)
|
||
|
|
{
|
||
|
|
static const std::optional<std::wstring> username = ObtainActiveUserName();
|
||
|
|
std::wstring result = L"Global\\";
|
||
|
|
if (restricted)
|
||
|
|
{
|
||
|
|
result += L"Restricted\\";
|
||
|
|
}
|
||
|
|
if (username)
|
||
|
|
{
|
||
|
|
result += *username;
|
||
|
|
}
|
||
|
|
result += name;
|
||
|
|
return result;
|
||
|
|
}
|