diff options
author | Richard Levitte <levitte@openssl.org> | 2000-09-15 11:33:14 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-09-15 11:33:14 +0000 |
commit | 848f3d40c830750d59ed9735216b4f8445089e05 (patch) | |
tree | 9383faf93348e68453219dac7481b49b137ce18c /crypto | |
parent | 1949e783363ef21bff29d083ad6a9498e328e1bc (diff) |
Later, Jeffrey changed his mind. Apparently, GetCursorInfo exists but
doesn't quite work on WinNT 4 earlier than SP6. It works fine on
Windows 98 and Windows 2000.
I'm disabling it for now. What's really needed is some kind of check
to see if GetCursorInfo is safe to call, or alternatively, GetCursor
or GetCursorPos could be used, according to Jeffrey.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rand/rand_win.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 5dc186f78d..e9fc37c567 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -242,9 +242,11 @@ int RAND_poll(void) { GETCURSORINFO cursor; GETFOREGROUNDWINDOW win; + GETQUEUESTATUS queue; win = (GETFOREGROUNDWINDOW) GetProcAddress(user, "GetForegroundWindow"); cursor = (GETCURSORINFO) GetProcAddress(user, "GetCursorInfo"); + queue = (GETQUEUESTATUS) GetProcAddress(user, "GetQueueStatus"); if (win) { @@ -253,13 +255,23 @@ int RAND_poll(void) RAND_add(&h, sizeof(h), 0); } +#if 0 if (cursor) { /* cursor position */ PCURSORINFO p = (PCURSORINFO) buf; p->cbSize = sizeof(CURSORINFO); if (cursor(p)) - RAND_add(p+sizeof(p->cbSize), p->cbSize-sizeof(p->cbSize), 0); + RAND_add(p+sizeof(p->cbSize), + p->cbSize-sizeof(p->cbSize), 0); + } +#endif + + if (queue) + { + /* message queue status */ + w = queue(QS_ALLEVENTS); + RAND_add(&w, sizeof(w), 0); } } |