Jeffrey Altman convinced me this patch was really needed, or there is
no way to make sure GetCursorInfo will give us a valid answer.
This commit is contained in:
parent
6dcbaf5857
commit
7abee0cedf
@ -130,14 +130,27 @@
|
|||||||
static void readtimer(void);
|
static void readtimer(void);
|
||||||
static void readscreen(void);
|
static void readscreen(void);
|
||||||
|
|
||||||
/* It appears like PCURSORINFO is only defined when WINVER is 0x0500 and up,
|
/* It appears like CURSORINFO, PCURSORINFO and LPCURSORINFO are only defined
|
||||||
which currently only happens on Win2000. Unfortunately, that is a typedef,
|
when WINVER is 0x0500 and up, which currently only happens on Win2000.
|
||||||
so it's a little bit difficult to detect properly. On the other hand, the
|
Unfortunately, those are typedefs, so they're a little bit difficult to
|
||||||
macro CURSOR_SHOWING is defined within the same conditional, so it can be
|
detect properly. On the other hand, the macro CURSOR_SHOWING is defined
|
||||||
use to detect the absence of PCURSORINFO. */
|
within the same conditional, so it can be use to detect the absence of said
|
||||||
|
typedefs. */
|
||||||
|
|
||||||
#ifndef CURSOR_SHOWING
|
#ifndef CURSOR_SHOWING
|
||||||
typedef void *PCURSORINFO;
|
/*
|
||||||
#endif
|
* Information about the global cursor.
|
||||||
|
*/
|
||||||
|
typedef struct tagCURSORINFO
|
||||||
|
{
|
||||||
|
DWORD cbSize;
|
||||||
|
DWORD flags;
|
||||||
|
HCURSOR hCursor;
|
||||||
|
POINT ptScreenPos;
|
||||||
|
} CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
|
||||||
|
|
||||||
|
#define CURSOR_SHOWING 0x00000001
|
||||||
|
#endif /* CURSOR_SHOWING */
|
||||||
|
|
||||||
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXT)(HCRYPTPROV *, LPCTSTR, LPCTSTR,
|
typedef BOOL (WINAPI *CRYPTACQUIRECONTEXT)(HCRYPTPROV *, LPCTSTR, LPCTSTR,
|
||||||
DWORD, DWORD);
|
DWORD, DWORD);
|
||||||
@ -245,8 +258,10 @@ int RAND_poll(void)
|
|||||||
if (cursor)
|
if (cursor)
|
||||||
{
|
{
|
||||||
/* cursor position */
|
/* cursor position */
|
||||||
cursor((PCURSORINFO)buf);
|
PCURSORINFO p = (PCURSORINFO) buf;
|
||||||
RAND_add(buf, sizeof(buf), 0);
|
p->cbSize = sizeof(CURSORINFO);
|
||||||
|
if (cursor(p))
|
||||||
|
RAND_add(p+sizeof(p->cbSize), p->cbSize-sizeof(p->cbSize), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queue)
|
if (queue)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user