Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:41:16+00:00 2026-06-13T23:41:16+00:00

I want to create a C++ program with limited privileges. I made some research

  • 0

I want to create a C++ program with limited privileges. I made some research on the internet and found out that I have to create a token and then use the AdjustTokenPrivileges() method to alter its privileges.

However, I didn’t quite understand how this is to be done. Can someone please provide me with an example of how to create a token and disable its privileges? Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:41:18+00:00Added an answer on June 13, 2026 at 11:41 pm

    Did you check out the example at Executing Privileged Operations Using C++ ? Seems like you just need to figure out which tokens are which after using the GetTokenInformation() function, and then disable some of them.

    [EDIT]
    Explaining in a bit more detail.

    • The first call to GetTokenInformation() gets you the length of your token priveledge info object, in bytes.
    • Then you actually build a buffer of that size on the heap.
    • The second call retrieves the token information object and stores it in your buffer.
    • Then you re-cast your buffer to TOKEN_PRIVILEGES*, which allows you to interpret it correctly.
    • Then you loop through the Privileges member of this object and set the different attributes to allowed.

    Here are specifics about the TOKEN_PRIVILEDGES structure. For each member of Priviledges array, you can look up the name of the priviledge using LookupPrivilegeName.

    Here is a list of Priviledge names and descriptions.

    After you know what priviledge it is (i.e. by checking the name), you can set the Attributes of the Priviledges[i] member to one of

    • SE_PRIVILEGE_ENABLED
    • SE_PRIVILEGE_ENABLED_BY_DEFAULT
    • SE_PRIVILEGE_REMOVED
    • SE_PRIVILEGE_USED_FOR_ACCESS

    In your case, I recon it will be mostly the third.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a program that takes in input and prints out the
i want to create a simple program that i have a array of strings
I want to create a program that runs on iPads, Playbooks, and Windows computers
I want to create a program that produces an executable slideshow. So I need
I created one GWT webapplication project.Inthat i want to create servlet program,but in that
I want to create a companion Windows desktop program for my app. One that
I want to create an extremely simple iPhone program that will open a telnet
I want to create a program that will parse text for key words and
I want to create java program that can pause / play the vlc video
I want to create a program that , when executed, will compress a selected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.