Skip to content

Commit 2bfb073

Browse files
committed
Updated enums and syscall signatures
1 parent a595933 commit 2bfb073

4 files changed

Lines changed: 41 additions & 41 deletions

File tree

src/internal/syscall/windows/at_windows_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func makeFileNotReadable(t *testing.T, name string) {
131131
Inheritance: windows.SUB_CONTAINERS_AND_OBJECTS_INHERIT,
132132
Trustee: windows.TRUSTEE{
133133
TrusteeForm: windows.TRUSTEE_IS_SID,
134-
Name: (*uint16)(unsafe.Pointer(sid)),
134+
Name: (uintptr)(unsafe.Pointer(sid)),
135135
},
136136
}
137137
}
@@ -142,7 +142,7 @@ func makeFileNotReadable(t *testing.T, name string) {
142142
entryForSid(everyoneSID),
143143
}
144144

145-
var oldAcl, newAcl syscall.Handle
145+
var oldAcl, newAcl *windows.ACL
146146
if err := windows.SetEntriesInAcl(
147147
uint32(len(entries)),
148148
&entries[0],
@@ -160,7 +160,7 @@ func makeFileNotReadable(t *testing.T, name string) {
160160
nil,
161161
nil,
162162
newAcl,
163-
0,
163+
nil,
164164
); err != nil {
165165
t.Fatal(err)
166166
}

src/internal/syscall/windows/syscall_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,5 +581,5 @@ type FILE_MODE_INFORMATION struct {
581581
//sys RtlIsDosDeviceName_U(name *uint16) (ret uint32) = ntdll.RtlIsDosDeviceName_U
582582
//sys NtQueryInformationFile(handle syscall.Handle, iosb *IO_STATUS_BLOCK, inBuffer unsafe.Pointer, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtQueryInformationFile
583583

584-
//sys SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL syscall.Handle, newACL *syscall.Handle) (ret error) = advapi32.SetEntriesInAclW
585-
//sys SetNamedSecurityInfo(objectName string, objectType int32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl syscall.Handle, sacl syscall.Handle) (ret error) = advapi32.SetNamedSecurityInfoW
584+
//sys SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW
585+
//sys SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) = advapi32.SetNamedSecurityInfoW

src/internal/syscall/windows/types_windows.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -305,38 +305,38 @@ const ValidFileFlagsMask = O_FILE_FLAG_OPEN_REPARSE_POINT |
305305
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379636.aspx
306306
type TRUSTEE struct {
307307
MultipleTrustee *TRUSTEE
308-
MultipleTrusteeOperation int32
309-
TrusteeForm int32
310-
TrusteeType int32
311-
Name *uint16
308+
MultipleTrusteeOperation uint32
309+
TrusteeForm uint32
310+
TrusteeType uint32
311+
Name uintptr
312312
}
313313

314314
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379638.aspx
315315
const (
316-
TRUSTEE_IS_SID = iota
317-
TRUSTEE_IS_NAME
318-
TRUSTEE_BAD_FORM
319-
TRUSTEE_IS_OBJECTS_AND_SID
320-
TRUSTEE_IS_OBJECTS_AND_NAME
316+
TRUSTEE_IS_SID = 0x0
317+
TRUSTEE_IS_NAME = 0x1
318+
TRUSTEE_BAD_FORM = 0x2
319+
TRUSTEE_IS_OBJECTS_AND_SID = 0x3
320+
TRUSTEE_IS_OBJECTS_AND_NAME = 0x4
321321
)
322322

323323
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
324324
type EXPLICIT_ACCESS struct {
325325
AccessPermissions uint32
326-
AccessMode int32
326+
AccessMode uint32
327327
Inheritance uint32
328328
Trustee TRUSTEE
329329
}
330330

331331
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa374899.aspx
332332
const (
333-
NOT_USED_ACCESS = iota
334-
GRANT_ACCESS
335-
SET_ACCESS
336-
DENY_ACCESS
337-
REVOKE_ACCESS
338-
SET_AUDIT_SUCCESS
339-
SET_AUDIT_FAILURE
333+
NOT_USED_ACCESS = 0x0
334+
GRANT_ACCESS = 0x1
335+
SET_ACCESS = 0x2
336+
DENY_ACCESS = 0x3
337+
REVOKE_ACCESS = 0x4
338+
SET_AUDIT_SUCCESS = 0x5
339+
SET_AUDIT_FAILURE = 0x6
340340
)
341341

342342
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
@@ -351,20 +351,20 @@ const (
351351

352352
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379593.aspx
353353
const (
354-
SE_UNKNOWN_OBJECT_TYPE = iota
355-
SE_FILE_OBJECT
356-
SE_SERVICE
357-
SE_PRINTER
358-
SE_REGISTRY_KEY
359-
SE_LMSHARE
360-
SE_KERNEL_OBJECT
361-
SE_WINDOW_OBJECT
362-
SE_DS_OBJECT
363-
SE_DS_OBJECT_ALL
364-
SE_PROVIDER_DEFINED_OBJECT
365-
SE_WMIGUID_OBJECT
366-
SE_REGISTRY_WOW64_32KEY
367-
SE_REGISTRY_WOW64_64KEY
354+
SE_UNKNOWN_OBJECT_TYPE = 0x0
355+
SE_FILE_OBJECT = 0x1
356+
SE_SERVICE = 0x2
357+
SE_PRINTER = 0x3
358+
SE_REGISTRY_KEY = 0x4
359+
SE_LMSHARE = 0x5
360+
SE_KERNEL_OBJECT = 0x6
361+
SE_WINDOW_OBJECT = 0x7
362+
SE_DS_OBJECT = 0x8
363+
SE_DS_OBJECT_ALL = 0x9
364+
SE_PROVIDER_DEFINED_OBJECT = 0xa
365+
SE_WMIGUID_OBJECT = 0xb
366+
SE_REGISTRY_WOW64_32KEY = 0xc
367+
SE_REGISTRY_WOW64_64KEY = 0xd
368368
)
369369

370370
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/23e75ca3-98fd-4396-84e5-86cd9d40d343

src/internal/syscall/windows/zsyscall_windows.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)