From 889e71c2ac43f22dbd41c0b935acac2e778c8f87 Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 21 Aug 2025 21:23:03 +0200 Subject: runtime: move Windows types and consts to internal/runtime/syscall/windows This CL doesn't change any behavior, it just moves code around to reduce the size of the runtime package and remove some duplicated symbols. Updates #51087. Cq-Include-Trybots: luci.golang.try:gotip-windows-arm64 Change-Id: I3d3e5f214f045c24fb5d4050d56e7b0822a6e4b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/698098 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt --- src/internal/syscall/windows/memory_windows.go | 24 ------------------------ src/internal/syscall/windows/types_windows.go | 5 +++++ 2 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 src/internal/syscall/windows/memory_windows.go (limited to 'src/internal/syscall') diff --git a/src/internal/syscall/windows/memory_windows.go b/src/internal/syscall/windows/memory_windows.go deleted file mode 100644 index 8fb34cf349..0000000000 --- a/src/internal/syscall/windows/memory_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package windows - -type MemoryBasicInformation struct { - // A pointer to the base address of the region of pages. - BaseAddress uintptr - // A pointer to the base address of a range of pages allocated by the VirtualAlloc function. - // The page pointed to by the BaseAddress member is contained within this allocation range. - AllocationBase uintptr - // The memory protection option when the region was initially allocated - AllocationProtect uint32 - PartitionId uint16 - // The size of the region beginning at the base address in which all pages have identical attributes, in bytes. - RegionSize uintptr - // The state of the pages in the region. - State uint32 - // The access protection of the pages in the region. - Protect uint32 - // The type of pages in the region. - Type uint32 -} diff --git a/src/internal/syscall/windows/types_windows.go b/src/internal/syscall/windows/types_windows.go index 3376739143..fe9e41f2f8 100644 --- a/src/internal/syscall/windows/types_windows.go +++ b/src/internal/syscall/windows/types_windows.go @@ -5,6 +5,7 @@ package windows import ( + "internal/runtime/syscall/windows" "syscall" "unsafe" ) @@ -276,3 +277,7 @@ type FILE_COMPLETION_INFORMATION struct { // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfoexw const VER_NT_WORKSTATION = 0x0000001 + +type MemoryBasicInformation = windows.MemoryBasicInformation + +type Context = windows.Context -- cgit v1.3-5-g9baa