The SYSTEM_INFO structure is suppose to contain the member contained in the code below. I get an undefined symbol error on compilation.

That is weird because i can get all the other members in the structure prior to that one. Havn't attempted getting the ones after though.

Running on 98se. Not using the latest masm but i don't think it should matter.

__________________________________________________

invoke dwtoa,sysinfo.dwNumberOfProcessors,addr buffer
invoke StrLen,addr buffer
invoke TextOut,hdc,XPOS,YPOS,addr buffer,eax


Any help appreciated.
Posted on 2003-01-07 14:28:29 by IwasTitan
Check windows.inc - maybe " dwNumberOfProcessors " is defined different.
Posted on 2003-01-07 14:30:37 by JimmyClif
Titan,

Dunno what you problem is,


LOCAL sinfo:SYSTEM_INFO

invoke GetSystemInfo,ADDR sinfo
invoke dwtoa,sinfo.dwNumberOfProcessors,ADDR buffer1
invoke MessageBox,hWin,ADDR buffer1,
SADD("Processor Count"),MB_OK

Seems to work fine.

Regards,

hutch@movsd.com
Posted on 2003-01-07 15:05:49 by hutch--

Titan,

Dunno what you problem is,


LOCAL sinfo:SYSTEM_INFO

invoke GetSystemInfo,ADDR sinfo
invoke dwtoa,sinfo.dwNumberOfProcessors,ADDR buffer1
invoke MessageBox,hWin,ADDR buffer1,
SADD("Processor Count"),MB_OK

Seems to work fine.

Regards,

hutch@movsd.com


The only difference is my structure is define in uninitialised data.

sysinfo SYSTEM_INFO <>

I'll check windows.inc as JimmyClif suggests

rrrrrrrrrrrrrrrrrrrrrrrrrrrr
Posted on 2003-01-07 15:23:17 by IwasTitan
Titan,

I just changed the example to the structure in the .DATA? section and it still runs fine.


.data?
sinfo SYSTEM_INFO <>

.code
.
.
.
.
invoke GetSystemInfo,ADDR sinfo
invoke dwtoa,sinfo.dwNumberOfProcessors,ADDR buffer1
invoke MessageBox,hWin,ADDR buffer1,
SADD("Processor Count"),MB_OK

What version of MASM32 and windows.inc are you using ?

This is the STRUCT in windows.inc


SYSTEM_INFO STRUCT
wProcessorArchitecture WORD ?
wReserved WORD ?
dwPageSize DWORD ?
lpMinimumApplicationAddress DWORD ?
lpMaximumApplicationAddress DWORD ?
dwActiveProcessorMask DWORD ?
dwNumberOfProcessors DWORD ?
dwProcessorType DWORD ?
dwAllocationGranularity DWORD ?
wProcessorLevel WORD ?
wProcessorRevision WORD ?
SYSTEM_INFO ENDS


Regards,

hutch@movsd.com
Posted on 2003-01-08 06:03:26 by hutch--
Hutch:

The dwNumberOfProcessors in my windows.inc file had an r after the dw...dwr

How it got there is a mystery but i corrected and it works fine.
Maybe somebody hacked my system and put it their knowing that i was going to use that structure.

Maybe it was an alien.

Maybe i am paranoid.

Maybe i should shut up.

Its fixed.

:alright:
Posted on 2003-01-08 12:27:44 by IwasTitan
I knew it :alright:

I spent once hours to look for an hWnd hwnd error in my Windows.inc... because I blindly trusted the inc file and was convinced it being my fault...

JC
Posted on 2003-01-08 13:28:23 by JimmyClif