Commit a8a422f7 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed more -DSTRICT issues.

parent 45078fb0
......@@ -551,7 +551,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags )
POPUPMENU *menu;
UINT i;
if (((*hmenu)==0xffff) || (!(menu = MENU_GetMenu(*hmenu)))) return NULL;
if ((*hmenu == (HMENU)0xffff) || (!(menu = MENU_GetMenu(*hmenu)))) return NULL;
if (wFlags & MF_BYPOSITION)
{
if (*nPos >= menu->nItems) return NULL;
......@@ -1789,7 +1789,7 @@ static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT_PTR id,
}
}
else if (IS_BITMAP_ITEM(flags))
item->text = (LPWSTR)(HBITMAP)LOWORD(str);
item->text = (LPWSTR)HBITMAP_32(LOWORD(str));
else item->text = NULL;
if (flags & MF_OWNERDRAW)
......@@ -3827,7 +3827,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
lpmenu->hWnd = hWnd;
lpmenu->Height = 0; /* Make sure we recalculate the size */
}
SetWindowLongA( hWnd, GWL_ID, hMenu );
SetWindowLongA( hWnd, GWL_ID, (LONG_PTR)hMenu );
if (IsWindowVisible(hWnd))
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
......@@ -3909,10 +3909,10 @@ void WINAPI EndMenu(void)
*/
HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id )
{
HMENU hmenu32 = hmenu;
HMENU hmenu32 = HMENU_32(hmenu);
UINT id32 = id;
if (!MENU_FindItem( &hmenu32, &id32, MF_BYCOMMAND )) return 0;
else return hmenu32;
else return HMENU_16(hmenu32);
}
......@@ -3964,7 +3964,7 @@ HMENU WINAPI LoadMenuW( HINSTANCE instance, LPCWSTR name )
*/
HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
{
HMENU16 hMenu;
HMENU hMenu;
WORD version, offset;
LPCSTR p = (LPCSTR)template;
......@@ -3984,7 +3984,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
DestroyMenu( hMenu );
return 0;
}
return hMenu;
return HMENU_16(hMenu);
}
......@@ -3993,7 +3993,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
*/
HMENU WINAPI LoadMenuIndirectA( LPCVOID template )
{
HMENU16 hMenu;
HMENU hMenu;
WORD version, offset;
LPCSTR p = (LPCSTR)template;
......
......@@ -659,7 +659,7 @@ static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID pData, DWORD
pXAct->hMem = WDML_BuildExecuteCommand(pConv, pData, cbData);
}
pXAct->lParam = pXAct->hMem;
pXAct->lParam = (LPARAM)pXAct->hMem;
return pXAct;
}
......@@ -682,7 +682,7 @@ static WDML_QUEUE_STATE WDML_HandleExecuteReply(WDML_CONV* pConv, MSG* msg, WDML
UnpackDDElParam(WM_DDE_ACK, msg->lParam, &uiLo, &uiHi);
FreeDDElParam(WM_DDE_ACK, msg->lParam);
if (uiHi != pXAct->hMem)
if ((HANDLE)uiHi != pXAct->hMem)
{
return WDML_QS_PASS;
}
......@@ -735,7 +735,7 @@ static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPCVOID pData, DWORD cb
}
}
pXAct->lParam = PackDDElParam(WM_DDE_POKE, pXAct->hMem, atom);
pXAct->lParam = PackDDElParam(WM_DDE_POKE, (UINT)pXAct->hMem, atom);
return pXAct;
}
......@@ -869,10 +869,7 @@ static WDML_QUEUE_STATE WDML_HandleIncomingData(WDML_CONV* pConv, MSG* msg, HDDE
if (hDdeDataOut != (HDDEDATA)DDE_FACK || wdh.fRelease)
{
if (uiLo)
{
GlobalFree(uiLo);
}
if (uiLo) GlobalFree((HANDLE)uiLo);
}
DdeFreeDataHandle(hDdeDataIn);
......
......@@ -120,8 +120,8 @@ HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt,
d1 = dwData1;
break;
}
ret = WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, hConv,
hsz1, hsz2, hdata, d1, dwData2);
ret = (HDDEDATA)WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, (LONG)hConv,
(LONG)hsz1, (LONG)hsz2, (LONG)hdata, d1, dwData2);
switch (uType)
{
case XTYP_CONNECT:
......
......@@ -2049,7 +2049,7 @@ UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, LPCONVINFO lpConvInfo)
}
else if ((DWORD)hConv & 1)
{
pConv = WDML_GetConv((DWORD)hConv & ~1, FALSE);
pConv = WDML_GetConv((HCONV)((DWORD)hConv & ~1), FALSE);
if (pConv != NULL)
{
FIXME("Request on remote conversation information is not implemented yet\n");
......
......@@ -794,7 +794,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX
case DDE_FNOTPROCESSED:
break;
}
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, pXAct->hMem, 0, 0);
WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, (UINT)pXAct->hMem, 0, 0);
return WDML_QS_HANDLED;
}
......
......@@ -1173,7 +1173,7 @@ static BOOL post_dde_message( DWORD dest_tid, struct packed_message *data, const
if (HIWORD(uiHi))
{
/* uiHi should contain a hMem from WM_DDE_EXECUTE */
HGLOBAL h = dde_get_pair( uiHi );
HGLOBAL h = dde_get_pair( (HANDLE)uiHi );
if (h)
{
/* send back the value of h on the other side */
......@@ -1279,8 +1279,8 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
if (!buffer || !*buffer) return FALSE;
uiLo = *lparam;
memcpy( &hMem, *buffer, size );
uiHi = hMem;
TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi, GlobalSize( uiHi ));
uiHi = (UINT)hMem;
TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi, GlobalSize( hMem ));
}
else
{
......@@ -1306,7 +1306,7 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
}
else return FALSE;
}
uiLo = hMem;
uiLo = (UINT)hMem;
*lparam = PackDDElParam( message, uiLo, uiHi );
break;
......@@ -1320,14 +1320,14 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
memcpy( ptr, *buffer, size );
GlobalUnlock( hMem );
TRACE( "exec: pairing c=%08lx s=%08lx\n", *lparam, (DWORD)hMem );
if (!dde_add_pair( *lparam, hMem ))
if (!dde_add_pair( (HGLOBAL)*lparam, hMem ))
{
GlobalFree( hMem );
return FALSE;
}
}
} else return FALSE;
*lparam = hMem;
*lparam = (LPARAM)hMem;
break;
}
return TRUE;
......
......@@ -84,6 +84,6 @@ typedef struct
#define CID_WIN32 0x0004
#define CID_NONSHARED 0x0008
extern void CURSORICON_FreeModuleIcons( HMODULE hModule );
extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule );
#endif /* __WINE_CURSORICON_H */
......@@ -150,10 +150,13 @@ extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackgro
extern DWORD USER16_AlertableWait;
/* HANDLE16 <-> HANDLE conversions */
#define HCURSOR_16(h32) (LOWORD(h32))
#define HICON_16(h32) (LOWORD(h32))
#define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HCURSOR_16(h32) (LOWORD(h32))
#define HICON_16(h32) (LOWORD(h32))
#define HINSTANCE_16(h32) (LOWORD(h32))
#define HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
#define HMODULE_32(h16) ((HMODULE)(ULONG_PTR)(h16))
#endif /* __WINE_USER_H */
......@@ -298,7 +298,7 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule )
for (ptr = firstClass; ptr; ptr = next)
{
next = ptr->next;
if (ptr->hInstance == hModule) CLASS_FreeClass( ptr );
if (ptr->hInstance == HINSTANCE_32(hModule)) CLASS_FreeClass( ptr );
}
USER_Unlock();
}
......@@ -331,13 +331,13 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
if (class->style & CS_GLOBALCLASS) continue;
if (class->atomName == atom)
{
if (hinstance==class->hInstance || hinstance==0xffff)
if (hinstance==class->hInstance || hinstance == (HINSTANCE)0xffff)
{
TRACE("-- found local %p\n", class);
return class;
}
if (class->hInstance == 0) tclass = class;
else if(class->hInstance == hUser)
else if(class->hInstance == HINSTANCE_32(hUser))
{
user_class = class;
}
......@@ -494,7 +494,7 @@ CLASS *CLASS_AddWindow( ATOM atom, HINSTANCE inst, WINDOWPROCTYPE type,
INT *winExtra, WNDPROC *winproc, DWORD *style, struct tagDCE **dce )
{
CLASS *class;
if (type == WIN_PROC_16) inst = GetExePtr(inst);
if (type == WIN_PROC_16) inst = HINSTANCE_32(GetExePtr(HINSTANCE_16(inst)));
if (!(class = CLASS_FindClassByAtom( atom, inst ))) return NULL;
class->cWindows++;
......@@ -533,7 +533,7 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
ATOM atom;
CLASS *classPtr;
int iSmIconWidth, iSmIconHeight;
HINSTANCE16 hInstance=GetExePtr(wc->hInstance);
HINSTANCE hInstance = HINSTANCE_32(GetExePtr(wc->hInstance));
if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
......@@ -555,7 +555,7 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON,
classPtr->hIconSm = CopyImage(classPtr->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE);
classPtr->hCursor = HCURSOR_32(wc->hCursor);
......@@ -660,7 +660,7 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
{
ATOM atom;
CLASS *classPtr;
HINSTANCE16 hInstance = GetExePtr( wc->hInstance );
HINSTANCE hInstance = HINSTANCE_32(GetExePtr( wc->hInstance ));
if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
......@@ -758,7 +758,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
*/
BOOL16 WINAPI UnregisterClass16( LPCSTR className, HINSTANCE16 hInstance )
{
return UnregisterClassA( className, GetExePtr( hInstance ) );
return UnregisterClassA( className, HINSTANCE_32(GetExePtr( hInstance )) );
}
/***********************************************************************
......@@ -1107,14 +1107,14 @@ INT WINAPI GetClassNameW( HWND hwnd, LPWSTR buffer, INT count )
/***********************************************************************
* GetClassInfo (USER.404)
*/
BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc )
BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInst16, SEGPTR name, WNDCLASS16 *wc )
{
ATOM atom;
CLASS *classPtr;
HINSTANCE hInstance = HINSTANCE_32(GetExePtr( hInst16 ));
TRACE("%x %s %p\n",hInstance, debugstr_a(MapSL(name)), wc);
hInstance = GetExePtr( hInstance );
if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
!(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
return FALSE;
......@@ -1125,7 +1125,7 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
wc->lpfnWndProc = CLASS_GetProc( classPtr, WIN_PROC_16 );
wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = classPtr->style & CS_GLOBALCLASS ? GetModuleHandle16("USER") : (HINSTANCE16)classPtr->hInstance;
wc->hInstance = classPtr->style & CS_GLOBALCLASS ? GetModuleHandle16("USER") : HINSTANCE_16(classPtr->hInstance);
wc->hIcon = HICON_16(classPtr->hIcon);
wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground);
......@@ -1219,14 +1219,14 @@ BOOL WINAPI GetClassInfoW( HINSTANCE hInstance, LPCWSTR name,
* FIXME: this is just a guess, I have no idea if GetClassInfoEx() is the
* same in Win16 as in Win32. --AJ
*/
BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16 *wc )
BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInst16, SEGPTR name, WNDCLASSEX16 *wc )
{
ATOM atom;
CLASS *classPtr;
HINSTANCE hInstance = HINSTANCE_32(GetExePtr( hInst16 ));
TRACE("%x %s %p\n",hInstance,debugstr_a( MapSL(name) ), wc);
hInstance = GetExePtr( hInstance );
if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
(hInstance != classPtr->hInstance)) return FALSE;
......@@ -1234,7 +1234,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16
wc->lpfnWndProc = CLASS_GetProc( classPtr, WIN_PROC_16 );
wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = (HINSTANCE16)classPtr->hInstance;
wc->hInstance = HINSTANCE_16(classPtr->hInstance);
wc->hIcon = HICON_16(classPtr->hIcon);
wc->hIconSm = HICON_16(classPtr->hIconSm);
wc->hCursor = HCURSOR_16(classPtr->hCursor);
......
......@@ -57,6 +57,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
#define CF_REGFORMATBASE 0xC000
#define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
/**************************************************************************
* Clipboard context global variables
*/
......@@ -207,7 +209,7 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange)
if (lpFormat->hData32)
DeleteObject(lpFormat->hData32);
if (lpFormat->hData16)
DeleteObject(lpFormat->hData16);
DeleteObject(HGDIOBJ_32(lpFormat->hData16));
}
else if( lpFormat->wFormatID == CF_METAFILEPICT )
{
......
......@@ -263,14 +263,10 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon )
/**********************************************************************
* CURSORICON_FreeModuleIcons
*/
void CURSORICON_FreeModuleIcons( HMODULE hModule )
void CURSORICON_FreeModuleIcons( HMODULE16 hMod16 )
{
ICONCACHE **ptr = &IconAnchor;
if ( HIWORD( hModule ) )
hModule = MapHModuleLS( hModule );
else
hModule = GetExePtr( hModule );
HMODULE hModule = HMODULE_32(GetExePtr( hMod16 ));
EnterCriticalSection( &IconCrst );
......@@ -761,9 +757,9 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
/* Normalize hInstance (must be uniquely represented for icon cache) */
if ( HIWORD( hInstance ) )
hInstance = MapHModuleLS( hInstance );
hInstance = HINSTANCE_32(MapHModuleLS( hInstance ));
else
hInstance = GetExePtr( hInstance );
hInstance = HINSTANCE_32(GetExePtr( HINSTANCE_16(hInstance) ));
/* Get directory resource ID */
......
......@@ -39,13 +39,14 @@
#include "wine/debug.h"
#include "windef.h"
#include "wingdi.h"
#include "wownt32.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
WINE_DEFAULT_DEBUG_CHANNEL(dc);
static DCE *firstDCE;
static HDC defaultDCstate;
static HDC16 defaultDCstate;
static void DCE_DeleteClipRgn( DCE* );
static INT DCE_ReleaseDC( DCE* );
......@@ -89,7 +90,7 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
HeapFree( GetProcessHeap(), 0, dce );
return 0;
}
if (!defaultDCstate) defaultDCstate = GetDCState16( dce->hDC );
if (!defaultDCstate) defaultDCstate = GetDCState16( HDC_16(dce->hDC) );
/* store DCE handle in DC hook data field */
......@@ -107,7 +108,7 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
if (style & WS_CLIPCHILDREN) dce->DCXflags |= DCX_CLIPCHILDREN;
if (style & WS_CLIPSIBLINGS) dce->DCXflags |= DCX_CLIPSIBLINGS;
}
SetHookFlags16(dce->hDC,DCHF_INVALIDATEVISRGN);
SetHookFlags16( HDC_16(dce->hDC), DCHF_INVALIDATEVISRGN );
}
else dce->DCXflags = DCX_CACHE | DCX_DCEEMPTY;
......@@ -223,7 +224,7 @@ static void DCE_DeleteClipRgn( DCE* dce )
/* make it dirty so that the vis rgn gets recomputed next time */
dce->DCXflags |= DCX_DCEDIRTY;
SetHookFlags16( dce->hDC, DCHF_INVALIDATEVISRGN );
SetHookFlags16( HDC_16(dce->hDC), DCHF_INVALIDATEVISRGN );
}
......@@ -243,8 +244,8 @@ static INT DCE_ReleaseDC( DCE* dce )
if (dce->DCXflags & DCX_CACHE)
{
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */
SetHookFlags16( dce->hDC, DCHF_VALIDATEVISRGN );
SetDCState16( dce->hDC, defaultDCstate );
SetHookFlags16( HDC_16(dce->hDC), DCHF_VALIDATEVISRGN );
SetDCState16( HDC_16(dce->hDC), defaultDCstate );
dce->DCXflags &= ~DCX_DCEBUSY;
if (dce->DCXflags & DCX_DCEDIRTY)
{
......@@ -323,7 +324,7 @@ BOOL DCE_InvalidateDCE(HWND hwnd, const RECT* pRectUpdate)
TRACE("\tfixed up %p dce [%04x]\n", dce, dce->hwndCurrent);
dce->DCXflags |= DCX_DCEDIRTY;
SetHookFlags16(dce->hDC, DCHF_INVALIDATEVISRGN);
SetHookFlags16( HDC_16(dce->hDC), DCHF_INVALIDATEVISRGN );
bRet = TRUE;
}
}
......@@ -510,7 +511,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
dce->DCXflags &= ~DCX_DCEDIRTY;
hdc = dce->hDC;
if (bUpdateVisRgn) SetHookFlags16( hdc, DCHF_INVALIDATEVISRGN ); /* force update */
if (bUpdateVisRgn) SetHookFlags16( HDC_16(hdc), DCHF_INVALIDATEVISRGN ); /* force update */
if (!USER_Driver.pGetDC( hwnd, hdc, hrgnClip, flags )) hdc = 0;
......@@ -588,7 +589,7 @@ BOOL16 WINAPI DCHook16( HDC16 hDC, WORD code, DWORD data, LPARAM lParam )
TRACE("hDC = %04x, %i\n", hDC, code);
if (!dce) return 0;
assert(dce->hDC == hDC);
assert( HDC_16(dce->hDC) == hDC );
/* Grab the windows lock before doing anything else */
USER_Lock();
......@@ -604,7 +605,7 @@ BOOL16 WINAPI DCHook16( HDC16 hDC, WORD code, DWORD data, LPARAM lParam )
{
/* Dirty bit has been cleared by caller, set it again so that
* pGetDC recomputes the visible region. */
SetHookFlags16( dce->hDC, DCHF_INVALIDATEVISRGN );
SetHookFlags16( hDC, DCHF_INVALIDATEVISRGN );
USER_Driver.pGetDC( dce->hwndCurrent, dce->hDC, dce->hClipRgn, dce->DCXflags );
}
else /* non-fatal but shouldn't happen */
......
......@@ -1120,9 +1120,9 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild )
if ( (menuInfo.fType & MFT_BITMAP) &&
(LOWORD(menuInfo.dwTypeData)!=0) &&
(LOWORD(menuInfo.dwTypeData)!=hBmpClose) )
(LOWORD(menuInfo.dwTypeData)!=HBITMAP_16(hBmpClose)) )
{
DeleteObject((HBITMAP)LOWORD(menuInfo.dwTypeData));
DeleteObject(HBITMAP_32(LOWORD(menuInfo.dwTypeData)));
}
if(TWEAK_WineLook > WIN31_LOOK)
......@@ -1245,7 +1245,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
else
{
LPCLIENTCREATESTRUCT16 ccs = MapSL((SEGPTR)cs->lpCreateParams);
ci->hWindowMenu = ccs->hWindowMenu;
ci->hWindowMenu = HMENU_32(ccs->hWindowMenu);
ci->idFirstChild = ccs->idFirstChild;
}
WIN_ReleasePtr( wndPtr );
......
......@@ -91,8 +91,8 @@ void STRUCT32_CREATESTRUCT32Ato16( const CREATESTRUCTA* from,
CREATESTRUCT16* to )
{
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE16)from->hInstance;
to->hMenu = (HMENU16)from->hMenu;
to->hInstance = HINSTANCE_16(from->hInstance);
to->hMenu = HMENU_16(from->hMenu);
to->hwndParent = HWND_16(from->hwndParent);
to->cy = from->cy;
to->cx = from->cx;
......@@ -106,8 +106,8 @@ void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
CREATESTRUCTA *to )
{
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE)from->hInstance;
to->hMenu = (HMENU)from->hMenu;
to->hInstance = HINSTANCE_32(from->hInstance);
to->hMenu = HMENU_32(from->hMenu);
to->hwndParent = WIN_Handle32(from->hwndParent);
to->cy = from->cy;
to->cx = from->cx;
......@@ -121,7 +121,7 @@ void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
MDICREATESTRUCT16* to )
{
to->hOwner = (HINSTANCE16)from->hOwner;
to->hOwner = HINSTANCE_16(from->hOwner);
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
......@@ -133,7 +133,7 @@ void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
MDICREATESTRUCTA *to )
{
to->hOwner = (HINSTANCE)from->hOwner;
to->hOwner = HINSTANCE_32(from->hOwner);
to->x = from->x;
to->y = from->y;
to->cx = from->cx;
......
......@@ -30,11 +30,12 @@
#include "sysmetrics.h"
#include "winbase.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wownt32.h"
#include "winreg.h"
#include "local.h"
#include "user.h"
#include "gdi.h" /* sic */
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(syscolor);
......@@ -123,7 +124,7 @@ static HPEN SysColorPens[NUM_SYS_COLORS];
* For a description of the GDI object magics and their flags,
* see "Undocumented Windows" (wrong about the OBJECT_NOSYSTEM flag, though).
*/
static void SYSCOLOR_MakeObjectSystem( HGDIOBJ handle, BOOL set)
static void SYSCOLOR_MakeObjectSystem( HGDIOBJ16 handle, BOOL set)
{
static WORD heap_sel = 0;
LPWORD ptr;
......@@ -151,19 +152,19 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
SysColors[index] = color;
if (SysColorBrushes[index])
{
SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], FALSE);
SYSCOLOR_MakeObjectSystem( HBRUSH_16(SysColorBrushes[index]), FALSE);
DeleteObject( SysColorBrushes[index] );
}
SysColorBrushes[index] = CreateSolidBrush( color );
SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], TRUE);
SYSCOLOR_MakeObjectSystem( HBRUSH_16(SysColorBrushes[index]), TRUE);
if (SysColorPens[index])
{
SYSCOLOR_MakeObjectSystem(SysColorPens[index], FALSE);
SYSCOLOR_MakeObjectSystem( HPEN_16(SysColorPens[index]), FALSE);
DeleteObject( SysColorPens[index] );
}
SysColorPens[index] = CreatePen( PS_SOLID, 1, color );
SYSCOLOR_MakeObjectSystem(SysColorPens[index], TRUE);
SYSCOLOR_MakeObjectSystem( HPEN_16(SysColorPens[index]), TRUE);
}
......
......@@ -793,7 +793,7 @@ BOOL WIN_CreateDesktopWindow(void)
wine_server_call( req );
pWndDesktop->dwStyle = reply->old_style;
pWndDesktop->dwExStyle = reply->old_ex_style;
pWndDesktop->hInstance = (ULONG_PTR)reply->old_instance;
pWndDesktop->hInstance = (HINSTANCE)reply->old_instance;
pWndDesktop->userdata = (ULONG_PTR)reply->old_user_data;
pWndDesktop->wIDmenu = reply->old_id;
}
......@@ -1154,7 +1154,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
if (HIWORD(cs->hInstance))
cs->hMenu = LoadMenuA(cs->hInstance,menuName);
else
cs->hMenu = LoadMenu16(cs->hInstance,menuName);
cs->hMenu = HMENU_32(LoadMenu16(HINSTANCE_16(cs->hInstance),menuName));
if (cs->hMenu) SetMenu( hwnd, cs->hMenu );
}
......@@ -1250,7 +1250,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className,
/* Create the window */
cs.lpCreateParams = data;
cs.hInstance = (HINSTANCE)instance;
cs.hInstance = HINSTANCE_32(instance);
cs.hMenu = HMENU_32(menu);
cs.hwndParent = WIN_Handle32( parent );
cs.style = style;
......
......@@ -1079,7 +1079,7 @@ void WINPROC_UnmapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
}
}
static HANDLE convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
static UINT convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
{
HANDLE dst;
UINT sz = GlobalSize16(src);
......@@ -1093,7 +1093,7 @@ static HANDLE convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
GlobalUnlock16(src);
GlobalUnlock(dst);
return dst;
return (UINT)dst;
}
/**********************************************************************
......@@ -1187,7 +1187,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
dis->itemState = dis16->itemState;
dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem)
: WIN_Handle32( dis16->hwndItem );
dis->hDC = dis16->hDC;
dis->hDC = HDC_32(dis16->hDC);
dis->itemData = dis16->itemData;
CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem );
*plparam = (LPARAM)dis;
......@@ -1240,7 +1240,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
if((LOWORD(*plparam) & MF_POPUP) && (LOWORD(*plparam) != 0xFFFF))
{
HMENU hmenu=HMENU_32(HIWORD(*plparam));
UINT Pos=MENU_FindSubMenu( &hmenu, wParam16);
UINT Pos=MENU_FindSubMenu( &hmenu, HMENU_32(wParam16));
if(Pos==0xFFFF) Pos=0; /* NO_SELECTED_ITEM */
*pwparam32 = MAKEWPARAM( Pos, LOWORD(*plparam) );
}
......@@ -1367,7 +1367,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
{
HANDLE16 lo16;
ATOM hi;
HANDLE lo32 = 0;
UINT lo32 = 0;
*pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo16 = LOWORD(*plparam);
......@@ -1686,18 +1686,18 @@ LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
return result;
}
static HANDLE16 convert_handle_32_to_16(HANDLE src, unsigned int flags)
static HANDLE16 convert_handle_32_to_16(UINT src, unsigned int flags)
{
HANDLE16 dst;
UINT sz = GlobalSize(src);
UINT sz = GlobalSize((HANDLE)src);
LPSTR ptr16, ptr32;
if (!(dst = GlobalAlloc16(flags, sz)))
return 0;
ptr32 = GlobalLock(src);
ptr32 = GlobalLock((HANDLE)src);
ptr16 = GlobalLock16(dst);
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr16, ptr32, sz);
GlobalUnlock(src);
GlobalUnlock((HANDLE)src);
GlobalUnlock16(dst);
return dst;
......@@ -2149,7 +2149,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case WM_DDE_DATA:
case WM_DDE_POKE:
{
unsigned lo32, hi;
UINT lo32, hi;
HANDLE16 lo16 = 0;
*pwparam16 = HWND_16((HWND)wParam32);
......@@ -2170,7 +2170,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
UnpackDDElParam(msg32, *plparam, &lo, &hi);
if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1;
if (GlobalSize(hi) != 0) flag |= 2;
if (GlobalSize((HANDLE)hi) != 0) flag |= 2;
switch (flag)
{
case 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment