Article View: borland.public.cppbuilder.nativeapi
Article #2053Re: Getting computer sid, problems with LookupAccountName
From: Jyrki Holopainen
Date: Thu, 26 Apr 2007 05:44
Date: Thu, 26 Apr 2007 05:44
11 lines
1401 bytes
1401 bytes
Mike Collins wrote: > // Generate computer SID hash > AnsiString szComputerName; > szComputerName.SetLength(MAX_COMPUTERNAME_LENGTH + 1); > DWORD dwSize = szComputerName.Length(); > if (GetComputerName(szComputerName.c_str(), &dwSize)) This is probably not safe. You must use a separate char buffer as a parameter to GetComputerName() and assign that to the szComputerName after the function call.
Technical Details
Message-ID:
<46303c43@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<462bc454@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,bd7990a8e1a7b3b1 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 26 Apr 2007 08:44:23 +0300 From: Jyrki Holopainen <JyrkiBorland@halo.pp.fi> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Getting computer sid, problems with LookupAccountName References: <462bc454@newsgroups.borland.com> In-Reply-To: <462bc454@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 91.152.173.240 Message-ID: <46303c43@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1177566275 91.152.173.240 (25 Apr 2007 22:44:35 -0700) Lines: 11 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail