-
Notifications
You must be signed in to change notification settings - Fork 7
/
winapi.go
40 lines (33 loc) · 1.18 KB
/
winapi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2015 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.
// +build windows
package winapi
type MEMORYSTATUSEX struct {
Length uint32
MemoryLoad uint32
TotalPhys uint64
AvailPhys uint64
TotalPageFile uint64
AvailPageFile uint64
TotalVirtual uint64
AvailVirtual uint64
AvailExtendedVirtual uint64
}
//sys GlobalMemoryStatusEx(buf *MEMORYSTATUSEX) (err error) = kernel32.GlobalMemoryStatusEx
//sys GetProcessHandleCount(process syscall.Handle, handleCount *uint32) (err error) = kernel32.GetProcessHandleCount
type OSVERSIONINFOEX struct {
OSVersionInfoSize uint32
MajorVersion uint32
MinorVersion uint32
BuildNumber uint32
PlatformId uint32
CSDVersion [128]uint16
ServicePackMajor uint16
ServicePackMinor uint16
SuiteMask uint16
ProductType byte
Reserved byte
}
//sys GetVersionEx(versioninfo *OSVERSIONINFOEX) (err error) = kernel32.GetVersionExW
//sys CopyFile(existingName *uint16, newName *uint16, failIfExists bool) (err error) = kernel32.CopyFileW