Skip to content

Commit c27269d

Browse files
committed
Don't panic if GetPhysicallyInstalledSystemMemory is not available (before Vista)
1 parent 712da40 commit c27269d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

kernel32.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ func init() {
142142
mulDiv = MustGetProcAddress(libkernel32, "MulDiv")
143143
setLastError = MustGetProcAddress(libkernel32, "SetLastError")
144144
systemTimeToFileTime = MustGetProcAddress(libkernel32, "SystemTimeToFileTime")
145-
getPhysicallyInstalledSystemMemory = MustGetProcAddress(libkernel32, "GetPhysicallyInstalledSystemMemory")
146-
145+
getPhysicallyInstalledSystemMemory, _ = syscall.GetProcAddress(syscall.Handle(libkernel32), "GetPhysicallyInstalledSystemMemory")
147146
}
148147

149148
func CloseHandle(hObject HANDLE) bool {

syslink.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const (
1010
INVALID_LINK_INDEX = -1
1111
MAX_LINKID_TEXT = 48
1212
L_MAX_URL_LENGTH = 2048 + 32 + len("://")
13-
WC_LINK = "SysLink"
13+
WC_LINK = "SysLink"
1414
)
1515

1616
const (

0 commit comments

Comments
 (0)