Do not allocate any USER data on the system heap.
This commit is contained in:
parent
92b23186ae
commit
da2892c0fb
|
@ -640,7 +640,7 @@ static void MENU_FreeItemData( MENUITEM* item )
|
|||
{
|
||||
/* delete text */
|
||||
if (IS_STRING_ITEM(item->fType) && item->text)
|
||||
HeapFree( SystemHeap, 0, item->text );
|
||||
HeapFree( GetProcessHeap(), 0, item->text );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1869,7 +1869,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id,
|
|||
flags |= MF_HELP;
|
||||
str++;
|
||||
}
|
||||
if (!(text = HEAP_strdupW( SystemHeap, 0, str ))) return FALSE;
|
||||
if (!(text = HEAP_strdupW( GetProcessHeap(), 0, str ))) return FALSE;
|
||||
item->text = text;
|
||||
}
|
||||
}
|
||||
|
@ -1914,7 +1914,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id,
|
|||
/* Don't call SetRectEmpty here! */
|
||||
|
||||
|
||||
if (prevText) HeapFree( SystemHeap, 0, prevText );
|
||||
if (prevText) HeapFree( GetProcessHeap(), 0, prevText );
|
||||
|
||||
debug_print_menuitem("MENU_SetItemData to : ", item, "");
|
||||
return TRUE;
|
||||
|
@ -1950,7 +1950,7 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags )
|
|||
|
||||
/* Create new items array */
|
||||
|
||||
newItems = HeapAlloc( SystemHeap, 0, sizeof(MENUITEM) * (menu->nItems+1) );
|
||||
newItems = HeapAlloc( GetProcessHeap(), 0, sizeof(MENUITEM) * (menu->nItems+1) );
|
||||
if (!newItems)
|
||||
{
|
||||
WARN("allocation failed\n" );
|
||||
|
@ -1962,7 +1962,7 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags )
|
|||
if (pos > 0) memcpy( newItems, menu->items, pos * sizeof(MENUITEM) );
|
||||
if (pos < menu->nItems) memcpy( &newItems[pos+1], &menu->items[pos],
|
||||
(menu->nItems-pos)*sizeof(MENUITEM) );
|
||||
HeapFree( SystemHeap, 0, menu->items );
|
||||
HeapFree( GetProcessHeap(), 0, menu->items );
|
||||
}
|
||||
menu->items = newItems;
|
||||
menu->nItems++;
|
||||
|
@ -2046,14 +2046,8 @@ static LPCSTR MENUEX_ParseResource( LPCSTR res, HMENU hMenu)
|
|||
/* Align the following fields on a dword boundary. */
|
||||
res += (~((int)res - 1)) & 3;
|
||||
|
||||
/* FIXME: This is inefficient and cannot be optimised away by gcc. */
|
||||
{
|
||||
LPSTR newstr = HEAP_strdupWtoA(GetProcessHeap(),
|
||||
0, mii.dwTypeData);
|
||||
TRACE("Menu item: [%08x,%08x,%04x,%04x,%s]\n",
|
||||
mii.fType, mii.fState, mii.wID, resinfo, newstr);
|
||||
HeapFree( GetProcessHeap(), 0, newstr );
|
||||
}
|
||||
mii.fType, mii.fState, mii.wID, resinfo, debugstr_w(mii.dwTypeData));
|
||||
|
||||
if (resinfo & 1) { /* Pop-up? */
|
||||
/* DWORD helpid = GET_DWORD(res); FIXME: use this. */
|
||||
|
@ -3720,7 +3714,7 @@ BOOL WINAPI RemoveMenu( HMENU hMenu, UINT nPos, UINT wFlags )
|
|||
|
||||
if (--menu->nItems == 0)
|
||||
{
|
||||
HeapFree( SystemHeap, 0, menu->items );
|
||||
HeapFree( GetProcessHeap(), 0, menu->items );
|
||||
menu->items = NULL;
|
||||
}
|
||||
else
|
||||
|
@ -3731,7 +3725,7 @@ BOOL WINAPI RemoveMenu( HMENU hMenu, UINT nPos, UINT wFlags )
|
|||
item++;
|
||||
nPos++;
|
||||
}
|
||||
menu->items = HeapReAlloc( SystemHeap, 0, menu->items,
|
||||
menu->items = HeapReAlloc( GetProcessHeap(), 0, menu->items,
|
||||
menu->nItems * sizeof(MENUITEM) );
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -3960,7 +3954,7 @@ BOOL WINAPI DestroyMenu( HMENU hMenu )
|
|||
if (item->fType & MF_POPUP) DestroyMenu(item->hSubMenu);
|
||||
MENU_FreeItemData( item );
|
||||
}
|
||||
HeapFree( SystemHeap, 0, lppop->items );
|
||||
HeapFree( GetProcessHeap(), 0, lppop->items );
|
||||
}
|
||||
USER_HEAP_FREE( hMenu );
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
|
@ -4500,7 +4494,7 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
|
|||
if (lpmii->fMask & MIIM_TYPE ) {
|
||||
/* Get rid of old string. */
|
||||
if ( IS_STRING_ITEM(menu->fType) && menu->text) {
|
||||
HeapFree(SystemHeap, 0, menu->text);
|
||||
HeapFree(GetProcessHeap(), 0, menu->text);
|
||||
menu->text = NULL;
|
||||
}
|
||||
|
||||
|
@ -4512,16 +4506,16 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
|
|||
|
||||
if (IS_STRING_ITEM(menu->fType) && menu->text) {
|
||||
if (unicode)
|
||||
menu->text = HEAP_strdupW(SystemHeap, 0, lpmii->dwTypeData);
|
||||
menu->text = HEAP_strdupW(GetProcessHeap(), 0, lpmii->dwTypeData);
|
||||
else
|
||||
menu->text = HEAP_strdupAtoW(SystemHeap, 0, (LPSTR)lpmii->dwTypeData);
|
||||
menu->text = HEAP_strdupAtoW(GetProcessHeap(), 0, (LPSTR)lpmii->dwTypeData);
|
||||
}
|
||||
}
|
||||
|
||||
if (lpmii->fMask & MIIM_FTYPE ) {
|
||||
/* free the string when the type is changing */
|
||||
if ( (!IS_STRING_ITEM(lpmii->fType)) && IS_STRING_ITEM(menu->fType) && menu->text) {
|
||||
HeapFree(SystemHeap, 0, menu->text);
|
||||
HeapFree(GetProcessHeap(), 0, menu->text);
|
||||
menu->text = NULL;
|
||||
}
|
||||
menu->fType &= ~MENU_ITEM_TYPE(menu->fType);
|
||||
|
@ -4531,11 +4525,11 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
|
|||
if (lpmii->fMask & MIIM_STRING ) {
|
||||
/* free the string when used */
|
||||
if ( IS_STRING_ITEM(menu->fType) && menu->text) {
|
||||
HeapFree(SystemHeap, 0, menu->text);
|
||||
HeapFree(GetProcessHeap(), 0, menu->text);
|
||||
if (unicode)
|
||||
menu->text = HEAP_strdupW(SystemHeap, 0, lpmii->dwTypeData);
|
||||
menu->text = HEAP_strdupW(GetProcessHeap(), 0, lpmii->dwTypeData);
|
||||
else
|
||||
menu->text = HEAP_strdupAtoW(SystemHeap, 0, (LPSTR) lpmii->dwTypeData);
|
||||
menu->text = HEAP_strdupAtoW(GetProcessHeap(), 0, (LPSTR) lpmii->dwTypeData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "wingdi.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "controls.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "debugtools.h"
|
||||
#include "user.h"
|
||||
|
@ -162,7 +161,7 @@ static SCROLLBAR_INFO *SCROLL_GetPtrScrollInfo( WND* wndPtr, INT nBar )
|
|||
|
||||
if (!infoPtr) /* Create the info structure if needed */
|
||||
{
|
||||
if ((infoPtr = HeapAlloc( SystemHeap, 0, sizeof(SCROLLBAR_INFO) )))
|
||||
if ((infoPtr = HeapAlloc( GetProcessHeap(), 0, sizeof(SCROLLBAR_INFO) )))
|
||||
{
|
||||
infoPtr->MinVal = infoPtr->CurVal = infoPtr->Page = 0;
|
||||
infoPtr->MaxVal = 100;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include "gdi.h"
|
||||
#include "heap.h"
|
||||
#include "ttydrv.h"
|
||||
#include "win.h"
|
||||
#include "debugtools.h"
|
||||
|
@ -52,8 +51,7 @@ WINDOW *TTYDRV_WND_GetCursesWindow(WND *wndPtr)
|
|||
*/
|
||||
void TTYDRV_WND_Initialize(WND *wndPtr)
|
||||
{
|
||||
TTYDRV_WND_DATA *pWndDriverData =
|
||||
(TTYDRV_WND_DATA *) HeapAlloc(SystemHeap, 0, sizeof(TTYDRV_WND_DATA));
|
||||
TTYDRV_WND_DATA *pWndDriverData = HeapAlloc(GetProcessHeap(), 0, sizeof(TTYDRV_WND_DATA));
|
||||
|
||||
TRACE("(%p)\n", wndPtr);
|
||||
|
||||
|
@ -81,7 +79,7 @@ void TTYDRV_WND_Finalize(WND *wndPtr)
|
|||
ERR("WND destroyed without destroying the associated Curses Windows");
|
||||
}
|
||||
|
||||
HeapFree(SystemHeap, 0, pWndDriverData);
|
||||
HeapFree(GetProcessHeap(), 0, pWndDriverData);
|
||||
wndPtr->pDriverData = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ static ICONCACHE* CURSORICON_FindCache(HANDLE handle)
|
|||
*/
|
||||
static void CURSORICON_AddSharedIcon( HMODULE hModule, HRSRC hRsrc, HRSRC hGroupRsrc, HANDLE handle )
|
||||
{
|
||||
ICONCACHE *ptr = HeapAlloc( SystemHeap, 0, sizeof(ICONCACHE) );
|
||||
ICONCACHE *ptr = HeapAlloc( GetProcessHeap(), 0, sizeof(ICONCACHE) );
|
||||
if ( !ptr ) return;
|
||||
|
||||
ptr->hModule = hModule;
|
||||
|
@ -234,7 +234,7 @@ void CURSORICON_FreeModuleIcons( HMODULE hModule )
|
|||
*ptr = freePtr->next;
|
||||
|
||||
GlobalFree16( freePtr->handle );
|
||||
HeapFree( SystemHeap, 0, freePtr );
|
||||
HeapFree( GetProcessHeap(), 0, freePtr );
|
||||
continue;
|
||||
}
|
||||
ptr = &(*ptr)->next;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "win.h"
|
||||
#include "gdi.h"
|
||||
#include "region.h"
|
||||
#include "heap.h"
|
||||
#include "user.h"
|
||||
#include "debugtools.h"
|
||||
#include "windef.h"
|
||||
|
@ -76,10 +75,10 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
|
|||
DCE * dce;
|
||||
WND* wnd;
|
||||
|
||||
if (!(dce = HeapAlloc( SystemHeap, 0, sizeof(DCE) ))) return NULL;
|
||||
if (!(dce = HeapAlloc( GetProcessHeap(), 0, sizeof(DCE) ))) return NULL;
|
||||
if (!(dce->hDC = CreateDCA( "DISPLAY", NULL, NULL, NULL )))
|
||||
{
|
||||
HeapFree( SystemHeap, 0, dce );
|
||||
HeapFree( GetProcessHeap(), 0, dce );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -134,7 +133,7 @@ DCE* DCE_FreeDCE( DCE *dce )
|
|||
DeleteDC( dce->hDC );
|
||||
if( dce->hClipRgn && !(dce->DCXflags & DCX_KEEPCLIPRGN) )
|
||||
DeleteObject(dce->hClipRgn);
|
||||
HeapFree( SystemHeap, 0, dce );
|
||||
HeapFree( GetProcessHeap(), 0, dce );
|
||||
|
||||
WIN_UnlockWnds();
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "win.h"
|
||||
#include "user.h"
|
||||
#include "heap.h"
|
||||
#include "nonclient.h"
|
||||
#include "winpos.h"
|
||||
#include "dce.h"
|
||||
|
@ -67,8 +66,8 @@ void DEFWND_SetTextA( WND *wndPtr, LPCSTR text )
|
|||
if (!text) text = "";
|
||||
count = MultiByteToWideChar( CP_ACP, 0, text, -1, NULL, 0 );
|
||||
|
||||
if (wndPtr->text) HeapFree(SystemHeap, 0, wndPtr->text);
|
||||
if ((wndPtr->text = HeapAlloc(SystemHeap, 0, count * sizeof(WCHAR))))
|
||||
if (wndPtr->text) HeapFree(GetProcessHeap(), 0, wndPtr->text);
|
||||
if ((wndPtr->text = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR))))
|
||||
MultiByteToWideChar( CP_ACP, 0, text, -1, wndPtr->text, count );
|
||||
else
|
||||
ERR("Not enough memory for window text");
|
||||
|
@ -89,8 +88,8 @@ void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text )
|
|||
if (!text) text = empty_string;
|
||||
count = strlenW(text) + 1;
|
||||
|
||||
if (wndPtr->text) HeapFree(SystemHeap, 0, wndPtr->text);
|
||||
if ((wndPtr->text = HeapAlloc(SystemHeap, 0, count * sizeof(WCHAR))))
|
||||
if (wndPtr->text) HeapFree(GetProcessHeap(), 0, wndPtr->text);
|
||||
if ((wndPtr->text = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR))))
|
||||
strcpyW( wndPtr->text, text );
|
||||
else
|
||||
ERR("Not enough memory for window text");
|
||||
|
@ -379,10 +378,10 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
|
|||
return NC_HandleNCActivate( wndPtr, wParam );
|
||||
|
||||
case WM_NCDESTROY:
|
||||
if (wndPtr->text) HeapFree( SystemHeap, 0, wndPtr->text );
|
||||
if (wndPtr->text) HeapFree( GetProcessHeap(), 0, wndPtr->text );
|
||||
wndPtr->text = NULL;
|
||||
if (wndPtr->pVScroll) HeapFree( SystemHeap, 0, wndPtr->pVScroll );
|
||||
if (wndPtr->pHScroll) HeapFree( SystemHeap, 0, wndPtr->pHScroll );
|
||||
if (wndPtr->pVScroll) HeapFree( GetProcessHeap(), 0, wndPtr->pVScroll );
|
||||
if (wndPtr->pHScroll) HeapFree( GetProcessHeap(), 0, wndPtr->pHScroll );
|
||||
wndPtr->pVScroll = wndPtr->pHScroll = NULL;
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -1182,8 +1182,8 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND hClient,
|
|||
/* store new "default" title if lpTitle is not NULL */
|
||||
if (lpTitle)
|
||||
{
|
||||
if (ci->frameTitle) HeapFree( SystemHeap, 0, ci->frameTitle );
|
||||
ci->frameTitle = HEAP_strdupW( SystemHeap, 0, lpTitle );
|
||||
if (ci->frameTitle) HeapFree( GetProcessHeap(), 0, ci->frameTitle );
|
||||
ci->frameTitle = HEAP_strdupW( GetProcessHeap(), 0, lpTitle );
|
||||
}
|
||||
|
||||
if (ci->frameTitle)
|
||||
|
|
|
@ -454,17 +454,17 @@ static DWORD MSG_ProcessKbdMsg( MSG *msg, BOOL remove )
|
|||
*/
|
||||
static void MSG_JournalRecordMsg( MSG *msg )
|
||||
{
|
||||
EVENTMSG *event = (EVENTMSG *) HeapAlloc(SystemHeap, 0, sizeof(EVENTMSG));
|
||||
if (!event) return;
|
||||
event->message = msg->message;
|
||||
event->time = msg->time;
|
||||
EVENTMSG event;
|
||||
|
||||
event.message = msg->message;
|
||||
event.time = msg->time;
|
||||
if ((msg->message >= WM_KEYFIRST) && (msg->message <= WM_KEYLAST))
|
||||
{
|
||||
event->paramL = (msg->wParam & 0xFF) | (HIWORD(msg->lParam) << 8);
|
||||
event->paramH = msg->lParam & 0x7FFF;
|
||||
event.paramL = (msg->wParam & 0xFF) | (HIWORD(msg->lParam) << 8);
|
||||
event.paramH = msg->lParam & 0x7FFF;
|
||||
if (HIWORD(msg->lParam) & 0x0100)
|
||||
event->paramH |= 0x8000; /* special_key - bit */
|
||||
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)event );
|
||||
event.paramH |= 0x8000; /* special_key - bit */
|
||||
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event );
|
||||
}
|
||||
else if ((msg->message >= WM_MOUSEFIRST) && (msg->message <= WM_MOUSELAST))
|
||||
{
|
||||
|
@ -472,20 +472,18 @@ static void MSG_JournalRecordMsg( MSG *msg )
|
|||
pt.x = SLOWORD(msg->lParam);
|
||||
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 );
|
||||
event.paramL = pt.x;
|
||||
event.paramH = pt.y;
|
||||
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event );
|
||||
}
|
||||
else if ((msg->message >= WM_NCMOUSEFIRST) &&
|
||||
(msg->message <= WM_NCMOUSELAST))
|
||||
{
|
||||
event->paramL = LOWORD(msg->lParam); /* X pos */
|
||||
event->paramH = HIWORD(msg->lParam); /* Y pos */
|
||||
event->message += WM_MOUSEMOVE-WM_NCMOUSEMOVE;/* give no info about NC area */
|
||||
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)event );
|
||||
event.paramL = LOWORD(msg->lParam); /* X pos */
|
||||
event.paramH = HIWORD(msg->lParam); /* Y pos */
|
||||
event.message += WM_MOUSEMOVE-WM_NCMOUSEMOVE;/* give no info about NC area */
|
||||
HOOK_CallHooksA( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&event );
|
||||
}
|
||||
|
||||
HeapFree(SystemHeap, 0, event);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -495,26 +493,24 @@ static void MSG_JournalRecordMsg( MSG *msg )
|
|||
*/
|
||||
static int MSG_JournalPlayBackMsg(void)
|
||||
{
|
||||
EVENTMSG *tmpMsg;
|
||||
long wtime,lParam,wParam;
|
||||
WORD keyDown,i,result=0;
|
||||
EVENTMSG tmpMsg;
|
||||
LPARAM lParam;
|
||||
WPARAM wParam;
|
||||
LRESULT wtime;
|
||||
int keyDown,i;
|
||||
|
||||
if ( HOOK_IsHooked( WH_JOURNALPLAYBACK ) )
|
||||
{
|
||||
tmpMsg = (EVENTMSG *) HeapAlloc(SystemHeap, 0, sizeof(EVENTMSG));
|
||||
if (!tmpMsg) return result;
|
||||
if (!HOOK_IsHooked( WH_JOURNALPLAYBACK )) return 0;
|
||||
|
||||
wtime=HOOK_CallHooksA( WH_JOURNALPLAYBACK, HC_GETNEXT, 0,
|
||||
(LPARAM) tmpMsg );
|
||||
wtime=HOOK_CallHooksA( WH_JOURNALPLAYBACK, HC_GETNEXT, 0, (LPARAM)&tmpMsg );
|
||||
/* TRACE(msg,"Playback wait time =%ld\n",wtime); */
|
||||
if (wtime<=0)
|
||||
{
|
||||
wtime=0;
|
||||
if ((tmpMsg->message >= WM_KEYFIRST) && (tmpMsg->message <= WM_KEYLAST))
|
||||
if ((tmpMsg.message >= WM_KEYFIRST) && (tmpMsg.message <= WM_KEYLAST))
|
||||
{
|
||||
wParam=tmpMsg->paramL & 0xFF;
|
||||
lParam=MAKELONG(tmpMsg->paramH&0x7ffff,tmpMsg->paramL>>8);
|
||||
if (tmpMsg->message == WM_KEYDOWN || tmpMsg->message == WM_SYSKEYDOWN)
|
||||
wParam=tmpMsg.paramL & 0xFF;
|
||||
lParam=MAKELONG(tmpMsg.paramH&0x7ffff,tmpMsg.paramL>>8);
|
||||
if (tmpMsg.message == WM_KEYDOWN || tmpMsg.message == WM_SYSKEYDOWN)
|
||||
{
|
||||
for (keyDown=i=0; i<256 && !keyDown; i++)
|
||||
if (InputKeyStateTable[i] & 0x80)
|
||||
|
@ -530,16 +526,13 @@ static int MSG_JournalPlayBackMsg(void)
|
|||
}
|
||||
if (InputKeyStateTable[VK_MENU] & 0x80)
|
||||
lParam |= 0x20000000;
|
||||
if (tmpMsg->paramH & 0x8000) /*special_key bit*/
|
||||
if (tmpMsg.paramH & 0x8000) /*special_key bit*/
|
||||
lParam |= 0x01000000;
|
||||
hardware_event( tmpMsg->message & 0xffff, LOWORD(wParam), lParam,
|
||||
0, 0, tmpMsg->time, 0 );
|
||||
hardware_event( tmpMsg.message, wParam, lParam, 0, 0, tmpMsg.time, 0 );
|
||||
}
|
||||
else
|
||||
else if ((tmpMsg.message>= WM_MOUSEFIRST) && (tmpMsg.message <= WM_MOUSELAST))
|
||||
{
|
||||
if ((tmpMsg->message>= WM_MOUSEFIRST) && (tmpMsg->message <= WM_MOUSELAST))
|
||||
{
|
||||
switch (tmpMsg->message)
|
||||
switch (tmpMsg.message)
|
||||
{
|
||||
case WM_LBUTTONDOWN:
|
||||
MouseButtonsStates[0]=AsyncMouseButtonsStates[0]=TRUE;break;
|
||||
|
@ -557,31 +550,26 @@ static int MSG_JournalPlayBackMsg(void)
|
|||
AsyncKeyStateTable[VK_LBUTTON]= InputKeyStateTable[VK_LBUTTON] = MouseButtonsStates[0] ? 0x80 : 0;
|
||||
AsyncKeyStateTable[VK_MBUTTON]= InputKeyStateTable[VK_MBUTTON] = MouseButtonsStates[1] ? 0x80 : 0;
|
||||
AsyncKeyStateTable[VK_RBUTTON]= InputKeyStateTable[VK_RBUTTON] = MouseButtonsStates[2] ? 0x80 : 0;
|
||||
SetCursorPos(tmpMsg->paramL,tmpMsg->paramH);
|
||||
lParam=MAKELONG(tmpMsg->paramL,tmpMsg->paramH);
|
||||
SetCursorPos(tmpMsg.paramL,tmpMsg.paramH);
|
||||
lParam=MAKELONG(tmpMsg.paramL,tmpMsg.paramH);
|
||||
wParam=0;
|
||||
if (MouseButtonsStates[0]) wParam |= MK_LBUTTON;
|
||||
if (MouseButtonsStates[1]) wParam |= MK_MBUTTON;
|
||||
if (MouseButtonsStates[2]) wParam |= MK_RBUTTON;
|
||||
hardware_event( tmpMsg->message & 0xffff, LOWORD (wParam), lParam,
|
||||
tmpMsg->paramL, tmpMsg->paramH, tmpMsg->time, 0 );
|
||||
hardware_event( tmpMsg.message, wParam, lParam,
|
||||
tmpMsg.paramL, tmpMsg.paramH, tmpMsg.time, 0 );
|
||||
}
|
||||
}
|
||||
HOOK_CallHooksA( WH_JOURNALPLAYBACK, HC_SKIP, 0,
|
||||
(LPARAM) tmpMsg);
|
||||
HOOK_CallHooksA( WH_JOURNALPLAYBACK, HC_SKIP, 0, (LPARAM)&tmpMsg);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if( tmpMsg->message == WM_QUEUESYNC )
|
||||
if( tmpMsg.message == WM_QUEUESYNC )
|
||||
if (HOOK_IsHooked( WH_CBT ))
|
||||
HOOK_CallHooksA( WH_CBT, HCBT_QS, 0, 0L);
|
||||
|
||||
result= QS_MOUSE | QS_KEY; /* ? */
|
||||
return QS_MOUSE | QS_KEY; /* ? */
|
||||
}
|
||||
HeapFree(SystemHeap, 0, tmpMsg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -808,7 +796,7 @@ static LRESULT MSG_SendMessageInterThread( HQUEUE16 hDestQueue,
|
|||
return 0;
|
||||
|
||||
/* create a SMSG structure to hold SendMessage() parameters */
|
||||
if (! (smsg = (SMSG *) HeapAlloc( SystemHeap, 0, sizeof(SMSG) )) )
|
||||
if (! (smsg = (SMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(SMSG) )) )
|
||||
return 0;
|
||||
if (!(queue = QUEUE_Lock( GetFastQueue16() ))) return 0;
|
||||
|
||||
|
@ -908,7 +896,7 @@ got:
|
|||
EnterCriticalSection( &queue->cSection );
|
||||
|
||||
if (smsg->flags & SMSG_RECEIVED)
|
||||
HeapFree(SystemHeap, 0, smsg);
|
||||
HeapFree(GetProcessHeap(), 0, smsg);
|
||||
else
|
||||
smsg->flags |= SMSG_RECEIVER_CLEANS;
|
||||
|
||||
|
@ -1000,7 +988,7 @@ BOOL WINAPI ReplyMessage( LRESULT result )
|
|||
if ( smsg->flags & SMSG_RECEIVER_CLEANS )
|
||||
{
|
||||
TRACE_(sendmsg)("Receiver cleans up!\n" );
|
||||
HeapFree( SystemHeap, 0, smsg );
|
||||
HeapFree( GetProcessHeap(), 0, smsg );
|
||||
}
|
||||
|
||||
if (senderQ) LeaveCriticalSection(&senderQ->cSection);
|
||||
|
@ -1366,7 +1354,7 @@ BOOL MSG_InternalGetMessage( int type, MSG *msg, HWND hwnd, HWND hwndOwner,
|
|||
|
||||
if (HOOK_IsHooked( WH_SYSMSGFILTER ) || HOOK_IsHooked( WH_MSGFILTER ))
|
||||
{
|
||||
MSG *pmsg = HeapAlloc( SystemHeap, 0, sizeof(MSG) );
|
||||
MSG *pmsg = HeapAlloc( GetProcessHeap(), 0, sizeof(MSG) );
|
||||
if (pmsg)
|
||||
{
|
||||
BOOL ret;
|
||||
|
@ -1376,7 +1364,7 @@ BOOL MSG_InternalGetMessage( int type, MSG *msg, HWND hwnd, HWND hwndOwner,
|
|||
HOOK_CallHooksA( WH_MSGFILTER, code, 0,
|
||||
(LPARAM) pmsg ));
|
||||
|
||||
HeapFree( SystemHeap, 0, pmsg );
|
||||
HeapFree( GetProcessHeap(), 0, pmsg );
|
||||
if (ret)
|
||||
{
|
||||
/* Message filtered -> remove it from the queue */
|
||||
|
|
|
@ -135,14 +135,14 @@ BOOL WINAPI SetPropA( HWND hwnd, LPCSTR str, HANDLE handle )
|
|||
/* We need to create it */
|
||||
WND *pWnd = WIN_FindWndPtr( hwnd );
|
||||
if (!pWnd) return FALSE;
|
||||
if (!(prop = HeapAlloc( SystemHeap, 0, sizeof(*prop) )))
|
||||
if (!(prop = HeapAlloc( GetProcessHeap(), 0, sizeof(*prop) )))
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(prop->string = SEGPTR_STRDUP(str)))
|
||||
{
|
||||
HeapFree( SystemHeap, 0, prop );
|
||||
HeapFree( GetProcessHeap(), 0, prop );
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return FALSE;
|
||||
|
||||
|
@ -229,7 +229,7 @@ HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str )
|
|||
handle = prop->handle;
|
||||
*pprop = prop->next;
|
||||
SEGPTR_FREE(prop->string);
|
||||
HeapFree( SystemHeap, 0, prop );
|
||||
HeapFree( GetProcessHeap(), 0, prop );
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ void PROPERTY_RemoveWindowProps( WND *pWnd )
|
|||
{
|
||||
next = prop->next;
|
||||
SEGPTR_FREE( prop->string );
|
||||
HeapFree( SystemHeap, 0, prop );
|
||||
HeapFree( GetProcessHeap(), 0, prop );
|
||||
}
|
||||
pWnd->pProp = NULL;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "queue.h"
|
||||
#include "win.h"
|
||||
#include "hook.h"
|
||||
#include "heap.h"
|
||||
#include "thread.h"
|
||||
#include "debugtools.h"
|
||||
#include "server.h"
|
||||
|
@ -70,7 +69,7 @@ PERQUEUEDATA * PERQDATA_CreateInstance( )
|
|||
}
|
||||
|
||||
/* Allocate PERQUEUEDATA from the system heap */
|
||||
if (!( pQData = (PERQUEUEDATA *) HeapAlloc( SystemHeap, 0,
|
||||
if (!( pQData = (PERQUEUEDATA *) HeapAlloc( GetProcessHeap(), 0,
|
||||
sizeof(PERQUEUEDATA) ) ))
|
||||
return 0;
|
||||
|
||||
|
@ -139,7 +138,7 @@ ULONG PERQDATA_Release( PERQUEUEDATA *pQData )
|
|||
pQDataWin16 = 0;
|
||||
|
||||
/* Free the PERQUEUEDATA instance */
|
||||
HeapFree( SystemHeap, 0, pQData );
|
||||
HeapFree( GetProcessHeap(), 0, pQData );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -309,16 +308,16 @@ MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue )
|
|||
{
|
||||
MESSAGEQUEUE *queue;
|
||||
|
||||
HeapLock( SystemHeap ); /* FIXME: a bit overkill */
|
||||
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
||||
queue = GlobalLock16( hQueue );
|
||||
if ( !queue || (queue->magic != QUEUE_MAGIC) )
|
||||
{
|
||||
HeapUnlock( SystemHeap );
|
||||
HeapUnlock( GetProcessHeap() );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
queue->lockCount++;
|
||||
HeapUnlock( SystemHeap );
|
||||
HeapUnlock( GetProcessHeap() );
|
||||
return queue;
|
||||
}
|
||||
|
||||
|
@ -333,7 +332,7 @@ void QUEUE_Unlock( MESSAGEQUEUE *queue )
|
|||
{
|
||||
if (queue)
|
||||
{
|
||||
HeapLock( SystemHeap ); /* FIXME: a bit overkill */
|
||||
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
||||
|
||||
if ( --queue->lockCount == 0 )
|
||||
{
|
||||
|
@ -343,7 +342,7 @@ void QUEUE_Unlock( MESSAGEQUEUE *queue )
|
|||
GlobalFree16( queue->self );
|
||||
}
|
||||
|
||||
HeapUnlock( SystemHeap );
|
||||
HeapUnlock( GetProcessHeap() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -551,7 +550,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
|
|||
/* flush sent messages */
|
||||
QUEUE_FlushMessages( msgQueue );
|
||||
|
||||
HeapLock( SystemHeap ); /* FIXME: a bit overkill */
|
||||
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
||||
|
||||
/* Release per queue data if present */
|
||||
if ( msgQueue->pQData )
|
||||
|
@ -579,7 +578,7 @@ BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue )
|
|||
if (pPrev && *pPrev) *pPrev = msgQueue->next;
|
||||
msgQueue->self = 0;
|
||||
|
||||
HeapUnlock( SystemHeap );
|
||||
HeapUnlock( GetProcessHeap() );
|
||||
|
||||
/* free up resource used by MESSAGEQUEUE structure */
|
||||
msgQueue->lockCount--;
|
||||
|
@ -1030,7 +1029,7 @@ BOOL QUEUE_AddMsg( HQUEUE16 hQueue, int type, MSG *msg, DWORD extraInfo )
|
|||
if (!(msgQueue = QUEUE_Lock( hQueue ))) return FALSE;
|
||||
|
||||
/* allocate new message in global heap for now */
|
||||
if (!(qmsg = (QMSG *) HeapAlloc( SystemHeap, 0, sizeof(QMSG) ) ))
|
||||
if (!(qmsg = (QMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(QMSG) ) ))
|
||||
{
|
||||
QUEUE_Unlock( msgQueue );
|
||||
return 0;
|
||||
|
@ -1130,7 +1129,7 @@ void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg )
|
|||
msgQueue->lastMsg = qmsg->prevMsg;
|
||||
|
||||
/* deallocate the memory for the message */
|
||||
HeapFree( SystemHeap, 0, qmsg );
|
||||
HeapFree( GetProcessHeap(), 0, qmsg );
|
||||
|
||||
msgQueue->msgCount--;
|
||||
if (!msgQueue->msgCount) msgQueue->wakeBits &= ~QS_POSTMESSAGE;
|
||||
|
@ -1246,7 +1245,7 @@ void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
|
|||
|
||||
/* Don't merge allocate a new msg in the global heap */
|
||||
|
||||
if (!(qmsg = (QMSG *) HeapAlloc( SystemHeap, 0, sizeof(QMSG) ) ))
|
||||
if (!(qmsg = (QMSG *) HeapAlloc( GetProcessHeap(), 0, sizeof(QMSG) ) ))
|
||||
{
|
||||
LeaveCriticalSection( &sysMsgQueue->cSection );
|
||||
return;
|
||||
|
@ -1494,13 +1493,13 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags )
|
|||
queuePtr = QUEUE_Lock( hQueue );
|
||||
queuePtr->teb = NtCurrentTeb();
|
||||
|
||||
HeapLock( SystemHeap ); /* FIXME: a bit overkill */
|
||||
HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */
|
||||
SetThreadQueue16( 0, hQueue );
|
||||
teb->queue = hQueue;
|
||||
|
||||
queuePtr->next = hFirstQueue;
|
||||
hFirstQueue = hQueue;
|
||||
HeapUnlock( SystemHeap );
|
||||
HeapUnlock( GetProcessHeap() );
|
||||
|
||||
QUEUE_Unlock( queuePtr );
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ void WINPOS_CheckInternalPos( WND* wndPtr )
|
|||
{
|
||||
if( IsWindow(lpPos->hwndIconTitle) )
|
||||
DestroyWindow( lpPos->hwndIconTitle );
|
||||
HeapFree( SystemHeap, 0, lpPos );
|
||||
HeapFree( GetProcessHeap(), 0, lpPos );
|
||||
}
|
||||
|
||||
QUEUE_Unlock( pMsgQ );
|
||||
|
@ -1087,7 +1087,7 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt,
|
|||
/* this happens when the window is minimized/maximized
|
||||
* for the first time (rectWindow is not adjusted yet) */
|
||||
|
||||
lpPos = HeapAlloc( SystemHeap, 0, sizeof(INTERNALPOS) );
|
||||
lpPos = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNALPOS) );
|
||||
if( !lpPos ) return NULL;
|
||||
|
||||
SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos );
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "gdi.h"
|
||||
#include "options.h"
|
||||
#include "message.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "windef.h"
|
||||
#include "x11drv.h"
|
||||
|
@ -137,8 +136,7 @@ static BOOL X11DRV_WND_IsZeroSizeWnd(WND *wndPtr)
|
|||
*/
|
||||
void X11DRV_WND_Initialize(WND *wndPtr)
|
||||
{
|
||||
X11DRV_WND_DATA *pWndDriverData =
|
||||
(X11DRV_WND_DATA *) HeapAlloc(SystemHeap, 0, sizeof(X11DRV_WND_DATA));
|
||||
X11DRV_WND_DATA *pWndDriverData = HeapAlloc(GetProcessHeap(), 0, sizeof(X11DRV_WND_DATA));
|
||||
|
||||
wndPtr->pDriverData = (void *) pWndDriverData;
|
||||
|
||||
|
@ -165,7 +163,7 @@ void X11DRV_WND_Finalize(WND *wndPtr)
|
|||
pWndDriverData->window
|
||||
);
|
||||
}
|
||||
HeapFree(SystemHeap, 0, wndPtr->pDriverData);
|
||||
HeapFree(GetProcessHeap(), 0, wndPtr->pDriverData);
|
||||
wndPtr->pDriverData = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue