createPipe is mainly borrowed from: https://github.com/natefinch/npipe for testing purposes.
(address string, first bool)
| 53 | |
| 54 | // createPipe is mainly borrowed from: https://github.com/natefinch/npipe for testing purposes. |
| 55 | func 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 | |
| 71 | func TestQueryType(t *testing.T) { |
| 72 | h, err := windows.OpenProcess(windows.PROCESS_QUERY_INFORMATION, false, uint32(os.Getpid())) |
no test coverage detected