From: Jeffrey Altman <[EMAIL PROTECTED]>
Subject: Re: Beta 1 errors on Win32
Date: Tue, 12 Sep 2000 18:29:00 EDT
Message-ID: <[EMAIL PROTECTED]>

jaltman> > From: Jeffrey Altman <[EMAIL PROTECTED]>
jaltman> > 
jaltman> > jaltman> #ifndef CURSOR_SHOWING
jaltman> > jaltman> /*
jaltman> > jaltman>  * Information about the global cursor.
jaltman> > jaltman>  */
jaltman> > jaltman> typedef struct tagCURSORINFO
jaltman> > jaltman> {
jaltman> > jaltman>     DWORD   cbSize;
jaltman> > jaltman>     DWORD   flags;
jaltman> > jaltman>     HCURSOR hCursor;
jaltman> > jaltman>     POINT   ptScreenPos;
jaltman> > jaltman> } CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
jaltman> > jaltman> 
jaltman> > jaltman> #define CURSOR_SHOWING     0x00000001
jaltman> > jaltman> #endif /* CURSOR_SHOWING */
jaltman> > 
jaltman> > The other alternative is to have PCURSORINFO defined like this:
jaltman> > 
jaltman> >      typedef void *PCURSORINFO;
jaltman> > 
jaltman> > Because in reality, it matters very little what it actually gets
jaltman> > defined to.  If buf is too small to contain CURSORINFO, we've screwed
jaltman> > up independent of the definition of PCURSORINFO.
jaltman> > 
jaltman> > I'd rather do that, because there's no guarantee that CURSORINFO
jaltman> > looks the same in 3 years, so there's no point trying to fool
jaltman> > ourselves with thinking we know what's in it at any time.
jaltman> 
jaltman> In that case then there is no reason to define PCURSORINFO at all.

Except that Borland C gives a warning because it PCURSORINFO is still
present in the function type that defines cursor.  That's what started
all this...

jaltman> Shouldn't the sizeof(buf) really be
jaltman> 
jaltman>      if (cursor)
jaltman>              {
jaltman>              /* cursor position */
jaltman>              cursor((PCURSORINFO) buf);
jaltman>              RAND_add(buf, sizeof(buf), 0);
jaltman>              }
jaltman> 
jaltman> sizeof(CURSORINFO) if we want to be accurate?

Sure, if we could be sure at all time that CURSORINFO is what we think
it is.

-- 
Richard Levitte   \ Spannv�gen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \      SWEDEN       \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to