diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-16 22:49:38 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-16 22:49:38 -0600 |
commit | ba9e364dab402cfc104eb00669f7fdfd9259559e (patch) | |
tree | 8da1081c32cdcf8a1592d6853b2dad4463cdd260 /tun/wintun/memmod/memmod_windows_64.go | |
parent | dfd688b6aa7b044f7e7e0662288c66ee1d56e0e8 (diff) |
wintun: remove memmod option for dll loading
Only wireguard-windows used this, and it's moving to wgnt exclusively.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun/wintun/memmod/memmod_windows_64.go')
-rw-r--r-- | tun/wintun/memmod/memmod_windows_64.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tun/wintun/memmod/memmod_windows_64.go b/tun/wintun/memmod/memmod_windows_64.go deleted file mode 100644 index a53851c..0000000 --- a/tun/wintun/memmod/memmod_windows_64.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build (windows && amd64) || (windows && arm64) - -/* SPDX-License-Identifier: MIT - * - * Copyright (C) 2017-2021 WireGuard LLC. All Rights Reserved. - */ - -package memmod - -import ( - "fmt" - - "golang.org/x/sys/windows" -) - -func (opthdr *IMAGE_OPTIONAL_HEADER) imageOffset() uintptr { - return uintptr(opthdr.ImageBase & 0xffffffff00000000) -} - -func (module *Module) check4GBBoundaries(alignedImageSize uintptr) (err error) { - for (module.codeBase >> 32) < ((module.codeBase + alignedImageSize) >> 32) { - node := &addressList{ - next: module.blockedMemory, - address: module.codeBase, - } - module.blockedMemory = node - module.codeBase, err = windows.VirtualAlloc(0, - alignedImageSize, - windows.MEM_RESERVE|windows.MEM_COMMIT, - windows.PAGE_READWRITE) - if err != nil { - return fmt.Errorf("Error allocating memory block: %w", err) - } - } - return -} |