1999-02-05 11:37:53 +01:00
|
|
|
/* * Message queues related functions
|
1996-03-14 19:08:34 +01:00
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
1999-02-28 13:25:03 +01:00
|
|
|
#include <string.h>
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
#include <signal.h>
|
2000-01-01 23:38:20 +01:00
|
|
|
#include <assert.h>
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "wingdi.h"
|
2000-08-04 06:21:02 +02:00
|
|
|
#include "winerror.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "wine/winbase16.h"
|
|
|
|
#include "wine/winuser16.h"
|
1996-03-14 19:08:34 +01:00
|
|
|
#include "queue.h"
|
|
|
|
#include "win.h"
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
#include "hook.h"
|
1997-02-02 20:01:52 +01:00
|
|
|
#include "thread.h"
|
1999-05-02 16:32:27 +02:00
|
|
|
#include "debugtools.h"
|
2000-05-30 21:48:18 +02:00
|
|
|
#include "server.h"
|
1999-02-18 18:34:09 +01:00
|
|
|
#include "spy.h"
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2000-05-30 21:48:18 +02:00
|
|
|
DECLARE_DEBUG_CHANNEL(msg);
|
|
|
|
DECLARE_DEBUG_CHANNEL(sendmsg);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
#define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
|
|
|
|
|
1996-07-17 22:02:21 +02:00
|
|
|
static HQUEUE16 hFirstQueue = 0;
|
1997-05-25 15:58:18 +02:00
|
|
|
static HQUEUE16 hExitingQueue = 0;
|
1996-07-17 22:02:21 +02:00
|
|
|
static HQUEUE16 hmemSysMsgQueue = 0;
|
1996-09-28 20:11:01 +02:00
|
|
|
static MESSAGEQUEUE *sysMsgQueue = NULL;
|
1999-02-05 11:37:53 +01:00
|
|
|
static PERQUEUEDATA *pQDataWin16 = NULL; /* Global perQData for Win16 tasks */
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1996-06-16 18:16:05 +02:00
|
|
|
static MESSAGEQUEUE *pMouseQueue = NULL; /* Queue for last mouse message */
|
|
|
|
static MESSAGEQUEUE *pKbdQueue = NULL; /* Queue for last kbd message */
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
HQUEUE16 hCursorQueue = 0;
|
|
|
|
HQUEUE16 hActiveQueue = 0;
|
|
|
|
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_CreateInstance
|
|
|
|
*
|
|
|
|
* Creates an instance of a reference counted PERQUEUEDATA element
|
|
|
|
* for the message queue. perQData is stored globally for 16 bit tasks.
|
|
|
|
*
|
|
|
|
* Note: We don't implement perQdata exactly the same way Windows does.
|
|
|
|
* Each perQData element is reference counted since it may be potentially
|
|
|
|
* shared by multiple message Queues (via AttachThreadInput).
|
|
|
|
* We only store the current values for Active, Capture and focus windows
|
|
|
|
* currently.
|
|
|
|
*/
|
|
|
|
PERQUEUEDATA * PERQDATA_CreateInstance( )
|
|
|
|
{
|
|
|
|
PERQUEUEDATA *pQData;
|
|
|
|
|
|
|
|
BOOL16 bIsWin16 = 0;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("()\n");
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
/* Share a single instance of perQData for all 16 bit tasks */
|
1999-06-22 13:43:42 +02:00
|
|
|
if ( ( bIsWin16 = THREAD_IsWin16( NtCurrentTeb() ) ) )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
|
|
|
/* If previously allocated, just bump up ref count */
|
|
|
|
if ( pQDataWin16 )
|
|
|
|
{
|
|
|
|
PERQDATA_Addref( pQDataWin16 );
|
|
|
|
return pQDataWin16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate PERQUEUEDATA from the system heap */
|
2001-02-23 02:13:42 +01:00
|
|
|
if (!( pQData = (PERQUEUEDATA *) HeapAlloc( GetProcessHeap(), 0,
|
1999-02-05 11:37:53 +01:00
|
|
|
sizeof(PERQUEUEDATA) ) ))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Initialize */
|
|
|
|
pQData->hWndCapture = pQData->hWndFocus = pQData->hWndActive = 0;
|
|
|
|
pQData->ulRefCount = 1;
|
|
|
|
pQData->nCaptureHT = HTCLIENT;
|
|
|
|
|
|
|
|
/* Note: We have an independent critical section for the per queue data
|
|
|
|
* since this may be shared by different threads. see AttachThreadInput()
|
|
|
|
*/
|
|
|
|
InitializeCriticalSection( &pQData->cSection );
|
1999-11-07 20:22:46 +01:00
|
|
|
/* FIXME: not all per queue data critical sections should be global */
|
|
|
|
MakeCriticalSectionGlobal( &pQData->cSection );
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
/* Save perQData globally for 16 bit tasks */
|
|
|
|
if ( bIsWin16 )
|
|
|
|
pQDataWin16 = pQData;
|
|
|
|
|
|
|
|
return pQData;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_Addref
|
|
|
|
*
|
|
|
|
* Increment reference count for the PERQUEUEDATA instance
|
|
|
|
* Returns reference count for debugging purposes
|
|
|
|
*/
|
|
|
|
ULONG PERQDATA_Addref( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n", pQData->ulRefCount);
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
++pQData->ulRefCount;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return pQData->ulRefCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_Release
|
|
|
|
*
|
|
|
|
* Release a reference to a PERQUEUEDATA instance.
|
|
|
|
* Destroy the instance if no more references exist
|
|
|
|
* Returns reference count for debugging purposes
|
|
|
|
*/
|
|
|
|
ULONG PERQDATA_Release( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n",
|
1999-02-05 11:37:53 +01:00
|
|
|
(LONG)pQData->ulRefCount );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
if ( --pQData->ulRefCount == 0 )
|
|
|
|
{
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
DeleteCriticalSection( &pQData->cSection );
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): deleting PERQUEUEDATA instance ...\n" );
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
/* Deleting our global 16 bit perQData? */
|
|
|
|
if ( pQData == pQDataWin16 )
|
|
|
|
pQDataWin16 = 0;
|
|
|
|
|
|
|
|
/* Free the PERQUEUEDATA instance */
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, pQData );
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return pQData->ulRefCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetFocusWnd
|
|
|
|
*
|
|
|
|
* Get the focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndFocus;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndFocus = pQData->hWndFocus;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndFocus;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetFocusWnd
|
|
|
|
*
|
|
|
|
* Set the focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndFocusPrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndFocusPrv = pQData->hWndFocus;
|
|
|
|
pQData->hWndFocus = hWndFocus;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndFocusPrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetActiveWnd
|
|
|
|
*
|
|
|
|
* Get the active hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndActive;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndActive = pQData->hWndActive;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetActiveWnd
|
|
|
|
*
|
|
|
|
* Set the active focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndActivePrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndActivePrv = pQData->hWndActive;
|
|
|
|
pQData->hWndActive = hWndActive;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndActivePrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetCaptureWnd
|
|
|
|
*
|
|
|
|
* Get the capture hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetCaptureWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapture;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapture = pQData->hWndCapture;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndCapture;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetCaptureWnd
|
|
|
|
*
|
|
|
|
* Set the capture hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetCaptureWnd( PERQUEUEDATA *pQData, HWND hWndCapture )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapturePrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapturePrv = pQData->hWndCapture;
|
|
|
|
pQData->hWndCapture = hWndCapture;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndCapturePrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetCaptureInfo
|
|
|
|
*
|
|
|
|
* Get the capture info member in a threadsafe manner
|
|
|
|
*/
|
|
|
|
INT16 PERQDATA_GetCaptureInfo( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
INT16 nCaptureHT;
|
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
nCaptureHT = pQData->nCaptureHT;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return nCaptureHT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetCaptureInfo
|
|
|
|
*
|
|
|
|
* Set the capture info member in a threadsafe manner
|
|
|
|
*/
|
|
|
|
INT16 PERQDATA_SetCaptureInfo( PERQUEUEDATA *pQData, INT16 nCaptureHT )
|
|
|
|
{
|
|
|
|
INT16 nCaptureHTPrv;
|
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
nCaptureHTPrv = pQData->nCaptureHT;
|
|
|
|
pQData->nCaptureHT = nCaptureHT;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return nCaptureHTPrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_Lock
|
|
|
|
*
|
2000-08-29 05:52:46 +02:00
|
|
|
* Function for getting a 32 bit pointer on queue structure. For thread
|
1999-01-28 11:54:11 +01:00
|
|
|
* safeness programmers should use this function instead of GlobalLock to
|
|
|
|
* retrieve a pointer on the structure. QUEUE_Unlock should also be called
|
|
|
|
* when access to the queue structure is not required anymore.
|
|
|
|
*/
|
|
|
|
MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue )
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
1999-01-28 11:54:11 +01:00
|
|
|
queue = GlobalLock16( hQueue );
|
|
|
|
if ( !queue || (queue->magic != QUEUE_MAGIC) )
|
|
|
|
{
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
queue->lockCount++;
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
return queue;
|
|
|
|
}
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_Unlock
|
|
|
|
*
|
1999-05-01 12:20:18 +02:00
|
|
|
* Use with QUEUE_Lock to get a thread safe access to message queue
|
1999-01-28 11:54:11 +01:00
|
|
|
* structure
|
|
|
|
*/
|
|
|
|
void QUEUE_Unlock( MESSAGEQUEUE *queue )
|
|
|
|
{
|
|
|
|
if (queue)
|
|
|
|
{
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
if ( --queue->lockCount == 0 )
|
|
|
|
{
|
|
|
|
DeleteCriticalSection ( &queue->cSection );
|
2000-05-30 21:48:18 +02:00
|
|
|
if (queue->server_queue)
|
|
|
|
CloseHandle( queue->server_queue );
|
1999-01-28 11:54:11 +01:00
|
|
|
GlobalFree16( queue->self );
|
|
|
|
}
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DumpQueue
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_DumpQueue( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *pq;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(pq = QUEUE_Lock( hQueue )) )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
WARN_(msg)("%04x is not a queue handle\n", hQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &pq->cSection );
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
DPRINTF( "next: %12.4x Intertask SendMessage:\n"
|
1999-01-26 10:30:05 +01:00
|
|
|
"thread: %10p ----------------------\n"
|
1999-02-18 18:34:09 +01:00
|
|
|
"firstMsg: %8p smWaiting: %10p\n"
|
|
|
|
"lastMsg: %8p smPending: %10p\n"
|
|
|
|
"msgCount: %8.4x smProcessing: %10p\n"
|
|
|
|
"lockCount: %7.4x\n"
|
|
|
|
"paints: %10.4x\n"
|
|
|
|
"timers: %10.4x\n"
|
1996-03-14 19:08:34 +01:00
|
|
|
"wakeBits: %8.4x\n"
|
|
|
|
"wakeMask: %8.4x\n"
|
|
|
|
"hCurHook: %8.4x\n",
|
1999-06-22 13:43:42 +02:00
|
|
|
pq->next, pq->teb, pq->firstMsg, pq->smWaiting, pq->lastMsg,
|
1999-02-18 18:34:09 +01:00
|
|
|
pq->smPending, pq->msgCount, pq->smProcessing,
|
2001-01-15 21:09:09 +01:00
|
|
|
(unsigned)pq->lockCount, pq->wPaintCount, pq->wTimerCount,
|
1999-02-18 18:34:09 +01:00
|
|
|
pq->wakeBits, pq->wakeMask, pq->hCurHook);
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &pq->cSection );
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( pq );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_WalkQueues
|
|
|
|
*/
|
|
|
|
void QUEUE_WalkQueues(void)
|
|
|
|
{
|
Release 980517
Sun May 17 16:23:56 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/profile.c]
Fix the return value of PROFILE_GetSection
* [misc/crtdll.c]
Do _getdrive, fix _chdrive.
* [misc/commdlg.c]
First cut at ChooseColor[WA].
* [misc/network.c]
Do something sensible for WNetGetDirectoryType16.
Sun May 17 10:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [controls/menu.c]
Fixed disabled sub menus with MF_BYPOSITION that were not disabled.
* [misc/crtdll.c] [relay32/crtdll.spec] [include/winerror.h]
Implemented fscanf, fsetpos, _access, _fpreset (thanks to Uwe Bonnes),
and _ltoa.
* [loader/task.c]
MakeProcInstance: must use CURRENT_DS if hInst == NULL.
* [misc/shell.c]
SHELL_GetResourceTable, InternalExtractIcon: fixed broken .ICO handling
* [windows/winpos.c]
DeferWindowPos: removed "same parent" requirement.
Which doc states that this is required ?
Sat May 16 20:08:11 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/module.c] [loader/ne/module.c]
More NE module cleanups.
* [loader/task.c]
Fixed SwitchStackBack().
Fri May 15 10:04:27 1998 Marcus Meissner <marcus@jet.franken.de>
* [configure.in][inlcude/acconfig.h]
Fixed broken OSS check, added check for working sigaltstack,
fixed broken statfs checks on some linux systems.
* [files/directory.c][loader/pe_image.c][relay32/builtin.c]
[loader/module.c]
Added handling of win32 module pathnames.
* [relay32/wnaspi32.spec]
New file.
* [misc/lzexpand.c]
LZCopy auto-decompresses LZ compressed files, even if they are not
specially flagged. Fixes some InstallShield problems.
* [misc/registry.c]
Some fixes for RegQueryInfoKey (reference program monkey.exe
from Win32 SDK works now better). Probably still has faults.
Fri May 15 08:58:58 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c] [include/dc.h] [include/gdi.h] [objects/dc.c]
Reworked the way world transformations and mapping modes are handled
so that both of these transformations can be computed in a single
step.
* [graphics/painting.c] [graphics/path.c] [include/path.h]
More GDI path support.
* [graphics/x11drv/graphics.c]
Fixed the return value of GRAPH_DrawArc for the zero height /
zero width case to reflect Windows' behaviour.
* [include/windows.h] [relay32/gdi32.spec] [objects/dc.c]
Implemented ModifyWorldTransform and CombineTransform.
Tue May 14 18:03:46 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/commctrl.c][relay32/comctl32.spec]
[controls/*.c][include/*.h]
Implemented InitCommonControlsEx (dll version 4.72 compatible).
InitCommonControls calls ImageCommonControlsEx.
Registering code of the common controls had to be changed
(see XXXX_Register functions).
* [controls/status.c][include/commctrl.h][include/status.h]
Implemented most new features and fixed the look and feel.
* [contols/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
Implemented MenuHelp (incomplete).
* [controls/status.c][controls/progress.c]
Changed allocation strategy for control specific memory.
* [controls/header.c][include/header.h][include/commctrl.h]
First implementation of header control.
* [windows/defwnd.c][windows/syscolors.c]
Fixed default control colors for Win95 look.
* [windows/nonclient.c]
Fixed off by one error for Win95 look. Top border of child windows
should be visible.
* [misc/imagelist.h]
Improved documentation and fixed some bugs.
Thu May 14 15:42:21 1998 Robert Wilhelm <robert@physiol.med.tu-muenchen.de>
* [relay32/crtdll.spec]
Added hypot,j0,j1,jn and ceil.
Wed May 13 19:10:10 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [controls/listbox.c]
Item height is now exactly font height.
Wine listboxes now behave like Windows' when they are
created without WS_VSCROLL but the program subsequently
calls ShowScrollBar or SetScrollInfo.
Wed May 13 18:33:01 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [relay32/relay386.c]
Restore ES also in the non-debug case.
* [windows/event.c]
Bugfix: Blocking TSXNextEvent could deadlock Wine.
* [win32/process.c] [windows/message.c]
Silly stubs for MsgWaitForMultipleObjects / PostThreadMessage
that make some programs run better.
* [windows/winproc.c]
WINPROC_MapMsg32Ato16/16To32A: added WM_NOTIFY.
* [win32/kernel32.c]
Added 16->32 thunking and improved 32->16 thunking functions.
* [tools/build.c]
Added new variant of CallFrom16 stub for use with Win95 thunks.
* [if1632/kernel.spec] [if1632/builtin.c] [win32/kernel32.c]
Added a few undocumented KERNEL functions.
* [loader/ne/module.c] [loader/ne/segment.c]
Call DllEntryPoint for 16-bit DLLs with subsystem >= 4.0.
* [win32/kernel32.spec] [win32/wow32.spec] [win32/ordinals.c]
Use names from the Oct 94 beta release for undoc. functions.
Wed May 13 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [misc/registry.c]
Code cleanup.
* [misc/cpu.c]
Commented out the registry puts temporarily.
* [programs/regtest/*]
New registry testing program.
Tue May 12 22:54:03 1998 Michael Mess <michael@kawo2.rwth-aachen.de>
* [multimedia/audio.c]
ioctl's do not commute in /dev/dsp initialization.
Tue May 12 20:11:42 1998 Karl Garrison <karlos@eznet.net>
* [win32/console.c]
Implemented SetConsoleTextAttribute, FillConsoleOutputCharacter.
Improved cursor positioning.
This allows for text colors in an xterm, rxvt, or console.
Tue May 12 17:57:52 1998 Petter Reinholdtsen <pere@td.org.uit.no>
* [Makefile.in]
Create prefix/{bin|lib} directories if missing during install.
Sun May 10 19:37:51 1998 Jan Willamowius <jan@janhh.shnet.org>
* [multimedia/mmio.c]
Have mmioSetBuffer return success (0), so Corel Draw 4
keeps working. (IO is still unbuffered)
Wed May 6 16:57:55 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [Make.rules.in]
Changed "make clean" to remove `textedit` backup files (*%)
* [controls/menu.c][graphics/x11drv/xfont.c][include/libres.h]
[loader/main.c][loader/ne/module.c][scheduler/synchro.c]
[win32/time.c][windows/winpos.c][include/windows.h]
Fixed miscellaneous compilation warnings.
* [misc/main.c][miscemu/main.c][include/main.h]
Moved prototypes to new include file main.h, various cleanups.
Tue May 5 21:05:06 1998 Morten Welinder <terra@diku.dk>
* [misc/winsock.c]
Don't refer to __FreeBSD__ when HAVE_STRERROR is meant.
* [misc/debugstr.c]
For debug_dumpstrSend, send strings to stderr.
Tue May 5 21:47:40 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [objects/region.c]
Fix for REGION_RegionOp() if newReg is one of the source regions.
Tue May 5 18:27:32 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [misc/main.c]
Add '-h/-help' option and print WINE_RELEASE_INFO with usage message.
* [misc/spy.c]
Realign trace messages.
Tue May 5 15:46:47 1998 Donnie V. Savage <dsavage@cisco.com>
* [graphics/ddraw.c]
Fixed compile warnings
* [misc/winsock.c]
Warnings should not be errors.
Tue May 5 13:40:42 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [*/*]
Remove many warnings through explicit casts, added #include's,
and corrected printf formats.
Tue May 5 05:18:12 1998 Insomnia (Stea Greene) <insomnia@core.binghamton.edu>
* [graphics/ddraw.c]
Kept unchanged portion of old palette when changing only a few
palette entries. Really should only deallocate the changed cells.
This make StarCraft work almost perfectly (sound overflows still
cause static).
Mon May 4 15:04:57 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage: terminate string on %0, undo linefeed strip.
1998-05-17 19:13:43 +02:00
|
|
|
char module[10];
|
1996-08-11 17:49:51 +02:00
|
|
|
HQUEUE16 hQueue = hFirstQueue;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
DPRINTF( "Queue Msgs Thread Task Module\n" );
|
1996-03-14 19:08:34 +01:00
|
|
|
while (hQueue)
|
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
MESSAGEQUEUE *queue = QUEUE_Lock( hQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
if (!queue)
|
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
WARN_(msg)("Bad queue handle %04x\n", hQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
return;
|
|
|
|
}
|
2000-05-29 23:25:10 +02:00
|
|
|
if (!GetModuleName16( queue->teb->htask16, module, sizeof(module )))
|
Release 980517
Sun May 17 16:23:56 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/profile.c]
Fix the return value of PROFILE_GetSection
* [misc/crtdll.c]
Do _getdrive, fix _chdrive.
* [misc/commdlg.c]
First cut at ChooseColor[WA].
* [misc/network.c]
Do something sensible for WNetGetDirectoryType16.
Sun May 17 10:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [controls/menu.c]
Fixed disabled sub menus with MF_BYPOSITION that were not disabled.
* [misc/crtdll.c] [relay32/crtdll.spec] [include/winerror.h]
Implemented fscanf, fsetpos, _access, _fpreset (thanks to Uwe Bonnes),
and _ltoa.
* [loader/task.c]
MakeProcInstance: must use CURRENT_DS if hInst == NULL.
* [misc/shell.c]
SHELL_GetResourceTable, InternalExtractIcon: fixed broken .ICO handling
* [windows/winpos.c]
DeferWindowPos: removed "same parent" requirement.
Which doc states that this is required ?
Sat May 16 20:08:11 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/module.c] [loader/ne/module.c]
More NE module cleanups.
* [loader/task.c]
Fixed SwitchStackBack().
Fri May 15 10:04:27 1998 Marcus Meissner <marcus@jet.franken.de>
* [configure.in][inlcude/acconfig.h]
Fixed broken OSS check, added check for working sigaltstack,
fixed broken statfs checks on some linux systems.
* [files/directory.c][loader/pe_image.c][relay32/builtin.c]
[loader/module.c]
Added handling of win32 module pathnames.
* [relay32/wnaspi32.spec]
New file.
* [misc/lzexpand.c]
LZCopy auto-decompresses LZ compressed files, even if they are not
specially flagged. Fixes some InstallShield problems.
* [misc/registry.c]
Some fixes for RegQueryInfoKey (reference program monkey.exe
from Win32 SDK works now better). Probably still has faults.
Fri May 15 08:58:58 1998 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/mapping.c] [include/dc.h] [include/gdi.h] [objects/dc.c]
Reworked the way world transformations and mapping modes are handled
so that both of these transformations can be computed in a single
step.
* [graphics/painting.c] [graphics/path.c] [include/path.h]
More GDI path support.
* [graphics/x11drv/graphics.c]
Fixed the return value of GRAPH_DrawArc for the zero height /
zero width case to reflect Windows' behaviour.
* [include/windows.h] [relay32/gdi32.spec] [objects/dc.c]
Implemented ModifyWorldTransform and CombineTransform.
Tue May 14 18:03:46 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/commctrl.c][relay32/comctl32.spec]
[controls/*.c][include/*.h]
Implemented InitCommonControlsEx (dll version 4.72 compatible).
InitCommonControls calls ImageCommonControlsEx.
Registering code of the common controls had to be changed
(see XXXX_Register functions).
* [controls/status.c][include/commctrl.h][include/status.h]
Implemented most new features and fixed the look and feel.
* [contols/commctrl.c][include/commctrl.h][relay32/comctl32.spec]
Implemented MenuHelp (incomplete).
* [controls/status.c][controls/progress.c]
Changed allocation strategy for control specific memory.
* [controls/header.c][include/header.h][include/commctrl.h]
First implementation of header control.
* [windows/defwnd.c][windows/syscolors.c]
Fixed default control colors for Win95 look.
* [windows/nonclient.c]
Fixed off by one error for Win95 look. Top border of child windows
should be visible.
* [misc/imagelist.h]
Improved documentation and fixed some bugs.
Thu May 14 15:42:21 1998 Robert Wilhelm <robert@physiol.med.tu-muenchen.de>
* [relay32/crtdll.spec]
Added hypot,j0,j1,jn and ceil.
Wed May 13 19:10:10 1998 Pascal Cuoq <pcuoq@ens-lyon.fr>
* [controls/listbox.c]
Item height is now exactly font height.
Wine listboxes now behave like Windows' when they are
created without WS_VSCROLL but the program subsequently
calls ShowScrollBar or SetScrollInfo.
Wed May 13 18:33:01 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [relay32/relay386.c]
Restore ES also in the non-debug case.
* [windows/event.c]
Bugfix: Blocking TSXNextEvent could deadlock Wine.
* [win32/process.c] [windows/message.c]
Silly stubs for MsgWaitForMultipleObjects / PostThreadMessage
that make some programs run better.
* [windows/winproc.c]
WINPROC_MapMsg32Ato16/16To32A: added WM_NOTIFY.
* [win32/kernel32.c]
Added 16->32 thunking and improved 32->16 thunking functions.
* [tools/build.c]
Added new variant of CallFrom16 stub for use with Win95 thunks.
* [if1632/kernel.spec] [if1632/builtin.c] [win32/kernel32.c]
Added a few undocumented KERNEL functions.
* [loader/ne/module.c] [loader/ne/segment.c]
Call DllEntryPoint for 16-bit DLLs with subsystem >= 4.0.
* [win32/kernel32.spec] [win32/wow32.spec] [win32/ordinals.c]
Use names from the Oct 94 beta release for undoc. functions.
Wed May 13 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [misc/registry.c]
Code cleanup.
* [misc/cpu.c]
Commented out the registry puts temporarily.
* [programs/regtest/*]
New registry testing program.
Tue May 12 22:54:03 1998 Michael Mess <michael@kawo2.rwth-aachen.de>
* [multimedia/audio.c]
ioctl's do not commute in /dev/dsp initialization.
Tue May 12 20:11:42 1998 Karl Garrison <karlos@eznet.net>
* [win32/console.c]
Implemented SetConsoleTextAttribute, FillConsoleOutputCharacter.
Improved cursor positioning.
This allows for text colors in an xterm, rxvt, or console.
Tue May 12 17:57:52 1998 Petter Reinholdtsen <pere@td.org.uit.no>
* [Makefile.in]
Create prefix/{bin|lib} directories if missing during install.
Sun May 10 19:37:51 1998 Jan Willamowius <jan@janhh.shnet.org>
* [multimedia/mmio.c]
Have mmioSetBuffer return success (0), so Corel Draw 4
keeps working. (IO is still unbuffered)
Wed May 6 16:57:55 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [Make.rules.in]
Changed "make clean" to remove `textedit` backup files (*%)
* [controls/menu.c][graphics/x11drv/xfont.c][include/libres.h]
[loader/main.c][loader/ne/module.c][scheduler/synchro.c]
[win32/time.c][windows/winpos.c][include/windows.h]
Fixed miscellaneous compilation warnings.
* [misc/main.c][miscemu/main.c][include/main.h]
Moved prototypes to new include file main.h, various cleanups.
Tue May 5 21:05:06 1998 Morten Welinder <terra@diku.dk>
* [misc/winsock.c]
Don't refer to __FreeBSD__ when HAVE_STRERROR is meant.
* [misc/debugstr.c]
For debug_dumpstrSend, send strings to stderr.
Tue May 5 21:47:40 1998 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [objects/region.c]
Fix for REGION_RegionOp() if newReg is one of the source regions.
Tue May 5 18:27:32 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [misc/main.c]
Add '-h/-help' option and print WINE_RELEASE_INFO with usage message.
* [misc/spy.c]
Realign trace messages.
Tue May 5 15:46:47 1998 Donnie V. Savage <dsavage@cisco.com>
* [graphics/ddraw.c]
Fixed compile warnings
* [misc/winsock.c]
Warnings should not be errors.
Tue May 5 13:40:42 1998 Jim Peterson <jspeter@roanoke.infi.net>
* [*/*]
Remove many warnings through explicit casts, added #include's,
and corrected printf formats.
Tue May 5 05:18:12 1998 Insomnia (Stea Greene) <insomnia@core.binghamton.edu>
* [graphics/ddraw.c]
Kept unchanged portion of old palette when changing only a few
palette entries. Really should only deallocate the changed cells.
This make StarCraft work almost perfectly (sound overflows still
cause static).
Mon May 4 15:04:57 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage: terminate string on %0, undo linefeed strip.
1998-05-17 19:13:43 +02:00
|
|
|
strcpy( module, "???" );
|
1999-05-02 16:32:27 +02:00
|
|
|
DPRINTF( "%04x %4d %p %04x %s\n", hQueue,queue->msgCount,
|
2000-05-29 23:25:10 +02:00
|
|
|
queue->teb, queue->teb->htask16, module );
|
1996-03-14 19:08:34 +01:00
|
|
|
hQueue = queue->next;
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
1999-05-02 16:32:27 +02:00
|
|
|
DPRINTF( "\n" );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-08-11 17:49:51 +02:00
|
|
|
/***********************************************************************
|
1997-05-25 15:58:18 +02:00
|
|
|
* QUEUE_IsExitingQueue
|
1996-08-11 17:49:51 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL QUEUE_IsExitingQueue( HQUEUE16 hQueue )
|
1996-08-11 17:49:51 +02:00
|
|
|
{
|
1997-05-25 15:58:18 +02:00
|
|
|
return (hExitingQueue && (hQueue == hExitingQueue));
|
1996-08-11 17:49:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
1997-05-25 15:58:18 +02:00
|
|
|
* QUEUE_SetExitingQueue
|
1996-08-11 17:49:51 +02:00
|
|
|
*/
|
1997-05-25 15:58:18 +02:00
|
|
|
void QUEUE_SetExitingQueue( HQUEUE16 hQueue )
|
1996-08-11 17:49:51 +02:00
|
|
|
{
|
1997-05-25 15:58:18 +02:00
|
|
|
hExitingQueue = hQueue;
|
1996-08-11 17:49:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_CreateMsgQueue
|
|
|
|
*
|
|
|
|
* Creates a message queue. Doesn't link it into queue list!
|
|
|
|
*/
|
1999-02-05 11:37:53 +01:00
|
|
|
static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1996-08-11 17:49:51 +02:00
|
|
|
HQUEUE16 hQueue;
|
2001-01-05 05:08:07 +01:00
|
|
|
HANDLE handle;
|
1996-03-14 19:08:34 +01:00
|
|
|
MESSAGEQUEUE * msgQueue;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): Creating message queue...\n");
|
Release 960428
Sun Apr 28 14:32:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [Makefile.in]
Subdir memory is now also compiled for Winelib, in order to get
the Win32 heap functions.
* [if1632/Makefile.in]
Renamed winprocs and winprocs32 to wprocs and wprocs32 to avoid
DLL names > 8 characters.
* [loader/builtin.c] (New file)
Grouped all built-in DLLs code in a single file.
* [memory/global.c]
Use the Win32 heap code instead of malloc() to allocate linear
memory. This will help test the heap code.
* [memory/local.c]
Fixed FreeSelector() to clear DS and ES correctly for huge blocks.
* [tools/build.c] [if1632/relay.c]
Removed 'id' directive in spec files. For relay debugging, the DLL
entry point is now computed from the CS:IP entry point address.
Added 'heap' directive to specifiy a local heap for the DLL. USER
and GDI heap are now created this way.
* [windows/class.c] [include/class.h]
Changed the class structure to use pointers instead of handles.
Changed Get/SetClassWord/Long to use a switch statement; this
allows changing the layout of the CLASS structure.
* [windows/win.c] [include/win.h]
Use a CLASS * instead of a handle for the window class.
Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec] [memory/global.c]
[win32/memory.c] [win32/process.c]
GetProcessAffinityMask,GlobalLock,IsBadReadPtr,IsBadWritePtr,
LocalLock,SetThreadAffinityMask: new relays.
* [win32/cursoricon32.c]
Return same handle if a cursor is loaded multiple times.
Sat Apr 27 15:13:37 1996 Bang Jun Young <bangjy@nownuri.nowcom.co.kr>
* [resources/sysres_Ko.rc]
Added support for Korean [Ko] language.
Fri Apr 26 00:49:05 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [objects/dc.c] [objects/font.c]
Fixed problem with SaveDC()/RestoreDC() and font cache 'used' count.
* [objects/metafile.c] [objects/dcvalues.c]
Fixed broken SetTextAlign() on metafiles.
* [objects/metafile.c]
Delete objects in handle table at end of PlayMetaFile().
Wed Apr 24 19:21:01 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/ver.spec] [misc/ver.c] [include/ver.h] (New files)
VER.DLL (partially) implemented (VerFindFile,VerInstallFile)
[If it doesn't work for you, use -dll -ver and report it to me]
* [if1632/user32.spec] [if1632/kernel32.spec] [if1632/shell.spec]
[if1632/shell32.spec] [misc/ole2nls.c] [windows/message.c]
[windows/graphics.c]
Simple win32 functions, where we can just use the win16 counterpart.
Misc. stubs.
* [misc/lstr.c]
Someone reported a _lstrlen(NULL). NULL is a valid argument. Fixed.
* [misc/registry.c]
Some alloclens were off by 1, one double fclose() fixed.
Requesting value 0 of a key with no values returns an error
(should we always return a made up value NULL? what does win3.1?)
Tue Apr 23 17:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [misc/shell.c]
Implemented FindEnvironmentString(), DoEnvironmentSubst(),
ExtractIcon(), InternalExtractIcon() and ExtractAssociatedIcon().
* [misc/user.c]
Do extensive cleanup on application exit.
* [windows/hook.c] [windows/win.c] [windows/class.c]
Added miscellaneous cleanup routines.
* [controls/menu.c]
More efficient popup menu window handling.
Mon Apr 22 21:35:22 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/windows.h][objects/oembitmap.c][include/bitmaps/obm_trtype]
Added "TT-bitmap" for later usage in a ChooseFont() ownerdraw combobox.
1996-04-28 17:09:19 +02:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if (!(hQueue = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT,
|
|
|
|
sizeof(MESSAGEQUEUE) )))
|
1996-03-14 19:08:34 +01:00
|
|
|
return 0;
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
msgQueue = (MESSAGEQUEUE *) GlobalLock16( hQueue );
|
1999-01-28 11:54:11 +01:00
|
|
|
if ( !msgQueue )
|
|
|
|
return 0;
|
|
|
|
|
2001-02-27 03:09:16 +01:00
|
|
|
SERVER_START_REQ( get_msg_queue )
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
2001-02-27 03:09:16 +01:00
|
|
|
SERVER_CALL_ERR();
|
2001-01-05 05:08:07 +01:00
|
|
|
handle = req->handle;
|
2000-08-30 02:00:48 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
2001-01-05 05:08:07 +01:00
|
|
|
if (!handle)
|
2000-05-30 21:48:18 +02:00
|
|
|
{
|
|
|
|
ERR_(msg)("Cannot get thread queue");
|
|
|
|
GlobalFree16( hQueue );
|
|
|
|
return 0;
|
|
|
|
}
|
2000-08-30 02:00:48 +02:00
|
|
|
msgQueue->server_queue = handle;
|
2000-05-30 21:48:18 +02:00
|
|
|
msgQueue->server_queue = ConvertToGlobalHandle( msgQueue->server_queue );
|
|
|
|
|
1996-09-28 20:11:01 +02:00
|
|
|
msgQueue->self = hQueue;
|
1999-02-18 18:34:09 +01:00
|
|
|
msgQueue->wakeBits = msgQueue->changeBits = 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
InitializeCriticalSection( &msgQueue->cSection );
|
1999-02-13 13:24:04 +01:00
|
|
|
MakeCriticalSectionGlobal( &msgQueue->cSection );
|
1999-02-09 16:35:12 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
msgQueue->lockCount = 1;
|
|
|
|
msgQueue->magic = QUEUE_MAGIC;
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Create and initialize our per queue data */
|
|
|
|
msgQueue->pQData = bCreatePerQData ? PERQDATA_CreateInstance() : NULL;
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return hQueue;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_FlushMessage
|
|
|
|
*
|
|
|
|
* Try to reply to all pending sent messages on exit.
|
|
|
|
*/
|
1999-06-26 16:58:24 +02:00
|
|
|
static void QUEUE_FlushMessages( MESSAGEQUEUE *queue )
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
|
|
|
SMSG *smsg;
|
|
|
|
MESSAGEQUEUE *senderQ = 0;
|
|
|
|
|
|
|
|
if( queue )
|
|
|
|
{
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
|
|
|
|
|
|
|
/* empty the list of pending SendMessage waiting to be received */
|
|
|
|
while (queue->smPending)
|
|
|
|
{
|
|
|
|
smsg = QUEUE_RemoveSMSG( queue, SM_PENDING_LIST, 0);
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
senderQ = QUEUE_Lock( smsg->hSrcQueue );
|
1999-02-18 18:34:09 +01:00
|
|
|
if ( !senderQ )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* return 0, to unblock other thread */
|
|
|
|
smsg->lResult = 0;
|
|
|
|
smsg->flags |= SMSG_HAVE_RESULT;
|
|
|
|
QUEUE_SetWakeBit( senderQ, QS_SMRESULT);
|
|
|
|
|
|
|
|
QUEUE_Unlock( senderQ );
|
|
|
|
}
|
|
|
|
|
|
|
|
QUEUE_ClearWakeBit( queue, QS_SENDMESSAGE );
|
|
|
|
|
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DeleteMsgQueue
|
|
|
|
*
|
|
|
|
* Unlinks and deletes a message queue.
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
*
|
|
|
|
* Note: We need to mask asynchronous events to make sure PostMessage works
|
|
|
|
* even in the signal handler.
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
MESSAGEQUEUE * msgQueue = QUEUE_Lock(hQueue);
|
1996-07-17 22:02:21 +02:00
|
|
|
HQUEUE16 *pPrev;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): Deleting message queue %04x\n", hQueue);
|
Release 960428
Sun Apr 28 14:32:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [Makefile.in]
Subdir memory is now also compiled for Winelib, in order to get
the Win32 heap functions.
* [if1632/Makefile.in]
Renamed winprocs and winprocs32 to wprocs and wprocs32 to avoid
DLL names > 8 characters.
* [loader/builtin.c] (New file)
Grouped all built-in DLLs code in a single file.
* [memory/global.c]
Use the Win32 heap code instead of malloc() to allocate linear
memory. This will help test the heap code.
* [memory/local.c]
Fixed FreeSelector() to clear DS and ES correctly for huge blocks.
* [tools/build.c] [if1632/relay.c]
Removed 'id' directive in spec files. For relay debugging, the DLL
entry point is now computed from the CS:IP entry point address.
Added 'heap' directive to specifiy a local heap for the DLL. USER
and GDI heap are now created this way.
* [windows/class.c] [include/class.h]
Changed the class structure to use pointers instead of handles.
Changed Get/SetClassWord/Long to use a switch statement; this
allows changing the layout of the CLASS structure.
* [windows/win.c] [include/win.h]
Use a CLASS * instead of a handle for the window class.
Sat Apr 27 18:10:11 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec] [memory/global.c]
[win32/memory.c] [win32/process.c]
GetProcessAffinityMask,GlobalLock,IsBadReadPtr,IsBadWritePtr,
LocalLock,SetThreadAffinityMask: new relays.
* [win32/cursoricon32.c]
Return same handle if a cursor is loaded multiple times.
Sat Apr 27 15:13:37 1996 Bang Jun Young <bangjy@nownuri.nowcom.co.kr>
* [resources/sysres_Ko.rc]
Added support for Korean [Ko] language.
Fri Apr 26 00:49:05 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk>
* [objects/dc.c] [objects/font.c]
Fixed problem with SaveDC()/RestoreDC() and font cache 'used' count.
* [objects/metafile.c] [objects/dcvalues.c]
Fixed broken SetTextAlign() on metafiles.
* [objects/metafile.c]
Delete objects in handle table at end of PlayMetaFile().
Wed Apr 24 19:21:01 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/ver.spec] [misc/ver.c] [include/ver.h] (New files)
VER.DLL (partially) implemented (VerFindFile,VerInstallFile)
[If it doesn't work for you, use -dll -ver and report it to me]
* [if1632/user32.spec] [if1632/kernel32.spec] [if1632/shell.spec]
[if1632/shell32.spec] [misc/ole2nls.c] [windows/message.c]
[windows/graphics.c]
Simple win32 functions, where we can just use the win16 counterpart.
Misc. stubs.
* [misc/lstr.c]
Someone reported a _lstrlen(NULL). NULL is a valid argument. Fixed.
* [misc/registry.c]
Some alloclens were off by 1, one double fclose() fixed.
Requesting value 0 of a key with no values returns an error
(should we always return a made up value NULL? what does win3.1?)
Tue Apr 23 17:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [misc/shell.c]
Implemented FindEnvironmentString(), DoEnvironmentSubst(),
ExtractIcon(), InternalExtractIcon() and ExtractAssociatedIcon().
* [misc/user.c]
Do extensive cleanup on application exit.
* [windows/hook.c] [windows/win.c] [windows/class.c]
Added miscellaneous cleanup routines.
* [controls/menu.c]
More efficient popup menu window handling.
Mon Apr 22 21:35:22 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/windows.h][objects/oembitmap.c][include/bitmaps/obm_trtype]
Added "TT-bitmap" for later usage in a ChooseFont() ownerdraw combobox.
1996-04-28 17:09:19 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
if (!hQueue || !msgQueue)
|
|
|
|
{
|
2000-08-29 05:52:46 +02:00
|
|
|
ERR_(msg)("invalid argument.\n");
|
1996-03-14 19:08:34 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
msgQueue->magic = 0;
|
|
|
|
|
|
|
|
if( hCursorQueue == hQueue ) hCursorQueue = 0;
|
|
|
|
if( hActiveQueue == hQueue ) hActiveQueue = 0;
|
1996-09-28 20:11:01 +02:00
|
|
|
|
|
|
|
/* flush sent messages */
|
1999-02-18 18:34:09 +01:00
|
|
|
QUEUE_FlushMessages( msgQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Release per queue data if present */
|
|
|
|
if ( msgQueue->pQData )
|
|
|
|
{
|
|
|
|
PERQDATA_Release( msgQueue->pQData );
|
|
|
|
msgQueue->pQData = 0;
|
|
|
|
}
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
/* remove the message queue from the global link list */
|
1996-03-14 19:08:34 +01:00
|
|
|
pPrev = &hFirstQueue;
|
|
|
|
while (*pPrev && (*pPrev != hQueue))
|
|
|
|
{
|
1996-05-06 18:06:24 +02:00
|
|
|
MESSAGEQUEUE *msgQ = (MESSAGEQUEUE*)GlobalLock16(*pPrev);
|
1999-02-09 15:07:07 +01:00
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
if ( !msgQ || (msgQ->magic != QUEUE_MAGIC) )
|
|
|
|
{
|
|
|
|
/* HQUEUE link list is corrupted, try to exit gracefully */
|
2000-08-29 05:52:46 +02:00
|
|
|
ERR_(msg)("HQUEUE link list corrupted!\n");
|
1999-02-09 15:07:07 +01:00
|
|
|
pPrev = 0;
|
|
|
|
break;
|
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
pPrev = &msgQ->next;
|
|
|
|
}
|
1999-02-09 15:07:07 +01:00
|
|
|
if (pPrev && *pPrev) *pPrev = msgQueue->next;
|
1996-06-16 18:16:05 +02:00
|
|
|
msgQueue->self = 0;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2000-08-29 05:52:46 +02:00
|
|
|
/* free up resource used by MESSAGEQUEUE structure */
|
1999-01-28 11:54:11 +01:00
|
|
|
msgQueue->lockCount--;
|
|
|
|
QUEUE_Unlock( msgQueue );
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_CreateSysMsgQueue
|
|
|
|
*
|
|
|
|
* Create the system message queue, and set the double-click speed.
|
|
|
|
* Must be called only once.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL QUEUE_CreateSysMsgQueue( int size )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Note: We dont need perQ data for the system message queue */
|
|
|
|
if (!(hmemSysMsgQueue = QUEUE_CreateMsgQueue( FALSE )))
|
|
|
|
return FALSE;
|
|
|
|
|
1996-05-06 18:06:24 +02:00
|
|
|
sysMsgQueue = (MESSAGEQUEUE *) GlobalLock16( hmemSysMsgQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_GetSysQueue
|
|
|
|
*/
|
|
|
|
MESSAGEQUEUE *QUEUE_GetSysQueue(void)
|
|
|
|
{
|
|
|
|
return sysMsgQueue;
|
|
|
|
}
|
|
|
|
|
Release 980822
Sat Aug 22 17:46:19 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [include/dosexe.h] [include/module.h] [include/pe_image.h]
[include/process.h] [include/windows.h] [loader/dos/module.c]
[loader/module.c] [loader/ne/module.c] [loader/pe_image.c]
[scheduler/process.c] [win32/process.c]
Partially implemented CreateProcess32.
* [win32/device.c] [relay32/kernel32.spec] [scheduler/k32obj.c]
[misc/registry.c] [win32/file.c]
Partially implemented VxDCall (VMM registry services).
* [files/dos_fs.c]
DOSFS_FindNext made thread-safe.
* [include/sig_context.h] [include/syslevel.h] [loader/signal.c]
[scheduler/syslevel.c] [tools/build.c]
Replaced CALLTO16_Current_fs by SYSLEVEL_Win16CurrentTeb.
* [win32/kernel32.c]
Bugfix: QT_Thunk/FT_Thunk should return 'long' in DX:AX, not EAX.
* [if1632/relay.c] [relay32/builtin32.c] [windows/msgbox.c]
[msdos/int20.c] [msdos/int21.c]
Use ExitProcess instead of TASK_KillCurrentTask.
* [include/task.h] [include/thread.h] [loader/task.c]
[scheduler/thread.c] [include/queue.h] [windows/message.c]
[windows/queue.c] [windows/win.c]
Prevent Win32 threads from entering the TASK_Reschedule loop.
(Note: Win32 messaging still doesn't work correctly; this patch
is just preventing the system from crashing when Win32 threads
call messaging functions. Messages will probably still get lost.)
* [scheduler/critsection.c]
Deactivated the use of SEM_UNDO for the SYSTEM_LOCK semaphore;
for some reason, this leads to problems after threads terminate...
Sat Aug 22 15:00:00 1998 Jrgen Schmied <juergen.schmied@metronet.de>
* [include/authors.h]
New file, includes all names of the developer (former shell.c)
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/shell32/Makefile.in][shres.rc]
Created dlls/shell32 and moved the shell32 stuff in it.
Started to create internal resources.
* [dlls/shell32/*]
Split the shell32 implementation into smaller files.
New classes: IContextMenu, IExtractIcon, IShellView.
Implemented Shell_GetImageList().
shell32 links to comctl32 now dynamically so it can use
internal/external implementations.
* [documentation/internal-dll] [documentation/shell32]
New, could anybody do a spellcheck?
* [include/commctrl.h]
Many new LV constants, structures, functions.
* [controls/comctl32undoc.c]
Rewrote the DSA* functions.
* [windows/winpos.c]
SetShellWindow32, GetShellWindow32.
Sat Aug 22 14:02:15 1998 Alexander Lukyanov <lav@long.yar.ru>
* [loader/resource.c]
Mark last accelerator as such in LoadAccelerators32W.
* [relay32/shell32.spec] [misc/shell.c]
Add stubs for SHGetSpecialFolderPath[AW].
Sat Aug 22 02:07:42 1998 Adrian Harvey <adrian@select.com.au>
* [include/file.h] [file/file.c] [msdos/int21.c] [msdos/vxd.c]
[misc/lzexpand.c] [win32/kernel32.c] [documentation/filehandles]
Fixed file handle handling. Created universal HFILE16 to HFILE32
translation macro from msdos/int21 code by Ove Kaaven.
Used macro in all Win16 functions so that win32 handles are translated
to avoid DOS/Win16 stdxx handles.
Removed handle translation from int21.c where Win16 functions are
called. Changed remaining calls to use new macro names.
Documented filehandle handling and differences between win 16 & 32.
Fri Aug 21 20:32:49 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [server/process.c] [server/thread.c]
Implemented object wait queues and synchronization.
Fri Aug 21 18:40:02 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
DEVMODE dmPaper{Width|Length} fields are in 0.1mm.
Select a 100 pixel default font in CreateDC.
Thu Aug 20 22:47:39 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [objects/bitmap.c]
Handle bits=32 in SetBitmapBits32 and GetBitmapBits32.
* [msdos/int21.c]
Add handling of Int21 0A and 37.
* [misc/commdlg.c]
Use MapHModuleLS and MapHModuleSL when translating HINSTANCE16 to
HINSTANCE32 and vice versa.
* [win32/file.c]
CreateFile32A: Abort if filename == NULL.
Thu Aug 20 12:28:31 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Lots of missing prototypes added, some parameter types adapted to match
SDK.
* [debugger/stabs.c]
Don't loop forever if we don't find wine or one of the libxxx.so.
* [loader/ne/module.c]
Implemented MapHModuleLS,MapHModuleSL,MapHinstLS,MapHinstSL.
* [misc/network.c]
Implemented WNetGetUser32A.
* [misc/shellord.c]
Implemented ILRemoveLastID.
* [multimedia/dsound.c]
Fixed StarCraft memory leak.
* [graphics/ddraw.c]
Removed some unnecessary simple relaying functions, tried polishing
up the Xlib implementation (still doesn't work), temp. removed Xshm
code (to be remerged with working Xlib code).
Tue Aug 18 22:29:17 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c] [multimedia/mmsystem.c]
Fixed most mmio bugs, fully implementing mmioSetBuffer
buffering, ability to read memory files, and the
sndPlaySound() SND_MEMORY flag. Most mmio-using programs
now work fine.
* [include/dosexe.h] [include/miscemu.h] [include/module.h]
[loader/module.c] [loader/task.c] [msdos/dosmem.c]
Improved DOS VM flexibility and portability somewhat. (Did
I get the #ifdefs right this time, BSD-ers?)
* [msdos/int21.c]
Made "Get Current PSP address" work as expected in a DOS VM.
* [loader/dos/*]
Began improving flexibility and portability somewhat. It
should be easier to add DPMI RMCB callbacks now. The
DOS VM no longer leaves big files lying around in /tmp
after a crash.
Tue Aug 18 12:38:31 1998 Turchanov Sergey <turchanov@usa.net>
* [relay32/winmm.spec]
This patch allows WinAmp to play WAV files (at least in PCM
format).
Sun Aug 16 05:34:13 1998 Pablo Saratxaga <srtxg@chanae.alphanet.ch>
* [windows/keyboard.c]
Corrected keyboard code to properly handle keys : ? ~ and "
on non US keyboards.
Sat Aug 15 18:47:14 1998 Brian Craft <bcboy@dorothy.wanglab.brandeis.edu>
* [windows/win.c]
Fixed severe bug in EnumChildWindwos().
Thu Aug 13 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/tooltips.c]
Fixed some bugs. Added subclassing support.
* [controls/toolbar.c]
Improved tooltip integration. Fixed some bugs.
* [controls/commctrl.c]
Changed control registration and added some documentation.
Fixed ShowHideMenuCtl.
* [controls/rebar.c][include/rebar.h][include/commctrl.h]
Improved rebar implementation (still no display).
* [controls/pager.c][include/pager.h][include/commctrl.h]
Improved pager implementation (still no display).
* [misc/imagelist.c]
Fixed a bug.
* [documentation/common_controls]
Updated.
Sun Aug 9 19:50:20 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [documentation/Makefile.in]
[programs/Makefile.in] [programs/*/Makefile.in]
Added uninstall rules, cleaned up install rules a little bit.
Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne/module.c] [if1632/kernel.spec]
Added the undocumented HIWORD of GetModuleHandle (hFirstModule).
* [loader/ne/segment.c]
Wine forgot to set some NE_SEGFLAGS_*.
Combined with another loader change, this fixed the
"BLINKER -- error in loading module" or ghost MessageBox problem
that about 1% of all Windows programs have.
Some BLINKER programs still don't work, though.
But I'm working on it, with great help from Blinkinc.
* [loader/task.c]
InitTask needs to decrement the SP register by two as Win95 does.
Sun Aug 9 02:41:28 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [if1632/kernel.spec] [relay32/kernel32.spec] [scheduler/syslevel.c]
[loader/main.c] [win32/ordinals.c] [include/syslevel.h]
[scheduler/Makefile.in]
Implemented Win95 'syslevel' routines (including Win16Lock).
* [if1632/relay.c] [if1632/thunk.c] [tools/build.c] [loader/task.c]
[loader/ne/segment.c] [win32/kernel32.c] [memory/selector.c]
[include/stackframe.h] [include/thread.h]
16-bit %fs handling revised. Use Win16Lock where appropriate.
* [include/thread.h] [scheduler/synchro.c] [windows/message.c]
[windows/queue.c] [win32/process.c]
Implemented MsgWaitForMultipleObjects.
* [files/change.c] [files/Makefile.in] [scheduler/k32obj.c]
[win32/newfns.c]
Implemented (dummy) file change notification objects.
* [debugger/dbg.y] [scheduler/process.c] [scheduler/thread.c]
[include/process.h] [include/thread.h]
Suspend all threads except current when hitting debugger break point.
* [objects/dib.c]
Bugfix for CreateDIBSection.
1998-08-22 21:03:56 +02:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
/***********************************************************************
|
1999-02-09 15:07:07 +01:00
|
|
|
* QUEUE_SetWakeBit
|
1996-05-28 20:54:58 +02:00
|
|
|
*
|
|
|
|
* See "Windows Internals", p.449
|
|
|
|
*/
|
2001-01-29 01:33:35 +01:00
|
|
|
static BOOL QUEUE_TrySetWakeBit( MESSAGEQUEUE *queue, WORD bit, BOOL always )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
BOOL wake = FALSE;
|
|
|
|
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
|
|
|
|
|
|
|
TRACE_(msg)("queue = %04x (wm=%04x), bit = %04x, always = %d\n",
|
|
|
|
queue->self, queue->wakeMask, bit, always );
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if ((queue->wakeMask & bit) || always)
|
|
|
|
{
|
|
|
|
if (bit & QS_MOUSE) pMouseQueue = queue;
|
|
|
|
if (bit & QS_KEY) pKbdQueue = queue;
|
|
|
|
queue->changeBits |= bit;
|
|
|
|
queue->wakeBits |= bit;
|
|
|
|
}
|
1996-05-28 20:54:58 +02:00
|
|
|
if (queue->wakeMask & bit)
|
|
|
|
{
|
|
|
|
queue->wakeMask = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
wake = TRUE;
|
|
|
|
}
|
2000-08-30 02:00:48 +02:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
|
|
|
|
if ( wake )
|
|
|
|
{
|
1999-02-09 16:35:12 +01:00
|
|
|
/* Wake up thread waiting for message */
|
2001-04-04 02:19:55 +02:00
|
|
|
SERVER_START_REQ( wake_queue )
|
1999-06-06 16:42:10 +02:00
|
|
|
{
|
2001-04-04 02:19:55 +02:00
|
|
|
req->handle = queue->server_queue;
|
|
|
|
req->bits = bit;
|
|
|
|
SERVER_CALL();
|
1999-02-09 16:35:12 +01:00
|
|
|
}
|
2001-04-04 02:19:55 +02:00
|
|
|
SERVER_END_REQ;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
2001-01-29 01:33:35 +01:00
|
|
|
|
|
|
|
return wake;
|
|
|
|
}
|
|
|
|
void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit )
|
|
|
|
{
|
|
|
|
QUEUE_TrySetWakeBit( queue, bit, TRUE );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-06-16 18:16:05 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_ClearWakeBit
|
|
|
|
*/
|
|
|
|
void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit )
|
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-06-16 18:16:05 +02:00
|
|
|
queue->changeBits &= ~bit;
|
|
|
|
queue->wakeBits &= ~bit;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_TestWakeBit
|
|
|
|
*/
|
|
|
|
WORD QUEUE_TestWakeBit( MESSAGEQUEUE *queue, WORD bit )
|
|
|
|
{
|
|
|
|
WORD ret;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
|
|
|
ret = queue->wakeBits & bit;
|
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
return ret;
|
1996-06-16 18:16:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_WaitBits
|
|
|
|
*
|
|
|
|
* See "Windows Internals", p.447
|
1999-03-10 17:21:12 +01:00
|
|
|
*
|
|
|
|
* return values:
|
|
|
|
* 0 if exit with timeout
|
|
|
|
* 1 otherwise
|
1996-05-28 20:54:58 +02:00
|
|
|
*/
|
1999-03-10 17:21:12 +01:00
|
|
|
int QUEUE_WaitBits( WORD bits, DWORD timeout )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
2000-01-01 23:38:20 +01:00
|
|
|
HQUEUE16 hQueue;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("q %04x waiting for %04x\n", GetFastQueue16(), bits);
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2000-01-01 23:38:20 +01:00
|
|
|
hQueue = GetFastQueue16();
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return 0;
|
1999-03-10 17:21:12 +01:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
for (;;)
|
|
|
|
{
|
2001-04-04 02:19:55 +02:00
|
|
|
DWORD dwlc;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &queue->cSection );
|
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
if (queue->changeBits & bits)
|
|
|
|
{
|
|
|
|
/* One of the bits is set; we can return */
|
|
|
|
queue->wakeMask = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
|
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1999-03-10 17:21:12 +01:00
|
|
|
return 1;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
if (queue->wakeBits & QS_SENDMESSAGE)
|
|
|
|
{
|
|
|
|
/* Process the sent message immediately */
|
1996-09-28 20:11:01 +02:00
|
|
|
queue->wakeMask = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
|
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
QUEUE_ReceiveMessage( queue );
|
1996-09-28 20:11:01 +02:00
|
|
|
continue; /* nested sm crux */
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
queue->wakeMask = bits | QS_SENDMESSAGE;
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("%04x) wakeMask is %04x, waiting\n", queue->self, queue->wakeMask);
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-04-04 02:19:55 +02:00
|
|
|
ReleaseThunkLock( &dwlc );
|
|
|
|
if (dwlc) TRACE_(msg)("had win16 lock\n");
|
|
|
|
WaitForSingleObject( queue->server_queue, timeout );
|
|
|
|
if (dwlc) RestoreThunkLock( dwlc );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
1999-02-18 18:34:09 +01:00
|
|
|
* QUEUE_AddSMSG
|
1996-05-28 20:54:58 +02:00
|
|
|
*
|
1999-02-18 18:34:09 +01:00
|
|
|
* This routine is called when a SMSG need to be added to one of the three
|
|
|
|
* SM list. (SM_PROCESSING_LIST, SM_PENDING_LIST, SM_WAITING_LIST)
|
1996-05-28 20:54:58 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL QUEUE_AddSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("queue=%x, list=%d, smsg=%p msg=%s\n", queue->self, list,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg, SPY_GetMsgName(smsg->msg));
|
|
|
|
|
|
|
|
switch (list)
|
|
|
|
{
|
|
|
|
case SM_PROCESSING_LIST:
|
|
|
|
/* don't need to be thread safe, only accessed by the
|
|
|
|
thread associated with the sender queue */
|
|
|
|
smsg->nextProcessing = queue->smProcessing;
|
|
|
|
queue->smProcessing = smsg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SM_WAITING_LIST:
|
|
|
|
/* don't need to be thread safe, only accessed by the
|
|
|
|
thread associated with the receiver queue */
|
|
|
|
smsg->nextWaiting = queue->smWaiting;
|
|
|
|
queue->smWaiting = smsg;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SM_PENDING_LIST:
|
1999-03-17 16:14:31 +01:00
|
|
|
{
|
1999-02-18 18:34:09 +01:00
|
|
|
/* make it thread safe, could be accessed by the sender and
|
|
|
|
receiver thread */
|
1999-03-17 16:14:31 +01:00
|
|
|
SMSG **prev;
|
1999-02-18 18:34:09 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1999-03-17 16:14:31 +01:00
|
|
|
smsg->nextPending = NULL;
|
|
|
|
prev = &queue->smPending;
|
|
|
|
while ( *prev )
|
|
|
|
prev = &(*prev)->nextPending;
|
|
|
|
*prev = smsg;
|
1999-02-18 18:34:09 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-03-17 16:14:31 +01:00
|
|
|
|
|
|
|
QUEUE_SetWakeBit( queue, QS_SENDMESSAGE );
|
1999-02-18 18:34:09 +01:00
|
|
|
break;
|
1999-03-17 16:14:31 +01:00
|
|
|
}
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
default:
|
2000-08-29 05:52:46 +02:00
|
|
|
ERR_(sendmsg)("Invalid list: %d", list);
|
1999-02-18 18:34:09 +01:00
|
|
|
break;
|
|
|
|
}
|
1997-02-15 15:29:56 +01:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_RemoveSMSG
|
|
|
|
*
|
2000-08-29 05:52:46 +02:00
|
|
|
* This routine is called when a SMSG needs to be removed from one of the three
|
|
|
|
* SM lists (SM_PROCESSING_LIST, SM_PENDING_LIST, SM_WAITING_LIST).
|
1999-02-18 18:34:09 +01:00
|
|
|
* If smsg == 0, remove the first smsg from the specified list
|
|
|
|
*/
|
|
|
|
SMSG *QUEUE_RemoveSMSG( MESSAGEQUEUE *queue, int list, SMSG *smsg )
|
|
|
|
{
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
switch (list)
|
1996-06-16 18:16:05 +02:00
|
|
|
{
|
1999-02-18 18:34:09 +01:00
|
|
|
case SM_PROCESSING_LIST:
|
|
|
|
/* don't need to be thread safe, only accessed by the
|
|
|
|
thread associated with the sender queue */
|
|
|
|
|
|
|
|
/* if smsg is equal to null, it means the first in the list */
|
|
|
|
if (!smsg)
|
|
|
|
smsg = queue->smProcessing;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("queue=%x, list=%d, smsg=%p msg=%s\n", queue->self, list,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg, SPY_GetMsgName(smsg->msg));
|
|
|
|
/* In fact SM_PROCESSING_LIST is a stack, and smsg
|
|
|
|
should be always at the top of the list */
|
|
|
|
if ( (smsg != queue->smProcessing) || !queue->smProcessing )
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2000-09-22 22:59:29 +02:00
|
|
|
ERR_(sendmsg)("smsg not at the top of Processing list, smsg=0x%p queue=0x%p\n", smsg, queue);
|
1999-02-18 18:34:09 +01:00
|
|
|
return 0;
|
|
|
|
}
|
1997-07-20 18:23:21 +02:00
|
|
|
else
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
|
|
|
queue->smProcessing = smsg->nextProcessing;
|
|
|
|
smsg->nextProcessing = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
1999-02-18 18:34:09 +01:00
|
|
|
return smsg;
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
case SM_WAITING_LIST:
|
|
|
|
/* don't need to be thread safe, only accessed by the
|
|
|
|
thread associated with the receiver queue */
|
|
|
|
|
|
|
|
/* if smsg is equal to null, it means the first in the list */
|
|
|
|
if (!smsg)
|
|
|
|
smsg = queue->smWaiting;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("queue=%x, list=%d, smsg=%p msg=%s\n", queue->self, list,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg, SPY_GetMsgName(smsg->msg));
|
|
|
|
/* In fact SM_WAITING_LIST is a stack, and smsg
|
|
|
|
should be always at the top of the list */
|
|
|
|
if ( (smsg != queue->smWaiting) || !queue->smWaiting )
|
|
|
|
{
|
2000-09-22 22:59:29 +02:00
|
|
|
ERR_(sendmsg)("smsg not at the top of Waiting list, smsg=0x%p queue=0x%p\n", smsg, queue);
|
1999-02-18 18:34:09 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
queue->smWaiting = smsg->nextWaiting;
|
|
|
|
smsg->nextWaiting = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
1999-02-18 18:34:09 +01:00
|
|
|
return smsg;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
case SM_PENDING_LIST:
|
|
|
|
/* make it thread safe, could be accessed by the sender and
|
|
|
|
receiver thread */
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2000-08-29 05:52:46 +02:00
|
|
|
if (!smsg)
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg = queue->smPending;
|
2000-08-29 05:52:46 +02:00
|
|
|
if ( (smsg != queue->smPending) || !queue->smPending )
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
2000-09-22 22:59:29 +02:00
|
|
|
ERR_(sendmsg)("should always remove the top one in Pending list, smsg=0x%p queue=0x%p\n", smsg, queue);
|
2000-08-29 05:52:46 +02:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-02-18 18:34:09 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("queue=%x, list=%d, smsg=%p msg=%s\n", queue->self, list,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg, SPY_GetMsgName(smsg->msg));
|
1996-06-16 18:16:05 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
queue->smPending = smsg->nextPending;
|
|
|
|
smsg->nextPending = 0;
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
/* if no more SMSG in Pending list, clear QS_SENDMESSAGE flag */
|
|
|
|
if (!queue->smPending)
|
|
|
|
QUEUE_ClearWakeBit( queue, QS_SENDMESSAGE );
|
|
|
|
|
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
return smsg;
|
|
|
|
|
|
|
|
default:
|
2000-09-22 22:59:29 +02:00
|
|
|
ERR_(sendmsg)("Invalid list: %d\n", list);
|
1999-02-18 18:34:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
/***********************************************************************
|
1999-02-18 18:34:09 +01:00
|
|
|
* QUEUE_ReceiveMessage
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
*
|
2001-01-29 01:33:35 +01:00
|
|
|
* This routine is called to check whether a sent message is waiting
|
|
|
|
* for the queue. If so, it is received and processed.
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
*/
|
2001-01-29 01:33:35 +01:00
|
|
|
BOOL QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
{
|
1999-02-18 18:34:09 +01:00
|
|
|
LRESULT result = 0;
|
|
|
|
SMSG *smsg;
|
|
|
|
MESSAGEQUEUE *senderQ;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &queue->cSection );
|
2000-11-05 04:17:41 +01:00
|
|
|
if ( !((queue->wakeBits & QS_SENDMESSAGE) && queue->smPending) )
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
return FALSE;
|
1999-02-18 18:34:09 +01:00
|
|
|
}
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
|
|
|
|
|
|
|
TRACE_(sendmsg)("queue %04x\n", queue->self );
|
1999-02-18 18:34:09 +01:00
|
|
|
|
|
|
|
/* remove smsg on the top of the pending list and put it in the processing list */
|
|
|
|
smsg = QUEUE_RemoveSMSG(queue, SM_PENDING_LIST, 0);
|
|
|
|
QUEUE_AddSMSG(queue, SM_WAITING_LIST, smsg);
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("RM: %s [%04x] (%04x -> %04x)\n",
|
1999-02-18 18:34:09 +01:00
|
|
|
SPY_GetMsgName(smsg->msg), smsg->msg, smsg->hSrcQueue, smsg->hDstQueue );
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
if (IsWindow( smsg->hWnd ))
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
|
|
|
WND *wndPtr = WIN_FindWndPtr( smsg->hWnd );
|
|
|
|
DWORD extraInfo = queue->GetMessageExtraInfoVal; /* save ExtraInfo */
|
|
|
|
|
|
|
|
/* use sender queue extra info value while calling the window proc */
|
2001-01-29 01:33:35 +01:00
|
|
|
senderQ = QUEUE_Lock( smsg->hSrcQueue );
|
1999-02-18 18:34:09 +01:00
|
|
|
if (senderQ)
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
1999-02-18 18:34:09 +01:00
|
|
|
queue->GetMessageExtraInfoVal = senderQ->GetMessageExtraInfoVal;
|
|
|
|
QUEUE_Unlock( senderQ );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* call the right version of CallWindowProcXX */
|
|
|
|
if (smsg->flags & SMSG_WIN32)
|
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("\trcm: msg is Win32\n" );
|
1999-02-18 18:34:09 +01:00
|
|
|
if (smsg->flags & SMSG_UNICODE)
|
1999-02-26 12:11:13 +01:00
|
|
|
result = CallWindowProcW( wndPtr->winproc,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg->hWnd, smsg->msg,
|
|
|
|
smsg->wParam, smsg->lParam );
|
|
|
|
else
|
1999-02-26 12:11:13 +01:00
|
|
|
result = CallWindowProcA( wndPtr->winproc,
|
1999-02-18 18:34:09 +01:00
|
|
|
smsg->hWnd, smsg->msg,
|
|
|
|
smsg->wParam, smsg->lParam );
|
|
|
|
}
|
|
|
|
else /* Win16 message */
|
|
|
|
result = CallWindowProc16( (WNDPROC16)wndPtr->winproc,
|
|
|
|
(HWND16) smsg->hWnd,
|
|
|
|
(UINT16) smsg->msg,
|
|
|
|
LOWORD (smsg->wParam),
|
|
|
|
smsg->lParam );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
queue->GetMessageExtraInfoVal = extraInfo; /* Restore extra info */
|
1999-03-14 18:25:32 +01:00
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(sendmsg)("result = %08x\n", (unsigned)result );
|
1999-02-18 18:34:09 +01:00
|
|
|
}
|
1999-05-02 16:32:27 +02:00
|
|
|
else WARN_(sendmsg)("\trcm: bad hWnd\n");
|
1998-10-14 20:38:22 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
/* set SMSG_SENDING_REPLY flag to tell ReplyMessage16, it's not
|
|
|
|
an early reply */
|
|
|
|
smsg->flags |= SMSG_SENDING_REPLY;
|
|
|
|
ReplyMessage( result );
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2000-08-29 05:52:46 +02:00
|
|
|
TRACE_(sendmsg)("done!\n" );
|
2001-01-29 01:33:35 +01:00
|
|
|
return TRUE;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
}
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_AddMsg
|
|
|
|
*
|
|
|
|
* Add a message to the queue. Return FALSE if queue is full.
|
|
|
|
*/
|
1999-12-10 04:47:13 +01:00
|
|
|
BOOL QUEUE_AddMsg( HQUEUE16 hQueue, int type, MSG *msg, DWORD extraInfo )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *msgQueue;
|
1999-01-26 10:30:05 +01:00
|
|
|
QMSG *qmsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(msgQueue = QUEUE_Lock( hQueue ))) return FALSE;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
/* allocate new message in global heap for now */
|
2001-02-23 02:13:42 +01:00
|
|
|
if (!(qmsg = (QMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(QMSG) ) ))
|
1999-01-28 11:54:11 +01:00
|
|
|
{
|
|
|
|
QUEUE_Unlock( msgQueue );
|
1999-01-26 10:30:05 +01:00
|
|
|
return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &msgQueue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/* Store message */
|
1999-12-10 04:47:13 +01:00
|
|
|
qmsg->type = type;
|
1999-01-26 10:30:05 +01:00
|
|
|
qmsg->msg = *msg;
|
|
|
|
qmsg->extraInfo = extraInfo;
|
|
|
|
|
|
|
|
/* insert the message in the link list */
|
|
|
|
qmsg->nextMsg = 0;
|
|
|
|
qmsg->prevMsg = msgQueue->lastMsg;
|
|
|
|
|
|
|
|
if (msgQueue->lastMsg)
|
|
|
|
msgQueue->lastMsg->nextMsg = qmsg;
|
|
|
|
|
|
|
|
/* update first and last anchor in message queue */
|
|
|
|
msgQueue->lastMsg = qmsg;
|
|
|
|
if (!msgQueue->firstMsg)
|
|
|
|
msgQueue->firstMsg = qmsg;
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
msgQueue->msgCount++;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
LeaveCriticalSection( &msgQueue->cSection );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
QUEUE_SetWakeBit( msgQueue, QS_POSTMESSAGE );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( msgQueue );
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_FindMsg
|
|
|
|
*
|
|
|
|
* Find a message matching the given parameters. Return -1 if none available.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
QMSG* QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd, int first, int last )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
QMSG* qmsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
EnterCriticalSection( &msgQueue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if (!msgQueue->msgCount)
|
|
|
|
qmsg = 0;
|
|
|
|
else if (!hwnd && !first && !last)
|
|
|
|
qmsg = msgQueue->firstMsg;
|
|
|
|
else
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
/* look in linked list for message matching first and last criteria */
|
|
|
|
for (qmsg = msgQueue->firstMsg; qmsg; qmsg = qmsg->nextMsg)
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
MSG *msg = &(qmsg->msg);
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!hwnd || (msg->hwnd == hwnd))
|
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
if (!first && !last)
|
|
|
|
break; /* found it */
|
|
|
|
|
1999-02-19 17:50:24 +01:00
|
|
|
if ((msg->message >= first) && (!last || (msg->message <= last)))
|
1999-01-26 10:30:05 +01:00
|
|
|
break; /* found it */
|
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
LeaveCriticalSection( &msgQueue->cSection );
|
|
|
|
|
|
|
|
return qmsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_RemoveMsg
|
|
|
|
*
|
|
|
|
* Remove a message from the queue (pos must be a valid position).
|
|
|
|
*/
|
1999-01-26 10:30:05 +01:00
|
|
|
void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
EnterCriticalSection( &msgQueue->cSection );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
/* set the linked list */
|
|
|
|
if (qmsg->prevMsg)
|
|
|
|
qmsg->prevMsg->nextMsg = qmsg->nextMsg;
|
|
|
|
|
|
|
|
if (qmsg->nextMsg)
|
|
|
|
qmsg->nextMsg->prevMsg = qmsg->prevMsg;
|
|
|
|
|
|
|
|
if (msgQueue->firstMsg == qmsg)
|
|
|
|
msgQueue->firstMsg = qmsg->nextMsg;
|
|
|
|
|
|
|
|
if (msgQueue->lastMsg == qmsg)
|
|
|
|
msgQueue->lastMsg = qmsg->prevMsg;
|
|
|
|
|
|
|
|
/* deallocate the memory for the message */
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, qmsg );
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
msgQueue->msgCount--;
|
1996-05-28 20:54:58 +02:00
|
|
|
if (!msgQueue->msgCount) msgQueue->wakeBits &= ~QS_POSTMESSAGE;
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
LeaveCriticalSection( &msgQueue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_WakeSomeone
|
|
|
|
*
|
|
|
|
* Wake a queue upon reception of a hardware event.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
static void QUEUE_WakeSomeone( UINT message )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
1996-09-28 20:11:01 +02:00
|
|
|
WND* wndPtr = NULL;
|
|
|
|
WORD wakeBit;
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hwnd;
|
1999-01-28 11:54:11 +01:00
|
|
|
HQUEUE16 hQueue = 0;
|
|
|
|
MESSAGEQUEUE *queue = NULL;
|
|
|
|
|
|
|
|
if (hCursorQueue)
|
|
|
|
hQueue = hCursorQueue;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1996-09-28 20:11:01 +02:00
|
|
|
if( (message >= WM_KEYFIRST) && (message <= WM_KEYLAST) )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
1996-09-28 20:11:01 +02:00
|
|
|
wakeBit = QS_KEY;
|
1999-01-28 11:54:11 +01:00
|
|
|
if( hActiveQueue )
|
|
|
|
hQueue = hActiveQueue;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
else
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
1996-09-28 20:11:01 +02:00
|
|
|
wakeBit = (message == WM_MOUSEMOVE) ? QS_MOUSEMOVE : QS_MOUSEBUTTON;
|
1999-02-26 12:11:13 +01:00
|
|
|
if( (hwnd = GetCapture()) )
|
1996-09-28 20:11:01 +02:00
|
|
|
if( (wndPtr = WIN_FindWndPtr( hwnd )) )
|
1999-01-28 11:54:11 +01:00
|
|
|
{
|
|
|
|
hQueue = wndPtr->hmemTaskQ;
|
1999-03-14 18:25:32 +01:00
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
|
|
|
if( (hwnd = GetSysModalWindow16()) )
|
1999-01-28 11:54:11 +01:00
|
|
|
{
|
1996-09-28 20:11:01 +02:00
|
|
|
if( (wndPtr = WIN_FindWndPtr( hwnd )) )
|
1999-03-14 18:25:32 +01:00
|
|
|
{
|
1999-01-28 11:54:11 +01:00
|
|
|
hQueue = wndPtr->hmemTaskQ;
|
1999-03-14 18:25:32 +01:00
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
|
|
|
}
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
if (hQueue)
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
queue = QUEUE_Lock( hQueue );
|
|
|
|
QUEUE_SetWakeBit( queue, wakeBit );
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
return;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
/* Search for someone to wake */
|
|
|
|
hQueue = hFirstQueue;
|
|
|
|
while ( (queue = QUEUE_Lock( hQueue )) )
|
|
|
|
{
|
|
|
|
if (QUEUE_TrySetWakeBit( queue, wakeBit, FALSE ))
|
|
|
|
{
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hQueue = queue->next;
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
}
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
WARN_(msg)("couldn't find queue\n");
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* hardware_event
|
|
|
|
*
|
|
|
|
* Add an event to the system message queue.
|
|
|
|
* Note: the position is relative to the desktop window.
|
|
|
|
*/
|
1999-08-07 14:33:35 +02:00
|
|
|
void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
|
1996-03-14 19:08:34 +01:00
|
|
|
int xPos, int yPos, DWORD time, DWORD extraInfo )
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
MSG *msg;
|
1999-03-28 15:10:54 +02:00
|
|
|
QMSG *qmsg;
|
1999-01-26 10:30:05 +01:00
|
|
|
int mergeMsg = 0;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
if (!sysMsgQueue) return;
|
|
|
|
|
1999-03-28 15:10:54 +02:00
|
|
|
EnterCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
|
|
|
|
/* Merge with previous event if possible */
|
|
|
|
qmsg = sysMsgQueue->lastMsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if ((message == WM_MOUSEMOVE) && sysMsgQueue->lastMsg)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
msg = &(sysMsgQueue->lastMsg->msg);
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
if ((msg->message == message) && (msg->wParam == wParam))
|
1999-01-26 10:30:05 +01:00
|
|
|
{
|
|
|
|
/* Merge events */
|
|
|
|
qmsg = sysMsgQueue->lastMsg;
|
|
|
|
mergeMsg = 1;
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if (!mergeMsg)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2000-08-29 05:52:46 +02:00
|
|
|
/* Should I limit the number of messages in
|
1999-01-26 10:30:05 +01:00
|
|
|
the system message queue??? */
|
|
|
|
|
|
|
|
/* Don't merge allocate a new msg in the global heap */
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
if (!(qmsg = (QMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(QMSG) ) ))
|
1999-03-28 15:10:54 +02:00
|
|
|
{
|
|
|
|
LeaveCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
return;
|
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
/* put message at the end of the linked list */
|
|
|
|
qmsg->nextMsg = 0;
|
|
|
|
qmsg->prevMsg = sysMsgQueue->lastMsg;
|
|
|
|
|
|
|
|
if (sysMsgQueue->lastMsg)
|
|
|
|
sysMsgQueue->lastMsg->nextMsg = qmsg;
|
|
|
|
|
|
|
|
/* set last and first anchor index in system message queue */
|
|
|
|
sysMsgQueue->lastMsg = qmsg;
|
|
|
|
if (!sysMsgQueue->firstMsg)
|
|
|
|
sysMsgQueue->firstMsg = qmsg;
|
|
|
|
|
|
|
|
sysMsgQueue->msgCount++;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Store message */
|
1999-01-26 10:30:05 +01:00
|
|
|
msg = &(qmsg->msg);
|
1996-03-14 19:08:34 +01:00
|
|
|
msg->hwnd = 0;
|
|
|
|
msg->message = message;
|
|
|
|
msg->wParam = wParam;
|
|
|
|
msg->lParam = lParam;
|
|
|
|
msg->time = time;
|
1999-01-26 10:30:05 +01:00
|
|
|
msg->pt.x = xPos;
|
|
|
|
msg->pt.y = yPos;
|
|
|
|
qmsg->extraInfo = extraInfo;
|
1999-12-10 04:47:13 +01:00
|
|
|
qmsg->type = QMSG_HARDWARE;
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1999-03-28 15:10:54 +02:00
|
|
|
LeaveCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
QUEUE_WakeSomeone( message );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_GetQueueTask
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-28 11:54:11 +01:00
|
|
|
HTASK16 hTask = 0;
|
|
|
|
|
|
|
|
MESSAGEQUEUE *queue = QUEUE_Lock( hQueue );
|
|
|
|
|
|
|
|
if (queue)
|
2000-08-29 05:52:46 +02:00
|
|
|
{
|
2000-05-29 23:25:10 +02:00
|
|
|
hTask = queue->teb->htask16;
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
2000-08-29 05:52:46 +02:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return hTask;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_IncPaintCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_IncPaintCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wPaintCount++;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
QUEUE_SetWakeBit( queue, QS_PAINT );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DecPaintCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_DecPaintCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wPaintCount--;
|
1996-05-28 20:54:58 +02:00
|
|
|
if (!queue->wPaintCount) queue->wakeBits &= ~QS_PAINT;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_IncTimerCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_IncTimerCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wTimerCount++;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
QUEUE_SetWakeBit( queue, QS_TIMER );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DecTimerCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_DecTimerCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wTimerCount--;
|
1996-05-28 20:54:58 +02:00
|
|
|
if (!queue->wTimerCount) queue->wakeBits &= ~QS_TIMER;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* PostQuitMessage (USER.6)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
void WINAPI PostQuitMessage16( INT16 exitCode )
|
1997-02-15 15:29:56 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
PostQuitMessage( exitCode );
|
1997-02-15 15:29:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* PostQuitMessage (USER32.@)
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* PostQuitMessage() posts a message to the system requesting an
|
|
|
|
* application to terminate execution. As a result of this function,
|
|
|
|
* the WM_QUIT message is posted to the application, and
|
|
|
|
* PostQuitMessage() returns immediately. The exitCode parameter
|
|
|
|
* specifies an application-defined exit code, which appears in the
|
|
|
|
* _wParam_ parameter of the WM_QUIT message posted to the application.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
|
|
|
* ECMA-234, Win32
|
1997-02-15 15:29:56 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
void WINAPI PostQuitMessage( INT exitCode )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wPostQMsg = TRUE;
|
|
|
|
queue->wExitCode = (WORD)exitCode;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetWindowTask (USER.224)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
HTASK16 WINAPI GetWindowTask16( HWND16 hwnd )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-03-14 18:25:32 +01:00
|
|
|
HTASK16 retvalue;
|
1996-03-14 19:08:34 +01:00
|
|
|
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
|
|
|
|
|
|
|
if (!wndPtr) return 0;
|
1999-03-14 18:25:32 +01:00
|
|
|
retvalue = QUEUE_GetQueueTask( wndPtr->hmemTaskQ );
|
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
|
|
|
return retvalue;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
1997-02-02 20:01:52 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetWindowThreadProcessId (USER32.@)
|
1997-02-02 20:01:52 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI GetWindowThreadProcessId( HWND hwnd, LPDWORD process )
|
1997-02-15 15:29:56 +01:00
|
|
|
{
|
1999-05-04 17:57:27 +02:00
|
|
|
DWORD retvalue;
|
|
|
|
MESSAGEQUEUE *queue;
|
1997-02-02 20:01:52 +01:00
|
|
|
|
|
|
|
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
|
|
|
if (!wndPtr) return 0;
|
1999-05-04 17:57:27 +02:00
|
|
|
|
|
|
|
queue = QUEUE_Lock( wndPtr->hmemTaskQ );
|
1999-03-14 18:25:32 +01:00
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
1999-05-04 17:57:27 +02:00
|
|
|
|
|
|
|
if (!queue) return 0;
|
|
|
|
|
2000-04-11 22:01:59 +02:00
|
|
|
if ( process ) *process = (DWORD)queue->teb->pid;
|
1999-06-22 13:43:42 +02:00
|
|
|
retvalue = (DWORD)queue->teb->tid;
|
1999-05-04 17:57:27 +02:00
|
|
|
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
return retvalue;
|
1997-02-02 20:01:52 +01:00
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* SetMessageQueue (USER.266)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
BOOL16 WINAPI SetMessageQueue16( INT16 size )
|
1997-02-15 15:29:56 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
return SetMessageQueue( size );
|
1997-02-15 15:29:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* SetMessageQueue (USER32.@)
|
1997-02-15 15:29:56 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI SetMessageQueue( INT size )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
/* now obsolete the message queue will be expanded dynamically
|
|
|
|
as necessary */
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
/* access the queue to create it if it's not existing */
|
1999-02-26 12:11:13 +01:00
|
|
|
GetFastQueue16();
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-12-24 16:15:00 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* InitThreadInput (USER.409)
|
1998-12-24 16:15:00 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags )
|
1998-12-24 16:15:00 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
HQUEUE16 hQueue;
|
|
|
|
MESSAGEQUEUE *queuePtr;
|
|
|
|
|
1999-06-22 13:43:42 +02:00
|
|
|
TEB *teb = NtCurrentTeb();
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1999-06-22 13:43:42 +02:00
|
|
|
if (!teb)
|
1999-01-26 10:30:05 +01:00
|
|
|
return 0;
|
|
|
|
|
1999-06-22 13:43:42 +02:00
|
|
|
hQueue = teb->queue;
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1999-01-17 17:32:32 +01:00
|
|
|
if ( !hQueue )
|
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
/* Create thread message queue */
|
1999-02-05 11:37:53 +01:00
|
|
|
if( !(hQueue = QUEUE_CreateMsgQueue( TRUE )))
|
1999-01-26 10:30:05 +01:00
|
|
|
{
|
2000-08-29 05:52:46 +02:00
|
|
|
ERR_(msg)("failed!\n");
|
1999-01-26 10:30:05 +01:00
|
|
|
return FALSE;
|
2000-01-01 23:38:20 +01:00
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
/* Link new queue into list */
|
2001-01-29 01:33:35 +01:00
|
|
|
queuePtr = QUEUE_Lock( hQueue );
|
1999-06-22 13:43:42 +02:00
|
|
|
queuePtr->teb = NtCurrentTeb();
|
1999-01-26 10:30:05 +01:00
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
1999-02-26 12:11:13 +01:00
|
|
|
SetThreadQueue16( 0, hQueue );
|
1999-06-22 13:43:42 +02:00
|
|
|
teb->queue = hQueue;
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
queuePtr->next = hFirstQueue;
|
|
|
|
hFirstQueue = hQueue;
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
QUEUE_Unlock( queuePtr );
|
1999-01-17 17:32:32 +01:00
|
|
|
}
|
1998-12-24 16:15:00 +01:00
|
|
|
|
|
|
|
return hQueue;
|
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetQueueStatus (USER.334)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
DWORD WINAPI GetQueueStatus16( UINT16 flags )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
DWORD ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
ret = MAKELONG( queue->changeBits, queue->wakeBits );
|
|
|
|
queue->changeBits = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return ret & MAKELONG( flags, flags );
|
|
|
|
}
|
|
|
|
|
1997-11-30 18:45:40 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetQueueStatus (USER32.@)
|
1997-11-30 18:45:40 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI GetQueueStatus( UINT flags )
|
1997-11-30 18:45:40 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
DWORD ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1997-11-30 18:45:40 +01:00
|
|
|
ret = MAKELONG( queue->changeBits, queue->wakeBits );
|
|
|
|
queue->changeBits = 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
1997-11-30 18:45:40 +01:00
|
|
|
return ret & MAKELONG( flags, flags );
|
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetInputState (USER.335)
|
1997-02-15 15:29:56 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
BOOL16 WINAPI GetInputState16(void)
|
1997-02-15 15:29:56 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
return GetInputState();
|
1997-02-15 15:29:56 +01:00
|
|
|
}
|
|
|
|
|
1998-03-29 21:44:57 +02:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* WaitForInputIdle (USER32.@)
|
1998-03-29 21:44:57 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI WaitForInputIdle (HANDLE hProcess, DWORD dwTimeOut)
|
1998-03-29 21:44:57 +02:00
|
|
|
{
|
2000-05-30 21:48:18 +02:00
|
|
|
DWORD cur_time, ret;
|
2000-08-30 02:00:48 +02:00
|
|
|
HANDLE idle_event = -1;
|
Release 980503
Thu Apr 30 16:28:12 1998 James Juran <jrj120@psu.edu>
* [scheduler/process.c]
Implemented GetExitCodeProcess. The code is a direct translation
of GetExitCodeThread.
Mon Apr 27 22:20:25 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [loader/pe_image.c]
Unload dummy module when PE_LoadLibraryEx32A fails with
PE_LoadImage (makes Encarta 98 installer proceed).
* [files/drive.c]
Make GetDriveType16 return DRIVE_REMOVABLE for TYPE_CDROM.
Make GetCurrentDirectory32 behave like the code does and not
like the help describes.
* [files/profile.c]
Revoke recent change in PROFILE_GetSection and try better
handling of special case.
* [include/windows.h]
Change definition of ACCEL32.
* [misc/commdlg.c]
Replace the GetXXXFilename32 macros by normal code.
Fix two reported bugs in my changes to commdlg.
* [windows/win.c]
Add a hook to catch bogus WM_SIZE messages by emitting a warning
in the appropriate case.
* [objects/bitmap.c]
Reject unreasonbable large size arguments in
CreateCompatibleBitmap32 and add an fixme for that situation.
Sun Apr 26 18:30:07 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/ldt.h] [debugger/*.c] [miscemu/instr.c]
Added IS_SELECTOR_SYSTEM and IS_SELECTOR_32BIT macros.
Make instruction emulation support system selectors.
* [loader/*.c]
Started moving NE specific functions to the new loader/ne
directory.
* [memory/environ.c]
Enforce the 127 chars limit only when creating the environment of
a Win16 process.
Sun Apr 26 12:22:23 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed an incredible typo in CopyFile32A that made it unusable
since a rewrite in 970112 (!!).
* [files/directory.c]
Fixed GetTempPath32A/W to include trailing backslash.
* [misc/ver.c]
Make find_pe_resource "work" with corrupt files.
* [misc/wsprintf.c]
Altered WPRINTF_ParseFormatA/W to treat invalid format chars
as normal output, too.
* [msdos/dpmi.c]
Implemented "Allocate/Free real mode callback" (0x0303/0x0304).
Cross your fingers if you need to use it ;) (completely untested)
Implemented "Call real mode proc with far return" (0x0301, tested).
* [msdos/int21.c]
Fixed ioctlGenericBlkDevReq/0x60.
* [relay32/dplayx.spec] [relay32/builtin32.c] [relay32/Makefile.in]
Added built-in DPLAYX.DLL.
* [windows/win.c]
Fixed GetWindowWord()/GWW_HWNDPARENT to return the window's owner
if it has no parent (SDK).
Sat Apr 25 15:09:53 1998 M.T.Fortescue <mark@mtfhpc.demon.co.uk>
* [debugger/db_disasm.c]
Fixed disassemble bug for no-display option and 'lock',
'repne' and 'repe' prefixes.
* [debugger/registers.c]
Added textual flag description output on 'info regs'.
Sat Apr 25 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [*/*.c]
Added stubs and/or documentation for the following functions:
LookupPrivilegeValue, OpenService, ControlService, RegGetKeySecurity,
StartService, SetComputerName, DeleteService, CloseServiceHandle,
OpenProcessToken, OpenSCManager, DeregisterEventSource,
WaitForDebugEvent, WaitForInputIdle, RegisterEventSource,
SetDebugErrorLevel, SetConsoleCursorPosition, ChoosePixelFormat,
SetPixelFormat, GetPixelFormat, DescribePixelFormat, SwapBuffers,
PolyBezier, AbortPath, DestroyAcceleratorTable, HeapWalk,
DdeInitialize, DdeUninitialize, DdeConnectList, DdeDisconnectList,
DdeCreateStringHandle, DdePostAdvise, DdeGetData, DdeNameService,
DdeGetLastError, WNetGetDirectoryType, EnumPrinters, RegFlushKey,
RegGetKeySecurity, DllGetClassObject, DllCanUnloadNow, CreateBitmap,
CreateCompatibleBitmap, CreateBitmapIndirect, GetBitmapBits,
SetBitmapBits, LoadImage, CopyImage, LoadBitmap, DrawIcon,
CreateDiscardableBitmap, SetDIBits, GetCharABCWidths, LoadTypeLib,
SetConsoleCtrlHandler, CreateConsoleScreenBuffer, ReadConsoleInput,
GetConsoleCursorInfo, SetConsoleCursorInfo, SetConsoleWindowInfo,
SetConsoleTextAttribute, SetConsoleScreenBufferSize,
FillConsoleOutputCharacter, FillConsoleOutputAttribute,
CreateMailslot, GetMailslotInfo, GetCompressedFileSize,
GetProcessWindowStation, GetThreadDesktop, SetDebugErrorLevel,
WaitForDebugEvent, SetComputerName, CreateMDIWindow.
Thu Apr 23 23:54:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [include/windows.h] [objects/enhmetafile.c] [relay32/gdi32.spec]
Implement CopyEnhMetaFile, Get/SetEnhMetaFileBits, other fixes.
* [include/windows.h] [objects/metafile.c] [relay32/gdi32.spec]
32-bit metafile fixes, implement EnumMetaFile32, GetMetaFileBitsEx.
* [objects/font.c] [graphics/x11drv/xfont.c] [graphics/x11drv/text.c]
Some rotated text support for X11R6 displays.
* [win32/newfns.c] [ole/ole2nls.c]
Moved GetNumberFormat32A.
Wed Apr 22 17:38:20 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [misc/network.c]
Changed some function documentation to the new style.
* [misc/network.c] [include/windows.h] [if1632/user.spec]
[relay32/mpr.spec] [misc/mpr.c]
Added stubs for some Win32 network functions; renamed some
16-bit ones with 32-bit counterparts, as well as
WNetGetDirectoryType; moved the stubs in misc/mpr.c (three of
them!) to misc/network.c.
* [ole/compobj.c] [ole/storage.c] [ole/ole2disp.c]
[ole/ole2nls.c] [ole/folders.c] [ole/moniker.c] [ole/ole2.c]
[graphics/fontengine.c] [graphics/ddraw.c] [graphics/env.c]
[graphics/driver.c] [graphics/escape.c]
Changed fprintf's to proper debug-macros.
* [include/winnls.h]
Added some flags (for internal use).
* [ole/ole2nls.c]
Added the Unicode core function, and worked out a way to hide
the commonality of the core.
* [relay32/kernel32.spec]
Added support for GetDate/Time32A/W.
Wed Apr 22 09:16:03 1998 Gordon Chaffee <chaffee@cs.berkeley.edu>
* [win32/code_page.c]
Fixed problem with MultiByteToWideChar that was introduced in
last release. Made MultiByteToWideChar more compatible with Win32.
* [graphics/x11drv/graphics.c]
Fixed problem with drawing arcs.
Tue Apr 21 11:24:58 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [ole/ole2nls.c]
Move stuff from 0x409 case to Lang_En.
* [relay32/user32.spec] [windows/winpos.c]
Added stubs for GetWindowRgn32 and SetWindowRgn32. Makes Office
Paperclip happy.
Tue Apr 21 11:16:16 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [loader/pe_image.c]
If image is relocated, TLS addresses need to be adjusted.
* [debugger/*.c]
Generalized tests for 32-bit segments.
Tue Apr 21 02:04:59 1998 James Juran <jrj120@psu.edu>
* [misc/*.c] [miscemu/*.c] [msdos/*.c] [if1632/*.c]
[include/*.h] [loader/*.c] [memory/*.c] [multimedia/*.c]
[objects/*.c]
Almost all fprintf statements converted to appropriate
debug messages.
* [README]
Updated "GETTING MORE INFORMATION" section to include WineHQ.
* [documentation/debugger]
Fixed typo.
* [windows/defwnd.c]
Added function documentation.
Sun Apr 19 16:30:58 1998 Marcus Meissner <marcus@mud.de>
* [Make.rules.in]
Added lint target (using lclint).
* [relay32/oleaut32.spec][relay32/Makefile.in][ole/typelib.c]
[ole/ole2disp.c]
Added oleaut32 spec, added some SysString functions.
* [if1632/signal.c]
Added printing of faultaddress in Linux (using CR2 debug register).
* [configure.in]
Added <sys/types.h> for statfs checks.
* [loader/*.c][debugger/break.c][debugger/hash.c]
Started to split win32/win16 module handling, preparing support
for other binary formats (like ELF).
Sat Apr 18 10:07:41 1998 Rein Klazes <rklazes@casema.net>
* [misc/registry.c]
Fixed a bug that made RegQueryValuexxx returning
incorrect registry values.
Fri Apr 17 22:59:22 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage32*: remove linefeed when nolinefeed set;
check for target underflow.
Fri Apr 17 00:38:14 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/crtdll.c]
Implement xlat_file_ptr for CRT stdin/stdout/stderr address
translation.
Wed Apr 15 20:43:56 1998 Jim Peterson <jspeter@birch.ee.vt.edu>
* [controls/menu.c]
Added 'odaction' parameter to MENU_DrawMenuItem() and redirected
WM_DRAWITEM messages to GetWindow(hwnd,GW_OWNER).
Tue Apr 14 16:17:55 1998 Berend Reitsma <berend@united-info.com>
* [graphics/metafiledrv/init.c] [graphics/painting.c]
[graphics/win16drv/init.c] [graphics/x11drv/graphics.c]
[graphics/x11drv/init.c] [include/gdi.h] [include/x11drv.h]
[relay32/gdi32.spec]
Added PolyPolyline routine.
* [windows/winproc.c]
Changed WINPROC_GetProc() to return proc instead of &(jmp proc).
1998-05-03 21:01:20 +02:00
|
|
|
|
2001-02-27 03:09:16 +01:00
|
|
|
SERVER_START_REQ( wait_input_idle )
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
|
|
|
req->handle = hProcess;
|
|
|
|
req->timeout = dwTimeOut;
|
2001-02-27 03:09:16 +01:00
|
|
|
if (!(ret = SERVER_CALL_ERR())) idle_event = req->event;
|
2000-08-30 02:00:48 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
if (ret) return 0xffffffff; /* error */
|
2001-01-05 05:08:07 +01:00
|
|
|
if (!idle_event) return 0; /* no event to wait on */
|
2000-01-01 23:38:20 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
cur_time = GetTickCount();
|
2000-01-01 23:38:20 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
TRACE_(msg)("waiting for %x\n", idle_event );
|
|
|
|
while ( dwTimeOut > GetTickCount() - cur_time || dwTimeOut == INFINITE )
|
|
|
|
{
|
|
|
|
ret = MsgWaitForMultipleObjects ( 1, &idle_event, FALSE, dwTimeOut, QS_SENDMESSAGE );
|
|
|
|
if ( ret == ( WAIT_OBJECT_0 + 1 ))
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE * queue;
|
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0xFFFFFFFF;
|
|
|
|
QUEUE_ReceiveMessage ( queue );
|
|
|
|
QUEUE_Unlock ( queue );
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if ( ret == WAIT_TIMEOUT || ret == 0xFFFFFFFF )
|
|
|
|
{
|
|
|
|
TRACE_(msg)("timeout or error\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE_(msg)("finished\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2000-01-01 23:38:20 +01:00
|
|
|
}
|
2001-01-29 01:33:35 +01:00
|
|
|
|
|
|
|
return WAIT_TIMEOUT;
|
1998-03-29 21:44:57 +02:00
|
|
|
}
|
|
|
|
|
1997-02-15 15:29:56 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetInputState (USER32.@)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL WINAPI GetInputState(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() )))
|
1997-02-15 15:29:56 +01:00
|
|
|
return FALSE;
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->wakeBits & (QS_KEY | QS_MOUSEBUTTON);
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
1998-12-24 16:15:00 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* UserYield (USER.332)
|
2001-01-25 23:22:21 +01:00
|
|
|
* UserYield16 (USER32.@)
|
1998-12-24 16:15:00 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
void WINAPI UserYield16(void)
|
1998-12-24 16:15:00 +01:00
|
|
|
{
|
1999-03-27 17:10:52 +01:00
|
|
|
MESSAGEQUEUE *queue;
|
1998-12-24 16:15:00 +01:00
|
|
|
|
|
|
|
/* Handle sent messages */
|
2001-01-29 01:33:35 +01:00
|
|
|
queue = QUEUE_Lock( GetFastQueue16() );
|
1999-03-27 17:10:52 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
while ( queue && QUEUE_ReceiveMessage( queue ) )
|
|
|
|
;
|
1998-12-24 16:15:00 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
2001-04-04 02:19:55 +02:00
|
|
|
|
1999-03-27 17:10:52 +01:00
|
|
|
/* Yield */
|
2001-04-04 02:19:55 +02:00
|
|
|
OldYield16();
|
1999-03-27 17:10:52 +01:00
|
|
|
|
|
|
|
/* Handle sent messages again */
|
2001-01-29 01:33:35 +01:00
|
|
|
queue = QUEUE_Lock( GetFastQueue16() );
|
1998-12-24 16:15:00 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
while ( queue && QUEUE_ReceiveMessage( queue ) )
|
|
|
|
;
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
QUEUE_Unlock( queue );
|
1998-12-24 16:15:00 +01:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessagePos (USER.119) (USER32.@)
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* The GetMessagePos() function returns a long value representing a
|
|
|
|
* cursor position, in screen coordinates, when the last message
|
|
|
|
* retrieved by the GetMessage() function occurs. The x-coordinate is
|
|
|
|
* in the low-order word of the return value, the y-coordinate is in
|
|
|
|
* the high-order word. The application can use the MAKEPOINT()
|
|
|
|
* macro to obtain a POINT structure from the return value.
|
|
|
|
*
|
|
|
|
* For the current cursor position, use GetCursorPos().
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Cursor position of last message on success, zero on failure.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
|
|
|
* ECMA-234, Win32
|
|
|
|
*
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
DWORD WINAPI GetMessagePos(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
DWORD ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessagePosVal;
|
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessageTime (USER.120) (USER32.@)
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* GetMessageTime() returns the message time for the last message
|
|
|
|
* retrieved by the function. The time is measured in milliseconds with
|
|
|
|
* the same offset as GetTickCount().
|
|
|
|
*
|
|
|
|
* Since the tick count wraps, this is only useful for moderately short
|
|
|
|
* relative time comparisons.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Time of last message on success, zero on failure.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
|
|
|
* ECMA-234, Win32
|
|
|
|
*
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
LONG WINAPI GetMessageTime(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
LONG ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessageTimeVal;
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessageExtraInfo (USER.288) (USER32.@)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
LONG WINAPI GetMessageExtraInfo(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
LONG ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessageExtraInfoVal;
|
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* AttachThreadInput (USER32.@) Attaches input of 1 thread to other
|
2000-08-04 06:21:02 +02:00
|
|
|
*
|
|
|
|
* Attaches the input processing mechanism of one thread to that of
|
|
|
|
* another thread.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*
|
|
|
|
* TODO:
|
|
|
|
* 1. Reset the Key State (currenly per thread key state is not maintained)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI AttachThreadInput(
|
|
|
|
DWORD idAttach, /* [in] Thread to attach */
|
|
|
|
DWORD idAttachTo, /* [in] Thread to attach to */
|
|
|
|
BOOL fAttach) /* [in] Attach or detach */
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
|
|
|
|
BOOL16 bRet = 0;
|
|
|
|
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
|
|
|
|
/* A thread cannot attach to itself */
|
|
|
|
if ( idAttach == idAttachTo )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
/* According to the docs this method should fail if a
|
|
|
|
* "Journal record" hook is installed. (attaches all input queues together)
|
|
|
|
*/
|
|
|
|
if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
/* Retrieve message queues corresponding to the thread id's */
|
2001-01-29 01:33:35 +01:00
|
|
|
pTgtMsgQ = QUEUE_Lock( GetThreadQueue16( idAttach ) );
|
|
|
|
pSrcMsgQ = QUEUE_Lock( GetThreadQueue16( idAttachTo ) );
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
/* Ensure we have message queues and that Src and Tgt threads
|
|
|
|
* are not system threads.
|
|
|
|
*/
|
|
|
|
if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
if (fAttach) /* Attach threads */
|
|
|
|
{
|
|
|
|
/* Only attach if currently detached */
|
|
|
|
if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
|
|
|
|
{
|
|
|
|
/* First release the target threads perQData */
|
|
|
|
PERQDATA_Release( pTgtMsgQ->pQData );
|
|
|
|
|
|
|
|
/* Share a reference to the source threads perQDATA */
|
|
|
|
PERQDATA_Addref( pSrcMsgQ->pQData );
|
|
|
|
pTgtMsgQ->pQData = pSrcMsgQ->pQData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else /* Detach threads */
|
|
|
|
{
|
|
|
|
/* Only detach if currently attached */
|
|
|
|
if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
|
|
|
|
{
|
|
|
|
/* First release the target threads perQData */
|
|
|
|
PERQDATA_Release( pTgtMsgQ->pQData );
|
|
|
|
|
|
|
|
/* Give the target thread its own private perQDATA once more */
|
|
|
|
pTgtMsgQ->pQData = PERQDATA_CreateInstance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Reset the Key State */
|
|
|
|
|
|
|
|
bRet = 1; /* Success */
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
|
|
|
|
/* Unlock the queues before returning */
|
|
|
|
if ( pSrcMsgQ )
|
|
|
|
QUEUE_Unlock( pSrcMsgQ );
|
|
|
|
if ( pTgtMsgQ )
|
|
|
|
QUEUE_Unlock( pTgtMsgQ );
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|