| 69 | } |
| 70 | |
| 71 | static bool getProcessOwnerSids(std::wstring& ownerSidStr, std::wstring& groupSidStr) { |
| 72 | PSID ownerSid = nullptr; |
| 73 | PSID groupSid = nullptr; |
| 74 | PSECURITY_DESCRIPTOR sd = nullptr; |
| 75 | DWORD ret = ::GetSecurityInfo(::GetCurrentProcess(), |
| 76 | SE_KERNEL_OBJECT, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION, |
| 77 | &ownerSid, &groupSid, nullptr, nullptr, &sd); |
| 78 | if (ret == ERROR_SUCCESS) { |
| 79 | // FIXME: Do we need to free the SIDs here? |
| 80 | ownerSidStr = sidToStr(ownerSid); |
| 81 | groupSidStr = sidToStr(groupSid); |
| 82 | ::LocalFree(sd); |
| 83 | return true; |
| 84 | } |
| 85 | return false; |
| 86 | } |
| 87 | |
| 88 | PipeSecurityAttributes::PipeSecurityAttributes(): |
| 89 | securittyDescriptor_(nullptr) { |
no test coverage detected