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
|
|
|
|
*/
|
|
|
|
|
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"
|
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
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(msg);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1997-05-25 15:58:18 +02:00
|
|
|
static HQUEUE16 hExitingQueue = 0;
|
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;
|
|
|
|
|
|
|
|
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 */
|
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;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
|
|
|
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 );
|
|
|
|
|
2001-06-21 01:16:34 +02:00
|
|
|
QUEUE_Unlock( queue );
|
1999-02-05 11:37:53 +01:00
|
|
|
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
|
|
|
|
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
|
|
|
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 );
|
|
|
|
|
2001-06-21 01:16:34 +02:00
|
|
|
QUEUE_Unlock( queue );
|
1999-02-05 11:37:53 +01:00
|
|
|
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
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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-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 )
|
|
|
|
{
|
|
|
|
SERVER_CALL_ERR();
|
|
|
|
handle = req->handle;
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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-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;
|
2001-06-19 21:16:41 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
if( hActiveQueue == hQueue ) hActiveQueue = 0;
|
2001-06-21 01:16:34 +02:00
|
|
|
if (hExitingQueue == hQueue) hExitingQueue = 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() );
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
/***********************************************************************
|
2001-05-19 00:51:56 +02:00
|
|
|
* QUEUE_CleanupWindow
|
1996-05-28 20:54:58 +02:00
|
|
|
*
|
2001-05-19 00:51:56 +02:00
|
|
|
* Cleanup the queue to account for a window being deleted.
|
1996-05-28 20:54:58 +02:00
|
|
|
*/
|
2001-05-19 00:51:56 +02:00
|
|
|
void QUEUE_CleanupWindow( HWND hwnd )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( cleanup_window_queue )
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
req->win = hwnd;
|
|
|
|
SERVER_CALL();
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_END_REQ;
|
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
|
|
|
/***********************************************************************
|
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
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
PostThreadMessageW( GetCurrentThreadId(), WM_QUIT, exitCode, 0 );
|
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;
|
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
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
return GetQueueStatus( flags );
|
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;
|
|
|
|
SERVER_CALL();
|
|
|
|
ret = MAKELONG( req->changed_bits & flags, req->wake_bits & flags );
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
return ret;
|
1997-11-30 18:45:40 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
SERVER_CALL();
|
|
|
|
ret = req->wake_bits & (QS_KEY | QS_MOUSEBUTTON);
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|