1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
//+build windows
package api
import (
"golang.org/x/sys/windows"
"testing"
)
func TestSetEntriesInAcl(t *testing.T) {
var (
entries = []ExplicitAccess{
{
AccessPermissions: windows.GENERIC_READ,
AccessMode: GRANT_ACCESS,
Inheritance: NO_INHERITANCE,
Trustee: Trustee{
TrusteeForm: TRUSTEE_IS_NAME,
Name: windows.StringToUTF16Ptr("CURRENT_USER"),
},
},
}
acl windows.Handle
)
if err := SetEntriesInAcl(
entries,
0,
&acl,
); err != nil {
t.Fatal(err)
}
defer windows.LocalFree(acl)
}
|