Fixed byteorder problems caused by non-portable code.

This commit is contained in:
Ulrich Weigand 2001-01-11 00:52:50 +00:00 committed by Alexandre Julliard
parent 1db20bfd33
commit e27670eac5
1 changed files with 17 additions and 16 deletions

View File

@ -62,27 +62,28 @@ static BOOL MSG_CheckFilter(DWORD uMsg, DWORD first, DWORD last)
*/ */
static void MSG_SendParentNotify(WND* wndPtr, WORD event, WORD idChild, LPARAM lValue) static void MSG_SendParentNotify(WND* wndPtr, WORD event, WORD idChild, LPARAM lValue)
{ {
#define lppt ((LPPOINT16)&lValue) POINT pt;
/* pt has to be in the client coordinates of the parent window */ /* pt has to be in the client coordinates of the parent window */
WND *tmpWnd = WIN_LockWndPtr(wndPtr); WND *tmpWnd = WIN_LockWndPtr(wndPtr);
MapWindowPoints16( 0, tmpWnd->hwndSelf, lppt, 1 ); pt.x = SLOWORD(lValue);
pt.y = SHIWORD(lValue);
MapWindowPoints( 0, tmpWnd->hwndSelf, &pt, 1 );
while (tmpWnd) while (tmpWnd)
{ {
if (!(tmpWnd->dwStyle & WS_CHILD) || (tmpWnd->dwExStyle & WS_EX_NOPARENTNOTIFY)) if (!(tmpWnd->dwStyle & WS_CHILD) || (tmpWnd->dwExStyle & WS_EX_NOPARENTNOTIFY))
{ {
WIN_ReleaseWndPtr(tmpWnd); WIN_ReleaseWndPtr(tmpWnd);
break; break;
} }
lppt->x += tmpWnd->rectClient.left; pt.x += tmpWnd->rectClient.left;
lppt->y += tmpWnd->rectClient.top; pt.y += tmpWnd->rectClient.top;
WIN_UpdateWndPtr(&tmpWnd,tmpWnd->parent); WIN_UpdateWndPtr(&tmpWnd,tmpWnd->parent);
SendMessageA( tmpWnd->hwndSelf, WM_PARENTNOTIFY, SendMessageA( tmpWnd->hwndSelf, WM_PARENTNOTIFY,
MAKEWPARAM( event, idChild ), lValue ); MAKEWPARAM( event, idChild ),
MAKELONG( pt.x, pt.y ) );
} }
#undef lppt
} }
@ -468,9 +469,12 @@ static void MSG_JournalRecordMsg( MSG *msg )
} }
else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST)) else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST))
{ {
event->paramL = LOWORD(msg->lParam); /* X pos */ POINT pt;
event->paramH = HIWORD(msg->lParam); /* Y pos */ pt.x = SLOWORD(msg->lParam);
ClientToScreen16( msg->hwnd, (LPPOINT16)&event->paramL ); pt.y = SHIWORD(msg->lParam);
ClientToScreen( msg->hwnd, &pt );
event->paramL = pt.x;
event->paramH = pt.y;
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)event ); HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)event );
} }
else if ((msg->message >= WM_NCMOUSEFIRST) && else if ((msg->message >= WM_NCMOUSEFIRST) &&
@ -1126,7 +1130,6 @@ static BOOL MSG_PeekMessage( int type, LPMSG msg, HWND hwnd,
int mask; int mask;
MESSAGEQUEUE *msgQueue; MESSAGEQUEUE *msgQueue;
HQUEUE16 hQueue; HQUEUE16 hQueue;
POINT16 pt16;
int iWndsLocks; int iWndsLocks;
mask = QS_POSTMESSAGE | QS_SENDMESSAGE; /* Always selected */ mask = QS_POSTMESSAGE | QS_SENDMESSAGE; /* Always selected */
@ -1198,8 +1201,7 @@ static BOOL MSG_PeekMessage( int type, LPMSG msg, HWND hwnd,
*msg = tmpMsg; *msg = tmpMsg;
msgQueue->GetMessageTimeVal = msg->time; msgQueue->GetMessageTimeVal = msg->time;
CONV_POINT32TO16(&msg->pt, &pt16); msgQueue->GetMessagePosVal = MAKELONG( (INT16)msg->pt.x, (INT16)msg->pt.y );
msgQueue->GetMessagePosVal = *(DWORD *)&pt16;
msgQueue->GetMessageExtraInfoVal = qmsg->extraInfo; msgQueue->GetMessageExtraInfoVal = qmsg->extraInfo;
if (flags & PM_REMOVE) QUEUE_RemoveMsg( msgQueue, qmsg ); if (flags & PM_REMOVE) QUEUE_RemoveMsg( msgQueue, qmsg );
@ -1214,8 +1216,7 @@ static BOOL MSG_PeekMessage( int type, LPMSG msg, HWND hwnd,
{ {
/* Got one */ /* Got one */
msgQueue->GetMessageTimeVal = msg->time; msgQueue->GetMessageTimeVal = msg->time;
CONV_POINT32TO16(&msg->pt, &pt16); msgQueue->GetMessagePosVal = MAKELONG( (INT16)msg->pt.x, (INT16)msg->pt.y );
msgQueue->GetMessagePosVal = *(DWORD *)&pt16;
msgQueue->GetMessageExtraInfoVal = 0; /* Always 0 for now */ msgQueue->GetMessageExtraInfoVal = 0; /* Always 0 for now */
break; break;
} }