2001-06-23 01:02:48 +02:00
|
|
|
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DDEML library
|
|
|
|
*
|
|
|
|
* Copyright 1997 Alexandre Julliard
|
|
|
|
* Copyright 1997 Len White
|
|
|
|
* Copyright 1999 Keith Matthews
|
|
|
|
* Copyright 2000 Corel
|
|
|
|
* Copyright 2001 Eric Pouech
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-06-23 01:02:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "dde.h"
|
|
|
|
#include "ddeml.h"
|
2001-09-14 02:24:39 +02:00
|
|
|
#include "win.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-06-29 21:20:18 +02:00
|
|
|
#include "dde/dde_private.h"
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ddeml);
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
static const char szServerNameClassA[] = "DdeServerNameAnsi";
|
|
|
|
const char WDML_szServerConvClassA[] = "DdeServerConvAnsi";
|
|
|
|
const WCHAR WDML_szServerConvClassW[] = {'D','d','e','S','e','r','v','e','r','C','o','n','v','U','n','i','c','o','d','e',0};
|
2001-06-23 01:02:48 +02:00
|
|
|
|
|
|
|
static LRESULT CALLBACK WDML_ServerNameProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
static LRESULT CALLBACK WDML_ServerConvProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DdePostAdvise [USER32.@] Send transaction to DDE callback function.
|
|
|
|
*
|
2001-08-10 00:07:22 +02:00
|
|
|
* PARAMS
|
|
|
|
* idInst [I] Instance identifier
|
|
|
|
* hszTopic [I] Handle to topic name string
|
|
|
|
* hszItem [I] Handle to item name string
|
|
|
|
*
|
2001-06-23 01:02:48 +02:00
|
|
|
* RETURNS
|
|
|
|
* Success: TRUE
|
|
|
|
* Failure: FALSE
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_INSTANCE* pInstance = NULL;
|
2001-06-23 01:02:48 +02:00
|
|
|
WDML_LINK* pLink = NULL;
|
2002-01-18 20:30:15 +01:00
|
|
|
HDDEDATA hDdeData = 0;
|
|
|
|
HGLOBAL hItemData = 0;
|
2001-06-23 01:02:48 +02:00
|
|
|
WDML_CONV* pConv = NULL;
|
2001-08-10 00:07:22 +02:00
|
|
|
ATOM atom = 0;
|
|
|
|
UINT count;
|
|
|
|
|
2002-11-22 22:22:14 +01:00
|
|
|
TRACE("(%ld,%p,%p)\n", idInst, hszTopic, hszItem);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
EnterCriticalSection(&WDML_CritSect);
|
|
|
|
|
|
|
|
pInstance = WDML_GetInstance(idInst);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (pInstance == NULL || pInstance->links == NULL)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
goto theError;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
atom = WDML_MakeAtomFromHsz(hszItem);
|
|
|
|
if (!atom) goto theError;
|
|
|
|
|
|
|
|
/* first compute the number of links which will trigger a message */
|
|
|
|
count = 0;
|
|
|
|
for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
|
|
|
|
{
|
|
|
|
if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
|
|
|
|
{
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (count >= CADV_LATEACK)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
FIXME("too high value for count\n");
|
|
|
|
count &= 0xFFFF;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
|
|
|
|
for (pLink = pInstance->links[WDML_SERVER_SIDE]; pLink != NULL; pLink = pLink->next)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
if (DdeCmpStringHandles(hszItem, pLink->hszItem) == 0)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
hDdeData = WDML_InvokeCallback(pInstance, XTYP_ADVREQ, pLink->uFmt, pLink->hConv,
|
|
|
|
hszTopic, hszItem, 0, count--, 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-18 20:30:15 +01:00
|
|
|
if (hDdeData == (HDDEDATA)CBR_BLOCK)
|
2001-08-10 00:07:22 +02:00
|
|
|
{
|
|
|
|
/* MS doc is not consistent here */
|
|
|
|
FIXME("CBR_BLOCK returned for ADVREQ\n");
|
|
|
|
continue;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
if (hDdeData)
|
|
|
|
{
|
|
|
|
if (pLink->transactionType & XTYPF_NODATA)
|
|
|
|
{
|
|
|
|
TRACE("no data\n");
|
|
|
|
hItemData = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("with data\n");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
hItemData = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE);
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pConv = WDML_GetConv(pLink->hConv, TRUE);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (pConv == NULL)
|
|
|
|
{
|
2002-01-18 20:30:15 +01:00
|
|
|
if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
|
2001-08-10 00:07:22 +02:00
|
|
|
goto theError;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!PostMessageA(pConv->hwndClient, WM_DDE_DATA, (WPARAM)pConv->hwndServer,
|
|
|
|
PackDDElParam(WM_DDE_DATA, (UINT)hItemData, atom)))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
ERR("post message failed\n");
|
2002-01-18 20:30:15 +01:00
|
|
|
pConv->wStatus &= ~ST_CONNECTED;
|
|
|
|
if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalFree(hItemData);
|
|
|
|
goto theError;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2002-01-18 20:30:15 +01:00
|
|
|
if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
2001-06-23 01:02:48 +02:00
|
|
|
return TRUE;
|
2001-08-10 00:07:22 +02:00
|
|
|
theError:
|
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
|
|
|
if (atom) GlobalDeleteAtom(atom);
|
|
|
|
return FALSE;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* DdeNameService [USER32.@] {Un}registers service name of DDE server
|
|
|
|
*
|
|
|
|
* PARAMS
|
|
|
|
* idInst [I] Instance identifier
|
|
|
|
* hsz1 [I] Handle to service name string
|
|
|
|
* hsz2 [I] Reserved
|
|
|
|
* afCmd [I] Service name flags
|
|
|
|
*
|
|
|
|
* RETURNS
|
|
|
|
* Success: Non-zero
|
|
|
|
* Failure: 0
|
|
|
|
*/
|
|
|
|
HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd)
|
|
|
|
{
|
|
|
|
WDML_SERVER* pServer;
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_INSTANCE* pInstance;
|
2001-06-23 01:02:48 +02:00
|
|
|
HDDEDATA hDdeData;
|
|
|
|
HWND hwndServer;
|
|
|
|
WNDCLASSEXA wndclass;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-12-02 19:10:57 +01:00
|
|
|
hDdeData = NULL;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-11-22 22:22:14 +01:00
|
|
|
TRACE("(%ld,%p,%p,%d)\n", idInst, hsz1, hsz2, afCmd);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
EnterCriticalSection(&WDML_CritSect);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
/* First check instance
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
pInstance = WDML_GetInstance(idInst);
|
|
|
|
if (pInstance == NULL)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
TRACE("Instance not found as initialised\n");
|
|
|
|
/* Nothing has been initialised - exit now ! can return TRUE since effect is the same */
|
2001-08-10 00:07:22 +02:00
|
|
|
goto theError;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
if (hsz2 != 0L)
|
|
|
|
{
|
|
|
|
/* Illegal, reserved parameter
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
pInstance->lastError = DMLERR_INVALIDPARAMETER;
|
|
|
|
WARN("Reserved parameter no-zero !!\n");
|
|
|
|
goto theError;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
if (hsz1 == 0 && afCmd != DNS_UNREGISTER)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
/* don't know if we should check this but it makes sense
|
|
|
|
* why supply REGISTER or filter flags if de-registering all
|
2001-06-23 01:02:48 +02:00
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
TRACE("General unregister unexpected flags\n");
|
|
|
|
pInstance->lastError = DMLERR_INVALIDPARAMETER;
|
|
|
|
goto theError;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
switch (afCmd)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
case DNS_REGISTER:
|
|
|
|
pServer = WDML_FindServer(pInstance, hsz1, 0);
|
2001-06-23 01:02:48 +02:00
|
|
|
if (pServer)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
ERR("Trying to register already registered service!\n");
|
|
|
|
pInstance->lastError = DMLERR_DLL_USAGE;
|
|
|
|
goto theError;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
|
|
|
|
TRACE("Adding service name\n");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_IncHSZ(pInstance, hsz1);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pServer = WDML_AddServer(pInstance, hsz1, 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
WDML_BroadcastDDEWindows(WDML_szEventClass, WM_WDML_REGISTER,
|
2001-08-10 00:07:22 +02:00
|
|
|
pServer->atomService, pServer->atomServiceSpec);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
wndclass.cbSize = sizeof(wndclass);
|
|
|
|
wndclass.style = 0;
|
|
|
|
wndclass.lpfnWndProc = WDML_ServerNameProc;
|
|
|
|
wndclass.cbClsExtra = 0;
|
|
|
|
wndclass.cbWndExtra = 2 * sizeof(DWORD);
|
|
|
|
wndclass.hInstance = 0;
|
|
|
|
wndclass.hIcon = 0;
|
|
|
|
wndclass.hCursor = 0;
|
|
|
|
wndclass.hbrBackground = 0;
|
|
|
|
wndclass.lpszMenuName = NULL;
|
|
|
|
wndclass.lpszClassName = szServerNameClassA;
|
|
|
|
wndclass.hIconSm = 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
RegisterClassExA(&wndclass);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
2001-06-23 01:02:48 +02:00
|
|
|
hwndServer = CreateWindowA(szServerNameClassA, NULL,
|
|
|
|
WS_POPUP, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0);
|
2001-08-10 00:07:22 +02:00
|
|
|
EnterCriticalSection(&WDML_CritSect);
|
|
|
|
|
|
|
|
SetWindowLongA(hwndServer, GWL_WDML_INSTANCE, (DWORD)pInstance);
|
|
|
|
SetWindowLongA(hwndServer, GWL_WDML_SERVER, (DWORD)pServer);
|
2002-11-22 22:22:14 +01:00
|
|
|
TRACE("Created nameServer=%p for instance=%08lx\n", hwndServer, idInst);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
pServer->hwndServer = hwndServer;
|
2001-08-10 00:07:22 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DNS_UNREGISTER:
|
|
|
|
if (hsz1 == 0L)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
/* General unregister situation
|
2002-06-01 01:06:46 +02:00
|
|
|
* terminate all server side pending conversations
|
2001-06-23 01:02:48 +02:00
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
while (pInstance->servers)
|
|
|
|
WDML_RemoveServer(pInstance, pInstance->servers->hszService, 0);
|
|
|
|
pInstance->servers = NULL;
|
|
|
|
TRACE("General de-register - finished\n");
|
|
|
|
}
|
|
|
|
else
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_RemoveServer(pInstance, hsz1, 0L);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
break;
|
|
|
|
case DNS_FILTERON:
|
|
|
|
case DNS_FILTEROFF:
|
2001-06-23 01:02:48 +02:00
|
|
|
/* Set filter flags on to hold notifications of connection
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
pServer = WDML_FindServer(pInstance, hsz1, 0);
|
2001-06-23 01:02:48 +02:00
|
|
|
if (!pServer)
|
|
|
|
{
|
|
|
|
/* trying to filter where no service names !!
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
pInstance->lastError = DMLERR_DLL_USAGE;
|
|
|
|
goto theError;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
|
|
|
else
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
pServer->filterOn = (afCmd == DNS_FILTERON);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
break;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
2001-06-23 01:02:48 +02:00
|
|
|
return (HDDEDATA)TRUE;
|
2001-08-10 00:07:22 +02:00
|
|
|
|
|
|
|
theError:
|
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
|
|
|
return FALSE;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_CreateServerConv
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
static WDML_CONV* WDML_CreateServerConv(WDML_INSTANCE* pInstance, HWND hwndClient,
|
2001-08-10 00:07:22 +02:00
|
|
|
HWND hwndServerName, HSZ hszApp, HSZ hszTopic)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
HWND hwndServerConv;
|
|
|
|
WDML_CONV* pConv;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (pInstance->unicode)
|
|
|
|
{
|
|
|
|
WNDCLASSEXW wndclass;
|
|
|
|
|
|
|
|
wndclass.cbSize = sizeof(wndclass);
|
|
|
|
wndclass.style = 0;
|
|
|
|
wndclass.lpfnWndProc = WDML_ServerConvProc;
|
|
|
|
wndclass.cbClsExtra = 0;
|
|
|
|
wndclass.cbWndExtra = 2 * sizeof(DWORD);
|
|
|
|
wndclass.hInstance = 0;
|
|
|
|
wndclass.hIcon = 0;
|
|
|
|
wndclass.hCursor = 0;
|
|
|
|
wndclass.hbrBackground = 0;
|
|
|
|
wndclass.lpszMenuName = NULL;
|
|
|
|
wndclass.lpszClassName = WDML_szServerConvClassW;
|
|
|
|
wndclass.hIconSm = 0;
|
|
|
|
|
|
|
|
RegisterClassExW(&wndclass);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
hwndServerConv = CreateWindowW(WDML_szServerConvClassW, 0,
|
|
|
|
WS_CHILD, 0, 0, 0, 0,
|
|
|
|
hwndServerName, 0, 0, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WNDCLASSEXA wndclass;
|
|
|
|
|
|
|
|
wndclass.cbSize = sizeof(wndclass);
|
|
|
|
wndclass.style = 0;
|
|
|
|
wndclass.lpfnWndProc = WDML_ServerConvProc;
|
|
|
|
wndclass.cbClsExtra = 0;
|
|
|
|
wndclass.cbWndExtra = 2 * sizeof(DWORD);
|
|
|
|
wndclass.hInstance = 0;
|
|
|
|
wndclass.hIcon = 0;
|
|
|
|
wndclass.hCursor = 0;
|
|
|
|
wndclass.hbrBackground = 0;
|
|
|
|
wndclass.lpszMenuName = NULL;
|
|
|
|
wndclass.lpszClassName = WDML_szServerConvClassA;
|
|
|
|
wndclass.hIconSm = 0;
|
|
|
|
|
|
|
|
RegisterClassExA(&wndclass);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
hwndServerConv = CreateWindowA(WDML_szServerConvClassA, 0,
|
|
|
|
WS_CHILD, 0, 0, 0, 0,
|
|
|
|
hwndServerName, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
2002-11-22 22:22:14 +01:00
|
|
|
TRACE("Created convServer=%p (nameServer=%p) for instance=%08lx\n",
|
2001-08-10 00:07:22 +02:00
|
|
|
hwndServerConv, hwndServerName, pInstance->instanceID);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
pConv = WDML_AddConv(pInstance, WDML_SERVER_SIDE, hszApp, hszTopic,
|
2001-08-10 00:07:22 +02:00
|
|
|
hwndClient, hwndServerConv);
|
|
|
|
if (pConv)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
SetWindowLongA(hwndServerConv, GWL_WDML_INSTANCE, (DWORD)pInstance);
|
|
|
|
SetWindowLongA(hwndServerConv, GWL_WDML_CONVERSATION, (DWORD)pConv);
|
|
|
|
|
|
|
|
/* this should be the only place using SendMessage for WM_DDE_ACK */
|
2002-01-18 20:30:15 +01:00
|
|
|
/* note: sent messages shall not use packing */
|
2001-08-10 00:07:22 +02:00
|
|
|
SendMessageA(hwndClient, WM_DDE_ACK, (WPARAM)hwndServerConv,
|
2002-01-18 20:30:15 +01:00
|
|
|
MAKELPARAM(WDML_MakeAtomFromHsz(hszApp), WDML_MakeAtomFromHsz(hszTopic)));
|
2002-06-01 01:06:46 +02:00
|
|
|
/* we assume we're connected since we've sent an answer...
|
2001-08-10 00:07:22 +02:00
|
|
|
* I'm not sure what we can do... it doesn't look like the return value
|
|
|
|
* of SendMessage is used... sigh...
|
2001-06-23 01:02:48 +02:00
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
pConv->wStatus |= ST_CONNECTED;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
DestroyWindow(hwndServerConv);
|
|
|
|
}
|
|
|
|
return pConv;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerNameProc
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
|
|
|
HWND hwndClient;
|
|
|
|
HSZ hszApp, hszTop;
|
|
|
|
HDDEDATA hDdeData = 0;
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_INSTANCE* pInstance;
|
|
|
|
UINT uiLo, uiHi;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
switch (iMsg)
|
|
|
|
{
|
|
|
|
case WM_DDE_INITIATE:
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
/* wParam -- sending window handle
|
|
|
|
LOWORD(lParam) -- application atom
|
|
|
|
HIWORD(lParam) -- topic atom */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
TRACE("WM_DDE_INITIATE message received!\n");
|
2001-06-23 01:02:48 +02:00
|
|
|
hwndClient = (HWND)wParam;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pInstance = WDML_GetInstanceFromWnd(hwndServer);
|
|
|
|
TRACE("idInst=%ld, threadID=0x%lx\n", pInstance->instanceID, GetCurrentThreadId());
|
|
|
|
if (!pInstance) return 0;
|
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
/* don't free DDEParams, since this is a broadcast */
|
2002-06-01 01:06:46 +02:00
|
|
|
UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi);
|
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
hszApp = WDML_MakeHszFromAtom(pInstance, uiLo);
|
|
|
|
hszTop = WDML_MakeHszFromAtom(pInstance, uiHi);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!(pInstance->CBFflags & CBF_FAIL_CONNECTIONS))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
BOOL self = FALSE;
|
|
|
|
CONVCONTEXT cc;
|
|
|
|
CONVCONTEXT* pcc = NULL;
|
|
|
|
WDML_CONV* pConv;
|
|
|
|
char buf[256];
|
|
|
|
|
|
|
|
if (GetWindowThreadProcessId(hwndClient, NULL) == GetWindowThreadProcessId(hwndServer, NULL) &&
|
|
|
|
WDML_GetInstanceFromWnd(hwndClient) == WDML_GetInstanceFromWnd(hwndServer))
|
|
|
|
{
|
|
|
|
self = TRUE;
|
|
|
|
}
|
|
|
|
/* FIXME: so far, we don't grab distant convcontext, so only check if remote is
|
|
|
|
* handled under DDEML, and if so build a default context
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
if ((GetClassNameA(hwndClient, buf, sizeof(buf)) &&
|
2001-08-10 00:07:22 +02:00
|
|
|
strcmp(buf, WDML_szClientConvClassA) == 0) ||
|
2002-06-01 01:06:46 +02:00
|
|
|
(GetClassNameW(hwndClient, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) &&
|
2001-08-10 00:07:22 +02:00
|
|
|
lstrcmpW((LPWSTR)buf, WDML_szClientConvClassW) == 0))
|
|
|
|
{
|
|
|
|
pcc = &cc;
|
|
|
|
memset(pcc, 0, sizeof(*pcc));
|
|
|
|
pcc->cb = sizeof(*pcc);
|
|
|
|
pcc->iCodePage = IsWindowUnicode(hwndClient) ? CP_WINUNICODE : CP_WINANSI;
|
|
|
|
}
|
|
|
|
if ((pInstance->CBFflags & CBF_FAIL_SELFCONNECTIONS) && self)
|
|
|
|
{
|
|
|
|
TRACE("Don't do self connection as requested\n");
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
else if (hszApp && hszTop)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_SERVER* pServer = (WDML_SERVER*)GetWindowLongA(hwndServer, GWL_WDML_SERVER);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
/* check filters for name service */
|
|
|
|
if (!pServer->filterOn || DdeCmpStringHandles(pServer->hszService, hszApp) == 0)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
/* pass on to the callback */
|
|
|
|
hDdeData = WDML_InvokeCallback(pInstance, XTYP_CONNECT,
|
|
|
|
0, 0, hszTop, hszApp, 0, (DWORD)pcc, self);
|
|
|
|
if ((UINT)hDdeData)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer,
|
2001-08-10 00:07:22 +02:00
|
|
|
hszApp, hszTop);
|
|
|
|
if (pConv && pcc) pConv->wStatus |= ST_ISLOCAL;
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
else if (pInstance->servers)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
/* pass on to the callback */
|
|
|
|
hDdeData = WDML_InvokeCallback(pInstance, XTYP_WILDCONNECT,
|
|
|
|
0, 0, hszTop, hszApp, 0, (DWORD)pcc, self);
|
|
|
|
|
2002-01-18 20:30:15 +01:00
|
|
|
if (hDdeData == (HDDEDATA)CBR_BLOCK)
|
2001-08-10 00:07:22 +02:00
|
|
|
{
|
|
|
|
/* MS doc is not consistent here */
|
|
|
|
FIXME("CBR_BLOCK returned for WILDCONNECT\n");
|
|
|
|
}
|
|
|
|
else if ((UINT)hDdeData != 0)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
HSZPAIR* hszp;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
hszp = (HSZPAIR*)DdeAccessData(hDdeData, NULL);
|
|
|
|
if (hszp)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; hszp[i].hszSvc && hszp[i].hszTopic; i++)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer,
|
2001-08-10 00:07:22 +02:00
|
|
|
hszp[i].hszSvc, hszp[i].hszTopic);
|
|
|
|
if (pConv && pcc) pConv->wStatus |= ST_ISLOCAL;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
DdeUnaccessData(hDdeData);
|
|
|
|
}
|
2002-01-18 20:30:15 +01:00
|
|
|
if (!WDML_IsAppOwned(hDdeData)) DdeFreeDataHandle(hDdeData);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
return 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_REQUEST:
|
|
|
|
FIXME("WM_DDE_REQUEST message received!\n");
|
|
|
|
return 0;
|
|
|
|
case WM_DDE_ADVISE:
|
|
|
|
FIXME("WM_DDE_ADVISE message received!\n");
|
|
|
|
return 0;
|
|
|
|
case WM_DDE_UNADVISE:
|
|
|
|
FIXME("WM_DDE_UNADVISE message received!\n");
|
|
|
|
return 0;
|
|
|
|
case WM_DDE_EXECUTE:
|
|
|
|
FIXME("WM_DDE_EXECUTE message received!\n");
|
|
|
|
return 0;
|
|
|
|
case WM_DDE_POKE:
|
|
|
|
FIXME("WM_DDE_POKE message received!\n");
|
|
|
|
return 0;
|
|
|
|
case WM_DDE_TERMINATE:
|
|
|
|
FIXME("WM_DDE_TERMINATE message received!\n");
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
return DefWindowProcA(hwndServer, iMsg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2001-08-10 00:07:22 +02:00
|
|
|
* WDML_ServerQueueRequest
|
2001-06-23 01:02:48 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_XACT* WDML_ServerQueueRequest(WDML_CONV* pConv, LPARAM lParam)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
UINT uiLo, uiHi;
|
|
|
|
WDML_XACT* pXAct;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
UnpackDDElParam(WM_DDE_REQUEST, lParam, &uiLo, &uiHi);
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_REQUEST,
|
2001-08-10 00:07:22 +02:00
|
|
|
uiLo, WDML_MakeHszFromAtom(pConv->instance, uiHi));
|
|
|
|
if (pXAct) pXAct->atom = uiHi;
|
|
|
|
return pXAct;
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandleRequest
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandleRequest(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
|
|
|
HDDEDATA hDdeData = 0;
|
|
|
|
WDML_QUEUE_STATE ret = WDML_QS_HANDLED;
|
|
|
|
|
|
|
|
if (!(pConv->instance->CBFflags & CBF_FAIL_REQUESTS))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_REQUEST, pXAct->wFmt, (HCONV)pConv,
|
2001-08-10 00:07:22 +02:00
|
|
|
pConv->hszTopic, pXAct->hszItem, 0, 0, 0);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
|
2002-01-18 20:30:15 +01:00
|
|
|
switch ((DWORD)hDdeData)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
case 0:
|
2002-06-01 01:06:46 +02:00
|
|
|
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, FALSE, pXAct->atom,
|
2002-01-18 20:30:15 +01:00
|
|
|
pXAct->lParam, WM_DDE_REQUEST);
|
2001-08-10 00:07:22 +02:00
|
|
|
break;
|
|
|
|
case CBR_BLOCK:
|
|
|
|
ret = WDML_QS_BLOCK;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
HGLOBAL hMem = WDML_DataHandle2Global(hDdeData, FALSE, FALSE, FALSE, FALSE);
|
|
|
|
if (!PostMessageA(pConv->hwndClient, WM_DDE_DATA, (WPARAM)pConv->hwndServer,
|
2002-06-01 01:06:46 +02:00
|
|
|
ReuseDDElParam(pXAct->lParam, WM_DDE_REQUEST, WM_DDE_DATA,
|
2001-08-10 00:07:22 +02:00
|
|
|
(UINT)hMem, (UINT)pXAct->atom)))
|
|
|
|
{
|
|
|
|
DdeFreeDataHandle(hDdeData);
|
|
|
|
GlobalFree(hMem);
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
break;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_DecHSZ(pConv->instance, pXAct->hszItem);
|
|
|
|
return ret;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2001-08-10 00:07:22 +02:00
|
|
|
* WDML_ServerQueueAdvise
|
2001-06-23 01:02:48 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_XACT* WDML_ServerQueueAdvise(WDML_CONV* pConv, LPARAM lParam)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
UINT uiLo, uiHi;
|
|
|
|
WDML_XACT* pXAct;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/* XTYP_ADVSTART transaction:
|
2001-06-23 01:02:48 +02:00
|
|
|
establish link and save link info to InstanceInfoTable */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-01-18 20:30:15 +01:00
|
|
|
if (!UnpackDDElParam(WM_DDE_ADVISE, lParam, &uiLo, &uiHi))
|
|
|
|
return NULL;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_ADVISE,
|
2001-08-10 00:07:22 +02:00
|
|
|
0, WDML_MakeHszFromAtom(pConv->instance, uiHi));
|
|
|
|
if (pXAct)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct->hMem = (HGLOBAL)uiLo;
|
|
|
|
pXAct->atom = uiHi;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
return pXAct;
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandleAdvise
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandleAdvise(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
|
|
|
UINT uType;
|
|
|
|
WDML_LINK* pLink;
|
|
|
|
DDEADVISE* pDdeAdvise;
|
|
|
|
HDDEDATA hDdeData;
|
|
|
|
BOOL fAck;
|
|
|
|
|
|
|
|
pDdeAdvise = (DDEADVISE*)GlobalLock(pXAct->hMem);
|
2002-06-01 01:06:46 +02:00
|
|
|
uType = XTYP_ADVSTART |
|
2001-06-23 01:02:48 +02:00
|
|
|
(pDdeAdvise->fDeferUpd ? XTYPF_NODATA : 0) |
|
|
|
|
(pDdeAdvise->fAckReq ? XTYPF_ACKREQ : 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!(pConv->instance->CBFflags & CBF_FAIL_ADVISES))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_ADVSTART, pDdeAdvise->cfFormat,
|
2001-08-10 00:07:22 +02:00
|
|
|
(HCONV)pConv, pConv->hszTopic, pXAct->hszItem, 0, 0, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hDdeData = 0;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if ((UINT)hDdeData)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
fAck = TRUE;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
/* billx: first to see if the link is already created. */
|
2002-06-01 01:06:46 +02:00
|
|
|
pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE,
|
2002-01-18 20:30:15 +01:00
|
|
|
pXAct->hszItem, TRUE, pDdeAdvise->cfFormat);
|
2001-06-23 01:02:48 +02:00
|
|
|
|
|
|
|
if (pLink != NULL)
|
|
|
|
{
|
|
|
|
/* we found a link, and only need to modify it in case it changes */
|
|
|
|
pLink->transactionType = uType;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("Adding Link with hConv=0x%lx\n", (DWORD)pConv);
|
2002-06-01 01:06:46 +02:00
|
|
|
WDML_AddLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE,
|
2001-08-10 00:07:22 +02:00
|
|
|
uType, pXAct->hszItem, pDdeAdvise->cfFormat);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TRACE("No data returned from the Callback\n");
|
2001-08-10 00:07:22 +02:00
|
|
|
fAck = FALSE;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalUnlock(pXAct->hMem);
|
|
|
|
if (fAck)
|
2002-01-18 20:30:15 +01:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalFree(pXAct->hMem);
|
2002-01-18 20:30:15 +01:00
|
|
|
}
|
|
|
|
pXAct->hMem = 0;
|
2001-08-10 00:07:22 +02:00
|
|
|
|
|
|
|
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, fAck, pXAct->atom, pXAct->lParam, WM_DDE_ADVISE);
|
|
|
|
|
|
|
|
WDML_DecHSZ(pConv->instance, pXAct->hszItem);
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
return WDML_QS_HANDLED;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2001-08-10 00:07:22 +02:00
|
|
|
* WDML_ServerQueueUnadvise
|
2001-06-23 01:02:48 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_XACT* WDML_ServerQueueUnadvise(WDML_CONV* pConv, LPARAM lParam)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
UINT uiLo, uiHi;
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_XACT* pXAct;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
|
|
|
UnpackDDElParam(WM_DDE_UNADVISE, lParam, &uiLo, &uiHi);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_UNADVISE,
|
2001-08-10 00:07:22 +02:00
|
|
|
uiLo, WDML_MakeHszFromAtom(pConv->instance, uiHi));
|
|
|
|
if (pXAct) pXAct->atom = uiHi;
|
|
|
|
return pXAct;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandleUnadvise
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandleUnadvise(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
|
|
|
WDML_LINK* pLink;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2002-12-02 19:10:57 +01:00
|
|
|
if (pXAct->hszItem == NULL || pXAct->wFmt == 0)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
ERR("Unsupported yet options (null item or clipboard format)\n");
|
|
|
|
return WDML_QS_ERROR;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
pLink = WDML_FindLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE,
|
2002-01-18 20:30:15 +01:00
|
|
|
pXAct->hszItem, TRUE, pXAct->wFmt);
|
2001-06-23 01:02:48 +02:00
|
|
|
if (pLink == NULL)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
ERR("Couln'd find link for %08lx, dropping request\n", (DWORD)pXAct->hszItem);
|
|
|
|
FreeDDElParam(WM_DDE_UNADVISE, pXAct->lParam);
|
|
|
|
return WDML_QS_ERROR;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!(pConv->instance->CBFflags & CBF_FAIL_ADVISES))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
WDML_InvokeCallback(pConv->instance, XTYP_ADVSTOP, pXAct->wFmt, (HCONV)pConv,
|
2001-08-10 00:07:22 +02:00
|
|
|
pConv->hszTopic, pXAct->hszItem, 0, 0, 0);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
WDML_RemoveLink(pConv->instance, (HCONV)pConv, WDML_SERVER_SIDE,
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct->hszItem, pXAct->wFmt);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
/* send back ack */
|
2002-06-01 01:06:46 +02:00
|
|
|
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, FALSE, TRUE, pXAct->atom,
|
2002-01-18 20:30:15 +01:00
|
|
|
pXAct->lParam, WM_DDE_UNADVISE);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_DecHSZ(pConv->instance, pXAct->hszItem);
|
|
|
|
|
|
|
|
return WDML_QS_HANDLED;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2001-08-10 00:07:22 +02:00
|
|
|
* WDML_QueueExecute
|
2001-06-23 01:02:48 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_XACT* WDML_ServerQueueExecute(WDML_CONV* pConv, LPARAM lParam)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_XACT* pXAct;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_EXECUTE, 0, 0);
|
|
|
|
if (pXAct)
|
|
|
|
{
|
|
|
|
pXAct->hMem = (HGLOBAL)lParam;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
return pXAct;
|
2001-08-10 00:07:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandleExecute
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
|
|
|
HDDEDATA hDdeData = DDE_FNOTPROCESSED;
|
|
|
|
BOOL fAck = FALSE, fBusy = FALSE;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!(pConv->instance->CBFflags & CBF_FAIL_EXECUTES))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
LPVOID ptr = GlobalLock(pXAct->hMem);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
if (ptr)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
hDdeData = DdeCreateDataHandle(0, ptr, GlobalSize(pXAct->hMem),
|
2001-06-23 01:02:48 +02:00
|
|
|
0, 0, CF_TEXT, 0);
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalUnlock(pXAct->hMem);
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
|
|
|
hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv,
|
2001-08-10 00:07:22 +02:00
|
|
|
pConv->hszTopic, 0, hDdeData, 0L, 0L);
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
switch ((UINT)hDdeData)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
case DDE_FACK:
|
|
|
|
fAck = TRUE;
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
case DDE_FBUSY:
|
|
|
|
fBusy = TRUE;
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
default:
|
2001-06-23 01:02:48 +02:00
|
|
|
WARN("Bad result code\n");
|
2001-08-21 19:07:17 +02:00
|
|
|
/* fall through */
|
2002-06-01 01:06:46 +02:00
|
|
|
case DDE_FNOTPROCESSED:
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
}
|
2002-11-22 21:43:01 +01:00
|
|
|
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, (UINT)pXAct->hMem, 0, 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
return WDML_QS_HANDLED;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
2001-08-10 00:07:22 +02:00
|
|
|
* WDML_ServerQueuePoke
|
2001-06-23 01:02:48 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_XACT* WDML_ServerQueuePoke(WDML_CONV* pConv, LPARAM lParam)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
UINT uiLo, uiHi;
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_XACT* pXAct;
|
|
|
|
|
|
|
|
UnpackDDElParam(WM_DDE_POKE, lParam, &uiLo, &uiHi);
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE,
|
2001-08-10 00:07:22 +02:00
|
|
|
0, WDML_MakeHszFromAtom(pConv->instance, uiHi));
|
|
|
|
if (pXAct)
|
|
|
|
{
|
|
|
|
pXAct->atom = uiHi;
|
|
|
|
pXAct->hMem = (HGLOBAL)uiLo;
|
|
|
|
}
|
|
|
|
return pXAct;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandlePoke
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandlePoke(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
2001-06-23 01:02:48 +02:00
|
|
|
DDEPOKE* pDdePoke;
|
|
|
|
HDDEDATA hDdeData;
|
2001-08-10 00:07:22 +02:00
|
|
|
BOOL fBusy = FALSE, fAck = FALSE;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pDdePoke = (DDEPOKE*)GlobalLock(pXAct->hMem);
|
2001-06-23 01:02:48 +02:00
|
|
|
if (!pDdePoke)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
return WDML_QS_ERROR;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!(pConv->instance->CBFflags & CBF_FAIL_POKES))
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, pDdePoke->Value,
|
|
|
|
GlobalSize(pXAct->hMem) - sizeof(DDEPOKE) + 1,
|
2001-06-23 01:02:48 +02:00
|
|
|
0, 0, pDdePoke->cfFormat, 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
if (hDdeData)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
HDDEDATA hDdeDataOut;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
hDdeDataOut = WDML_InvokeCallback(pConv->instance, XTYP_POKE, pDdePoke->cfFormat,
|
|
|
|
(HCONV)pConv, pConv->hszTopic, pXAct->hszItem,
|
2001-08-10 00:07:22 +02:00
|
|
|
hDdeData, 0, 0);
|
2002-06-01 01:06:46 +02:00
|
|
|
switch ((UINT)hDdeDataOut)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
|
|
|
case DDE_FACK:
|
2002-06-01 01:06:46 +02:00
|
|
|
fAck = TRUE;
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
|
|
|
case DDE_FBUSY:
|
2001-08-10 00:07:22 +02:00
|
|
|
fBusy = TRUE;
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("Unsupported returned value %08lx\n", (DWORD)hDdeDataOut);
|
2001-08-21 19:07:17 +02:00
|
|
|
/* fal through */
|
2002-06-01 01:06:46 +02:00
|
|
|
case DDE_FNOTPROCESSED:
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
DdeFreeDataHandle(hDdeData);
|
|
|
|
}
|
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalUnlock(pXAct->hMem);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (!fAck)
|
2002-01-18 20:30:15 +01:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
GlobalFree(pXAct->hMem);
|
2002-01-18 20:30:15 +01:00
|
|
|
}
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, pXAct->atom, pXAct->lParam, WM_DDE_POKE);
|
|
|
|
|
|
|
|
WDML_DecHSZ(pConv->instance, pXAct->hszItem);
|
|
|
|
|
|
|
|
return WDML_QS_HANDLED;
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerQueueTerminate
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_XACT* WDML_ServerQueueTerminate(WDML_CONV* pConv, LPARAM lParam)
|
|
|
|
{
|
|
|
|
WDML_XACT* pXAct;
|
|
|
|
|
|
|
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_TERMINATE, 0, 0);
|
|
|
|
return pXAct;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandleTerminate
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2001-08-10 00:07:22 +02:00
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandleTerminate(WDML_CONV* pConv, WDML_XACT* pXAct)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
/* billx: two things to remove: the conv, and associated links.
|
|
|
|
* Respond with another WM_DDE_TERMINATE iMsg.
|
|
|
|
*/
|
|
|
|
if (!(pConv->instance->CBFflags & CBF_SKIP_DISCONNECTS))
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
WDML_InvokeCallback(pConv->instance, XTYP_DISCONNECT, 0, (HCONV)pConv, 0, 0,
|
2001-08-10 00:07:22 +02:00
|
|
|
0, 0, (pConv->wStatus & ST_ISSELF) ? 1 : 0);
|
|
|
|
}
|
|
|
|
PostMessageA(pConv->hwndClient, WM_DDE_TERMINATE, (WPARAM)pConv->hwndServer, 0);
|
|
|
|
WDML_RemoveConv(pConv, WDML_SERVER_SIDE);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
return WDML_QS_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerHandle
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV* pConv, WDML_XACT* pXAct)
|
|
|
|
{
|
|
|
|
WDML_QUEUE_STATE qs = WDML_QS_ERROR;
|
|
|
|
|
|
|
|
switch (pXAct->ddeMsg)
|
|
|
|
{
|
|
|
|
case WM_DDE_INITIATE:
|
|
|
|
FIXME("WM_DDE_INITIATE shouldn't be there!\n");
|
|
|
|
break;
|
|
|
|
case WM_DDE_REQUEST:
|
|
|
|
qs = WDML_ServerHandleRequest(pConv, pXAct);
|
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
case WM_DDE_ADVISE:
|
|
|
|
qs = WDML_ServerHandleAdvise(pConv, pXAct);
|
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
case WM_DDE_UNADVISE:
|
|
|
|
qs = WDML_ServerHandleUnadvise(pConv, pXAct);
|
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
case WM_DDE_EXECUTE:
|
|
|
|
qs = WDML_ServerHandleExecute(pConv, pXAct);
|
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
case WM_DDE_POKE:
|
|
|
|
qs = WDML_ServerHandlePoke(pConv, pXAct);
|
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
case WM_DDE_TERMINATE:
|
|
|
|
qs = WDML_ServerHandleTerminate(pConv, pXAct);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_DDE_ACK:
|
|
|
|
WARN("Shouldn't receive a ACK message (never requests them). Ignoring it\n");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("Unsupported message %d\n", pXAct->ddeMsg);
|
|
|
|
}
|
|
|
|
return qs;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* WDML_ServerConvProc
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
static LRESULT CALLBACK WDML_ServerConvProc(HWND hwndServer, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_INSTANCE* pInstance;
|
2001-06-23 01:02:48 +02:00
|
|
|
WDML_CONV* pConv;
|
2001-08-10 00:07:22 +02:00
|
|
|
WDML_XACT* pXAct = NULL;
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
if (iMsg == WM_DESTROY)
|
|
|
|
{
|
|
|
|
EnterCriticalSection(&WDML_CritSect);
|
|
|
|
pConv = WDML_GetConvFromWnd(hwndServer);
|
|
|
|
if (pConv && !(pConv->wStatus & ST_TERMINATED))
|
|
|
|
{
|
|
|
|
WDML_ServerHandleTerminate(pConv, NULL);
|
|
|
|
}
|
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
|
|
|
}
|
2001-06-23 01:02:48 +02:00
|
|
|
if (iMsg < WM_DDE_FIRST || iMsg > WM_DDE_LAST)
|
|
|
|
{
|
|
|
|
return DefWindowProcA(hwndServer, iMsg, wParam, lParam);
|
|
|
|
}
|
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
EnterCriticalSection(&WDML_CritSect);
|
2001-06-23 01:02:48 +02:00
|
|
|
|
2001-08-10 00:07:22 +02:00
|
|
|
pInstance = WDML_GetInstanceFromWnd(hwndServer);
|
|
|
|
pConv = WDML_GetConvFromWnd(hwndServer);
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (!pConv)
|
2001-06-23 01:02:48 +02:00
|
|
|
{
|
2001-08-10 00:07:22 +02:00
|
|
|
ERR("Got a message (%u) on a not known conversation, dropping request\n", iMsg);
|
|
|
|
goto theError;
|
|
|
|
}
|
2001-09-14 02:24:39 +02:00
|
|
|
if (pConv->hwndClient != WIN_GetFullHandle( (HWND)wParam ) || pConv->hwndServer != hwndServer)
|
2001-08-10 00:07:22 +02:00
|
|
|
{
|
|
|
|
ERR("mismatch between C/S windows and converstation\n");
|
|
|
|
goto theError;
|
|
|
|
}
|
|
|
|
if (pConv->instance != pInstance || pConv->instance == NULL)
|
|
|
|
{
|
|
|
|
ERR("mismatch in instances\n");
|
|
|
|
goto theError;
|
2001-06-23 01:02:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (iMsg)
|
|
|
|
{
|
|
|
|
case WM_DDE_INITIATE:
|
2001-08-10 00:07:22 +02:00
|
|
|
FIXME("WM_DDE_INITIATE message received!\n");
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_REQUEST:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueueRequest(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_ADVISE:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueueAdvise(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_UNADVISE:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueueUnadvise(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_EXECUTE:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueueExecute(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_POKE:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueuePoke(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2001-06-23 01:02:48 +02:00
|
|
|
case WM_DDE_TERMINATE:
|
2001-08-10 00:07:22 +02:00
|
|
|
pXAct = WDML_ServerQueueTerminate(pConv, lParam);
|
2001-06-23 01:02:48 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WM_DDE_ACK:
|
|
|
|
WARN("Shouldn't receive a ACK message (never requests them). Ignoring it\n");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
FIXME("Unsupported message %d\n", iMsg);
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
if (pXAct)
|
2001-08-10 00:07:22 +02:00
|
|
|
{
|
|
|
|
pXAct->lParam = lParam;
|
|
|
|
if (WDML_ServerHandle(pConv, pXAct) == WDML_QS_BLOCK)
|
|
|
|
{
|
|
|
|
WDML_QueueTransaction(pConv, pXAct);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WDML_FreeTransaction(pInstance, pXAct, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
theError:
|
|
|
|
LeaveCriticalSection(&WDML_CritSect);
|
2001-06-23 01:02:48 +02:00
|
|
|
return 0;
|
|
|
|
}
|