Valhalla Legends Forums Archive | C/C++ Programming | System/Winsock Functions

AuthorMessageTime
Sargera
What functions (for Windows NT 5.0+) are there for getting system information such as amount of memory, type of processor, etc.? Additionally, what functions are there for getting information on a current connection on a socket (Winsock) such as connection uptime, packets sent/received, etc.. I know that some of this information I'd like to get from functions could be done logically with just basic code, but I'd like to know if there are actual functions for getting this information, and information related to it.
September 14, 2004, 7:38 PM
Sargera
Hmm, found this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information_functions.asp

But if there are any other functions that you know of, please submit them here. I still don't see functions for getting the amount of memory on the computer, or what kind of processor the system is running.
September 14, 2004, 7:40 PM
UserLoser.
For system information, and things like amount of memory, see: GetSystemInfo, GlobalMemoryStatus. AFAIK, there are no Winsock API functions which keep track of the amount of data sent/received, along with the uptime of the connection. Also, Depends on what you want to know about the connection, few examples which retrieve information about the connection: if you want to get your local ip, use getsockname(), if you want to get the remote host ip, use getpeername(). Much much more information on here
September 14, 2004, 9:44 PM
kamakazie
Google is your friend.

http://www.codeproject.com/internet/BytesSentReceived.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;161151

I'm sure you can convert that last one from VB to C++
September 14, 2004, 9:55 PM
K
you can get all sorts of information about the system using WMI, but I've never tried to implement it in C/C++ -- it looks tedious and difficult.
September 14, 2004, 10:33 PM
Skywing
[quote author=K link=board=30;threadid=8679;start=0#msg80145 date=1095201214]
you can get all sorts of information about the system using WMI, but I've never tried to implement it in C/C++ -- it looks tedious and difficult.

[/quote]
WMI is definitely designed for access from scripting languages (or languages with extensive built-in COM support).

You can usually get whatever WMI can give you from other sources, so in most cases it's a good idea to avoid using WMI from C/C++.
September 15, 2004, 2:04 AM
Sargera
What method is used to get the processor brand, model, and speed?
September 15, 2004, 4:00 AM
kamakazie
[quote author=Sargera link=board=30;threadid=8679;start=0#msg80217 date=1095220813]
What method is used to get the processor brand, model, and speed?
[/quote]

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html
September 15, 2004, 4:51 AM
UserLoser.
[quote author=dxoigmn link=board=30;threadid=8679;start=0#msg80220 date=1095223900]

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html
[/quote]

Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question
September 15, 2004, 6:51 PM
K
[quote author=UserLoser. link=board=30;threadid=8679;start=0#msg80264 date=1095274278]
[quote author=dxoigmn link=board=30;threadid=8679;start=0#msg80220 date=1095223900]

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html
[/quote]



Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question
[/quote]

Scroll down past the ads. ::)
September 15, 2004, 7:19 PM
kamakazie
[quote author=K link=board=30;threadid=8679;start=0#msg80270 date=1095275976]
Scroll down past the ads. ::)
[/quote]

Indeed ;)
September 15, 2004, 7:26 PM
UserLoser.
[quote author=K link=board=30;threadid=8679;start=0#msg80270 date=1095275976]
[quote author=UserLoser. link=board=30;threadid=8679;start=0#msg80264 date=1095274278]
[quote author=dxoigmn link=board=30;threadid=8679;start=0#msg80220 date=1095223900]

Google told me: http://www.experts-exchange.com/Programming/Programming_Platforms/Win_Prog/Q_20305588.html
[/quote]



Perhaps you should share a suscription login to that website, since it's quite usless and just shows somebody asking a question
[/quote]

Scroll down past the ads. ::)
[/quote]

I went ther twice or so, and didn't bother to keep scrolling after i saw ads/other stuff, oops.
September 15, 2004, 7:29 PM
thetempest
hey,

long time since i've been here.  But this is a program that i've been using for a long time, its like netstat, but it tells you what programs are bound to what ports and what not.

It's called, FPORT, and its by foundstone Inc.  I thought they released the source, but i guess i got them confused with someone else.

Perhaps you can look at the Import Address Table to see what API functions they use, if any.

Just thought i'd let you know,
http://www.foundstone.com/index.htm?subnav=resources/navigation.htm&subcontent=/resources/proddesc/fport.htm
October 13, 2004, 3:00 PM

Search