00001 00007 #pragma once 00008 00010 class PermissiveSecurityDescriptor 00011 { 00012 private: 00013 SECURITY_DESCRIPTOR m_SD; 00014 SECURITY_ATTRIBUTES m_SA; 00015 bool m_Used; 00016 public: 00017 PermissiveSecurityDescriptor() 00018 : m_Used(false) 00019 { 00020 InitializeSecurityDescriptor (&m_SD, SECURITY_DESCRIPTOR_REVISION); 00021 SetSecurityDescriptorDacl (&m_SD, TRUE, NULL, FALSE); 00022 m_SA.nLength = sizeof(m_SA); 00023 m_SA.lpSecurityDescriptor = &m_SD; 00024 m_SA.bInheritHandle = FALSE; 00025 } 00026 00027 operator SECURITY_ATTRIBUTES *() 00028 { 00029 m_Used = true; 00030 return &m_SA; 00031 } 00032 00033 ~PermissiveSecurityDescriptor() 00034 { 00035 ASSERT(m_Used); 00036 } 00037 };