-USING: alien alien.c-types kernel libc math namespaces
-hardware-info.backend windows windows.advapi32 windows.kernel32
-;
+USING: alien alien.c-types hardware-info.windows.backend
+kernel libc math namespaces hardware-info.backend
+windows windows.advapi32 windows.kernel32 ;
IN: hardware-info.windows.nt
+ TUPLE: winnt ;
+
T{ winnt } os set-global
+ : system-info ( -- SYSTEM_INFO )
+ "SYSTEM_INFO" <c-object> [ GetSystemInfo ] keep ;
+
+ M: winnt cpus ( -- n )
+ system-info SYSTEM_INFO-dwNumberOfProcessors ;
+
: memory-status ( -- MEMORYSTATUSEX )
"MEMORYSTATUSEX" <c-object>
"MEMORYSTATUSEX" heap-size over set-MEMORYSTATUSEX-dwLength
USING: alien alien.c-types kernel libc math namespaces
windows windows.kernel32 windows.advapi32
-words combinators vocabs.loader hardware-info.backend
-system ;
+hardware-info.windows.backend
+words combinators vocabs.loader hardware-info.backend ;
IN: hardware-info.windows
- USE: system
-
: system-info ( -- SYSTEM_INFO )
"SYSTEM_INFO" <c-object> [ GetSystemInfo ] keep ;