Re: CreateSymbolicLink doesn't fail on 64-bit if process doesn't have sufficient privileges

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.




.



Relevant Pages

  • Newbie thread stuff
    ... I generate a FileList object which the compiler told me had to be final ... It sets a boolean in theList object to signal when it has completed. ... The code after that is cut and pasted from a GUI tutorial on the Sun ... I decided to give eclipse and netbeans a try - but netbeans quickly ...
    (comp.lang.java.programmer)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... SPARK will allow a variable to have a value that conforms ... might be that a package somewhere will look like this ... An Ada compiler may issue a warning; ... LC> Ada/SPARK support a boolean type? ...
    (comp.lang.pl1)
  • Re: Is this C program doing what it is supposed to do ?
    ... Boolean values and expressions in contexts other than explicit ... Also many programmers confuse compact source code with compact binary. ... Very likely the compiler in each case will emit the same code. ... is no advantage in terms of performance, just readability. ...
    (comp.lang.c)
  • Re: Very strange behavior with Tertiary op, null and autoboxing
    ... it's considered a portability issue if the compiled bytecode from one platform has a different result when moved to another platform.. ... When you're moving the source instead of the bytecode to a different platform, and compiling with a different compiler, it becomes a compiler issue instead. ... > public Boolean getValue{ ... the second operand type is determined ...
    (comp.lang.java.programmer)