]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix Microsoft links
authorqmuntal <quimmuntal@gmail.com>
Tue, 12 Sep 2023 12:48:12 +0000 (14:48 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 12 Sep 2023 16:42:41 +0000 (16:42 +0000)
This CL fixes the links to Microsoft documentation in the Go source
code. Some links were broken and some others were outdated.

Change-Id: I4c3bcd3aa3c07a31be1b7f94c25339dcc2e771e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/527556
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Auto-Submit: Quim Muntal <quimmuntal@gmail.com>

13 files changed:
src/archive/zip/struct.go
src/cmd/dist/sys_windows.go
src/cmd/go/internal/fsys/fsys.go
src/internal/syscall/windows/registry/key.go
src/internal/syscall/windows/reparse_windows.go
src/os/os_windows_test.go
src/os/path_windows.go
src/os/user/lookup_windows.go
src/runtime/race_amd64.s
src/runtime/sys_windows_amd64.s
src/syscall/security_windows.go
src/syscall/syscall_windows.go
src/syscall/types_windows.go

index bdcc45c7293f56b780ca3a2c3173b59782599266..165ad44caff783d8ce7c3c2dfaac44b79a5a8cda 100644 (file)
@@ -245,7 +245,7 @@ func timeZone(offset time.Duration) *time.Location {
 
 // msDosTimeToTime converts an MS-DOS date and time into a time.Time.
 // The resolution is 2s.
-// See: https://msdn.microsoft.com/en-us/library/ms724247(v=VS.85).aspx
+// See: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-dosdatetimetofiletime
 func msDosTimeToTime(dosDate, dosTime uint16) time.Time {
        return time.Date(
                // date bits 0-4: day of month; 5-8: month; 9-15: years since 1980
@@ -265,7 +265,7 @@ func msDosTimeToTime(dosDate, dosTime uint16) time.Time {
 
 // timeToMsDosTime converts a time.Time to an MS-DOS date and time.
 // The resolution is 2s.
-// See: https://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx
+// See: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-filetimetodosdatetime
 func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) {
        fDate = uint16(t.Day() + int(t.Month())<<5 + (t.Year()-1980)<<9)
        fTime = uint16(t.Second()/2 + t.Minute()<<5 + t.Hour()<<11)
index 265f729d0fc345611f27e25037a955f9bc1fca17..37dffb8541447eaf4f962d9f998160030069e997 100644 (file)
@@ -14,7 +14,7 @@ var (
        procGetSystemInfo = modkernel32.NewProc("GetSystemInfo")
 )
 
-// see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx
+// see https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
 type systeminfo struct {
        wProcessorArchitecture      uint16
        wReserved                   uint16
@@ -29,7 +29,7 @@ type systeminfo struct {
        wProcessorRevision          uint16
 }
 
-// See https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
+// See https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
 const (
        PROCESSOR_ARCHITECTURE_AMD64 = 9
        PROCESSOR_ARCHITECTURE_INTEL = 0
index b83c5a3202b70cef6b4e2af52d10cd3c749c7adc..06159dbbb7343215b01618dd81627e0de03e80c8 100644 (file)
@@ -690,7 +690,7 @@ func volumeNameLen(path string) int {
        if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') {
                return 2
        }
-       // is it UNC? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
+       // is it UNC? https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file
        if l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) &&
                !isSlash(path[2]) && path[2] != '.' {
                // first, leading `\\` and next shouldn't be `\`. its server name.
index ce6397f1e29c7dde3be1e9f21fc9172e70cf0c4c..b95fa8d3326e39bff771415f94084ae250096d54 100644 (file)
@@ -31,7 +31,7 @@ import (
 
 const (
        // Registry key security and access rights.
-       // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878.aspx
+       // See https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-key-security-and-access-rights
        // for details.
        ALL_ACCESS         = 0xf003f
        CREATE_LINK        = 0x00020
@@ -98,7 +98,7 @@ func (k Key) ReadSubKeyNames() ([]string, error) {
 
        names := make([]string, 0)
        // Registry key size limit is 255 bytes and described there:
-       // https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx
+       // https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-element-size-limits
        buf := make([]uint16, 256) //plus extra room for terminating zero byte
 loopItems:
        for i := uint32(0); ; i++ {
index 6e111392f09169d174f00f9d38c2d62538ca7832..a5bc4963c21a9ba637bb6521f2842a62dee9206b 100644 (file)
@@ -17,8 +17,8 @@ const (
 )
 
 // These structures are described
-// in https://msdn.microsoft.com/en-us/library/cc232007.aspx
-// and https://msdn.microsoft.com/en-us/library/cc232006.aspx.
+// in https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ca069dad-ed16-42aa-b057-b6b207f447cc
+// and https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/b41f1cbf-10df-4a47-98d4-1c52a833d913.
 
 type REPARSE_DATA_BUFFER struct {
        ReparseTag        uint32
index 90c1eabd962775aad8c715e60c7a35b913298101..f8edaeb87606b2507681de13f7bdac6a6c503a34 100644 (file)
@@ -281,7 +281,7 @@ func TestDirectoryJunction(t *testing.T) {
                        },
                },
                {
-                       // Do as junction utility https://technet.microsoft.com/en-au/sysinternals/bb896768.aspx does - set PrintNameLength to 0.
+                       // Do as junction utility https://learn.microsoft.com/en-us/sysinternals/downloads/junction does - set PrintNameLength to 0.
                        name: "have_blank_print_name",
                        mklink: func(link, target string) error {
                                var t reparseData
@@ -885,7 +885,7 @@ func main() {
                ` \\\\\""x"""y z`,
                "\tb\t\"x\ty\"",
                ` "Брад" d e`,
-               // examples from https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
+               // examples from https://learn.microsoft.com/en-us/cpp/cpp/main-function-command-line-args
                ` "abc" d e`,
                ` a\\b d"e f"g h`,
                ` a\\\"b c d`,
index ec9a87274de6d882d84efd88e2b4397bdd9f8a53..052202514825ec315be0f5e41b7ef5f92244b534 100644 (file)
@@ -139,7 +139,7 @@ var canUseLongPaths bool
 // or contains .. elements), or is short enough, fixLongPath returns
 // path unmodified.
 //
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
+// See https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
 func fixLongPath(path string) string {
        if canUseLongPaths {
                return path
index e64b8ae0286f99e50cbf91bc0c46c710415764f6..a48fc89720b1cb35e1956d7db64160d2de34fc65 100644 (file)
@@ -116,7 +116,7 @@ func lookupGroupName(groupname string) (string, error) {
        if e != nil {
                return "", e
        }
-       // https://msdn.microsoft.com/en-us/library/cc245478.aspx#gt_0387e636-5654-4910-9519-1f8326cf5ec0
+       // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-samr/7b2aeb27-92fc-41f6-8437-deb65d950921#gt_0387e636-5654-4910-9519-1f8326cf5ec0
        // SidTypeAlias should also be treated as a group type next to SidTypeGroup
        // and SidTypeWellKnownGroup:
        // "alias object -> resource group: A group object..."
@@ -145,7 +145,7 @@ func listGroupsForUsernameAndDomain(username, domain string) ([]string, error) {
        }
        var p0 *byte
        var entriesRead, totalEntries uint32
-       // https://msdn.microsoft.com/en-us/library/windows/desktop/aa370655(v=vs.85).aspx
+       // https://learn.microsoft.com/en-us/windows/win32/api/lmaccess/nf-lmaccess-netusergetlocalgroups
        // NetUserGetLocalGroups() would return a list of LocalGroupUserInfo0
        // elements which hold the names of local groups where the user participates.
        // The list does not follow any sorting order.
@@ -255,7 +255,7 @@ func lookupUserPrimaryGroup(username, domain string) (string, error) {
        //
        // The correct way to obtain the primary group of a domain user is
        // probing the user primaryGroupID attribute in the server Active Directory:
-       // https://msdn.microsoft.com/en-us/library/ms679375(v=vs.85).aspx
+       // https://learn.microsoft.com/en-us/windows/win32/adschema/a-primarygroupid
        //
        // Note that the primary group of domain users should not be modified
        // on Windows for performance reasons, even if it's possible to do that.
index 4fa130e8613703275e2959937f5983c524a9904a..45c1255509c8fbaf8bc953959302268c75701393 100644 (file)
@@ -24,7 +24,7 @@
 // Arguments are passed in CX, DX, R8, R9, the rest is on stack.
 // Callee-saved registers are: BX, BP, DI, SI, R12-R15.
 // SP must be 16-byte aligned. Windows also requires "stack-backing" for the 4 register arguments:
-// https://msdn.microsoft.com/en-us/library/ms235286.aspx
+// https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention
 // We do not do this, because it seems to be intended for vararg/unprototyped functions.
 // Gcc-compiled race runtime does not try to use that space.
 
index 4a14b45c63159bd69d0b811010ec32223fc3442a..7a7905e56a3a8f8bf9f2f551e7d9ce2f30b1ae20 100644 (file)
@@ -58,7 +58,7 @@ loadregs:
        // Floating point arguments are passed in the XMM
        // registers. Set them here in case any of the arguments
        // are floating point values. For details see
-       //      https://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
+       //      https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170
        MOVQ    CX, X0
        MOVQ    DX, X1
        MOVQ    R8, X2
index 00dc920974456c783335658ae7c0fc4ead04001e..4e988c418a326fb57969db79f173d5aad005e7db 100644 (file)
@@ -30,7 +30,7 @@ const (
 )
 
 // This function returns 1 byte BOOLEAN rather than the 4 byte BOOL.
-// https://blogs.msdn.com/b/drnick/archive/2007/12/19/windows-and-upn-format-credentials.aspx
+// https://learn.microsoft.com/en-gb/archive/blogs/drnick/windows-and-upn-format-credentials
 //sys  TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.TranslateNameW
 //sys  GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.GetUserNameExW
 
index 28091f769055645c13cc35ed7f59c5ebab1d4e21..8229e252d9e8e0ecfe161a57b18979b7fed76844 100644 (file)
@@ -475,7 +475,7 @@ var procSetFilePointerEx = modkernel32.NewProc("SetFilePointerEx")
 const ptrSize = unsafe.Sizeof(uintptr(0))
 
 // setFilePointerEx calls SetFilePointerEx.
-// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365542(v=vs.85).aspx
+// See https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfilepointerex
 func setFilePointerEx(handle Handle, distToMove int64, newFilePointer *int64, whence uint32) error {
        var e1 Errno
        if unsafe.Sizeof(uintptr(0)) == 8 {
index 384b5b4f2c1f6ce12361d0c9aa5fb7bf685222cb..b338ec47001f850c9ecca012f466e7a4276a48fc 100644 (file)
@@ -586,7 +586,7 @@ const (
        SIO_KEEPALIVE_VALS                 = IOC_IN | IOC_VENDOR | 4
        SIO_UDP_CONNRESET                  = IOC_IN | IOC_VENDOR | 12
 
-       // cf. https://support.microsoft.com/default.aspx?scid=kb;en-us;257460
+       // cf. https://learn.microsoft.com/en-US/troubleshoot/windows/win32/header-library-requirement-socket-ipproto-ip
 
        IP_TOS             = 0x3
        IP_TTL             = 0x4