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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. printing a sid

printing a sid

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 3 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.
  • S Offline
    S Offline
    Spiritofamerica
    wrote on last edited by
    #1

    I have a question: supposing I call the LookupAccountSid(NULL, ptiUser->User.Sid, szUser, pcchUser,szDomain, pcchDomain, &snu)) and I get the sid how can I print this sid?

    J 1 Reply Last reply
    0
    • S Spiritofamerica

      I have a question: supposing I call the LookupAccountSid(NULL, ptiUser->User.Sid, szUser, pcchUser,szDomain, pcchDomain, &snu)) and I get the sid how can I print this sid?

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      In LookupAccountSid, the SID is an input parameter and what you get is user and domain names as character strings... -- jlr http://jlamas.blogspot.com/[^]

      S 1 Reply Last reply
      0
      • J Jose Lamas Rios

        In LookupAccountSid, the SID is an input parameter and what you get is user and domain names as character strings... -- jlr http://jlamas.blogspot.com/[^]

        S Offline
        S Offline
        Spiritofamerica
        wrote on last edited by
        #3

        yes you are right but anyway I have the sid I just want to print it how do I do that ?

        J 1 Reply Last reply
        0
        • S Spiritofamerica

          yes you are right but anyway I have the sid I just want to print it how do I do that ?

          J Offline
          J Offline
          James Brown
          wrote on last edited by
          #4

          straight from MSDN: ConvertSidToStringSid james
          http://www.catch22.net

          S 1 Reply Last reply
          0
          • J James Brown

            straight from MSDN: ConvertSidToStringSid james
            http://www.catch22.net

            S Offline
            S Offline
            Spiritofamerica
            wrote on last edited by
            #5

            LPSTR * StringSid; ConvertSidToStringSid(ptiUser->User.Sid,StringSid); this gets me the run-time error " the variable StringSid is being used withouth having been initialized so I try to initialize it: LPSTR toader=new char[1024];strcpy(toader," "); LPSTR * StringSid=&toader; but this gets me a error also about access memory violation what is the good way of doing this?

            J 1 Reply Last reply
            0
            • S Spiritofamerica

              LPSTR * StringSid; ConvertSidToStringSid(ptiUser->User.Sid,StringSid); this gets me the run-time error " the variable StringSid is being used withouth having been initialized so I try to initialize it: LPSTR toader=new char[1024];strcpy(toader," "); LPSTR * StringSid=&toader; but this gets me a error also about access memory violation what is the good way of doing this?

              J Offline
              J Offline
              James Brown
              wrote on last edited by
              #6

              You're not calling it quite right. ConvertSidToSidString(sid, &string); you must pass a *pointer* to a pointer, not just the address of the string. The function then modifies this pointer and returns the string this way. james
              http://www.catch22.net

              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