Results 1 to 10 of 10

Thread: NtQuerySystemInformation

  1. #1

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461

    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 {
    }

  2. #2

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    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 {
    }

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  4. #4

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    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 {
    }

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  10. #10
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    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
  •  



Click Here to Expand Forum to Full Width