MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / createPipe

Function createPipe

pkg/handle/object_test.go:55–69  ·  view source on GitHub ↗

createPipe is mainly borrowed from: https://github.com/natefinch/npipe for testing purposes.

(address string, first bool)

Source from the content-addressed store, hash-verified

53
54// createPipe is mainly borrowed from: https://github.com/natefinch/npipe for testing purposes.
55func createPipe(address string, first bool) (syscall.Handle, error) {
56 n, err := syscall.UTF16PtrFromString(address)
57 if err != nil {
58 return 0, err
59 }
60 mode := uint32(0x3 | syscall.FILE_FLAG_OVERLAPPED)
61 if first {
62 mode |= 0x00080000
63 }
64 return createNamedPipe(n,
65 mode,
66 0x0,
67 255,
68 512, 512, 0, nil)
69}
70
71func TestQueryType(t *testing.T) {
72 h, err := windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, uint32(os.Getpid()))

Callers 2

TestTimeoutFunction · 0.85
TestQueryNamedPipeFunction · 0.85

Calls 1

createNamedPipeFunction · 0.85

Tested by

no test coverage detected