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
|
|
|
|
2000-05-30 21:48:18 +02:00
|
|
|
DECLARE_DEBUG_CHANNEL(sendmsg);
|
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
|
|
|
#define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
|
|
|
|
|
1997-05-25 15:58:18 +02:00
|
|
|
static HQUEUE16 hExitingQueue = 0;
|
1996-07-17 22:02:21 +02:00
|
|
|
static HQUEUE16 hmemSysMsgQueue = 0;
|
1996-09-28 20:11:01 +02:00
|
|
|
static MESSAGEQUEUE *sysMsgQueue = NULL;
|
1999-02-05 11:37:53 +01:00
|
|
|
static PERQUEUEDATA *pQDataWin16 = NULL; /* Global perQData for Win16 tasks */
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1996-06-16 18:16:05 +02:00
|
|
|
static MESSAGEQUEUE *pMouseQueue = NULL; /* Queue for last mouse message */
|
|
|
|
static MESSAGEQUEUE *pKbdQueue = NULL; /* Queue for last kbd message */
|
1996-09-28 20:11:01 +02:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
HQUEUE16 hCursorQueue = 0;
|
|
|
|
HQUEUE16 hActiveQueue = 0;
|
|
|
|
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_CreateInstance
|
|
|
|
*
|
|
|
|
* Creates an instance of a reference counted PERQUEUEDATA element
|
|
|
|
* for the message queue. perQData is stored globally for 16 bit tasks.
|
|
|
|
*
|
|
|
|
* Note: We don't implement perQdata exactly the same way Windows does.
|
|
|
|
* Each perQData element is reference counted since it may be potentially
|
|
|
|
* shared by multiple message Queues (via AttachThreadInput).
|
|
|
|
* We only store the current values for Active, Capture and focus windows
|
|
|
|
* currently.
|
|
|
|
*/
|
|
|
|
PERQUEUEDATA * PERQDATA_CreateInstance( )
|
|
|
|
{
|
|
|
|
PERQUEUEDATA *pQData;
|
|
|
|
|
|
|
|
BOOL16 bIsWin16 = 0;
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("()\n");
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
/* Share a single instance of perQData for all 16 bit tasks */
|
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_Addref
|
|
|
|
*
|
|
|
|
* Increment reference count for the PERQUEUEDATA instance
|
|
|
|
* Returns reference count for debugging purposes
|
|
|
|
*/
|
|
|
|
ULONG PERQDATA_Addref( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n", pQData->ulRefCount);
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
++pQData->ulRefCount;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return pQData->ulRefCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_Release
|
|
|
|
*
|
|
|
|
* Release a reference to a PERQUEUEDATA instance.
|
|
|
|
* Destroy the instance if no more references exist
|
|
|
|
* Returns reference count for debugging purposes
|
|
|
|
*/
|
|
|
|
ULONG PERQDATA_Release( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
assert(pQData != 0 );
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): current refcount %lu ...\n",
|
1999-02-05 11:37:53 +01:00
|
|
|
(LONG)pQData->ulRefCount );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
if ( --pQData->ulRefCount == 0 )
|
|
|
|
{
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
DeleteCriticalSection( &pQData->cSection );
|
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("(): deleting PERQUEUEDATA instance ...\n" );
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
/* Deleting our global 16 bit perQData? */
|
|
|
|
if ( pQData == pQDataWin16 )
|
|
|
|
pQDataWin16 = 0;
|
|
|
|
|
|
|
|
/* Free the PERQUEUEDATA instance */
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, pQData );
|
1999-02-05 11:37:53 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return pQData->ulRefCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetFocusWnd
|
|
|
|
*
|
|
|
|
* Get the focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndFocus;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndFocus = pQData->hWndFocus;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndFocus;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetFocusWnd
|
|
|
|
*
|
|
|
|
* Set the focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndFocusPrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndFocusPrv = pQData->hWndFocus;
|
|
|
|
pQData->hWndFocus = hWndFocus;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndFocusPrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetActiveWnd
|
|
|
|
*
|
|
|
|
* Get the active hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndActive;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndActive = pQData->hWndActive;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetActiveWnd
|
|
|
|
*
|
|
|
|
* Set the active focus hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndActivePrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndActivePrv = pQData->hWndActive;
|
|
|
|
pQData->hWndActive = hWndActive;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndActivePrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetCaptureWnd
|
|
|
|
*
|
|
|
|
* Get the capture hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetCaptureWnd( PERQUEUEDATA *pQData )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapture;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapture = pQData->hWndCapture;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndCapture;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetCaptureWnd
|
|
|
|
*
|
|
|
|
* Set the capture hwnd member in a threadsafe manner
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_SetCaptureWnd( PERQUEUEDATA *pQData, HWND hWndCapture )
|
1999-02-05 11:37:53 +01:00
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndCapturePrv;
|
1999-02-05 11:37:53 +01:00
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
hWndCapturePrv = pQData->hWndCapture;
|
|
|
|
pQData->hWndCapture = hWndCapture;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return hWndCapturePrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_GetCaptureInfo
|
|
|
|
*
|
|
|
|
* Get the capture info member in a threadsafe manner
|
|
|
|
*/
|
|
|
|
INT16 PERQDATA_GetCaptureInfo( PERQUEUEDATA *pQData )
|
|
|
|
{
|
|
|
|
INT16 nCaptureHT;
|
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
nCaptureHT = pQData->nCaptureHT;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return nCaptureHT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* PERQDATA_SetCaptureInfo
|
|
|
|
*
|
|
|
|
* Set the capture info member in a threadsafe manner
|
|
|
|
*/
|
|
|
|
INT16 PERQDATA_SetCaptureInfo( PERQUEUEDATA *pQData, INT16 nCaptureHT )
|
|
|
|
{
|
|
|
|
INT16 nCaptureHTPrv;
|
|
|
|
assert(pQData != 0 );
|
|
|
|
|
|
|
|
EnterCriticalSection( &pQData->cSection );
|
|
|
|
nCaptureHTPrv = pQData->nCaptureHT;
|
|
|
|
pQData->nCaptureHT = nCaptureHT;
|
|
|
|
LeaveCriticalSection( &pQData->cSection );
|
|
|
|
|
|
|
|
return nCaptureHTPrv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_Lock
|
|
|
|
*
|
2000-08-29 05:52:46 +02:00
|
|
|
* Function for getting a 32 bit pointer on queue structure. For thread
|
1999-01-28 11:54:11 +01:00
|
|
|
* safeness programmers should use this function instead of GlobalLock to
|
|
|
|
* retrieve a pointer on the structure. QUEUE_Unlock should also be called
|
|
|
|
* when access to the queue structure is not required anymore.
|
|
|
|
*/
|
|
|
|
MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue )
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
1999-01-28 11:54:11 +01:00
|
|
|
queue = GlobalLock16( hQueue );
|
|
|
|
if ( !queue || (queue->magic != QUEUE_MAGIC) )
|
|
|
|
{
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
queue->lockCount++;
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
return queue;
|
|
|
|
}
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_Unlock
|
|
|
|
*
|
1999-05-01 12:20:18 +02:00
|
|
|
* Use with QUEUE_Lock to get a thread safe access to message queue
|
1999-01-28 11:54:11 +01:00
|
|
|
* structure
|
|
|
|
*/
|
|
|
|
void QUEUE_Unlock( MESSAGEQUEUE *queue )
|
|
|
|
{
|
|
|
|
if (queue)
|
|
|
|
{
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
1999-01-28 11:54:11 +01:00
|
|
|
|
|
|
|
if ( --queue->lockCount == 0 )
|
|
|
|
{
|
|
|
|
DeleteCriticalSection ( &queue->cSection );
|
2000-05-30 21:48:18 +02:00
|
|
|
if (queue->server_queue)
|
|
|
|
CloseHandle( queue->server_queue );
|
1999-01-28 11:54:11 +01:00
|
|
|
GlobalFree16( queue->self );
|
|
|
|
}
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapUnlock( GetProcessHeap() );
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DumpQueue
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_DumpQueue( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *pq;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(pq = QUEUE_Lock( hQueue )) )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-05-02 16:32:27 +02:00
|
|
|
WARN_(msg)("%04x is not a queue handle\n", hQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
EnterCriticalSection( &pq->cSection );
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
DPRINTF( "thread: %10p Intertask SendMessage:\n"
|
|
|
|
"firstMsg: %8p lastMsg: %8p\n"
|
1999-02-18 18:34:09 +01:00
|
|
|
"lockCount: %7.4x\n"
|
|
|
|
"paints: %10.4x\n"
|
1996-03-14 19:08:34 +01:00
|
|
|
"hCurHook: %8.4x\n",
|
2001-05-19 00:51:56 +02:00
|
|
|
pq->teb, pq->firstMsg, pq->lastMsg,
|
|
|
|
(unsigned)pq->lockCount, pq->wPaintCount,
|
|
|
|
pq->hCurHook);
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &pq->cSection );
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( pq );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
InitializeCriticalSection( &msgQueue->cSection );
|
1999-02-13 13:24:04 +01:00
|
|
|
MakeCriticalSectionGlobal( &msgQueue->cSection );
|
1999-02-09 16:35:12 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
msgQueue->lockCount = 1;
|
|
|
|
msgQueue->magic = QUEUE_MAGIC;
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Create and initialize our per queue data */
|
|
|
|
msgQueue->pQData = bCreatePerQData ? PERQDATA_CreateInstance() : NULL;
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return hQueue;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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;
|
|
|
|
|
|
|
|
if( hCursorQueue == hQueue ) hCursorQueue = 0;
|
|
|
|
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() );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2000-08-29 05:52:46 +02:00
|
|
|
/* free up resource used by MESSAGEQUEUE structure */
|
1999-01-28 11:54:11 +01:00
|
|
|
msgQueue->lockCount--;
|
|
|
|
QUEUE_Unlock( msgQueue );
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_CreateSysMsgQueue
|
|
|
|
*
|
|
|
|
* Create the system message queue, and set the double-click speed.
|
|
|
|
* Must be called only once.
|
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
BOOL QUEUE_CreateSysMsgQueue( int size )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Note: We dont need perQ data for the system message queue */
|
|
|
|
if (!(hmemSysMsgQueue = QUEUE_CreateMsgQueue( FALSE )))
|
|
|
|
return FALSE;
|
2001-05-14 22:01:38 +02:00
|
|
|
FarSetOwner16( hmemSysMsgQueue, 0 );
|
1996-05-06 18:06:24 +02:00
|
|
|
sysMsgQueue = (MESSAGEQUEUE *) GlobalLock16( hmemSysMsgQueue );
|
1996-03-14 19:08:34 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_GetSysQueue
|
|
|
|
*/
|
|
|
|
MESSAGEQUEUE *QUEUE_GetSysQueue(void)
|
|
|
|
{
|
|
|
|
return sysMsgQueue;
|
|
|
|
}
|
|
|
|
|
Release 980822
Sat Aug 22 17:46:19 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [include/dosexe.h] [include/module.h] [include/pe_image.h]
[include/process.h] [include/windows.h] [loader/dos/module.c]
[loader/module.c] [loader/ne/module.c] [loader/pe_image.c]
[scheduler/process.c] [win32/process.c]
Partially implemented CreateProcess32.
* [win32/device.c] [relay32/kernel32.spec] [scheduler/k32obj.c]
[misc/registry.c] [win32/file.c]
Partially implemented VxDCall (VMM registry services).
* [files/dos_fs.c]
DOSFS_FindNext made thread-safe.
* [include/sig_context.h] [include/syslevel.h] [loader/signal.c]
[scheduler/syslevel.c] [tools/build.c]
Replaced CALLTO16_Current_fs by SYSLEVEL_Win16CurrentTeb.
* [win32/kernel32.c]
Bugfix: QT_Thunk/FT_Thunk should return 'long' in DX:AX, not EAX.
* [if1632/relay.c] [relay32/builtin32.c] [windows/msgbox.c]
[msdos/int20.c] [msdos/int21.c]
Use ExitProcess instead of TASK_KillCurrentTask.
* [include/task.h] [include/thread.h] [loader/task.c]
[scheduler/thread.c] [include/queue.h] [windows/message.c]
[windows/queue.c] [windows/win.c]
Prevent Win32 threads from entering the TASK_Reschedule loop.
(Note: Win32 messaging still doesn't work correctly; this patch
is just preventing the system from crashing when Win32 threads
call messaging functions. Messages will probably still get lost.)
* [scheduler/critsection.c]
Deactivated the use of SEM_UNDO for the SYSTEM_LOCK semaphore;
for some reason, this leads to problems after threads terminate...
Sat Aug 22 15:00:00 1998 Jrgen Schmied <juergen.schmied@metronet.de>
* [include/authors.h]
New file, includes all names of the developer (former shell.c)
* [Makefile.in][configure][configure.in][dlls/Makefile.in]
[dlls/shell32/Makefile.in][shres.rc]
Created dlls/shell32 and moved the shell32 stuff in it.
Started to create internal resources.
* [dlls/shell32/*]
Split the shell32 implementation into smaller files.
New classes: IContextMenu, IExtractIcon, IShellView.
Implemented Shell_GetImageList().
shell32 links to comctl32 now dynamically so it can use
internal/external implementations.
* [documentation/internal-dll] [documentation/shell32]
New, could anybody do a spellcheck?
* [include/commctrl.h]
Many new LV constants, structures, functions.
* [controls/comctl32undoc.c]
Rewrote the DSA* functions.
* [windows/winpos.c]
SetShellWindow32, GetShellWindow32.
Sat Aug 22 14:02:15 1998 Alexander Lukyanov <lav@long.yar.ru>
* [loader/resource.c]
Mark last accelerator as such in LoadAccelerators32W.
* [relay32/shell32.spec] [misc/shell.c]
Add stubs for SHGetSpecialFolderPath[AW].
Sat Aug 22 02:07:42 1998 Adrian Harvey <adrian@select.com.au>
* [include/file.h] [file/file.c] [msdos/int21.c] [msdos/vxd.c]
[misc/lzexpand.c] [win32/kernel32.c] [documentation/filehandles]
Fixed file handle handling. Created universal HFILE16 to HFILE32
translation macro from msdos/int21 code by Ove Kaaven.
Used macro in all Win16 functions so that win32 handles are translated
to avoid DOS/Win16 stdxx handles.
Removed handle translation from int21.c where Win16 functions are
called. Changed remaining calls to use new macro names.
Documented filehandle handling and differences between win 16 & 32.
Fri Aug 21 20:32:49 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [server/process.c] [server/thread.c]
Implemented object wait queues and synchronization.
Fri Aug 21 18:40:02 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk>
* [graphics/psdrv/*]
DEVMODE dmPaper{Width|Length} fields are in 0.1mm.
Select a 100 pixel default font in CreateDC.
Thu Aug 20 22:47:39 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [objects/bitmap.c]
Handle bits=32 in SetBitmapBits32 and GetBitmapBits32.
* [msdos/int21.c]
Add handling of Int21 0A and 37.
* [misc/commdlg.c]
Use MapHModuleLS and MapHModuleSL when translating HINSTANCE16 to
HINSTANCE32 and vice versa.
* [win32/file.c]
CreateFile32A: Abort if filename == NULL.
Thu Aug 20 12:28:31 1998 Marcus Meissner <marcus@jet.franken.de>
* [*/*]
Lots of missing prototypes added, some parameter types adapted to match
SDK.
* [debugger/stabs.c]
Don't loop forever if we don't find wine or one of the libxxx.so.
* [loader/ne/module.c]
Implemented MapHModuleLS,MapHModuleSL,MapHinstLS,MapHinstSL.
* [misc/network.c]
Implemented WNetGetUser32A.
* [misc/shellord.c]
Implemented ILRemoveLastID.
* [multimedia/dsound.c]
Fixed StarCraft memory leak.
* [graphics/ddraw.c]
Removed some unnecessary simple relaying functions, tried polishing
up the Xlib implementation (still doesn't work), temp. removed Xshm
code (to be remerged with working Xlib code).
Tue Aug 18 22:29:17 1998 Ove Kaaven <ovek@arcticnet.no>
* [multimedia/mmio.c] [multimedia/mmsystem.c]
Fixed most mmio bugs, fully implementing mmioSetBuffer
buffering, ability to read memory files, and the
sndPlaySound() SND_MEMORY flag. Most mmio-using programs
now work fine.
* [include/dosexe.h] [include/miscemu.h] [include/module.h]
[loader/module.c] [loader/task.c] [msdos/dosmem.c]
Improved DOS VM flexibility and portability somewhat. (Did
I get the #ifdefs right this time, BSD-ers?)
* [msdos/int21.c]
Made "Get Current PSP address" work as expected in a DOS VM.
* [loader/dos/*]
Began improving flexibility and portability somewhat. It
should be easier to add DPMI RMCB callbacks now. The
DOS VM no longer leaves big files lying around in /tmp
after a crash.
Tue Aug 18 12:38:31 1998 Turchanov Sergey <turchanov@usa.net>
* [relay32/winmm.spec]
This patch allows WinAmp to play WAV files (at least in PCM
format).
Sun Aug 16 05:34:13 1998 Pablo Saratxaga <srtxg@chanae.alphanet.ch>
* [windows/keyboard.c]
Corrected keyboard code to properly handle keys : ? ~ and "
on non US keyboards.
Sat Aug 15 18:47:14 1998 Brian Craft <bcboy@dorothy.wanglab.brandeis.edu>
* [windows/win.c]
Fixed severe bug in EnumChildWindwos().
Thu Aug 13 21:05:35 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de>
* [controls/tooltips.c]
Fixed some bugs. Added subclassing support.
* [controls/toolbar.c]
Improved tooltip integration. Fixed some bugs.
* [controls/commctrl.c]
Changed control registration and added some documentation.
Fixed ShowHideMenuCtl.
* [controls/rebar.c][include/rebar.h][include/commctrl.h]
Improved rebar implementation (still no display).
* [controls/pager.c][include/pager.h][include/commctrl.h]
Improved pager implementation (still no display).
* [misc/imagelist.c]
Fixed a bug.
* [documentation/common_controls]
Updated.
Sun Aug 9 19:50:20 1998 James Juran <jrj120@psu.edu>
* [Makefile.in] [documentation/Makefile.in]
[programs/Makefile.in] [programs/*/Makefile.in]
Added uninstall rules, cleaned up install rules a little bit.
Sun Aug 9 13:21:35 1998 Andreas Mohr <100.30936@germany.net>
* [loader/ne/module.c] [if1632/kernel.spec]
Added the undocumented HIWORD of GetModuleHandle (hFirstModule).
* [loader/ne/segment.c]
Wine forgot to set some NE_SEGFLAGS_*.
Combined with another loader change, this fixed the
"BLINKER -- error in loading module" or ghost MessageBox problem
that about 1% of all Windows programs have.
Some BLINKER programs still don't work, though.
But I'm working on it, with great help from Blinkinc.
* [loader/task.c]
InitTask needs to decrement the SP register by two as Win95 does.
Sun Aug 9 02:41:28 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de>
* [if1632/kernel.spec] [relay32/kernel32.spec] [scheduler/syslevel.c]
[loader/main.c] [win32/ordinals.c] [include/syslevel.h]
[scheduler/Makefile.in]
Implemented Win95 'syslevel' routines (including Win16Lock).
* [if1632/relay.c] [if1632/thunk.c] [tools/build.c] [loader/task.c]
[loader/ne/segment.c] [win32/kernel32.c] [memory/selector.c]
[include/stackframe.h] [include/thread.h]
16-bit %fs handling revised. Use Win16Lock where appropriate.
* [include/thread.h] [scheduler/synchro.c] [windows/message.c]
[windows/queue.c] [win32/process.c]
Implemented MsgWaitForMultipleObjects.
* [files/change.c] [files/Makefile.in] [scheduler/k32obj.c]
[win32/newfns.c]
Implemented (dummy) file change notification objects.
* [debugger/dbg.y] [scheduler/process.c] [scheduler/thread.c]
[include/process.h] [include/thread.h]
Suspend all threads except current when hitting debugger break point.
* [objects/dib.c]
Bugfix for CreateDIBSection.
1998-08-22 21:03:56 +02:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
/***********************************************************************
|
1999-02-09 15:07:07 +01:00
|
|
|
* QUEUE_SetWakeBit
|
1996-05-28 20:54:58 +02:00
|
|
|
*
|
|
|
|
* See "Windows Internals", p.449
|
|
|
|
*/
|
2001-05-19 00:51:56 +02:00
|
|
|
static BOOL QUEUE_TrySetWakeBit( MESSAGEQUEUE *queue, WORD set, WORD clear, BOOL always )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
2001-01-29 01:33:35 +01:00
|
|
|
BOOL wake = FALSE;
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
TRACE_(msg)("queue = %04x, set = %04x, clear = %04x, always = %d\n",
|
|
|
|
queue->self, set, clear, always );
|
|
|
|
if (!queue->server_queue) return FALSE;
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( set_queue_bits )
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
req->handle = queue->server_queue;
|
|
|
|
req->set = set;
|
|
|
|
req->clear = clear;
|
|
|
|
req->mask_cond = always ? 0 : set;
|
|
|
|
if (!SERVER_CALL()) wake = (req->changed_mask & set) != 0;
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_END_REQ;
|
2001-01-29 01:33:35 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
if (wake || always)
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
if (set & QS_MOUSE) pMouseQueue = queue;
|
|
|
|
if (set & QS_KEY) pKbdQueue = queue;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
2001-01-29 01:33:35 +01:00
|
|
|
return wake;
|
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD set, WORD clear )
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
QUEUE_TrySetWakeBit( queue, set, clear, TRUE );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-06-16 18:16:05 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_ClearWakeBit
|
|
|
|
*/
|
|
|
|
void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit )
|
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
QUEUE_SetWakeBit( queue, 0, bit );
|
1996-06-16 18:16:05 +02:00
|
|
|
}
|
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_WaitBits
|
|
|
|
*
|
|
|
|
* See "Windows Internals", p.447
|
1999-03-10 17:21:12 +01:00
|
|
|
*
|
|
|
|
* return values:
|
|
|
|
* 0 if exit with timeout
|
|
|
|
* 1 otherwise
|
1996-05-28 20:54:58 +02:00
|
|
|
*/
|
1999-03-10 17:21:12 +01:00
|
|
|
int QUEUE_WaitBits( WORD bits, DWORD timeout )
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
2000-01-01 23:38:20 +01:00
|
|
|
HQUEUE16 hQueue;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1999-05-02 16:32:27 +02:00
|
|
|
TRACE_(msg)("q %04x waiting for %04x\n", GetFastQueue16(), bits);
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2000-01-01 23:38:20 +01:00
|
|
|
hQueue = GetFastQueue16();
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return 0;
|
1999-03-10 17:21:12 +01:00
|
|
|
|
1996-05-28 20:54:58 +02:00
|
|
|
for (;;)
|
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
unsigned int wake_bits = 0, changed_bits = 0;
|
2001-04-04 02:19:55 +02:00
|
|
|
DWORD dwlc;
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( set_queue_mask )
|
|
|
|
{
|
|
|
|
req->wake_mask = QS_SENDMESSAGE;
|
|
|
|
req->changed_mask = bits | QS_SENDMESSAGE;
|
|
|
|
req->skip_wait = 1;
|
|
|
|
if (!SERVER_CALL())
|
|
|
|
{
|
|
|
|
wake_bits = req->wake_bits;
|
|
|
|
changed_bits = req->changed_bits;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
2001-01-29 01:33:35 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
if (changed_bits & bits)
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
|
|
|
/* One of the bits is set; we can return */
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1999-03-10 17:21:12 +01:00
|
|
|
return 1;
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
if (wake_bits & QS_SENDMESSAGE)
|
1996-05-28 20:54:58 +02:00
|
|
|
{
|
|
|
|
/* Process the sent message immediately */
|
2001-05-19 00:51:56 +02:00
|
|
|
QMSG msg;
|
|
|
|
QUEUE_FindMsg( 0, 0, 0, TRUE, TRUE, &msg );
|
|
|
|
continue; /* nested sm crux */
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
TRACE_(msg)("(%04x) mask=%08x, bits=%08x, changed=%08x, waiting\n",
|
|
|
|
queue->self, bits, wake_bits, changed_bits );
|
1996-09-28 20:11:01 +02:00
|
|
|
|
2001-04-04 02:19:55 +02:00
|
|
|
ReleaseThunkLock( &dwlc );
|
|
|
|
if (dwlc) TRACE_(msg)("had win16 lock\n");
|
2001-05-16 21:52:29 +02:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
if (USER_Driver.pMsgWaitForMultipleObjectsEx)
|
|
|
|
USER_Driver.pMsgWaitForMultipleObjectsEx( 1, &queue->server_queue, timeout, 0, 0 );
|
2001-05-16 21:52:29 +02:00
|
|
|
else
|
|
|
|
WaitForSingleObject( queue->server_queue, timeout );
|
2001-04-04 02:19:55 +02:00
|
|
|
if (dwlc) RestoreThunkLock( dwlc );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
/* handle the reception of a sent message by calling the corresponding window proc */
|
|
|
|
static void handle_sent_message( QMSG *msg )
|
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-05-19 00:51:56 +02:00
|
|
|
LRESULT result = 0;
|
|
|
|
MESSAGEQUEUE *queue = QUEUE_Lock( GetFastQueue16() );
|
|
|
|
DWORD extraInfo = queue->GetMessageExtraInfoVal; /* save ExtraInfo */
|
|
|
|
WND *wndPtr = WIN_FindWndPtr( msg->msg.hwnd );
|
1999-02-18 18:34:09 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
TRACE( "got hwnd %x msg %x (%s) wp %x lp %lx\n",
|
|
|
|
msg->msg.hwnd, msg->msg.message, SPY_GetMsgName(msg->msg.message),
|
|
|
|
msg->msg.wParam, msg->msg.lParam );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
queue->GetMessageExtraInfoVal = msg->extraInfo;
|
1999-02-18 18:34:09 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
/* call the right version of CallWindowProcXX */
|
|
|
|
switch(msg->type)
|
1999-02-18 18:34:09 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
case QMSG_WIN16:
|
|
|
|
result = CallWindowProc16( (WNDPROC16)wndPtr->winproc,
|
|
|
|
(HWND16) msg->msg.hwnd,
|
|
|
|
(UINT16) msg->msg.message,
|
|
|
|
LOWORD(msg->msg.wParam),
|
|
|
|
msg->msg.lParam );
|
|
|
|
break;
|
|
|
|
case QMSG_WIN32A:
|
|
|
|
result = CallWindowProcA( wndPtr->winproc, msg->msg.hwnd, msg->msg.message,
|
|
|
|
msg->msg.wParam, msg->msg.lParam );
|
|
|
|
break;
|
|
|
|
case QMSG_WIN32W:
|
|
|
|
result = CallWindowProcW( wndPtr->winproc, msg->msg.hwnd, msg->msg.message,
|
|
|
|
msg->msg.wParam, msg->msg.lParam );
|
|
|
|
break;
|
1999-02-18 18:34:09 +01:00
|
|
|
}
|
1999-01-28 11:54:11 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
queue->GetMessageExtraInfoVal = extraInfo; /* Restore extra info */
|
|
|
|
WIN_ReleaseWndPtr(wndPtr);
|
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( reply_message )
|
1999-01-28 11:54:11 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
req->result = result;
|
|
|
|
req->remove = 1;
|
|
|
|
SERVER_CALL();
|
1999-01-28 11:54:11 +01:00
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_END_REQ;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_FindMsg
|
|
|
|
*
|
|
|
|
* Find a message matching the given parameters. Return -1 if none available.
|
|
|
|
*/
|
2001-05-19 00:51:56 +02:00
|
|
|
BOOL QUEUE_FindMsg( HWND hwnd, UINT first, UINT last, BOOL remove, BOOL sent_only, QMSG *msg )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
BOOL ret = FALSE, sent = FALSE;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
if (!first && !last) last = ~0;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
for (;;)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
SERVER_START_REQ( get_message )
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
req->remove = remove;
|
|
|
|
req->posted = !sent_only;
|
|
|
|
req->get_win = hwnd;
|
|
|
|
req->get_first = first;
|
|
|
|
req->get_last = last;
|
|
|
|
if ((ret = !SERVER_CALL()))
|
2001-01-29 01:33:35 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
sent = req->sent;
|
|
|
|
msg->type = req->type;
|
|
|
|
msg->msg.hwnd = req->win;
|
|
|
|
msg->msg.message = req->msg;
|
|
|
|
msg->msg.wParam = req->wparam;
|
|
|
|
msg->msg.lParam = req->lparam;
|
|
|
|
msg->msg.time = 0; /* FIXME */
|
|
|
|
msg->msg.pt.x = 0; /* FIXME */
|
|
|
|
msg->msg.pt.y = 0; /* FIXME */
|
|
|
|
msg->extraInfo = req->info;
|
1999-01-26 10:30:05 +01:00
|
|
|
}
|
2001-05-19 00:51:56 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
|
|
|
|
if (!ret || !sent) break;
|
|
|
|
handle_sent_message( msg );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
if (ret) TRACE( "got hwnd %x msg %x (%s) wp %x lp %lx\n",
|
|
|
|
msg->msg.hwnd, msg->msg.message, SPY_GetMsgName(msg->msg.message),
|
|
|
|
msg->msg.wParam, msg->msg.lParam );
|
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_RemoveMsg
|
|
|
|
*
|
|
|
|
* Remove a message from the queue (pos must be a valid position).
|
|
|
|
*/
|
1999-01-26 10:30:05 +01:00
|
|
|
void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
EnterCriticalSection( &msgQueue->cSection );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
/* set the linked list */
|
|
|
|
if (qmsg->prevMsg)
|
|
|
|
qmsg->prevMsg->nextMsg = qmsg->nextMsg;
|
|
|
|
|
|
|
|
if (qmsg->nextMsg)
|
|
|
|
qmsg->nextMsg->prevMsg = qmsg->prevMsg;
|
|
|
|
|
|
|
|
if (msgQueue->firstMsg == qmsg)
|
|
|
|
msgQueue->firstMsg = qmsg->nextMsg;
|
|
|
|
|
|
|
|
if (msgQueue->lastMsg == qmsg)
|
|
|
|
msgQueue->lastMsg = qmsg->prevMsg;
|
|
|
|
|
|
|
|
/* deallocate the memory for the message */
|
2001-02-23 02:13:42 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, qmsg );
|
Release 961201
Sat Nov 30 19:21:17 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [configure]
Re-generated with autoconf 2.11. Let me know if you have
problems.
* [controls/listbox.c] [controls/oldlbox.c]
Listboxes rewritten from scratch. Moved old code still used by
comboboxes to oldlbox.c
* [misc/registry.c]
Use temporary file when saving registry.
* [windows/dialog.c]
Implemented Win32 version of DlgDirList() and DlgDirListComboBox().
* [windows/winproc.c]
Added translation for listbox Win32 messages.
Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [controls/widgets.c] [controls/button.c]
Fixed some incompatibilities with CTL3D DLL.
* [windows/dialog.c]
Made dialog windows fit into the desktop.
* [misc/winsock.c] [misc/winsock_async.c]
New Winsock engine.
* [windows/message.c]
GetMessage() fixes.
* [windows/queue.c] [windows/hook.c] [windows/win.c]
SetMessageQueue() fixes.
Fri Nov 29 10:25:12 1996 Slaven Rezic <eserte@cs.tu-berlin.de>
* [objects/text.c]
DrawText16(): Fixed return value.
Tue Nov 26 14:47:09 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/profile.c] [*/*]
Added Win32 profile functions, updated to new naming standard.
* [objects/font.c] [if1632/thunk.c] [include/windows.h]
Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
structures.
* [misc/ole2nls.c] [if1632/thunk.c]
Added EnumSystemLocales() (winhelp.exe).
* [misc/registry.c]
Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no
* [win32/file.c]
Partially fixed CreateFileMapping(), added UnmapViewOfFile().
Sat Nov 23 23:36:05 1996 Ronan Waide <waider@waider.ie>
* [misc/shell.c]
Fixed some FIXMEs relating to ShellExec() and FindExecutable().
* [misc/main.c]
Implemented a few more of the SystemParametersInfo() cases.
Tue Nov 19 01:24:34 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [include/keyboard.h]
New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).
* [include/windows.h]
New [VK_A, VK_Z] and [VK_0, VK9] macros.
* [misc/keyboard.c]
Fixes in KeyTable and ToAscii.
* [objects/font.c]
FONT_init : Give default value for MSWIN "system" font.
FONT_MatchFont : Do not try every size of a font family if the
family does not exist.
* [windows/event.c]
lastEventChar hack removed.
KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
and QueueKeyStateTable (maintained in message.c).
EVENT_key : Corrections to the extended bit setting.
* [windows/message.c] [windows/keyboard.c]
Implementation of a new QueueKeyStateTable : table of key states
valid when messages are retrieved by GetMessage or PeekMessage,
and valid for TranslateMessage.
TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
and ToAscii.
Mon Nov 18 16:59:01 1996 Robert Pouliot <krynos@clic.net>
* [graphics/Makefile.in] [graphics/wing.c]
[if1632/wing.spec]
Some functions for WinG support, mostly empty stubs.
* [misc/crtdll.c] [if1632/crtdll.spec]
Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 18:17:47 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
LeaveCriticalSection( &msgQueue->cSection );
|
1996-05-28 20:54:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* hardware_event
|
|
|
|
*
|
|
|
|
* Add an event to the system message queue.
|
|
|
|
* Note: the position is relative to the desktop window.
|
|
|
|
*/
|
1999-08-07 14:33:35 +02:00
|
|
|
void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
|
1996-03-14 19:08:34 +01:00
|
|
|
int xPos, int yPos, DWORD time, DWORD extraInfo )
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
MSG *msg;
|
1999-03-28 15:10:54 +02:00
|
|
|
QMSG *qmsg;
|
2001-05-16 21:52:29 +02:00
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-26 10:30:05 +01:00
|
|
|
int mergeMsg = 0;
|
1996-05-28 20:54:58 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
if (!sysMsgQueue) return;
|
|
|
|
|
1999-03-28 15:10:54 +02:00
|
|
|
EnterCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
|
|
|
|
/* Merge with previous event if possible */
|
|
|
|
qmsg = sysMsgQueue->lastMsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if ((message == WM_MOUSEMOVE) && sysMsgQueue->lastMsg)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
msg = &(sysMsgQueue->lastMsg->msg);
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
if ((msg->message == message) && (msg->wParam == wParam))
|
1999-01-26 10:30:05 +01:00
|
|
|
{
|
|
|
|
/* Merge events */
|
|
|
|
qmsg = sysMsgQueue->lastMsg;
|
|
|
|
mergeMsg = 1;
|
2001-01-29 01:33:35 +01:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
if (!mergeMsg)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
2000-08-29 05:52:46 +02:00
|
|
|
/* Should I limit the number of messages in
|
1999-01-26 10:30:05 +01:00
|
|
|
the system message queue??? */
|
|
|
|
|
|
|
|
/* Don't merge allocate a new msg in the global heap */
|
|
|
|
|
2001-02-23 02:13:42 +01:00
|
|
|
if (!(qmsg = (QMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(QMSG) ) ))
|
1999-03-28 15:10:54 +02:00
|
|
|
{
|
|
|
|
LeaveCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
return;
|
|
|
|
}
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
/* put message at the end of the linked list */
|
|
|
|
qmsg->nextMsg = 0;
|
|
|
|
qmsg->prevMsg = sysMsgQueue->lastMsg;
|
|
|
|
|
|
|
|
if (sysMsgQueue->lastMsg)
|
|
|
|
sysMsgQueue->lastMsg->nextMsg = qmsg;
|
|
|
|
|
|
|
|
/* set last and first anchor index in system message queue */
|
|
|
|
sysMsgQueue->lastMsg = qmsg;
|
|
|
|
if (!sysMsgQueue->firstMsg)
|
|
|
|
sysMsgQueue->firstMsg = qmsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Store message */
|
1999-01-26 10:30:05 +01:00
|
|
|
msg = &(qmsg->msg);
|
1996-03-14 19:08:34 +01:00
|
|
|
msg->hwnd = 0;
|
|
|
|
msg->message = message;
|
|
|
|
msg->wParam = wParam;
|
|
|
|
msg->lParam = lParam;
|
|
|
|
msg->time = time;
|
1999-01-26 10:30:05 +01:00
|
|
|
msg->pt.x = xPos;
|
|
|
|
msg->pt.y = yPos;
|
|
|
|
qmsg->extraInfo = extraInfo;
|
1999-12-10 04:47:13 +01:00
|
|
|
qmsg->type = QMSG_HARDWARE;
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1999-03-28 15:10:54 +02:00
|
|
|
LeaveCriticalSection( &sysMsgQueue->cSection );
|
|
|
|
|
2001-05-16 21:52:29 +02:00
|
|
|
if ((queue = QUEUE_Lock( GetFastQueue16() )))
|
|
|
|
{
|
|
|
|
WORD wakeBit;
|
|
|
|
|
|
|
|
if ((message >= WM_KEYFIRST) && (message <= WM_KEYLAST)) wakeBit = QS_KEY;
|
|
|
|
else wakeBit = (message == WM_MOUSEMOVE) ? QS_MOUSEMOVE : QS_MOUSEBUTTON;
|
|
|
|
|
2001-05-19 00:51:56 +02:00
|
|
|
QUEUE_SetWakeBit( queue, wakeBit, 0 );
|
2001-05-16 21:52:29 +02:00
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
2001-05-16 21:52:29 +02:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_GetQueueTask
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
1999-01-28 11:54:11 +01:00
|
|
|
HTASK16 hTask = 0;
|
|
|
|
|
|
|
|
MESSAGEQUEUE *queue = QUEUE_Lock( hQueue );
|
|
|
|
|
|
|
|
if (queue)
|
2000-08-29 05:52:46 +02:00
|
|
|
{
|
2000-05-29 23:25:10 +02:00
|
|
|
hTask = queue->teb->htask16;
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
2000-08-29 05:52:46 +02:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return hTask;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_IncPaintCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_IncPaintCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wPaintCount++;
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
2001-05-19 00:51:56 +02:00
|
|
|
QUEUE_SetWakeBit( queue, QS_PAINT, 0 );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* QUEUE_DecPaintCount
|
|
|
|
*/
|
1996-07-12 21:02:39 +02:00
|
|
|
void QUEUE_DecPaintCount( HQUEUE16 hQueue )
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( hQueue ))) return;
|
|
|
|
EnterCriticalSection( &queue->cSection );
|
1996-03-14 19:08:34 +01:00
|
|
|
queue->wPaintCount--;
|
2001-05-19 00:51:56 +02:00
|
|
|
if (!queue->wPaintCount) QUEUE_ClearWakeBit( queue, QS_PAINT );
|
2001-01-29 01:33:35 +01:00
|
|
|
LeaveCriticalSection( &queue->cSection );
|
1999-01-28 11:54:11 +01:00
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
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;
|
|
|
|
}
|
|
|
|
|
1998-03-29 21:44:57 +02:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* WaitForInputIdle (USER32.@)
|
1998-03-29 21:44:57 +02:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI WaitForInputIdle (HANDLE hProcess, DWORD dwTimeOut)
|
1998-03-29 21:44:57 +02:00
|
|
|
{
|
2000-05-30 21:48:18 +02:00
|
|
|
DWORD cur_time, ret;
|
2000-08-30 02:00:48 +02:00
|
|
|
HANDLE idle_event = -1;
|
Release 980503
Thu Apr 30 16:28:12 1998 James Juran <jrj120@psu.edu>
* [scheduler/process.c]
Implemented GetExitCodeProcess. The code is a direct translation
of GetExitCodeThread.
Mon Apr 27 22:20:25 1998 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [loader/pe_image.c]
Unload dummy module when PE_LoadLibraryEx32A fails with
PE_LoadImage (makes Encarta 98 installer proceed).
* [files/drive.c]
Make GetDriveType16 return DRIVE_REMOVABLE for TYPE_CDROM.
Make GetCurrentDirectory32 behave like the code does and not
like the help describes.
* [files/profile.c]
Revoke recent change in PROFILE_GetSection and try better
handling of special case.
* [include/windows.h]
Change definition of ACCEL32.
* [misc/commdlg.c]
Replace the GetXXXFilename32 macros by normal code.
Fix two reported bugs in my changes to commdlg.
* [windows/win.c]
Add a hook to catch bogus WM_SIZE messages by emitting a warning
in the appropriate case.
* [objects/bitmap.c]
Reject unreasonbable large size arguments in
CreateCompatibleBitmap32 and add an fixme for that situation.
Sun Apr 26 18:30:07 1998 Alexandre Julliard <julliard@lrc.epfl.ch>
* [include/ldt.h] [debugger/*.c] [miscemu/instr.c]
Added IS_SELECTOR_SYSTEM and IS_SELECTOR_32BIT macros.
Make instruction emulation support system selectors.
* [loader/*.c]
Started moving NE specific functions to the new loader/ne
directory.
* [memory/environ.c]
Enforce the 127 chars limit only when creating the environment of
a Win16 process.
Sun Apr 26 12:22:23 1998 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed an incredible typo in CopyFile32A that made it unusable
since a rewrite in 970112 (!!).
* [files/directory.c]
Fixed GetTempPath32A/W to include trailing backslash.
* [misc/ver.c]
Make find_pe_resource "work" with corrupt files.
* [misc/wsprintf.c]
Altered WPRINTF_ParseFormatA/W to treat invalid format chars
as normal output, too.
* [msdos/dpmi.c]
Implemented "Allocate/Free real mode callback" (0x0303/0x0304).
Cross your fingers if you need to use it ;) (completely untested)
Implemented "Call real mode proc with far return" (0x0301, tested).
* [msdos/int21.c]
Fixed ioctlGenericBlkDevReq/0x60.
* [relay32/dplayx.spec] [relay32/builtin32.c] [relay32/Makefile.in]
Added built-in DPLAYX.DLL.
* [windows/win.c]
Fixed GetWindowWord()/GWW_HWNDPARENT to return the window's owner
if it has no parent (SDK).
Sat Apr 25 15:09:53 1998 M.T.Fortescue <mark@mtfhpc.demon.co.uk>
* [debugger/db_disasm.c]
Fixed disassemble bug for no-display option and 'lock',
'repne' and 'repe' prefixes.
* [debugger/registers.c]
Added textual flag description output on 'info regs'.
Sat Apr 25 14:18:26 1998 Matthew Becker <mbecker@glasscity.net>
* [*/*.c]
Added stubs and/or documentation for the following functions:
LookupPrivilegeValue, OpenService, ControlService, RegGetKeySecurity,
StartService, SetComputerName, DeleteService, CloseServiceHandle,
OpenProcessToken, OpenSCManager, DeregisterEventSource,
WaitForDebugEvent, WaitForInputIdle, RegisterEventSource,
SetDebugErrorLevel, SetConsoleCursorPosition, ChoosePixelFormat,
SetPixelFormat, GetPixelFormat, DescribePixelFormat, SwapBuffers,
PolyBezier, AbortPath, DestroyAcceleratorTable, HeapWalk,
DdeInitialize, DdeUninitialize, DdeConnectList, DdeDisconnectList,
DdeCreateStringHandle, DdePostAdvise, DdeGetData, DdeNameService,
DdeGetLastError, WNetGetDirectoryType, EnumPrinters, RegFlushKey,
RegGetKeySecurity, DllGetClassObject, DllCanUnloadNow, CreateBitmap,
CreateCompatibleBitmap, CreateBitmapIndirect, GetBitmapBits,
SetBitmapBits, LoadImage, CopyImage, LoadBitmap, DrawIcon,
CreateDiscardableBitmap, SetDIBits, GetCharABCWidths, LoadTypeLib,
SetConsoleCtrlHandler, CreateConsoleScreenBuffer, ReadConsoleInput,
GetConsoleCursorInfo, SetConsoleCursorInfo, SetConsoleWindowInfo,
SetConsoleTextAttribute, SetConsoleScreenBufferSize,
FillConsoleOutputCharacter, FillConsoleOutputAttribute,
CreateMailslot, GetMailslotInfo, GetCompressedFileSize,
GetProcessWindowStation, GetThreadDesktop, SetDebugErrorLevel,
WaitForDebugEvent, SetComputerName, CreateMDIWindow.
Thu Apr 23 23:54:04 1998 Douglas Ridgway <ridgway@winehq.com>
* [include/windows.h] [objects/enhmetafile.c] [relay32/gdi32.spec]
Implement CopyEnhMetaFile, Get/SetEnhMetaFileBits, other fixes.
* [include/windows.h] [objects/metafile.c] [relay32/gdi32.spec]
32-bit metafile fixes, implement EnumMetaFile32, GetMetaFileBitsEx.
* [objects/font.c] [graphics/x11drv/xfont.c] [graphics/x11drv/text.c]
Some rotated text support for X11R6 displays.
* [win32/newfns.c] [ole/ole2nls.c]
Moved GetNumberFormat32A.
Wed Apr 22 17:38:20 1998 David Lee Lambert <lamber45@egr.msu.edu>
* [ole/ole2nls.c] [misc/network.c]
Changed some function documentation to the new style.
* [misc/network.c] [include/windows.h] [if1632/user.spec]
[relay32/mpr.spec] [misc/mpr.c]
Added stubs for some Win32 network functions; renamed some
16-bit ones with 32-bit counterparts, as well as
WNetGetDirectoryType; moved the stubs in misc/mpr.c (three of
them!) to misc/network.c.
* [ole/compobj.c] [ole/storage.c] [ole/ole2disp.c]
[ole/ole2nls.c] [ole/folders.c] [ole/moniker.c] [ole/ole2.c]
[graphics/fontengine.c] [graphics/ddraw.c] [graphics/env.c]
[graphics/driver.c] [graphics/escape.c]
Changed fprintf's to proper debug-macros.
* [include/winnls.h]
Added some flags (for internal use).
* [ole/ole2nls.c]
Added the Unicode core function, and worked out a way to hide
the commonality of the core.
* [relay32/kernel32.spec]
Added support for GetDate/Time32A/W.
Wed Apr 22 09:16:03 1998 Gordon Chaffee <chaffee@cs.berkeley.edu>
* [win32/code_page.c]
Fixed problem with MultiByteToWideChar that was introduced in
last release. Made MultiByteToWideChar more compatible with Win32.
* [graphics/x11drv/graphics.c]
Fixed problem with drawing arcs.
Tue Apr 21 11:24:58 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [ole/ole2nls.c]
Move stuff from 0x409 case to Lang_En.
* [relay32/user32.spec] [windows/winpos.c]
Added stubs for GetWindowRgn32 and SetWindowRgn32. Makes Office
Paperclip happy.
Tue Apr 21 11:16:16 1998 Constantine Sapuntzakis <csapuntz@tma-1.lcs.mit.edu>
* [loader/pe_image.c]
If image is relocated, TLS addresses need to be adjusted.
* [debugger/*.c]
Generalized tests for 32-bit segments.
Tue Apr 21 02:04:59 1998 James Juran <jrj120@psu.edu>
* [misc/*.c] [miscemu/*.c] [msdos/*.c] [if1632/*.c]
[include/*.h] [loader/*.c] [memory/*.c] [multimedia/*.c]
[objects/*.c]
Almost all fprintf statements converted to appropriate
debug messages.
* [README]
Updated "GETTING MORE INFORMATION" section to include WineHQ.
* [documentation/debugger]
Fixed typo.
* [windows/defwnd.c]
Added function documentation.
Sun Apr 19 16:30:58 1998 Marcus Meissner <marcus@mud.de>
* [Make.rules.in]
Added lint target (using lclint).
* [relay32/oleaut32.spec][relay32/Makefile.in][ole/typelib.c]
[ole/ole2disp.c]
Added oleaut32 spec, added some SysString functions.
* [if1632/signal.c]
Added printing of faultaddress in Linux (using CR2 debug register).
* [configure.in]
Added <sys/types.h> for statfs checks.
* [loader/*.c][debugger/break.c][debugger/hash.c]
Started to split win32/win16 module handling, preparing support
for other binary formats (like ELF).
Sat Apr 18 10:07:41 1998 Rein Klazes <rklazes@casema.net>
* [misc/registry.c]
Fixed a bug that made RegQueryValuexxx returning
incorrect registry values.
Fri Apr 17 22:59:22 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/lstr.c]
FormatMessage32*: remove linefeed when nolinefeed set;
check for target underflow.
Fri Apr 17 00:38:14 1998 Alexander V. Lukyanov <lav@long.yar.ru>
* [misc/crtdll.c]
Implement xlat_file_ptr for CRT stdin/stdout/stderr address
translation.
Wed Apr 15 20:43:56 1998 Jim Peterson <jspeter@birch.ee.vt.edu>
* [controls/menu.c]
Added 'odaction' parameter to MENU_DrawMenuItem() and redirected
WM_DRAWITEM messages to GetWindow(hwnd,GW_OWNER).
Tue Apr 14 16:17:55 1998 Berend Reitsma <berend@united-info.com>
* [graphics/metafiledrv/init.c] [graphics/painting.c]
[graphics/win16drv/init.c] [graphics/x11drv/graphics.c]
[graphics/x11drv/init.c] [include/gdi.h] [include/x11drv.h]
[relay32/gdi32.spec]
Added PolyPolyline routine.
* [windows/winproc.c]
Changed WINPROC_GetProc() to return proc instead of &(jmp proc).
1998-05-03 21:01:20 +02:00
|
|
|
|
2001-02-27 03:09:16 +01:00
|
|
|
SERVER_START_REQ( wait_input_idle )
|
2000-08-30 02:00:48 +02:00
|
|
|
{
|
|
|
|
req->handle = hProcess;
|
|
|
|
req->timeout = dwTimeOut;
|
2001-02-27 03:09:16 +01:00
|
|
|
if (!(ret = SERVER_CALL_ERR())) idle_event = req->event;
|
2000-08-30 02:00:48 +02:00
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
if (ret) return 0xffffffff; /* error */
|
2001-01-05 05:08:07 +01:00
|
|
|
if (!idle_event) return 0; /* no event to wait on */
|
2000-01-01 23:38:20 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
cur_time = GetTickCount();
|
2000-01-01 23:38:20 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
TRACE_(msg)("waiting for %x\n", idle_event );
|
|
|
|
while ( dwTimeOut > GetTickCount() - cur_time || dwTimeOut == INFINITE )
|
|
|
|
{
|
|
|
|
ret = MsgWaitForMultipleObjects ( 1, &idle_event, FALSE, dwTimeOut, QS_SENDMESSAGE );
|
|
|
|
if ( ret == ( WAIT_OBJECT_0 + 1 ))
|
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
QMSG msg;
|
|
|
|
QUEUE_FindMsg( 0, 0, 0, TRUE, TRUE, &msg );
|
2001-01-29 01:33:35 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if ( ret == WAIT_TIMEOUT || ret == 0xFFFFFFFF )
|
|
|
|
{
|
|
|
|
TRACE_(msg)("timeout or error\n");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE_(msg)("finished\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2000-01-01 23:38:20 +01:00
|
|
|
}
|
2001-01-29 01:33:35 +01:00
|
|
|
|
|
|
|
return WAIT_TIMEOUT;
|
1998-03-29 21:44:57 +02:00
|
|
|
}
|
|
|
|
|
1998-12-24 16:15:00 +01:00
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* UserYield (USER.332)
|
2001-01-25 23:22:21 +01:00
|
|
|
* UserYield16 (USER32.@)
|
1998-12-24 16:15:00 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
void WINAPI UserYield16(void)
|
1998-12-24 16:15:00 +01:00
|
|
|
{
|
2001-05-19 00:51:56 +02:00
|
|
|
QMSG msg;
|
1998-12-24 16:15:00 +01:00
|
|
|
|
|
|
|
/* Handle sent messages */
|
2001-05-19 00:51:56 +02:00
|
|
|
while (QUEUE_FindMsg( 0, 0, 0, TRUE, TRUE, &msg ))
|
2001-01-29 01:33:35 +01:00
|
|
|
;
|
1998-12-24 16:15:00 +01:00
|
|
|
|
1999-03-27 17:10:52 +01:00
|
|
|
/* Yield */
|
2001-04-04 02:19:55 +02:00
|
|
|
OldYield16();
|
1999-03-27 17:10:52 +01:00
|
|
|
|
|
|
|
/* Handle sent messages again */
|
2001-05-19 00:51:56 +02:00
|
|
|
while (QUEUE_FindMsg( 0, 0, 0, TRUE, TRUE, &msg ))
|
2001-01-29 01:33:35 +01:00
|
|
|
;
|
1998-12-24 16:15:00 +01:00
|
|
|
}
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessagePos (USER.119) (USER32.@)
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* The GetMessagePos() function returns a long value representing a
|
|
|
|
* cursor position, in screen coordinates, when the last message
|
|
|
|
* retrieved by the GetMessage() function occurs. The x-coordinate is
|
|
|
|
* in the low-order word of the return value, the y-coordinate is in
|
|
|
|
* the high-order word. The application can use the MAKEPOINT()
|
|
|
|
* macro to obtain a POINT structure from the return value.
|
|
|
|
*
|
|
|
|
* For the current cursor position, use GetCursorPos().
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Cursor position of last message on success, zero on failure.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
|
|
|
* ECMA-234, Win32
|
|
|
|
*
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
DWORD WINAPI GetMessagePos(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
DWORD ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessagePosVal;
|
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessageTime (USER.120) (USER32.@)
|
1998-10-25 10:20:30 +01:00
|
|
|
*
|
|
|
|
* GetMessageTime() returns the message time for the last message
|
|
|
|
* retrieved by the function. The time is measured in milliseconds with
|
|
|
|
* the same offset as GetTickCount().
|
|
|
|
*
|
|
|
|
* Since the tick count wraps, this is only useful for moderately short
|
|
|
|
* relative time comparisons.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
*
|
|
|
|
* Time of last message on success, zero on failure.
|
|
|
|
*
|
|
|
|
* CONFORMANCE
|
|
|
|
*
|
|
|
|
* ECMA-234, Win32
|
|
|
|
*
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
LONG WINAPI GetMessageTime(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
LONG ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessageTimeVal;
|
|
|
|
QUEUE_Unlock( queue );
|
|
|
|
|
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* GetMessageExtraInfo (USER.288) (USER32.@)
|
1996-03-14 19:08:34 +01:00
|
|
|
*/
|
1997-08-24 18:00:30 +02:00
|
|
|
LONG WINAPI GetMessageExtraInfo(void)
|
1996-03-14 19:08:34 +01:00
|
|
|
{
|
|
|
|
MESSAGEQUEUE *queue;
|
1999-01-28 11:54:11 +01:00
|
|
|
LONG ret;
|
|
|
|
|
2001-01-29 01:33:35 +01:00
|
|
|
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
1999-01-28 11:54:11 +01:00
|
|
|
ret = queue->GetMessageExtraInfoVal;
|
|
|
|
QUEUE_Unlock( queue );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
return ret;
|
1996-03-14 19:08:34 +01:00
|
|
|
}
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2000-12-22 02:38:01 +01:00
|
|
|
* AttachThreadInput (USER32.@) Attaches input of 1 thread to other
|
2000-08-04 06:21:02 +02:00
|
|
|
*
|
|
|
|
* Attaches the input processing mechanism of one thread to that of
|
|
|
|
* another thread.
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*
|
|
|
|
* TODO:
|
|
|
|
* 1. Reset the Key State (currenly per thread key state is not maintained)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI AttachThreadInput(
|
|
|
|
DWORD idAttach, /* [in] Thread to attach */
|
|
|
|
DWORD idAttachTo, /* [in] Thread to attach to */
|
|
|
|
BOOL fAttach) /* [in] Attach or detach */
|
|
|
|
{
|
|
|
|
MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
|
|
|
|
BOOL16 bRet = 0;
|
|
|
|
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
|
|
|
|
/* A thread cannot attach to itself */
|
|
|
|
if ( idAttach == idAttachTo )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
/* According to the docs this method should fail if a
|
|
|
|
* "Journal record" hook is installed. (attaches all input queues together)
|
|
|
|
*/
|
|
|
|
if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
/* Retrieve message queues corresponding to the thread id's */
|
2001-01-29 01:33:35 +01:00
|
|
|
pTgtMsgQ = QUEUE_Lock( GetThreadQueue16( idAttach ) );
|
|
|
|
pSrcMsgQ = QUEUE_Lock( GetThreadQueue16( idAttachTo ) );
|
2000-08-04 06:21:02 +02:00
|
|
|
|
|
|
|
/* Ensure we have message queues and that Src and Tgt threads
|
|
|
|
* are not system threads.
|
|
|
|
*/
|
|
|
|
if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
if (fAttach) /* Attach threads */
|
|
|
|
{
|
|
|
|
/* Only attach if currently detached */
|
|
|
|
if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
|
|
|
|
{
|
|
|
|
/* First release the target threads perQData */
|
|
|
|
PERQDATA_Release( pTgtMsgQ->pQData );
|
|
|
|
|
|
|
|
/* Share a reference to the source threads perQDATA */
|
|
|
|
PERQDATA_Addref( pSrcMsgQ->pQData );
|
|
|
|
pTgtMsgQ->pQData = pSrcMsgQ->pQData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else /* Detach threads */
|
|
|
|
{
|
|
|
|
/* Only detach if currently attached */
|
|
|
|
if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
|
|
|
|
{
|
|
|
|
/* First release the target threads perQData */
|
|
|
|
PERQDATA_Release( pTgtMsgQ->pQData );
|
|
|
|
|
|
|
|
/* Give the target thread its own private perQDATA once more */
|
|
|
|
pTgtMsgQ->pQData = PERQDATA_CreateInstance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Reset the Key State */
|
|
|
|
|
|
|
|
bRet = 1; /* Success */
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
|
|
|
|
/* Unlock the queues before returning */
|
|
|
|
if ( pSrcMsgQ )
|
|
|
|
QUEUE_Unlock( pSrcMsgQ );
|
|
|
|
if ( pTgtMsgQ )
|
|
|
|
QUEUE_Unlock( pTgtMsgQ );
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|