SystemInfo structv0.1.0
What GetSystemInfo reports about the machine.
pub struct SystemInfo {
pub processorArchitecture: uint32;
pub pageSize: uint32;
pub minimumApplicationAddress: *var opaque;
pub maximumApplicationAddress: *var opaque;
pub activeProcessorMask: uint64;
pub numberOfProcessors: uint32;
pub processorType: uint32;
pub allocationGranularity: uint32;
pub processorLevel: uint16;
pub processorRevision: uint16;
}
The two granularities are not the same and the difference matters: pageSize is what protection is applied at,
while allocationGranularity is what a reservation's base address is rounded to, and on every Windows release it
is 64 KiB rather than a page. A reservation therefore wastes address space that a page-granular system would not.
Fields
| Name | Type | Description |
|---|---|---|
processorArchitecture | uint32 | The processor architecture, such as PROCESSOR_ARCHITECTURE_AMD64, in the low 16 bits. The field is a union in C whose upper 16 bits are reserved, so the architecture is (processorArchitecture & 0xFFFF) as uint16. |
pageSize | uint32 | The size of a page, which is what memory protection is applied at. |
minimumApplicationAddress | *var opaque | The lowest address an application may have. |
maximumApplicationAddress | *var opaque | The highest address an application may have. |
activeProcessorMask | uint64 | A mask of the processors this process may run on. |
numberOfProcessors | uint32 | How many logical processors the machine has in the calling process's processor group. |
processorType | uint32 | The processor type, obsolete; read processorArchitecture instead. |
allocationGranularity | uint32 | The granularity a reservation's base address is rounded to, which is not the page size. |
processorLevel | uint16 | The processor level, which depends on the architecture: the family on x86-64. |
processorRevision | uint16 | The processor revision, which depends on the architecture: the model and stepping on x86-64. |
Related
GetSystemInfo
pub extern func GetSystemInfo(info: *var SystemInfo)
Reads what the system reports about the machine, including its page size. Cannot fail and reports nothing: the structure is always filled.
See also: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsysteminfo
Parameters
| Name | Type | Description |
|---|---|---|
info | *var SystemInfo | receives the system information |