Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How Cool are void pointers?

How Cool are void pointers?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    ursus zeta
    wrote on last edited by
    #1

    I'm reading Feng Yuan's, "Windows Graphics Programming", and while it is an incredible investigative journey, I am really confused about one particular feature. In his technical description of the the internal data structures of the Windows 2000 graphics engine and GDI APIs, he lists numerous undocumented structures which the operating system maintains in kernel address space. This is fascinating stuff, but, even a nitwit like me notices pretty quickly that most of these structs are populated with void pointers to other undocumented structs. I can't imagine why Microsoft would use so many void pointers. The only possibility that seems reasonable is that the void pointer conceals the actual data structure from nitwits like me in user address space. Anybody have any hard intel on this stuff?

    P N I 3 Replies Last reply
    0
    • U ursus zeta

      I'm reading Feng Yuan's, "Windows Graphics Programming", and while it is an incredible investigative journey, I am really confused about one particular feature. In his technical description of the the internal data structures of the Windows 2000 graphics engine and GDI APIs, he lists numerous undocumented structures which the operating system maintains in kernel address space. This is fascinating stuff, but, even a nitwit like me notices pretty quickly that most of these structs are populated with void pointers to other undocumented structs. I can't imagine why Microsoft would use so many void pointers. The only possibility that seems reasonable is that the void pointer conceals the actual data structure from nitwits like me in user address space. Anybody have any hard intel on this stuff?

      P Offline
      P Offline
      palbano
      wrote on last edited by
      #2

      no but i want to know so if u discover anything please post it back here

      "No matter where you go, there your are..." - Buckaoo Banzi

      -pete

      1 Reply Last reply
      0
      • U ursus zeta

        I'm reading Feng Yuan's, "Windows Graphics Programming", and while it is an incredible investigative journey, I am really confused about one particular feature. In his technical description of the the internal data structures of the Windows 2000 graphics engine and GDI APIs, he lists numerous undocumented structures which the operating system maintains in kernel address space. This is fascinating stuff, but, even a nitwit like me notices pretty quickly that most of these structs are populated with void pointers to other undocumented structs. I can't imagine why Microsoft would use so many void pointers. The only possibility that seems reasonable is that the void pointer conceals the actual data structure from nitwits like me in user address space. Anybody have any hard intel on this stuff?

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #3

        void pointers are generic and can point to anything. It allows you to write generic functions and classes. so you could pass a string pointer or a integere pointer or a struct pointer and they'll all be accepted by the coid pointer variable. Nish


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

        1 Reply Last reply
        0
        • U ursus zeta

          I'm reading Feng Yuan's, "Windows Graphics Programming", and while it is an incredible investigative journey, I am really confused about one particular feature. In his technical description of the the internal data structures of the Windows 2000 graphics engine and GDI APIs, he lists numerous undocumented structures which the operating system maintains in kernel address space. This is fascinating stuff, but, even a nitwit like me notices pretty quickly that most of these structs are populated with void pointers to other undocumented structs. I can't imagine why Microsoft would use so many void pointers. The only possibility that seems reasonable is that the void pointer conceals the actual data structure from nitwits like me in user address space. Anybody have any hard intel on this stuff?

          I Offline
          I Offline
          includeh10
          wrote on last edited by
          #4

          "undocumented structure" means the structure can't be defined, the reason that it can't be defined is those void pointers, they are not cool at all, they are something can not be defined. i.e. for dialog template structure ("undocumented structure"), u see these stories: WORD id; void* pv; what does pv mean? if id=0; pv is null; if id=1; pv to a DWORD; if id=2; pv to a char string; (i can't remember exactly values, here is just idea) these kind of "structures" can't be defined, so called "undocumented structure" - do body can document (define) it. hope u understand that void* is not cool, it is "no words to say". includeh10

          U 1 Reply Last reply
          0
          • I includeh10

            "undocumented structure" means the structure can't be defined, the reason that it can't be defined is those void pointers, they are not cool at all, they are something can not be defined. i.e. for dialog template structure ("undocumented structure"), u see these stories: WORD id; void* pv; what does pv mean? if id=0; pv is null; if id=1; pv to a DWORD; if id=2; pv to a char string; (i can't remember exactly values, here is just idea) these kind of "structures" can't be defined, so called "undocumented structure" - do body can document (define) it. hope u understand that void* is not cool, it is "no words to say". includeh10

            U Offline
            U Offline
            ursus zeta
            wrote on last edited by
            #5

            You know, I kind of posted this inquiry half in jest, becuase it was my understanding that void pointers are NOT cool (and are, in fact, unsafe). I mean without typecasting, the potential exists for the wrong type of pointer residing in the structure. And, apparently, I've confused you guys somewhat, because the author represents much of his technical information on "undocumented internals" as being taken from Microsoft's documentation for the Device Driver SDK. The Feng Yuan also invents soem ingenious methods for obtaining information from OS kernel components (which is theoretically, not accessible from a user application). He does this with Windows 2000 (my machine has Windows 98, and some of the function calls he employs are not available on Windows versions earlier than 2000 or XP). Anyway, it's a long story. And, I'm a novice to Windows systematics. The main reason I posted is that it seemed like a marginal technique to employ for critical kernel DLLs and the systems calls that they provide. If I find out anything interesting, I'll get back.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups