Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Thu, 7 Aug 2008 19:40:31 -0700
If the function prototype visible to the application compiler says
"BOOLEAN", then the compiler will only test the lower byte. Even if the
actual function is actually compiled with BOOL, which is unlikely, because
the headers included with SDK are exactly ones used to build the OS itself.
"Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx> wrote in message
news:%23dA29nJ%23IHA.5056@xxxxxxxxxxxxxxxxxxxxxxx
Alexander Grigoriev wrote:
OK,
But then it could not be a reason for that "CreateSymbolicLink
doesn't fail on 64-bit if process doesn't have sufficient privileges"
bug. BOOLEAN perfectly converts to BOOL, implicitly. Not the other
way around, though.
But if the prototype is wrong, the compiler doesn't insert an implicit
(widening) conversion. The function sets only the low byte to zero, the
caller tests the whole word against zero. Problem because the upper bits
contain random garbage.
"Alan" <Alan.Bateman@xxxxxxx> wrote in message
news:510f7834-508e-4503-b1ae-4dd5ed7f00d9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 7, 3:12 am, "Alexander Grigoriev" <al...@xxxxxxxxxxxxx> wrote:
Why do you think so? Win32 doesn't use BOOLEAN.
The function prototype in the SDK (WinBase.h) defines it to return
BOOLEAN. The online SDK docs say BOOL. We logged a call with
Microsoft on this and the return type is indeed a BOOLEAN.
.
- Follow-Ups:
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Jochen Kalmbach [MVP]
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- References:
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Alan
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Alexander Grigoriev
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Alan
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Alexander Grigoriev
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- From: Ben Voigt [C++ MVP]
- Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- Prev by Date: Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- Next by Date: Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- Previous by thread: Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- Next by thread: Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges
- Index(es):
Relevant Pages
|