Commit c61f11ea authored by Alexandre Julliard's avatar Alexandre Julliard

Added a magic number to the WDML_CONV structure to fix some failing

tests.
parent c5c6968e
......@@ -1742,6 +1742,7 @@ WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
pConv->instance = pInstance;
WDML_IncHSZ(pInstance, pConv->hszService = hszService);
WDML_IncHSZ(pInstance, pConv->hszTopic = hszTopic);
pConv->magic = WDML_CONV_MAGIC;
pConv->hwndServer = hwndServer;
pConv->hwndClient = hwndClient;
pConv->transactions = NULL;
......@@ -1835,7 +1836,7 @@ void WDML_RemoveConv(WDML_CONV* pRef, WDML_SIDE side)
{
pPrev->next = pCurrent->next;
}
pCurrent->magic = 0;
HeapFree(GetProcessHeap(), 0, pCurrent);
break;
}
......@@ -1913,7 +1914,7 @@ WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected)
WDML_CONV* pConv = (WDML_CONV*)hConv;
/* FIXME: should do better checking */
if (pConv == NULL) return NULL;
if (pConv == NULL || pConv->magic != WDML_CONV_MAGIC) return NULL;
if (checkConnected && !(pConv->wStatus & ST_CONNECTED))
{
......
......@@ -127,6 +127,7 @@ typedef struct tagWDML_CONV
struct tagWDML_INSTANCE* instance;
HSZ hszService; /* pmt used for connection */
HSZ hszTopic; /* pmt used for connection */
UINT magic; /* magic number to check validity */
UINT afCmd; /* service name flag */
CONVCONTEXT convContext;
HWND hwndClient; /* source of conversation (ClientConvClass) */
......@@ -137,6 +138,8 @@ typedef struct tagWDML_CONV
DWORD wConvst; /* same values as convinfo.wConvst */
} WDML_CONV;
#define WDML_CONV_MAGIC 0xbabe1234
/* DDE_LINK struct defines hot, warm, and cold links */
typedef struct tagWDML_LINK {
struct tagWDML_LINK* next; /* to link all the active links */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment