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. Understanding GetUserObjectSecurity function

Understanding GetUserObjectSecurity function

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiocomagentic-aitutorial
2 Posts 2 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.
  • R Offline
    R Offline
    rbwest86
    wrote on last edited by
    #1

    Hello all, As you all probably know I am very new to programming. I am trying to understand the terminology involved with programming. So if you all do not mind, lets use the following example as I try and explain it. Please refer to the following link: http://msdn.microsoft.com/en-us/library/aa446675(VS.85).aspx[LINK] GetUserObjectSecurity is a function. Its function is a member of what? does GetUserObjectSecurity have to be included in int main() ? If not can you please explain the reasoning? If you look at the link I provided above, on the page it has a syntax block. In the syntax block, it is refering to BOOL. Now I have seen bool and BOOL and was wondering if this is included in your source code? I read that BOOL is the older version of bool? And all bool is for, is for true/false correct? I also read that bool is a type of int, meaning could you use bool main() ? Obviously I am confused on this. Also when you use bool, is it required to be typed out in your source, or is it implied by some <header> file? How do you properly use bool? I also read that bool uses one (byte), versus BOOL uses 32(bits). Why is this? When using GetUserObjectSecurity, what are the usages of the parameters? Can anyone provide an example with an explanation? Thank you all so very much for your time and effort in helping me learn C++ and to continue my academic future. V/R Rob

    R 1 Reply Last reply
    0
    • R rbwest86

      Hello all, As you all probably know I am very new to programming. I am trying to understand the terminology involved with programming. So if you all do not mind, lets use the following example as I try and explain it. Please refer to the following link: http://msdn.microsoft.com/en-us/library/aa446675(VS.85).aspx[LINK] GetUserObjectSecurity is a function. Its function is a member of what? does GetUserObjectSecurity have to be included in int main() ? If not can you please explain the reasoning? If you look at the link I provided above, on the page it has a syntax block. In the syntax block, it is refering to BOOL. Now I have seen bool and BOOL and was wondering if this is included in your source code? I read that BOOL is the older version of bool? And all bool is for, is for true/false correct? I also read that bool is a type of int, meaning could you use bool main() ? Obviously I am confused on this. Also when you use bool, is it required to be typed out in your source, or is it implied by some <header> file? How do you properly use bool? I also read that bool uses one (byte), versus BOOL uses 32(bits). Why is this? When using GetUserObjectSecurity, what are the usages of the parameters? Can anyone provide an example with an explanation? Thank you all so very much for your time and effort in helping me learn C++ and to continue my academic future. V/R Rob

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      rbwest86 wrote:

      GetUserObjectSecurity is a function. Its function is a member of what?

      I don't quite get this. If you're asking "where" is this function located, then I would say it is within a DLL named User32.dll, and comes with a companion lib file named User32.lib (The prototype is defined in Winuser.h, which is in turn included by Windows.h). So when you link to User32.lib, you could use the function like using a function that is within your code.

      rbwest86 wrote:

      does GetUserObjectSecurity have to be included in int main()

      You don't "include" a function, you call it. You can call this function, wherever you want to, given that you've included the relevant header file and linked to the relevant library, discussed above.

      rbwest86 wrote:

      I read that BOOL is the older version of bool? And all bool is for, is for true/false correct?

      BOOL is actually int, defined like this: typedef int BOOL; (I'm not sure about the file, just right click and select go to definition.) Also, Google for "BOOL vs bool".

      rbwest86 wrote:

      Is BOOL older version of bool?

      No.

      rbwest86 wrote:

      And all bool is for, is for true/false correct?

      Yes.

      rbwest86 wrote:

      I also read that bool uses one (byte), versus BOOL uses 32(bits). Why is this?

      BOOL uses 32 bits because it *is* an integer (discussed above). bool is limited to work with true and false. But with BOOL, you could use any integer. And this can come handy, if you're returning BOOL from a function and you could: * return -1 to indicate that the function failed * return 1 to indicate that the function succeeded * return 5 to indicate that the something went wrong, but the error was handled. (A file wasn't existing, but it was created and written into) * etc.,

      rbwest86 wrote:

      Also when you use bool, is it required to be typed out in your source, or is it implied by some

      file? How do you properly use bool?

      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