[USER32] Sync ddemisc.c with Wine Staging 1.7.55. CORE-10536

svn path=/trunk/; revision=70172
This commit is contained in:
Amine Khaldi 2015-11-27 22:52:21 +00:00
parent 99429545d9
commit bc29d4a7d5
3 changed files with 52 additions and 57 deletions

View file

@ -301,9 +301,9 @@ User32 -
reactos/win32ss/user/user32/controls/scrollbar.c # Forked reactos/win32ss/user/user32/controls/scrollbar.c # Forked
reactos/win32ss/user/user32/controls/static.c # Synced to WineStaging-1.7.55 reactos/win32ss/user/user32/controls/static.c # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/include/dde_private.h # Synced to Wine-1.1.24 reactos/win32ss/user/user32/include/dde_private.h # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/misc/dde.c # Synced to Wine-1.1.24 (dde_misc.c) reactos/win32ss/user/user32/misc/dde.c # Synced to WineStaging-1.7.55 (dde_misc.c)
reactos/win32ss/user/user32/misc/ddeclient.c # Synced to WineStaging-1.7.55 reactos/win32ss/user/user32/misc/ddeclient.c # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/misc/ddeserver.c # Synced to WineStaging-1.7.55 reactos/win32ss/user/user32/misc/ddeserver.c # Synced to WineStaging-1.7.55
reactos/win32ss/user/user32/misc/exticon.c # Synced to Wine-1_1_22 reactos/win32ss/user/user32/misc/exticon.c # Synced to Wine-1_1_22

View file

