diff options
| author | Stefan Boberg <[email protected]> | 2021-09-18 11:26:46 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-18 11:26:46 +0200 |
| commit | 60898b9fcc57bdc0408f6a48de161a7989b91957 (patch) | |
| tree | 72f9d143ef12d3b32e34c9d3fd59777af3eb4abe /zenutil/zenserverprocess.cpp | |
| parent | Eliminated some redundant logger configuration (diff) | |
| download | zen-60898b9fcc57bdc0408f6a48de161a7989b91957.tar.xz zen-60898b9fcc57bdc0408f6a48de161a7989b91957.zip | |
Simplified AnyUserSecurityAttributes helper
Diffstat (limited to 'zenutil/zenserverprocess.cpp')
| -rw-r--r-- | zenutil/zenserverprocess.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/zenutil/zenserverprocess.cpp b/zenutil/zenserverprocess.cpp index c6bee1ed7..9e370ae10 100644 --- a/zenutil/zenserverprocess.cpp +++ b/zenutil/zenserverprocess.cpp @@ -40,20 +40,16 @@ namespace zenutil { m_Attributes.nLength = sizeof m_Attributes; m_Attributes.bInheritHandle = false; // Disable inheritance - const BOOL success = InitializeSecurityDescriptor(&m_Sd, SECURITY_DESCRIPTOR_REVISION); + const BOOL Success = InitializeSecurityDescriptor(&m_Sd, SECURITY_DESCRIPTOR_REVISION); - if (success) + if (Success) { - const BOOL bSetOk = SetSecurityDescriptorDacl(&m_Sd, TRUE, (PACL)NULL, FALSE); - - if (bSetOk) - { - m_Attributes.lpSecurityDescriptor = &m_Sd; - } - else + if (!SetSecurityDescriptorDacl(&m_Sd, TRUE, (PACL)NULL, FALSE)) { zen::ThrowLastError("SetSecurityDescriptorDacl failed", std::source_location::current()); } + + m_Attributes.lpSecurityDescriptor = &m_Sd; } } }; |