diff --git a/README.md b/README.md index 71620774..7474b4f0 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Alternatively, `golangci-lint` can be [installed locally][lint-install] and run ### Go Generate -The pipeline checks that auto-generated code, via `go generate`, be up to date. +The pipeline checks that auto-generated code, via `go generate`, are up to date. This can be done for the entire repo: diff --git a/backup.go b/backup.go index 53fbac7e..09621c88 100644 --- a/backup.go +++ b/backup.go @@ -39,7 +39,7 @@ const ( //nolint:revive // var-naming: ALL_CAPS const ( WRITE_DAC = windows.WRITE_DAC - WRITE_OWNER = windows.WRITE_DAC + WRITE_OWNER = windows.WRITE_OWNER ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY ) diff --git a/backup_test.go b/backup_test.go index afd26c02..112726e6 100644 --- a/backup_test.go +++ b/backup_test.go @@ -8,6 +8,8 @@ import ( "os" "syscall" "testing" + + "golang.org/x/sys/windows" ) var testFileName string @@ -200,12 +202,7 @@ func makeSparseFile() error { } defer f.Close() - const ( - fsctlSetSparse = 0x000900c4 - fsctlSetZeroData = 0x000980c8 - ) - - err = syscall.DeviceIoControl(syscall.Handle(f.Fd()), fsctlSetSparse, nil, 0, nil, 0, nil, nil) + err = syscall.DeviceIoControl(syscall.Handle(f.Fd()), windows.FSCTL_SET_SPARSE, nil, 0, nil, 0, nil, nil) if err != nil { return err } diff --git a/hvsock_go118_test.go b/hvsock_go118_test.go new file mode 100644 index 00000000..dd529146 --- /dev/null +++ b/hvsock_go118_test.go @@ -0,0 +1,88 @@ +//go:build windows && go1.18 + +package winio + +import ( + "errors" + "fmt" + "testing" + "time" +) + +func FuzzHvSockRxTx(f *testing.F) { + for _, b := range [][]byte{ + []byte("hello?"), + []byte("This is a really long string that should be a good example of the really long " + + "payloads that may be sent over hvsockets when really long inputs are being used, tautologically. " + + "That means that we will have to test with really long input sequences, which means that " + + "we need to include really long byte sequences or strings in our testing so that we know that " + + "the sockets can deal with really long inputs. Look at this key mashing: " + + "sdflhsdfgkjdhskljjsad;kljfasd;lfkjsadl ;fasdjfopiwej09q34iur092\"i4o[piwajfliasdkf-012ior]-" + + "01oi3;'lSD