Add SECURITY_ATTRIBUTES wrapper

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
2022-03-10 14:51:29 +01:00
parent 6a8310a9e7
commit 7defbb8cab
5 changed files with 143 additions and 1 deletions

26
UnitTests/SDDL.cpp Normal file
View File

@@ -0,0 +1,26 @@
/*
SPDX-License-Identifier: MIT
Copyright © 2022 Amebis
*/
#include "pch.h"
using namespace std;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTests
{
TEST_CLASS(SDDL)
{
public:
TEST_METHOD(security_attributes)
{
winstd::security_attributes sa;
Assert::IsTrue(ConvertStringSecurityDescriptorToSecurityDescriptorW(L"O:BAD:PAI(A;;FA;;;BA)", SDDL_REVISION_1, sa, NULL));
Assert::IsNotNull(sa.lpSecurityDescriptor);
winstd::security_attributes sa2(move(sa));
Assert::IsNull(sa.lpSecurityDescriptor);
Assert::IsNotNull(sa2.lpSecurityDescriptor);
}
};
}