Remove unnecessary type conversions.

This commit is contained in:
Martin Smith committed 2025-03-22 18:20:30 +00:00
1 parent 2099ec1cd6
commit 092899df8b
17 files changed
+30 -30

No files matched your search

+1 -1
View File
@@ -150,7 +150,7 @@ func getFileEA(handle windows.Handle, iosb *ioStatusBlock, buf *uint8, bufLen ui
if restartScan {
_p1 = 1
}
r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(buf)), uintptr(bufLen), uintptr(_p0), uintptr(eaList), uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1))
r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(buf)), uintptr(bufLen), uintptr(_p0), eaList, uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1))
status = ntStatus(r0)
return
}
+1 -1
View File
@@ -105,7 +105,7 @@ func clearAttribute(path string, attribute uint32) error {
}
if fileAttributes&attribute != 0 {
// Clear the attribute
fileAttributes &= ^uint32(attribute)
fileAttributes &= ^attribute
err = windows.SetFileAttributes(ptr, fileAttributes)
if err != nil {
return err
+1 -1
View File
@@ -211,6 +211,6 @@ func securityDescriptorBytesToStruct(sd []byte) (*windows.SECURITY_DESCRIPTOR, e
// securityDescriptorStructToBytes converts the pointer to windows SECURITY_DESCRIPTOR
// into a security descriptor bytes representation.
func securityDescriptorStructToBytes(sd *windows.SECURITY_DESCRIPTOR) ([]byte, error) {
b := unsafe.Slice((*byte)(unsafe.Pointer(sd)), sd.Length())
b := unsafe.Slice(unsafe.Pointer(sd), sd.Length())
return b, nil
}