Article View: borland.public.cppbuilder.nativeapi
Article #1042Re: [bds2006] Can vcl appl use SetNamedSecurityInfo()?
From: Remy Lebeau (TeamB)
Date: Thu, 15 Nov 2007 17:40
Date: Thu, 15 Nov 2007 17:40
63 lines
3290 bytes
3290 bytes
"dhoke" <dhoke.nojunk@east-shore.com> wrote in message
news:473c4335$1@newsgroups.borland.com...
> How does one make straightforward use of SetNamedSecurityInfo()
> in a module that includes vcl.h?
Just call it like any other function.
> Compiling the above produces:
> Error E2015 C:\Program Files\Borland\BDS\4.0\Include\aclapi.h 103:
> Ambiguity between 'PACCESS_MASK' and 'Windows::PACCESS_MASK'
PACCESS_MASK has nothing to do with SetNamedSecurityInfo(). This is a
completely different issue.
Did you look at line 103 yet? The compiler is complaining about
GetEffectiveRightsFromAcl(), which has a PACCESS_MASK parameter.
Like I told you the other day, PACCESS_MASK is declared in two separate
namespaces and your project is including both of them - the global namespace
and the "Windows" namespace. Since the function declaration does not
qualify which namespace to use, the compiler does not know which declaration
of PACCESS_MASK to use, which is exactly what the error message is telling
you.
This is due to a bug in the Windows.pas source file of the VCL.
Borland/CodGear is not defining PACCESS_MASK with the EXTERNALSYM flag so
the Delphi compiler will not re-declare PACCESS_MASK when generating the
Windows.hpp file. Since you are not allowed to recompile the VCL, you have
two choices:
1) edit Windows.hpp to remove/comment the offending declaration of
PACCESS_MASK
// RLebeau: comment this out
// typedef unsigned *PACCESS_MASK;
2) edit aclapi.h to qualify the PACCESS_MASK parameter of
GetEffectiveRightsFromAcl() with the global namespace:
WINADVAPI
DWORD
WINAPI
GetEffectiveRightsFromAclA(
IN PACL pacl,
IN PTRUSTEE_A pTrustee,
OUT ::PACCESS_MASK pAccessRights // <-- RLebeau: qualified
);
WINADVAPI
DWORD
WINAPI
GetEffectiveRightsFromAclW(
IN PACL pacl,
IN PTRUSTEE_W pTrustee,
OUT ::PACCESS_MASK pAccessRights // <-- RLebeau: qualified
);
#1 is technically the best way to go, but if you go with #2 then you will
have to make the same change for GetAuditedPermissionsFromAcl() as well.
Gambit
Technical Details
Message-ID:
<473c84be$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!feed.xsnews.nl!border-2.ams.xsnews.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<473c4335$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ffb5c25f9ee4103d 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: <473c4335$1@newsgroups.borland.com> Subject: Re: [bds2006] Can vcl appl use SetNamedSecurityInfo()? Date: Thu, 15 Nov 2007 09:40:14 -0800 Lines: 65 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <473c84be$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195148478 207.178.157.90 (15 Nov 2007 09:41:18 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!feed.xsnews.nl!border-2.ams.xsnews.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail