2001-05-19 00:51:56 +02:00
|
|
|
/*
|
|
|
|
* Message queues related functions
|
1996-03-14 19:08:34 +01:00
|
|
|
*
|
|
|
|
* Copyright 1993, 1994 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
|
|
|
|
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"
|
2001-05-16 21:52:29 +02:00
|
|
|
#include "user.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"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-07-19 02:39:09 +02:00
|
|
|
#include "wine/server.h"
|
1999-02-18 18:34:09 +01:00
|
|
|
#include "spy.h"
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msg);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
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
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
HQUEUE16 hActiveQueue = 0;
|
|
|
|
|
|
|
|
|
2001-06-21 01:16:34 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_Addref
|
|
|
|
*
|
|
|
|
* Increment reference count for the PERQUEUEDATA instance
|
|
|
|
* Returns reference count for debugging purposes
|
|
|
|
*/
|
|
|
|
static void PERQDATA_Addref( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n", pQData->ulRefCount);
|
|
|
|
|
|
|
|
InterlockedIncrement( &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
|
|
|
|
*/
|
|
|
|
static void PERQDATA_Release( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n",
|
|
|
|
(LONG)pQData->ulRefCount );
|
|
|
|
|
|
|
|
if (!InterlockedDecrement( &pQData->ulRefCount ))
|
|
|
|
{
|
|
|
|
DeleteCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
TRACE_(msg)("(): deleting PERQUEUEDATA instance ...\n" );
|
|
|
|
|
|
|
|
/* Deleting our global 16 bit perQData? */
|
|
|
|
if ( pQData == pQDataWin16 ) pQDataWin16 = 0;
|
|
|
|
|
|
|
|
/* Free the PERQUEUEDATA instance */
|
|
|
|
HeapFree( GetProcessHeap(), 0, pQData );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
2001-06-21 01:16:34 +02:00
|
|
|
static PERQUEUEDATA * PERQDATA_CreateInstance(void)
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
|
|
|
PERQUEUEDATA *pQData;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
BOOL16 bIsWin16 = 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
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 */
|
2001-05-19 00:51:56 +02:00
|
|
|
if ( ( bIsWin16 = !(NtCurrentTeb()->tibflags & TEBF_WIN32) ) )
|
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;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
return pQData;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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
|
|
|
|
*/
|
2001-06-21 01:16:34 +02:00
|
|
|
HWND PERQDATA_GetCaptureWnd( INT *hittest )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
2001-06-21 01:16:34 +02:00
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
PERQUEUEDATA *pQData;
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapture;
|
2001-06-21 01:16:34 +02:00
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(queue = QUEUE_Current())) return 0;
|
2001-06-21 01:16:34 +02:00
|
|
|
pQData = queue->pQData;
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapture = pQData->hWndCapture;
|
2001-06-21 01:16:34 +02:00
|
|
|
*hittest = pQData->nCaptureHT;
|
1999-02-05 11:37:53 +01:00
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
return hWndCapture;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetCaptureWnd
|
|
|
|
*
|
|
|
|
* Set the capture hwnd member in a threadsafe manner
|
|
|
|
*/
|
2001-06-21 01:16:34 +02:00
|
|
|
HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
2001-06-21 01:16:34 +02:00
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
PERQUEUEDATA *pQData;
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapturePrv;
|
2001-06-21 01:16:34 +02:00
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(queue = QUEUE_Current())) return 0;
|
2001-06-21 01:16:34 +02:00
|
|
|
pQData = queue->pQData;
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapturePrv = pQData->hWndCapture;
|
|
|
|
pQData->hWndCapture = hWndCapture;
|
2001-06-21 01:16:34 +02:00
|
|
|
pQData->nCaptureHT = hittest;
|
1999-02-05 11:37:53 +01:00
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
return hWndCapturePrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_Current
|
|
|
|
*
|
|
|
|
* Get the current thread queue, creating it if required.
|
|
|
|
* QUEUE_Unlock is not needed since the queue can only be deleted by
|
|
|
|
* the current thread anyway.
|
|
|
|
*/
|
|
|
|
MESSAGEQUEUE *QUEUE_Current(void)
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
HQUEUE16 hQueue;
|
|
|
|
|
|
|
|
if (!(hQueue = GetThreadQueue16(0)))
|
|
|
|
{
|
|
|
|
if (!(hQueue = InitThreadInput16( 0, 0 ))) return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((queue = GlobalLock16( hQueue )))
|
|
|
|
{
|
|
|
|
if (queue->magic != QUEUE_MAGIC) queue = NULL;
|
|
|
|
}
|
|
|
|
return queue;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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 )
|
|
|
|
{
|
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 );
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
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_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-05-19 00:51:56 +02:00
|
|
|
if (bCreatePerQData)
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( get_msg_queue )
|
|
|
|
{
|
2001-11-30 19:46:42 +01:00
|
|
|
wine_server_call_err( req );
|
|
|
|
handle = reply->handle;
|
2001-05-19 00:51:56 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
if (!handle)
|
|
|
|
{
|
|
|
|
ERR_(msg)("Cannot get thread queue");
|
|
|
|
GlobalFree16( hQueue );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
msgQueue->server_queue = handle;
|
2000-05-30 21:48:18 +02:00
|
|
|
}
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
msgQueue->self = hQueue;
|
1999-01-28 11:54:11 +01:00
|
|
|
msgQueue->lockCount = 1;
|
|
|
|
msgQueue->magic = QUEUE_MAGIC;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Create and initialize our per queue data */
|
|
|
|
msgQueue->pQData = bCreatePerQData ? PERQDATA_CreateInstance() : NULL;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return hQueue;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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
|
|
|
*/
|
2001-07-26 22:12:22 +02:00
|
|
|
void QUEUE_DeleteMsgQueue(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2001-07-26 22:12:22 +02:00
|
|
|
HQUEUE16 hQueue = GetThreadQueue16(0);
|
|
|
|
MESSAGEQUEUE * msgQueue;
|
|
|
|
|
|
|
|
if (!hQueue) return; /* thread doesn't have a queue */
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
TRACE("(): 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
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(msgQueue = QUEUE_Lock(hQueue)))
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2001-07-26 22:12:22 +02:00
|
|
|
ERR("invalid thread queue\n");
|
|
|
|
return;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
msgQueue->magic = 0;
|
2001-06-19 21:16:41 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
if( hActiveQueue == hQueue ) hActiveQueue = 0;
|
1996-09-28 20:11:01 +02: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-02-09 15:07:07 +01:00
|
|
|
|
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() );
|
2001-07-26 22:12:22 +02:00
|
|
|
SetThreadQueue16( 0, 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
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
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;
|
2001-08-07 21:19:08 +02:00
|
|
|
MESSAGEQUEUE *queue;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-09-19 22:37:04 +02:00
|
|
|
WND *wndPtr = WIN_FindWndPtr16( hwnd );
|
1996-03-14 19:08:34 +01:00
|
|
|
if (!wndPtr) return 0;
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
queue = QUEUE_Lock( wndPtr->hmemTaskQ );
|
1999-03-14 18:25:32 +01:00
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
2001-08-07 21:19:08 +02:00
|
|
|
|
|
|
|
if (!queue) return 0;
|
|
|
|
|
|
|
|
retvalue = queue->teb->htask16;
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
1999-03-14 18:25:32 +01:00
|
|
|
return retvalue;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
MESSAGEQUEUE *queuePtr;
|
2001-07-26 22:12:22 +02:00
|
|
|
HQUEUE16 hQueue = NtCurrentTeb()->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
|
|
|
}
|
2002-06-01 01:06:46 +02: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 );
|
2001-07-26 22:12:22 +02:00
|
|
|
NtCurrentTeb()->queue = hQueue;
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
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
|
|
|
|
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
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
DWORD ret = 0;
|
1997-11-30 18:45:40 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( get_queue_status )
|
|
|
|
{
|
|
|
|
req->clear = 1;
|
2001-11-30 19:46:42 +01:00
|
|
|
wine_server_call( req );
|
|
|
|
ret = MAKELONG( reply->changed_bits & flags, reply->wake_bits & flags );
|
2001-05-19 00:51:56 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
return ret;
|
1997-11-30 18:45:40 +01:00
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetInputState (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetInputState(void)
|
|
|
|
{
|
|
|
|
DWORD ret = 0;
|
|
|
|
|
|
|
|
SERVER_START_REQ( get_queue_status )
|
|
|
|
{
|
|
|
|
req->clear = 0;
|
2001-11-30 19:46:42 +01:00
|
|
|
wine_server_call( req );
|
|
|
|
ret = reply->wake_bits & (QS_KEY | QS_MOUSEBUTTON);
|
2001-05-19 00:51:56 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* GetMessagePos (USER.119)
|
|
|
|
* GetMessagePos (USER32.@)
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
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()
|
2002-06-01 01:06:46 +02:00
|
|
|
* macro to obtain a POINT structure from the return value.
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(queue = QUEUE_Current())) return 0;
|
|
|
|
return queue->GetMessagePosVal;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* GetMessageTime (USER.120)
|
|
|
|
* GetMessageTime (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
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
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;
|
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(queue = QUEUE_Current())) return 0;
|
|
|
|
return queue->GetMessageTimeVal;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* GetMessageExtraInfo (USER.288)
|
|
|
|
* GetMessageExtraInfo (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;
|
|
|
|
|
2001-07-26 22:12:22 +02:00
|
|
|
if (!(queue = QUEUE_Current())) return 0;
|
|
|
|
return queue->GetMessageExtraInfoVal;
|
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)
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
BOOL WINAPI AttachThreadInput(
|
2000-08-04 06:21:02 +02:00
|
|
|
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;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
/* 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 );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
/* 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 );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
/* Give the target thread its own private perQDATA once more */
|
|
|
|
pTgtMsgQ->pQData = PERQDATA_CreateInstance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Reset the Key State */
|
|
|
|
|
|
|
|
bRet = 1; /* Success */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
CLEANUP:
|
|
|
|
|
|
|
|
/* Unlock the queues before returning */
|
|
|
|
if ( pSrcMsgQ )
|
|
|
|
QUEUE_Unlock( pSrcMsgQ );
|
|
|
|
if ( pTgtMsgQ )
|
|
|
|
QUEUE_Unlock( pTgtMsgQ );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-08-04 06:21:02 +02:00
|
|
|
return bRet;
|
|
|
|
}
|