void CreateIpcName() { ZeroMemory(krnlobjsddl, sizeof(krnlobjsddl)); ZeroMemory(mgrpipename, sizeof(mgrpipename)); ZeroMemory(mgrmutexname, sizeof(mgrmutexname)); LPWSTR pszUserSid = nullptr; if(GetUserSid(&pszUserSid)) { // SDDL_ALL_APP_PACKAGES / SDDL_RESTRICTED_CODE / SDDL_LOCAL_SYSTEM / SDDL_BUILTIN_ADMINISTRATORS / User SID _snwprintf_s(krnlobjsddl, _TRUNCATE, L"D:%s(A;;GA;;;RC)(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;%s)", (IsWindowsVersion62OrLater() ? L"(A;;GA;;;AC)" : L""), pszUserSid); // (SDDL_MANDATORY_LABEL, SDDL_NO_WRITE_UP, SDDL_ML_LOW) wcsncat_s(krnlobjsddl, L"S:(ML;;NW;;;LW)", _TRUNCATE); LocalFree(pszUserSid); } LPWSTR pszUserUUID = nullptr; if(GetUserUUID(&pszUserUUID)) { _snwprintf_s(mgrpipename, _TRUNCATE, L"%s%s", IMCRVMGRPIPE, pszUserUUID); _snwprintf_s(mgrmutexname, _TRUNCATE, L"%s%s", IMCRVMGRMUTEX, pszUserUUID); LocalFree(pszUserUUID); } }
void CreateIpcName() { ZeroMemory(cnfmutexname, sizeof(cnfmutexname)); LPWSTR pszUserUUID = nullptr; if(GetUserUUID(&pszUserUUID)) { _snwprintf_s(cnfmutexname, _TRUNCATE, L"%s%s", IMCRVCNFMUTEX, pszUserUUID); LocalFree(pszUserUUID); } }