33#define ATOM2HSZ(atom) ((HSZ) (ULONG_PTR)(atom))
34#define HSZ2ATOM(hsz) ((ATOM) (ULONG_PTR)(hsz))
46 0, 0, { (
DWORD_PTR)(__FILE__
": WDML_CritSect") }
76 ERR(
"GlobalAlloc failed\n");
81 ERR(
"GlobalLock failed (%p)\n", hMem);
122 if (uiLo) *uiLo =
params[0];
123 if (uiHi) *uiHi =
params[1];
191 ERR(
"GlobalLock failed\n");
196 TRACE(
"Reusing pack %08lx %08lx\n", uiLo, uiHi);
223 FIXME(
"(%p %p): stub\n", hWndClient, hWndServer);
234 FIXME(
"(%p %p %p): stub\n", hwndClient, pqosNew, pqosPrev);
313 if (pNode->
hsz == hsz)
break;
315 if (!pNode)
WARN(
"HSZ %p not found\n", hsz);
331 WARN(
"HSZ %p not found\n", hsz);
346 if (!atom)
return NULL;
353 WARN(
"ATOM 0x%x not found\n", atom);
367 if (!pNode)
return FALSE;
385 for (pCurrent =
pInstance->nodeList; pCurrent !=
NULL; pCurrent = (pPrev = pCurrent)->
next)
390 if (pCurrent->
hsz == hsz)
408 WARN(
"HSZ %p not found\n", hsz);
451 ERR(
"Primary HSZ Node allocation failed - out of memory\n");
506 TRACE(
"(%d, %p, %p, %d, %d)\n", idInst, hsz, psz,
cchMax, iCodePage);
530 TRACE(
"(%d, %p, %p, %d, %d)\n", idInst, hsz, psz,
cchMax, iCodePage);
636 TRACE(
"(%d,%p):\n", idInst, hsz);
659 TRACE(
"(%d,%p):\n", idInst, hsz);
698 if (ret1 == 0 && ret2 == 0)
751 TRACE(
"New instance id %d allocated\n",
id);
811 pConv->
hszTopic, pConv->hszService, 0, 0,
835 TRACE(
"(%p,%p,0x%x,%d,0x%x)\n",
836 pidInst, pfnCallback, afCmd, ulRes, bUnicode);
840 ERR(
"Reserved value not zero? What does this mean?\n");
851 ERR(
"Instance create failed - out of memory\n");
885 TRACE(
"instance created - checking validity\n");
890 TRACE(
"new instance, callback %p flags %X\n",pfnCallback,afCmd);
909 TRACE(
"First application instance detected OK\n");
918 TRACE(
"Subsequent application instance - starting checks\n");
919 while (reference_inst->
next !=
NULL)
954 reference_inst = reference_inst->
next;
958 TRACE(
"Application Instance checks finished\n");
967 wndclass.
cbSize =
sizeof(wndclass);
988 TRACE(
"New application instance processing finished OK\n");
993 TRACE(
"reinitialisation of (%p,%p,0x%x,%d): stub\n", pidInst, pfnCallback, afCmd, ulRes);
1009 while (reference_inst->
next !=
NULL)
1011 if (*pidInst == reference_inst->
instanceID && pfnCallback == reference_inst->
callback)
1045 reference_inst = reference_inst->
next;
1120 TRACE(
"(%d)\n", idInst);
1138 pConvNext = pConv->
next;
1142 FIXME(
"still pending conversations\n");
1207 HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
1215 TRACE(
"invoking CB[%p] (%x %x %p %p %p %p %lx %lx)\n",
1217 hConv, hsz1, hsz2, hdata, dwData1, dwData2);
1218 ret =
pInstance->callback(uType, uFmt, hConv, hsz1, hsz2, hdata, dwData1, dwData2);
1242 FIXME(
"Tried to get instance from wrong thread\n");
1252 WARN(
"Instance entry missing for id %04x\n", instId);
1276 HSZ hszItem,
UINT wFmt,
UINT afCmd)
1302 TRACE(
"(%d,%p,cb %d, cbOff %d,%p <%s>,fmt %04x,%x)\n",
1303 idInst, pSrc,
cb, cbOff, hszItem,
debugstr_w(psz), wFmt, afCmd);
1311 ERR(
"GlobalAlloc failed\n");
1325 pByte = (
LPBYTE)(pDdh + 1);
1332 TRACE(
"=> %p\n", hMem);
1342 DWORD old_sz, new_sz;
1345 TRACE(
"(%p,%p,cb %d, cbOff %d)\n", hData, pSrc,
cb, cbOff);
1348 if (!pDst)
return 0;
1350 new_sz =
cb + cbOff;
1351 if (new_sz > old_sz)
1359 if (!pDst)
return 0;
1384 TRACE(
"(%p,%p,%d,%d)\n", hData, pDst, cbMax, cbOff);
1394 else if (cbOff + cbMax <
dwSize)
1406 if (pDst && dwRet != 0)
1408 memcpy(pDst, pByte + cbOff, dwRet);
1427 TRACE(
"(%p,%p)\n", hData, pcbDataSize);
1432 ERR(
"Failed on GlobalLock(%p)\n", hMem);
1436 if (pcbDataSize !=
NULL)
1441 return (
LPBYTE)(pDdh + 1);
1451 TRACE(
"(%p)\n", hData);
1463 TRACE(
"(%p)\n", hData);
1466 if (hData == (HDDEDATA)1)
1520 FIXME(
"Unsupported format (%04x) for data %p, passing raw information\n",
1537 bmp->bmPlanes,
bmp->bmBitsPixel,
1543 else ERR(
"Can't create bmp\n");
1549 }
else ERR(
"No bitmap header\n");
1579 FIXME(
"Unsupported format (%04x) for data %p, passing raw information\n",
1640 static const WCHAR fmtW[] = {
'%',
's',
'(',
'0',
'x',
'%',
'*',
'x',
')',0};
1679 while (pServer !=
NULL)
1688 pConvNext = pConv->
next;
1718 pServer = pServer->
next;
1740 TRACE(
"Service name missing\n");
1756 UINT wType, HSZ hszItem,
UINT wFmt)
1767 pLink->
hConv = hConv;
1781 HSZ hszItem,
UINT uFmt)
1788 while (pCurrent !=
NULL)
1790 if (pCurrent->
hConv == hConv &&
1792 pCurrent->
uFmt == uFmt)
1809 pCurrent = pCurrent->
next;
1830 while (pCurrent !=
NULL)
1832 if (pCurrent->
hConv == (HCONV)pConv)
1837 pNext = pCurrent->
next;
1842 pNext = pCurrent->
next;
1854 pCurrent = pCurrent->
next;
1869 HSZ hszItem,
BOOL use_fmt,
UINT uFmt)
1873 for (pCurrent =
pInstance->links[side]; pCurrent !=
NULL; pCurrent = pCurrent->
next)
1877 if (pCurrent->
hConv == hConv &&
1879 (!use_fmt || pCurrent->
uFmt == uFmt))
1901 UINT wFmt, HSZ hszItem)
2015 if (!pConv)
return NULL;
2053 for (pCurrent =
pInstance->convs[side]; pCurrent !=
NULL; pCurrent = pCurrent->
next)
2084 pXActNext = pXAct->
next;
2105 for (pCurrent = pRef->
instance->convs[side]; pCurrent !=
NULL; pCurrent = (pPrev = pCurrent)->
next)
2107 if (pCurrent == pRef)
2109 if (pCurrent == pRef->
instance->convs[side])
2117 pCurrent->
magic = 0;
2132 TRACE(
"EC_DISABLE: conv %p status flags %04x\n", pConv, pConv->
wStatus);
2141 FIXME(
"Unknown command code %04x\n", wCmd);
2147 pConv->
wStatus &= ~ST_BLOCKED;
2148 TRACE(
"EC_ENABLEALL: conv %p status flags %04x\n", pConv, pConv->
wStatus);
2183 TRACE(
"(%d, %p, %04x)\n", idInst, hConv, wCmd);
2189 if (pConv && pConv->
instance->instanceID == idInst)
2239 WARN(
"wrong thread ID, no instance\n");
2245 WARN(
"wrong thread ID\n");
2252 WARN(
"found conv but ain't connected\n");
2294 ddeAck.
fBusy = fBusy;
2297 TRACE(
"Posting a %s ack\n", ddeAck.
fAck ?
"positive" :
"negative");
2303 pConv->
wStatus &= ~ST_CONNECTED;
2324 pConv->
hUser = hUser;
2333 pXAct->
hUser = hUser;
2363 for (pLink = pConv->
instance->links[side]; pLink !=
NULL; pLink = pLink->
next)
2365 if (pLink->
hConv == (HCONV)pConv)
2432 TRACE(
"(%p,%x,%p)\n", hConv,
id, lpConvInfo);
2436 FIXME(
"hConv is NULL\n");
2452 FIXME(
"Request on remote conversation information is not implemented yet\n");
2459 ci.
cb = lpConvInfo->
cb;
2460 memcpy(lpConvInfo, &ci,
min((
size_t)lpConvInfo->
cb,
sizeof(ci)));
#define InterlockedIncrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define WM_WDML_CONNECT_CONFIRM
#define GWL_WDML_CONVERSATION
WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV *pConv, WDML_XACT *pXAct) DECLSPEC_HIDDEN
enum tagWDML_SIDE WDML_SIDE
struct tagDDE_DATAHANDLE_HEAD DDE_DATAHANDLE_HEAD
HDDEDATA WDML_ClientHandle(WDML_CONV *pConv, WDML_XACT *pXAct, DWORD dwTimeout, LPDWORD pdwResult) DECLSPEC_HIDDEN
#define WM_WDML_UNREGISTER
#define GWL_WDML_INSTANCE
void WDML_QueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct)
static int WDML_QueryString(WDML_INSTANCE *pInstance, HSZ hsz, LPVOID ptr, DWORD cchMax, int codepage)
BOOL WINAPI DdeUnaccessData(HDDEDATA hData)
static BOOL CALLBACK WDML_BroadcastEnumProc(HWND hWnd, LPARAM lParam)
WDML_INSTANCE * WDML_GetInstanceFromWnd(HWND hWnd)
static HSZ WDML_CreateString(WDML_INSTANCE *pInstance, LPCVOID ptr, int codepage)
HDDEDATA WDML_Global2DataHandle(WDML_CONV *pConv, HGLOBAL hMem, WINE_DDEHEAD *p)
static WDML_XACT * WDML_FindTransaction(WDML_CONV *pConv, DWORD tid)
BOOL WINAPI DdeUninitialize(DWORD idInst)
BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData)
const WCHAR WDML_szEventClass[]
WDML_CONV * WDML_AddConv(WDML_INSTANCE *pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer)
HDDEDATA WDML_InvokeCallback(WDML_INSTANCE *pInstance, UINT uType, UINT uFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hdata, ULONG_PTR dwData1, ULONG_PTR dwData2)
static BOOL WDML_GetLocalConvInfo(WDML_CONV *pConv, CONVINFO *ci, DWORD id)
static void WDML_IncrementInstanceId(WDML_INSTANCE *pInstance)
WDML_CONV * WDML_GetConv(HCONV hConv, BOOL checkConnected)
UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, PCONVINFO lpConvInfo)
BOOL WDML_PostAck(WDML_CONV *pConv, WDML_SIDE side, WORD appRetCode, BOOL fBusy, BOOL fAck, UINT_PTR pmt, LPARAM lParam, UINT oldMsg)
HSZ WDML_MakeHszFromAtom(const WDML_INSTANCE *pInstance, ATOM atom)
void WDML_RemoveLink(WDML_INSTANCE *pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, UINT uFmt)
INT WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2)
static void WDML_FreeAllHSZ(WDML_INSTANCE *pInstance)
static void WDML_SetAllLastError(DWORD lastError)
void WDML_FreeTransaction(WDML_INSTANCE *pInstance, WDML_XACT *pXAct, BOOL doFreePmt)
static void WDML_InsertHSZNode(WDML_INSTANCE *pInstance, HSZ hsz)
HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd)
static CRITICAL_SECTION_DEBUG critsect_debug
BOOL WINAPI ImpersonateDdeClientWindow(HWND hWndClient, HWND hWndServer)
BOOL WDML_IncHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
WDML_SERVER * WDML_AddServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
BOOL WDML_DecHSZ(WDML_INSTANCE *pInstance, HSZ hsz)
static HSZNode * WDML_FindNode(WDML_INSTANCE *pInstance, HSZ hsz)
BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz)
void WDML_RemoveConv(WDML_CONV *pRef, WDML_SIDE side)
WDML_INSTANCE * WDML_GetInstance(DWORD instId)
BOOL WINAPI UnpackDDElParam(UINT msg, LPARAM lParam, PUINT_PTR uiLo, PUINT_PTR uiHi)
static UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes, BOOL bUnicode)
HSZ WINAPI DdeCreateStringHandleW(DWORD idInst, LPCWSTR psz, INT codepage)
BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz)
WDML_XACT * WDML_AllocTransaction(WDML_INSTANCE *pInstance, UINT ddeMsg, UINT wFmt, HSZ hszItem)
UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes)
void WDML_RemoveServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
ATOM WDML_MakeAtomFromHsz(HSZ hsz)
static WDML_INSTANCE * WDML_InstanceList
UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes)
BOOL WINAPI DdeSetQualityOfService(HWND hwndClient, const SECURITY_QUALITY_OF_SERVICE *pqosNew, PSECURITY_QUALITY_OF_SERVICE pqosPrev)
void WDML_NotifyThreadDetach(void)
BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd)
LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize)
DWORD WINAPI DdeGetData(HDDEDATA hData, LPBYTE pDst, DWORD cbMax, DWORD cbOff)
static LONG WDML_MaxInstanceID
static BOOL WDML_EnableCallback(WDML_CONV *pConv, UINT wCmd)
WDML_LINK * WDML_FindLink(WDML_INSTANCE *pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, BOOL use_fmt, UINT uFmt)
HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL fAckReq)
WDML_CONV * WDML_FindConv(WDML_INSTANCE *pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic)
static CRITICAL_SECTION WDML_CritSect
BOOL WDML_UnQueueTransaction(WDML_CONV *pConv, WDML_XACT *pXAct)
UINT WINAPI DdeGetLastError(DWORD idInst)
static void WDML_RemoveAllLinks(WDML_INSTANCE *pInstance, WDML_CONV *pConv, WDML_SIDE side)
DWORD WINAPI DdeQueryStringA(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, INT iCodePage)
DWORD WINAPI DdeQueryStringW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, INT iCodePage)
LPARAM WINAPI PackDDElParam(UINT msg, UINT_PTR uiLo, UINT_PTR uiHi)
BOOL WDML_IsAppOwned(HDDEDATA hData)
static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPARAM WINAPI ReuseDDElParam(LPARAM lParam, UINT msgIn, UINT msgOut, UINT_PTR uiLo, UINT_PTR uiHi)
HSZ WINAPI DdeCreateStringHandleA(DWORD idInst, LPCSTR psz, INT codepage)
BOOL WINAPI FreeDDElParam(UINT msg, LPARAM lParam)
WDML_SERVER * WDML_FindServer(WDML_INSTANCE *pInstance, HSZ hszService, HSZ hszTopic)
WDML_CONV * WDML_GetConvFromWnd(HWND hWnd)
void WDML_AddLink(WDML_INSTANCE *pInstance, HCONV hConv, WDML_SIDE side, UINT wType, HSZ hszItem, UINT wFmt)
BOOL WINAPI DdeSetUserHandle(HCONV hConv, DWORD id, DWORD hUser)
HDDEDATA WINAPI DdeAddData(HDDEDATA hData, LPBYTE pSrc, DWORD cb, DWORD cbOff)
void WDML_BroadcastDDEWindows(LPCWSTR clsName, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define CBF_SKIP_CONNECT_CONFIRMS
#define DMLERR_POSTMSG_FAILED
#define APPCMD_FILTERINITS
#define DMLERR_UNFOUND_QUEUE_ID
#define DMLERR_MEMORY_ERROR
#define XTYP_CONNECT_CONFIRM
HDDEDATA(CALLBACK * PFNCALLBACK)(UINT, UINT, HCONV, HSZ, HSZ, HDDEDATA, ULONG_PTR, ULONG_PTR)
BOOL WINAPI DdeDisconnect(HCONV)
#define CBF_SKIP_REGISTRATIONS
HDDEDATA WINAPI DdeNameService(DWORD, HSZ, HSZ, UINT)
#define DMLERR_NO_CONV_ESTABLISHED
#define CBF_FAIL_ALLSVRXACTIONS
#define APPCMD_CLIENTONLY
#define DMLERR_INVALIDPARAMETER
#define CBF_SKIP_UNREGISTRATIONS
#define HeapFree(x, y, z)
UINT WINAPI GetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
UINT WINAPI GlobalGetAtomNameW(ATOM nAtom, LPWSTR lpBuffer, int nSize)
ATOM WINAPI AddAtomA(LPCSTR lpString)
ATOM WINAPI DeleteAtom(ATOM nAtom)
ATOM WINAPI AddAtomW(LPCWSTR lpString)
UINT WINAPI GetAtomNameA(ATOM nAtom, LPSTR lpBuffer, int nSize)
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
FxWmiInstanceExternal * pInstance
GLuint GLuint GLsizei count
GLenum const GLfloat * params
HGLOBAL NTAPI GlobalHandle(LPCVOID pMem)
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
HGLOBAL NTAPI GlobalReAlloc(HGLOBAL hMem, SIZE_T dwBytes, UINT uFlags)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static HMODULE MODULEINFO DWORD cb
unsigned __int3264 UINT_PTR
static unsigned __int64 next
unsigned short bAppReturnCode
LIST_ENTRY ProcessLocksList
struct tagWDML_CONV * next
struct tagWDML_INSTANCE * instance
struct tagWDML_INSTANCE * next
struct tagWDML_LINK * next
struct tagWDML_SERVER * next
struct tagWDML_XACT * next
#define WIN_GetFullHandle(h)
static rfbScreenInfoPtr server
DWORD WINAPI GetCurrentThreadId(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI GetCurrentProcessId(void)
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
#define GetWindowLongPtrW
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define SetWindowLongPtrW
BOOL WINAPI DestroyWindow(_In_ HWND)