@ -19,7 +19,7 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __WINE_DDEML_PRIVATE_H #ifndef __WINE_DDEML_PRIVATE_H
@ -72,9 +72,9 @@
* be to provide a new protocol in the case were both partners are handled by DDEML. * be to provide a new protocol in the case were both partners are handled by DDEML.
* *
* The StringHandles are in fact stored as local atoms. So an HSZ and a (local) atom * The StringHandles are in fact stored as local atoms. So an HSZ and a (local) atom
* can be used interchangably. However, in order to keep track of the allocated HSZ, * can be used interchangeably. However, in order to keep track of the allocated HSZ,
* and to free them upon instance termination, all HSZ are stored in a link list. * and to free them upon instance termination, all HSZ are stored in a link list.
* When the HSZ need to be passed thru DDE messages, we need to convert them back and * When the HSZ need to be passed through DDE messages, we need to convert them back and
* forth to global atoms. * forth to global atoms.
*/ */
@ -143,9 +143,9 @@ typedef struct tagWDML_CONV
/* DDE_LINK struct defines hot, warm, and cold links */ /* DDE_LINK struct defines hot, warm, and cold links */
typedef struct tagWDML_LINK { typedef struct tagWDML_LINK {
struct tagWDML_LINK* next; /* to link all the active links */ struct tagWDML_LINK* next; /* to link all the active links */
HCONV hConv; /* to get back to the converstaion */ HCONV hConv; /* to get back to the conversation */
UINT transactionType;/* 0 for no link */ UINT transactionType;/* 0 for no link */
HSZ hszItem; /* item targetted for (hot/warm) link */ HSZ hszItem; /* item targeted for (hot/warm) link */
UINT uFmt; /* format for data */ UINT uFmt; /* format for data */
} WDML_LINK; } WDML_LINK;
@ -169,8 +169,6 @@ typedef struct tagWDML_INSTANCE
WDML_LINK* links[2]; /* active links for this instance (client and server) */ WDML_LINK* links[2]; /* active links for this instance (client and server) */
} WDML_INSTANCE; } WDML_INSTANCE;
extern CRITICAL_SECTION WDML_CritSect; /* protection for instance list */
/* header for the DDE Data objects */ /* header for the DDE Data objects */
typedef struct tagDDE_DATAHANDLE_HEAD typedef struct tagDDE_DATAHANDLE_HEAD
{ {
@ -189,66 +187,63 @@ typedef enum {
extern HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInst, UINT uType, UINT uFmt, HCONV hConv, extern HDDEDATA WDML_InvokeCallback(WDML_INSTANCE* pInst, UINT uType, UINT uFmt, HCONV hConv,
HSZ hsz1, HSZ hsz2, HDDEDATA hdata, HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
ULONG_PTR dwData1, ULONG_PTR dwData2); ULONG_PTR dwData1, ULONG_PTR dwData2) DECLSPEC_HIDDEN;
extern WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); extern WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN;
extern void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); extern void WDML_RemoveServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN;
extern WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic); extern WDML_SERVER* WDML_FindServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN;
/* transaction handler on the server side */ /* transaction handler on the server side */
extern WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV* pConv, WDML_XACT* pXAct); extern WDML_QUEUE_STATE WDML_ServerHandle(WDML_CONV* pConv, WDML_XACT* pXAct) DECLSPEC_HIDDEN;
/* transaction handler on the client side */ /* transaction handler on the client side */
HDDEDATA WDML_ClientHandle(WDML_CONV *pConv, WDML_XACT *pXAct, DWORD dwTimeout, LPDWORD pdwResult) DECLSPEC_HIDDEN; HDDEDATA WDML_ClientHandle(WDML_CONV *pConv, WDML_XACT *pXAct, DWORD dwTimeout, LPDWORD pdwResult) DECLSPEC_HIDDEN;
/* called both in DdeClientTransaction and server side. */ /* called both in DdeClientTransaction and server side. */
extern UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
DWORD afCmd, DWORD ulRes, BOOL bUnicode);
extern WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side, extern WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer); HSZ hszService, HSZ hszTopic, HWND hwndClient, HWND hwndServer) DECLSPEC_HIDDEN;
extern void WDML_RemoveConv(WDML_CONV* pConv, WDML_SIDE side); extern void WDML_RemoveConv(WDML_CONV* pConv, WDML_SIDE side) DECLSPEC_HIDDEN;
extern WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected); extern WDML_CONV* WDML_GetConv(HCONV hConv, BOOL checkConnected) DECLSPEC_HIDDEN;
extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd); extern WDML_CONV* WDML_GetConvFromWnd(HWND hWnd) DECLSPEC_HIDDEN;
extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, extern WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
HSZ hszService, HSZ hszTopic); HSZ hszService, HSZ hszTopic) DECLSPEC_HIDDEN;
extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode, extern BOOL WDML_PostAck(WDML_CONV* pConv, WDML_SIDE side, WORD appRetCode,
BOOL fBusy, BOOL fAck, UINT_PTR pmt, LPARAM lParam, UINT oldMsg); BOOL fBusy, BOOL fAck, UINT_PTR pmt, LPARAM lParam, UINT oldMsg) DECLSPEC_HIDDEN;
extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, extern void WDML_AddLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
UINT wType, HSZ hszItem, UINT wFmt); UINT wType, HSZ hszItem, UINT wFmt) DECLSPEC_HIDDEN;
extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, extern WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
HSZ hszItem, BOOL use_fmt, UINT uFmt); HSZ hszItem, BOOL use_fmt, UINT uFmt) DECLSPEC_HIDDEN;
extern void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, extern void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
HSZ hszItem, UINT wFmt); HSZ hszItem, UINT wFmt) DECLSPEC_HIDDEN;
extern void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side);
/* string internals */ /* string internals */
extern void WDML_FreeAllHSZ(WDML_INSTANCE* pInstance); extern BOOL WDML_DecHSZ(WDML_INSTANCE* pInstance, HSZ hsz) DECLSPEC_HIDDEN;
extern BOOL WDML_DecHSZ(WDML_INSTANCE* pInstance, HSZ hsz); extern BOOL WDML_IncHSZ(WDML_INSTANCE* pInstance, HSZ hsz) DECLSPEC_HIDDEN;
extern BOOL WDML_IncHSZ(WDML_INSTANCE* pInstance, HSZ hsz); extern ATOM WDML_MakeAtomFromHsz(HSZ hsz) DECLSPEC_HIDDEN;
extern ATOM WDML_MakeAtomFromHsz(HSZ hsz); extern HSZ WDML_MakeHszFromAtom(const WDML_INSTANCE* pInstance, ATOM atom) DECLSPEC_HIDDEN;
extern HSZ WDML_MakeHszFromAtom(const WDML_INSTANCE* pInstance, ATOM atom);
/* client calls these */ /* client calls these */
extern WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, UINT wFmt, HSZ hszItem); extern WDML_XACT* WDML_AllocTransaction(WDML_INSTANCE* pInstance, UINT ddeMsg, UINT wFmt, HSZ hszItem) DECLSPEC_HIDDEN;
extern void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct); extern void WDML_QueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) DECLSPEC_HIDDEN;
extern BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct); extern BOOL WDML_UnQueueTransaction(WDML_CONV* pConv, WDML_XACT* pXAct) DECLSPEC_HIDDEN;
extern void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt); extern void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFreePmt) DECLSPEC_HIDDEN;
extern WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid); extern HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease,
extern HGLOBAL WDML_DataHandle2Global(HDDEDATA hDdeData, BOOL fResponse, BOOL fRelease, BOOL fDeferUpd, BOOL dAckReq) DECLSPEC_HIDDEN;
BOOL fDeferUpd, BOOL fAckReq); extern HDDEDATA WDML_Global2DataHandle(WDML_CONV* pConv, HGLOBAL hMem, WINE_DDEHEAD* da) DECLSPEC_HIDDEN;
extern HDDEDATA WDML_Global2DataHandle(WDML_CONV* pConv, HGLOBAL hMem, WINE_DDEHEAD* p); extern BOOL WDML_IsAppOwned(HDDEDATA hDdeData) DECLSPEC_HIDDEN;
extern BOOL WDML_IsAppOwned(HDDEDATA hDdeData); extern WDML_INSTANCE* WDML_GetInstance(DWORD InstId) DECLSPEC_HIDDEN;
extern WDML_INSTANCE* WDML_GetInstance(DWORD InstId); extern WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd) DECLSPEC_HIDDEN;
extern WDML_INSTANCE* WDML_GetInstanceFromWnd(HWND hWnd);
/* broadcasting to DDE windows */ /* broadcasting to DDE windows */
extern void WDML_BroadcastDDEWindows(LPCWSTR clsName, UINT uMsg, extern void WDML_BroadcastDDEWindows(LPCWSTR clsName, UINT uMsg,
WPARAM wParam, LPARAM lParam); WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
extern void WDML_NotifyThreadExit(DWORD tid); extern void WDML_NotifyThreadExit(DWORD tid) DECLSPEC_HIDDEN;
extern void WDML_NotifyThreadDetach(void) DECLSPEC_HIDDEN;
static __inline void WDML_ExtractAck(WORD status, DDEACK* da) static __inline void WDML_ExtractAck(WORD status, DDEACK* da)
{ {
*da = *((DDEACK*)&status); *da = *((DDEACK*)&status);
} }
extern const WCHAR WDML_szEventClass[]; /* class of window for events (aka instance) */ extern const WCHAR WDML_szEventClass[] DECLSPEC_HIDDEN; /* class of window for events (aka instance) */
extern const char WDML_szServerConvClassA[]; /* ANSI class of window for server side conv */ extern const char WDML_szServerConvClassA[] DECLSPEC_HIDDEN; /* ANSI class of window for server side conv */
extern const WCHAR WDML_szServerConvClassW[]; /* unicode class of window for server side conv */ extern const WCHAR WDML_szServerConvClassW[] DECLSPEC_HIDDEN; /* unicode class of window for server side conv */
extern const char WDML_szClientConvClassA[]; /* ANSI class of window for client side conv */ extern const char WDML_szClientConvClassA[] DECLSPEC_HIDDEN; /* ANSI class of window for client side conv */
extern const WCHAR WDML_szClientConvClassW[]; /* unicode class of window for client side conv */ extern const WCHAR WDML_szClientConvClassW[] DECLSPEC_HIDDEN; /* unicode class of window for client side conv */
#define WM_WDML_REGISTER (WM_USER + 0x200) #define WM_WDML_REGISTER (WM_USER + 0x200)
#define WM_WDML_UNREGISTER (WM_USER + 0x201) #define WM_WDML_UNREGISTER (WM_USER + 0x201)

View file

@ -39,14 +39,14 @@ static LONG WDML_MaxInstanceID = 0; /* OK for present, have to worry about wra
const WCHAR WDML_szEventClass[] = L"DDEMLEvent"; const WCHAR WDML_szEventClass[] = L"DDEMLEvent";
/* protection for instance list */ /* protection for instance list */
CRITICAL_SECTION WDML_CritSect; static CRITICAL_SECTION WDML_CritSect;
static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION_DEBUG critsect_debug =
{ {
0, 0, &WDML_CritSect, 0, 0, &WDML_CritSect,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": WDML_CritSect") } 0, 0, { (DWORD_PTR)(__FILE__ ": WDML_CritSect") }
}; };
CRITICAL_SECTION WDML_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION WDML_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 };
/* ================================================================ /* ================================================================
* *
@ -417,7 +417,7 @@ BOOL WDML_DecHSZ(WDML_INSTANCE* pInstance, HSZ hsz)
* Frees up all the strings still allocated in the list and * Frees up all the strings still allocated in the list and
* remove all the nodes from the list of HSZ nodes. * remove all the nodes from the list of HSZ nodes.
*/ */
void WDML_FreeAllHSZ(WDML_INSTANCE* pInstance) static void WDML_FreeAllHSZ(WDML_INSTANCE* pInstance)
{ {
/* Free any strings created in this instance. /* Free any strings created in this instance.
*/ */
@ -825,7 +825,7 @@ static LRESULT CALLBACK WDML_EventProc(HWND hwndEvent, UINT uMsg, WPARAM wParam,
* *
* *
*/ */
UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback, static UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
DWORD afCmd, DWORD ulRes, BOOL bUnicode) DWORD afCmd, DWORD ulRes, BOOL bUnicode)
{ {
WDML_INSTANCE* pInstance; WDML_INSTANCE* pInstance;
@ -1820,7 +1820,7 @@ void WDML_RemoveLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
* *
* *
*/ */
void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side) static void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE side)
{ {
WDML_LINK* pPrev = NULL; WDML_LINK* pPrev = NULL;
WDML_LINK* pCurrent = NULL; WDML_LINK* pCurrent = NULL;
@ -1869,7 +1869,7 @@ void WDML_RemoveAllLinks(WDML_INSTANCE* pInstance, WDML_CONV* pConv, WDML_SIDE s
WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side,
HSZ hszItem, BOOL use_fmt, UINT uFmt) HSZ hszItem, BOOL use_fmt, UINT uFmt)
{ {
WDML_LINK* pCurrent = NULL; WDML_LINK* pCurrent;
for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next)
{ {
@ -1982,7 +1982,7 @@ void WDML_FreeTransaction(WDML_INSTANCE* pInstance, WDML_XACT* pXAct, BOOL doFre
* *
* *
*/ */
WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid) static WDML_XACT* WDML_FindTransaction(WDML_CONV* pConv, DWORD tid)
{ {
WDML_XACT* pXAct; WDML_XACT* pXAct;
@ -2049,7 +2049,7 @@ WDML_CONV* WDML_AddConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side,
HSZ hszService, HSZ hszTopic) HSZ hszService, HSZ hszTopic)
{ {
WDML_CONV* pCurrent = NULL; WDML_CONV* pCurrent;
for (pCurrent = pInstance->convs[side]; pCurrent != NULL; pCurrent = pCurrent->next) for (pCurrent = pInstance->convs[side]; pCurrent != NULL; pCurrent = pCurrent->next)
{ {