-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathtypes_windows.go
More file actions
76 lines (64 loc) · 1.85 KB
/
types_windows.go
File metadata and controls
76 lines (64 loc) · 1.85 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package credman
import (
"time"
"unsafe"
syscall "golang.org/x/sys/windows"
)
const (
CredTypeGeneric CredentialType = 0x1
)
// Credential is the basic credential structure.
// A credential is identified by its target name.
// The actual credential secret is available in the CredentialBlob field.
type Credential struct {
TargetName string
Comment string
LastWritten time.Time
CredentialBlob []byte
TargetAlias string
UserName string
Persist CredentialPersistence
}
// CredentialPersistence describes one of three persistence modes of a credential.
// A detailed description of the available modes can be found on:
//
// https://learn.microsoft.com/windows/win32/api/wincred/ns-wincred-credentiala
type CredentialPersistence uint32
const (
// PersistSession indicates that the credential only persists for the life
// of the current Windows login session. Such a credential is not visible in
// any other logon session, even from the same user.
PersistSession CredentialPersistence = 0x1
)
// CredentialAttribute represents an application-specific attribute of a credential.
type CredentialAttribute struct {
Keyword string
Value []byte
}
// Interface for syscall.Proc
type proc interface {
Call(a ...uintptr) (r1, r2 uintptr, lastErr error)
}
type CREDENTIAL struct {
Flags uint32
Type uint32
TargetName *uint16
Comment *uint16
LastWritten syscall.Filetime
CredentialBlobSize uint32
CredentialBlob unsafe.Pointer
Persist uint32
AttributeCount uint32
Attributes uintptr
TargetAlias *uint16
UserName *uint16
}
type CREDENTIAL_ATTRIBUTE struct {
Keyword *uint16
Flags uint32
ValueSize uint32
Value uintptr
}
type CredentialType uint32