Skip to content

Commit 9d1e666

Browse files
committed
AttachConsole function.
1 parent de62721 commit 9d1e666

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Native FFI items currently implemented:
2525
| Native FFI item | Count |
2626
| - | -: |
2727
| Handles | 32 |
28-
| Functions | 675 |
28+
| Functions | 676 |
2929
| COM interfaces | 78 |
3030
| COM methods | 534 |
3131
| Const types | 417 |

win/kernel_funcs.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ func AllocConsole() error {
4040

4141
var _kernel_AllocConsole *syscall.Proc
4242

43+
// [AttachConsole] function.
44+
//
45+
// [AttachConsole]: https://learn.microsoft.com/en-us/windows/console/attachconsole
46+
func AttachConsole(processId int) error {
47+
ret, _, err := syscall.SyscallN(
48+
dll.Kernel.Load(&_kernel_AttachConsole, "AttachConsole"),
49+
uintptr(uint32(processId)))
50+
return utl.ZeroAsGetLastError(ret, err)
51+
}
52+
53+
var _kernel_AttachConsole *syscall.Proc
54+
4355
// [CompareFileTime] function.
4456
//
4557
// [CompareFileTime]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-comparefiletime

0 commit comments

Comments
 (0)