CoInitializeSecurity
InitializeSecurity
PSECURITY_DESCRIPTOR pSecurityDescriptor = nullptr; if (ConvertStringSecurityDescriptorToSecurityDescriptor( L"D:(A;;CC;;;S-1-5-32-544)", // DACL string to allow only privileged users SDDL_REVISION_1, &pSecurityDescriptor, nullptr)) { HRESULT hr = CoInitializeSecurity( pSecurityDescriptor, // Security descriptor -1, // Count of entries in the arrays nullptr, // Array of access control entries nullptr, // Reserved RPC_C_AUTHN_LEVEL_PKT_PRIVACY, // Authentication level RPC_C_IMP_LEVEL_IDENTIFY, // Impersonation level nullptr, // Authentication info EOAC_NONE, // Additional capabilities nullptr // Reserved ); if(FAILED(hr)) { // Handle the error // Failed to initialize security return hr; } LocalFree(pSecurityDescriptor); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)