🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #750

Re: Get user SID with LookupAccountName

#750
From: Remy Lebeau (TeamB)
Date: Thu, 24 Jan 2008 18:03
34 lines
2109 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message 
news:4798a5a6$1@newsgroups.borland.com...

> Why have you coded the GetTextualSid instead of using
> the ConvertSidToStringSid?

1) GetTextualSid() is provided in MSDN's own examples, and keeps showing up 
in newsgroup postings, even from Microsoft MVPs.

2) ConvertSidToStringSid() is not available on NT

If you have ConvertSidToStringSid() available on your machine, you can 
certainly use it.

> Why do you use LocalFree?

Because I use LocalAlloc().  You can't use GlobalFree() to release memory 
allocated by LocalAlloc().  Microsoft's documentation even says as much:

    LocalAlloc Function
    http://msdn2.microsoft.com/en-us/library/aa366723.aspx

    "It is not safe to free memory allocated with LocalAlloc using 
GlobalFree."

> In my implementation i use GlobalFree - what is the difference
> in using these two?

    Global and Local Functions
    http://msdn2.microsoft.com/en-us/library/aa366596(VS.85).aspx


Gambit 
Technical Details
Message-ID: <4798d2c4$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4797d1c8@newsgroups.borland.com> <4797e247$1@newsgroups.borland.com> <4798a5a6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4137c5655902c5b4
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4797d1c8@newsgroups.borland.com> <4797e247$1@newsgroups.borland.com> <4798a5a6$1@newsgroups.borland.com>
Subject: Re: Get user SID with LookupAccountName
Date: Thu, 24 Jan 2008 10:03:31 -0800
Lines: 36
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 207.178.157.90
Message-ID: <4798d2c4$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1201197764 207.178.157.90 (24 Jan 2008 10:02:44 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail