|
-
Oct 17th, 2002, 06:44 PM
#1
Thread Starter
Hyperactive Member
NtQuerySystemInformation
seems msvc++ doesnt have a proto for this. how do i make it know that NtQuerySystemInformation is in ntdll.dll in windows nt???????
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 17th, 2002, 06:54 PM
#2
Thread Starter
Hyperactive Member
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
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 17th, 2002, 09:10 PM
#3
Monday Morning Lunatic
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
There should be a prototype for it defined in one of the Windows headers.
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
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 17th, 2002, 10:05 PM
#4
Thread Starter
Hyperactive Member
ive added every include qwith a nt in it, and it dont work.
I know a lot oF Vb, expert in C++, and i think in assembly.
MSVC++6.NET
vb6
masm
Windowz Xp
I find my self using this a lot in C++
__asm {
}
-
Oct 18th, 2002, 04:33 AM
#5
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 18th, 2002, 04:53 AM
#6
taskmgr.exe links to ntdll directly and also imports NtQuerySystemInformation, so I guess it's safe to use.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 18th, 2002, 05:01 AM
#7
Monday Morning Lunatic
But Task Manager is a system program, still.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 18th, 2002, 05:28 AM
#8
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?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 18th, 2002, 05:37 AM
#9
Monday Morning Lunatic
You can get it with WMI 
But I thought you could get it by connecting to the CPU performance counter?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 18th, 2002, 09:15 AM
#10
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|