File: sid_test.go

package info (click to toggle)
golang-github-hectane-go-acl 0.0~git20230122.ca0b05c-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (2)
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
//+build windows

package api

import (
	"golang.org/x/sys/windows"

	"testing"
	"unsafe"
)

func TestSIDLookup(t *testing.T) {
	var (
		sid    = make([]byte, SECURITY_MAX_SID_SIZE)
		sidLen = uint32(unsafe.Sizeof(sid))
	)
	if err := CreateWellKnownSid(
		WinNullSid,
		nil,
		(*windows.SID)(unsafe.Pointer(&sid[0])),
		&sidLen,
	); err != nil {
		t.Fatal(err)
	}
}