seems msvc++ doesnt have a proto for this. how do i make it know that NtQuerySystemInformation is in ntdll.dll in windows nt???????
Printable View
seems msvc++ doesnt have a proto for this. how do i make it know that NtQuerySystemInformation is in ntdll.dll in windows nt???????
damn c++ you cant even use api that isnt declared, unlike in masm!!!!!!!!!!!
how do i make it referance it??????
hell ill make a wrapper dll
There should be a prototype for it defined in one of the Windows headers.Quote:
Originally posted by Cmdr0Sunburn
damn c++ you cant even use api that isnt declared, unlike in masm!!!!!!!!!!!
how do i make it referance it??????
hell ill make a wrapper dll
The Platform SDK will have the prototype, and will tell you what header you need. If in the unlikely situation that there's no header, just add a function prototype to your source file and it's happy :)
ive added every include qwith a nt in it, and it dont work.
The ntdll.dll functions are not supposed to be used in normal programming. They are not listed in the headers, and there's a reason for that. Neither can they be found in the reference.
But if you really want to use NtQuerySystemInformation make sure you know the correct prototype, then use LoadLibrary and GetProcAddress to get access.
taskmgr.exe links to ntdll directly and also imports NtQuerySystemInformation, so I guess it's safe to use.
But Task Manager is a system program, still.
There seems to be no other way to get the CPU usage.
Damn MS for not documenting such things, why should only system programs access this?
You can get it with WMI :rolleyes:
But I thought you could get it by connecting to the CPU performance counter?
ntddk.h in the DDK is the header file you want.
And, instead of getting cranky, try reading the MSDN information on-line. It mentions this.