Convert HACCEL to a void*.

This commit is contained in:
Michael Stefaniuc 2002-08-28 00:39:39 +00:00 committed by Alexandre Julliard
parent d8f50798b6
commit 4a75c5c6ea
6 changed files with 21 additions and 14 deletions

View File

@ -4995,7 +4995,7 @@ INT WINAPI TranslateAccelerator( HWND hWnd, HACCEL hAccel, LPMSG msg )
WARN_(accel)("msg null; should hang here to be win compatible\n");
return 0;
}
if (!hAccel || !(lpAccelTbl = (LPACCEL16) LockResource16(hAccel)))
if (!hAccel || !(lpAccelTbl = (LPACCEL16) LockResource16(HACCEL_16(hAccel))))
{
WARN_(accel)("invalid accel handle=%x\n", hAccel);
return 0;

View File

@ -48,6 +48,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(accel);
#define HACCEL_16(h32) (LOWORD(h32))
/******************************************************************************
* These are static/global variables and internal data structures that the
* OLE module uses to maintain it's state.
@ -1431,7 +1433,7 @@ BOOL WINAPI IsAccelerator(HACCEL hAccel, int cAccelEntries, LPMSG lpMsg, WORD* l
int i;
if(!lpMsg) return FALSE;
if (!hAccel || !(lpAccelTbl = (LPACCEL16)LockResource16(hAccel)))
if (!hAccel || !(lpAccelTbl = (LPACCEL16)LockResource16(HACCEL_16(hAccel))))
{
WARN_(accel)("invalid accel handle=%04x\n", hAccel);
return FALSE;
@ -2267,4 +2269,3 @@ BOOL WINAPI DllDebugObjectRPCHook(BOOL b, void *dummy)
FIXME("stub\n");
return TRUE;
}

View File

@ -449,7 +449,7 @@ INT16 WINAPI TranslateAccelerator16( HWND16 hwnd, HACCEL16 hAccel, LPMSG16 msg )
/* msg32.hwnd not used */
msg32.wParam = msg->wParam;
msg32.lParam = msg->lParam;
return TranslateAccelerator( WIN_Handle32(hwnd), hAccel, &msg32 );
return TranslateAccelerator( WIN_Handle32(hwnd), HACCEL_32(hAccel), &msg32 );
}

View File

@ -25,6 +25,7 @@
#include "winnls.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "user.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(resource);
@ -70,7 +71,8 @@ HACCEL16 WINAPI LoadAccelerators16(HINSTANCE16 instance, LPCSTR lpTableName)
HACCEL WINAPI LoadAcceleratorsW(HINSTANCE instance,LPCWSTR lpTableName)
{
HRSRC hRsrc;
HACCEL hMem,hRetval=0;
HACCEL hMem;
HACCEL16 hRetval=0;
DWORD size;
if (HIWORD(lpTableName))
@ -103,7 +105,7 @@ HACCEL WINAPI LoadAcceleratorsW(HINSTANCE instance,LPCWSTR lpTableName)
}
}
TRACE_(accel)("returning HACCEL 0x%x\n", hRsrc);
return hRetval;
return HACCEL_32(hRetval);
}
/***********************************************************************
@ -144,7 +146,7 @@ INT WINAPI CopyAcceleratorTableW(HACCEL src, LPACCEL dst,
INT entries)
{
int i,xsize;
LPACCEL16 accel = (LPACCEL16)GlobalLock16(src);
LPACCEL16 accel = (LPACCEL16)GlobalLock16(HACCEL_16(src));
BOOL done = FALSE;
/* Do parameter checking to avoid the explosions and the screaming
@ -154,7 +156,7 @@ INT WINAPI CopyAcceleratorTableW(HACCEL src, LPACCEL dst,
(LPVOID)src, (LPVOID)dst, entries);
return 0;
}
xsize = GlobalSize16(src)/sizeof(ACCEL16);
xsize = GlobalSize16(HACCEL_16(src))/sizeof(ACCEL16);
if (xsize>entries) entries=xsize;
i=0;
@ -213,7 +215,7 @@ HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccel, INT cEntries)
/* Allocate memory and copy the table. */
hAccel = GlobalAlloc16(0,cEntries*sizeof(ACCEL16));
hAccel = HACCEL_32(GlobalAlloc16(0,cEntries*sizeof(ACCEL16)));
TRACE_(accel)("handle %x\n", hAccel);
if(!hAccel) {
@ -221,7 +223,7 @@ HACCEL WINAPI CreateAcceleratorTableA(LPACCEL lpaccel, INT cEntries)
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return (HACCEL)NULL;
}
accel = GlobalLock16(hAccel);
accel = GlobalLock16(HACCEL_16(hAccel));
for (i=0;i<cEntries;i++) {
accel[i].fVirt = lpaccel[i].fVirt;
accel[i].key = lpaccel[i].key;
@ -259,7 +261,7 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries)
/* Allocate memory and copy the table. */
hAccel = GlobalAlloc16(0,cEntries*sizeof(ACCEL16));
hAccel = HACCEL_32(GlobalAlloc16(0,cEntries*sizeof(ACCEL16)));
TRACE_(accel)("handle %x\n", hAccel);
if(!hAccel) {
@ -267,7 +269,7 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries)
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return (HACCEL)NULL;
}
accel = GlobalLock16(hAccel);
accel = GlobalLock16(HACCEL_16(hAccel));
for (i=0;i<cEntries;i++) {
@ -303,7 +305,7 @@ HACCEL WINAPI CreateAcceleratorTableW(LPACCEL lpaccel, INT cEntries)
*/
BOOL WINAPI DestroyAcceleratorTable( HACCEL handle )
{
return !GlobalFree16(handle);
return !GlobalFree16(HACCEL_16(handle));
}
/**********************************************************************

View File

@ -141,4 +141,8 @@ extern HPEN SYSCOLOR_GetPen( INT index );
extern DWORD USER16_AlertableWait;
/* HANDLE16 <-> HANDLE conversions */
#define HACCEL_32(h16) ((HACCEL)(ULONG_PTR)(h16))
#define HACCEL_16(h32) (LOWORD(h32))
#endif /* __WINE_USER_H */

View File

@ -71,7 +71,7 @@ typedef DWORD COLORREF, *LPCOLORREF;
/* Handle types that exist both in Win16 and Win32. */
typedef int HFILE;
DECLARE_OLD_HANDLE(HACCEL);
DECLARE_HANDLE(HACCEL);
DECLARE_OLD_HANDLE(HBITMAP);
DECLARE_OLD_HANDLE(HBRUSH);
DECLARE_HANDLE(HCOLORSPACE);