Fixed more -DSTRICT issues.

This commit is contained in:
Alexandre Julliard 2002-11-22 20:43:01 +00:00
parent 45078fb008
commit a8a422f70d
18 changed files with 187 additions and 150 deletions

View file

@ -551,7 +551,7 @@ static MENUITEM *MENU_FindItem( HMENU *hmenu, UINT *nPos, UINT wFlags )
POPUPMENU *menu; POPUPMENU *menu;
UINT i; 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 (wFlags & MF_BYPOSITION)
{ {
if (*nPos >= menu->nItems) return NULL; 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)) else if (IS_BITMAP_ITEM(flags))
item->text = (LPWSTR)(HBITMAP)LOWORD(str); item->text = (LPWSTR)HBITMAP_32(LOWORD(str));
else item->text = NULL; else item->text = NULL;
if (flags & MF_OWNERDRAW) if (flags & MF_OWNERDRAW)
@ -3827,7 +3827,7 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
lpmenu->hWnd = hWnd; lpmenu->hWnd = hWnd;
lpmenu->Height = 0; /* Make sure we recalculate the size */ lpmenu->Height = 0; /* Make sure we recalculate the size */
} }
SetWindowLongA( hWnd, GWL_ID, hMenu ); SetWindowLongA( hWnd, GWL_ID, (LONG_PTR)hMenu );
if (IsWindowVisible(hWnd)) if (IsWindowVisible(hWnd))
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | 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 ) HMENU16 WINAPI LookupMenuHandle16( HMENU16 hmenu, INT16 id )
{ {
HMENU hmenu32 = hmenu; HMENU hmenu32 = HMENU_32(hmenu);
UINT id32 = id; UINT id32 = id;
if (!MENU_FindItem( &hmenu32, &id32, MF_BYCOMMAND )) return 0; 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 WINAPI LoadMenuIndirect16( LPCVOID template )
{ {
HMENU16 hMenu; HMENU hMenu;
WORD version, offset; WORD version, offset;
LPCSTR p = (LPCSTR)template; LPCSTR p = (LPCSTR)template;
@ -3984,7 +3984,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
DestroyMenu( hMenu ); DestroyMenu( hMenu );
return 0; return 0;
} }
return hMenu; return HMENU_16(hMenu);
} }
@ -3993,7 +3993,7 @@ HMENU16 WINAPI LoadMenuIndirect16( LPCVOID template )
*/ */
HMENU WINAPI LoadMenuIndirectA( LPCVOID template ) HMENU WINAPI LoadMenuIndirectA( LPCVOID template )
{ {
HMENU16 hMenu; HMENU hMenu;
WORD version, offset; WORD version, offset;
LPCSTR p = (LPCSTR)template; LPCSTR p = (LPCSTR)template;

View file

@ -659,7 +659,7 @@ static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPCVOID pData, DWORD
pXAct->hMem = WDML_BuildExecuteCommand(pConv, pData, cbData); pXAct->hMem = WDML_BuildExecuteCommand(pConv, pData, cbData);
} }
pXAct->lParam = pXAct->hMem; pXAct->lParam = (LPARAM)pXAct->hMem;
return pXAct; 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); UnpackDDElParam(WM_DDE_ACK, msg->lParam, &uiLo, &uiHi);
FreeDDElParam(WM_DDE_ACK, msg->lParam); FreeDDElParam(WM_DDE_ACK, msg->lParam);
if (uiHi != pXAct->hMem) if ((HANDLE)uiHi != pXAct->hMem)
{ {
return WDML_QS_PASS; 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; 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 (hDdeDataOut != (HDDEDATA)DDE_FACK || wdh.fRelease)
{ {
if (uiLo) if (uiLo) GlobalFree((HANDLE)uiLo);
{
GlobalFree(uiLo);
}
} }
DdeFreeDataHandle(hDdeDataIn); DdeFreeDataHandle(hDdeDataIn);

View file

@ -120,8 +120,8 @@ HDDEDATA WDML_InvokeCallback16(PFNCALLBACK pfn, UINT uType, UINT uFmt,
d1 = dwData1; d1 = dwData1;
break; break;
} }
ret = WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, hConv, ret = (HDDEDATA)WDML_CallTo16_long_llllllll((FARPROC16)pfn, uType, uFmt, (LONG)hConv,
hsz1, hsz2, hdata, d1, dwData2); (LONG)hsz1, (LONG)hsz2, (LONG)hdata, d1, dwData2);
switch (uType) switch (uType)
{ {
case XTYP_CONNECT: case XTYP_CONNECT:

View file

@ -2049,7 +2049,7 @@ UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD id, LPCONVINFO lpConvInfo)
} }
else if ((DWORD)hConv & 1) else if ((DWORD)hConv & 1)
{ {
pConv = WDML_GetConv((DWORD)hConv & ~1, FALSE); pConv = WDML_GetConv((HCONV)((DWORD)hConv & ~1), FALSE);
if (pConv != NULL) if (pConv != NULL)
{ {
FIXME("Request on remote conversation information is not implemented yet\n"); FIXME("Request on remote conversation information is not implemented yet\n");

View file

@ -794,7 +794,7 @@ static WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pX
case DDE_FNOTPROCESSED: case DDE_FNOTPROCESSED:
break; 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; return WDML_QS_HANDLED;
} }

View file

@ -1173,7 +1173,7 @@ static BOOL post_dde_message( DWORD dest_tid, struct packed_message *data, const
if (HIWORD(uiHi)) if (HIWORD(uiHi))
{ {
/* uiHi should contain a hMem from WM_DDE_EXECUTE */ /* uiHi should contain a hMem from WM_DDE_EXECUTE */
HGLOBAL h = dde_get_pair( uiHi ); HGLOBAL h = dde_get_pair( (HANDLE)uiHi );
if (h) if (h)
{ {
/* send back the value of h on the other side */ /* 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; if (!buffer || !*buffer) return FALSE;
uiLo = *lparam; uiLo = *lparam;
memcpy( &hMem, *buffer, size ); memcpy( &hMem, *buffer, size );
uiHi = hMem; uiHi = (UINT)hMem;
TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi, GlobalSize( uiHi )); TRACE("recv dde-ack %u mem=%x[%lx]\n", uiLo, uiHi, GlobalSize( hMem ));
} }
else else
{ {
@ -1306,7 +1306,7 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
} }
else return FALSE; else return FALSE;
} }
uiLo = hMem; uiLo = (UINT)hMem;
*lparam = PackDDElParam( message, uiLo, uiHi ); *lparam = PackDDElParam( message, uiLo, uiHi );
break; break;
@ -1320,14 +1320,14 @@ static BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM
memcpy( ptr, *buffer, size ); memcpy( ptr, *buffer, size );
GlobalUnlock( hMem ); GlobalUnlock( hMem );
TRACE( "exec: pairing c=%08lx s=%08lx\n", *lparam, (DWORD)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 ); GlobalFree( hMem );
return FALSE; return FALSE;
} }
} }
} else return FALSE; } else return FALSE;
*lparam = hMem; *lparam = (LPARAM)hMem;
break; break;
} }
return TRUE; return TRUE;

View file

@ -84,6 +84,6 @@ typedef struct
#define CID_WIN32 0x0004 #define CID_WIN32 0x0004
#define CID_NONSHARED 0x0008 #define CID_NONSHARED 0x0008
extern void CURSORICON_FreeModuleIcons( HMODULE hModule ); extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule );
#endif /* __WINE_CURSORICON_H */ #endif /* __WINE_CURSORICON_H */

View file

@ -150,10 +150,13 @@ extern HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackgro
extern DWORD USER16_AlertableWait; extern DWORD USER16_AlertableWait;
/* HANDLE16 <-> HANDLE conversions */ /* HANDLE16 <-> HANDLE conversions */
#define HCURSOR_16(h32) (LOWORD(h32)) #define HCURSOR_16(h32) (LOWORD(h32))
#define HICON_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 HCURSOR_32(h16) ((HCURSOR)(ULONG_PTR)(h16))
#define HICON_32(h16) ((HICON)(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 */ #endif /* __WINE_USER_H */

View file

@ -298,7 +298,7 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule )
for (ptr = firstClass; ptr; ptr = next) for (ptr = firstClass; ptr; ptr = next)
{ {
next = ptr->next; next = ptr->next;
if (ptr->hInstance == hModule) CLASS_FreeClass( ptr ); if (ptr->hInstance == HINSTANCE_32(hModule)) CLASS_FreeClass( ptr );
} }
USER_Unlock(); USER_Unlock();
} }
@ -331,13 +331,13 @@ static CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE hinstance )
if (class->style & CS_GLOBALCLASS) continue; if (class->style & CS_GLOBALCLASS) continue;
if (class->atomName == atom) if (class->atomName == atom)
{ {
if (hinstance==class->hInstance || hinstance==0xffff) if (hinstance==class->hInstance || hinstance == (HINSTANCE)0xffff)
{ {
TRACE("-- found local %p\n", class); TRACE("-- found local %p\n", class);
return class; return class;
} }
if (class->hInstance == 0) tclass = class; if (class->hInstance == 0) tclass = class;
else if(class->hInstance == hUser) else if(class->hInstance == HINSTANCE_32(hUser))
{ {
user_class = class; 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 ) INT *winExtra, WNDPROC *winproc, DWORD *style, struct tagDCE **dce )
{ {
CLASS *class; 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; if (!(class = CLASS_FindClassByAtom( atom, inst ))) return NULL;
class->cWindows++; class->cWindows++;
@ -533,7 +533,7 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
ATOM atom; ATOM atom;
CLASS *classPtr; CLASS *classPtr;
int iSmIconWidth, iSmIconHeight; int iSmIconWidth, iSmIconHeight;
HINSTANCE16 hInstance=GetExePtr(wc->hInstance); HINSTANCE hInstance = HINSTANCE_32(GetExePtr(wc->hInstance));
if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0; if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style, if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style,
@ -555,7 +555,7 @@ ATOM WINAPI RegisterClass16( const WNDCLASS16 *wc )
iSmIconHeight = GetSystemMetrics(SM_CYSMICON); iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
classPtr->hIcon = HICON_32(wc->hIcon); classPtr->hIcon = HICON_32(wc->hIcon);
classPtr->hIconSm = CopyImage(wc->hIcon, IMAGE_ICON, classPtr->hIconSm = CopyImage(classPtr->hIcon, IMAGE_ICON,
iSmIconWidth, iSmIconHeight, iSmIconWidth, iSmIconHeight,
LR_COPYFROMRESOURCE); LR_COPYFROMRESOURCE);
classPtr->hCursor = HCURSOR_32(wc->hCursor); classPtr->hCursor = HCURSOR_32(wc->hCursor);
@ -660,7 +660,7 @@ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc )
{ {
ATOM atom; ATOM atom;
CLASS *classPtr; CLASS *classPtr;
HINSTANCE16 hInstance = GetExePtr( wc->hInstance ); HINSTANCE hInstance = HINSTANCE_32(GetExePtr( wc->hInstance ));
if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0; if (!(atom = GlobalAddAtomA( MapSL(wc->lpszClassName) ))) return 0;
if (!(classPtr = CLASS_RegisterClass( atom, hInstance, wc->style, 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 ) 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) * GetClassInfo (USER.404)
*/ */
BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc ) BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInst16, SEGPTR name, WNDCLASS16 *wc )
{ {
ATOM atom; ATOM atom;
CLASS *classPtr; CLASS *classPtr;
HINSTANCE hInstance = HINSTANCE_32(GetExePtr( hInst16 ));
TRACE("%x %s %p\n",hInstance, debugstr_a(MapSL(name)), wc); TRACE("%x %s %p\n",hInstance, debugstr_a(MapSL(name)), wc);
hInstance = GetExePtr( hInstance );
if (!(atom = GlobalFindAtomA( MapSL(name) )) || if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
!(classPtr = CLASS_FindClassByAtom( atom, hInstance ))) !(classPtr = CLASS_FindClassByAtom( atom, hInstance )))
return FALSE; return FALSE;
@ -1125,7 +1125,7 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
wc->lpfnWndProc = CLASS_GetProc( classPtr, WIN_PROC_16 ); wc->lpfnWndProc = CLASS_GetProc( classPtr, WIN_PROC_16 );
wc->cbClsExtra = (INT16)classPtr->cbClsExtra; wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra; 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->hIcon = HICON_16(classPtr->hIcon);
wc->hCursor = HCURSOR_16(classPtr->hCursor); wc->hCursor = HCURSOR_16(classPtr->hCursor);
wc->hbrBackground = HBRUSH_16(classPtr->hbrBackground); 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 * FIXME: this is just a guess, I have no idea if GetClassInfoEx() is the
* same in Win16 as in Win32. --AJ * 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; ATOM atom;
CLASS *classPtr; CLASS *classPtr;
HINSTANCE hInstance = HINSTANCE_32(GetExePtr( hInst16 ));
TRACE("%x %s %p\n",hInstance,debugstr_a( MapSL(name) ), wc); TRACE("%x %s %p\n",hInstance,debugstr_a( MapSL(name) ), wc);
hInstance = GetExePtr( hInstance );
if (!(atom = GlobalFindAtomA( MapSL(name) )) || if (!(atom = GlobalFindAtomA( MapSL(name) )) ||
!(classPtr = CLASS_FindClassByAtom( atom, hInstance )) || !(classPtr = CLASS_FindClassByAtom( atom, hInstance )) ||
(hInstance != classPtr->hInstance)) return FALSE; (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->lpfnWndProc = CLASS_GetProc( classPtr, WIN_PROC_16 );
wc->cbClsExtra = (INT16)classPtr->cbClsExtra; wc->cbClsExtra = (INT16)classPtr->cbClsExtra;
wc->cbWndExtra = (INT16)classPtr->cbWndExtra; wc->cbWndExtra = (INT16)classPtr->cbWndExtra;
wc->hInstance = (HINSTANCE16)classPtr->hInstance; wc->hInstance = HINSTANCE_16(classPtr->hInstance);
wc->hIcon = HICON_16(classPtr->hIcon); wc->hIcon = HICON_16(classPtr->hIcon);
wc->hIconSm = HICON_16(classPtr->hIconSm); wc->hIconSm = HICON_16(classPtr->hIconSm);
wc->hCursor = HCURSOR_16(classPtr->hCursor); wc->hCursor = HCURSOR_16(classPtr->hCursor);

View file

@ -57,6 +57,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(clipboard);
#define CF_REGFORMATBASE 0xC000 #define CF_REGFORMATBASE 0xC000
#define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
/************************************************************************** /**************************************************************************
* Clipboard context global variables * Clipboard context global variables
*/ */
@ -207,7 +209,7 @@ void CLIPBOARD_DeleteRecord(LPWINE_CLIPFORMAT lpFormat, BOOL bChange)
if (lpFormat->hData32) if (lpFormat->hData32)
DeleteObject(lpFormat->hData32); DeleteObject(lpFormat->hData32);
if (lpFormat->hData16) if (lpFormat->hData16)
DeleteObject(lpFormat->hData16); DeleteObject(HGDIOBJ_32(lpFormat->hData16));
} }
else if( lpFormat->wFormatID == CF_METAFILEPICT ) else if( lpFormat->wFormatID == CF_METAFILEPICT )
{ {

View file

@ -263,14 +263,10 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon )
/********************************************************************** /**********************************************************************
* CURSORICON_FreeModuleIcons * CURSORICON_FreeModuleIcons
*/ */
void CURSORICON_FreeModuleIcons( HMODULE hModule ) void CURSORICON_FreeModuleIcons( HMODULE16 hMod16 )
{ {
ICONCACHE **ptr = &IconAnchor; ICONCACHE **ptr = &IconAnchor;
HMODULE hModule = HMODULE_32(GetExePtr( hMod16 ));
if ( HIWORD( hModule ) )
hModule = MapHModuleLS( hModule );
else
hModule = GetExePtr( hModule );
EnterCriticalSection( &IconCrst ); EnterCriticalSection( &IconCrst );
@ -761,9 +757,9 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name,
/* Normalize hInstance (must be uniquely represented for icon cache) */ /* Normalize hInstance (must be uniquely represented for icon cache) */
if ( HIWORD( hInstance ) ) if ( HIWORD( hInstance ) )
hInstance = MapHModuleLS( hInstance ); hInstance = HINSTANCE_32(MapHModuleLS( hInstance ));
else else
hInstance = GetExePtr( hInstance ); hInstance = HINSTANCE_32(GetExePtr( HINSTANCE_16(hInstance) ));
/* Get directory resource ID */ /* Get directory resource ID */

View file

@ -39,13 +39,14 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "windef.h" #include "windef.h"
#include "wingdi.h" #include "wingdi.h"
#include "wownt32.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
WINE_DEFAULT_DEBUG_CHANNEL(dc); WINE_DEFAULT_DEBUG_CHANNEL(dc);
static DCE *firstDCE; static DCE *firstDCE;
static HDC defaultDCstate; static HDC16 defaultDCstate;
static void DCE_DeleteClipRgn( DCE* ); static void DCE_DeleteClipRgn( DCE* );
static INT DCE_ReleaseDC( DCE* ); static INT DCE_ReleaseDC( DCE* );
@ -89,7 +90,7 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
HeapFree( GetProcessHeap(), 0, dce ); HeapFree( GetProcessHeap(), 0, dce );
return 0; return 0;
} }
if (!defaultDCstate) defaultDCstate = GetDCState16( dce->hDC ); if (!defaultDCstate) defaultDCstate = GetDCState16( HDC_16(dce->hDC) );
/* store DCE handle in DC hook data field */ /* 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_CLIPCHILDREN) dce->DCXflags |= DCX_CLIPCHILDREN;
if (style & WS_CLIPSIBLINGS) dce->DCXflags |= DCX_CLIPSIBLINGS; 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; 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 */ /* make it dirty so that the vis rgn gets recomputed next time */
dce->DCXflags |= DCX_DCEDIRTY; 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) if (dce->DCXflags & DCX_CACHE)
{ {
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */ /* make the DC clean so that SetDCState doesn't try to update the vis rgn */
SetHookFlags16( dce->hDC, DCHF_VALIDATEVISRGN ); SetHookFlags16( HDC_16(dce->hDC), DCHF_VALIDATEVISRGN );
SetDCState16( dce->hDC, defaultDCstate ); SetDCState16( HDC_16(dce->hDC), defaultDCstate );
dce->DCXflags &= ~DCX_DCEBUSY; dce->DCXflags &= ~DCX_DCEBUSY;
if (dce->DCXflags & DCX_DCEDIRTY) 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); TRACE("\tfixed up %p dce [%04x]\n", dce, dce->hwndCurrent);
dce->DCXflags |= DCX_DCEDIRTY; dce->DCXflags |= DCX_DCEDIRTY;
SetHookFlags16(dce->hDC, DCHF_INVALIDATEVISRGN); SetHookFlags16( HDC_16(dce->hDC), DCHF_INVALIDATEVISRGN );
bRet = TRUE; bRet = TRUE;
} }
} }
@ -510,7 +511,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
dce->DCXflags &= ~DCX_DCEDIRTY; dce->DCXflags &= ~DCX_DCEDIRTY;
hdc = dce->hDC; 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; 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); TRACE("hDC = %04x, %i\n", hDC, code);
if (!dce) return 0; if (!dce) return 0;
assert(dce->hDC == hDC); assert( HDC_16(dce->hDC) == hDC );
/* Grab the windows lock before doing anything else */ /* Grab the windows lock before doing anything else */
USER_Lock(); 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 /* Dirty bit has been cleared by caller, set it again so that
* pGetDC recomputes the visible region. */ * 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 ); USER_Driver.pGetDC( dce->hwndCurrent, dce->hDC, dce->hClipRgn, dce->DCXflags );
} }
else /* non-fatal but shouldn't happen */ else /* non-fatal but shouldn't happen */

View file

@ -407,12 +407,12 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
/*********************************************************************** /***********************************************************************
* DIALOG_CreateControls * DIALOG_CreateControls16
* *
* Create the control windows for a dialog. * Create the control windows for a dialog.
*/ */
static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLATE *dlgTemplate, static BOOL DIALOG_CreateControls16( HWND hwnd, LPCSTR template,
HINSTANCE hInst, BOOL win32 ) const DLG_TEMPLATE *dlgTemplate, HINSTANCE16 hInst )
{ {
DIALOGINFO *dlgInfo = DIALOG_get_info( hwnd ); DIALOGINFO *dlgInfo = DIALOG_get_info( hwnd );
DLG_CONTROL_INFO info; DLG_CONTROL_INFO info;
@ -422,62 +422,93 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
TRACE(" BEGIN\n" ); TRACE(" BEGIN\n" );
while (items--) while (items--)
{ {
if (!win32) HINSTANCE16 instance = hInst;
{ SEGPTR segptr;
HINSTANCE16 instance;
SEGPTR segptr;
template = DIALOG_GetControl16( template, &info ); template = DIALOG_GetControl16( template, &info );
if (HIWORD(info.className) && !strcmp( info.className, "EDIT") && if (HIWORD(info.className) && !strcmp( info.className, "EDIT") &&
!(GetWindowLongW( hwnd, GWL_STYLE ) & DS_LOCALEDIT)) !(GetWindowLongW( hwnd, GWL_STYLE ) & DS_LOCALEDIT))
{
if (!dlgInfo->hDialogHeap)
{ {
dlgInfo->hDialogHeap = GlobalAlloc16(GMEM_FIXED, 0x10000);
if (!dlgInfo->hDialogHeap) if (!dlgInfo->hDialogHeap)
{ {
dlgInfo->hDialogHeap = GlobalAlloc16(GMEM_FIXED, 0x10000); ERR("Insufficient memory to create heap for edit control\n" );
if (!dlgInfo->hDialogHeap) continue;
{
ERR("Insufficient memory to create heap for edit control\n" );
continue;
}
LocalInit16(dlgInfo->hDialogHeap, 0, 0xffff);
} }
instance = dlgInfo->hDialogHeap; LocalInit16(dlgInfo->hDialogHeap, 0, 0xffff);
} }
else instance = (HINSTANCE16)hInst; instance = dlgInfo->hDialogHeap;
}
segptr = MapLS( info.data ); segptr = MapLS( info.data );
hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle | WS_EX_NOPARENTNOTIFY, hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle | WS_EX_NOPARENTNOTIFY,
info.className, info.windowName, info.className, info.windowName,
info.style | WS_CHILD, info.style | WS_CHILD,
MulDiv(info.x, dlgInfo->xBaseUnit, 4), MulDiv(info.x, dlgInfo->xBaseUnit, 4),
MulDiv(info.y, dlgInfo->yBaseUnit, 8), MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4), MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8), MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
HWND_16(hwnd), (HMENU16)info.id, HWND_16(hwnd), (HMENU16)info.id,
instance, (LPVOID)segptr )); instance, (LPVOID)segptr ));
UnMapLS( segptr ); UnMapLS( segptr );
}
else if (!hwndCtrl) return FALSE;
/* Send initialisation messages to the control */
if (dlgInfo->hUserFont) SendMessageA( hwndCtrl, WM_SETFONT,
(WPARAM)dlgInfo->hUserFont, 0 );
if (SendMessageA(hwndCtrl, WM_GETDLGCODE, 0, 0) & DLGC_DEFPUSHBUTTON)
{ {
template = (LPCSTR)DIALOG_GetControl32( (WORD *)template, &info, /* If there's already a default push-button, set it back */
dlgTemplate->dialogEx ); /* to normal and use this one instead. */
/* Is this it? */ if (hwndDefButton)
if (info.style & WS_BORDER) SendMessageA( hwndDefButton, BM_SETSTYLE,
{ BS_PUSHBUTTON,FALSE );
info.style &= ~WS_BORDER; hwndDefButton = hwndCtrl;
info.exStyle |= WS_EX_CLIENTEDGE; dlgInfo->idResult = GetWindowLongA( hwndCtrl, GWL_ID );
}
hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
(LPCWSTR)info.className,
(LPCWSTR)info.windowName,
info.style | WS_CHILD,
MulDiv(info.x, dlgInfo->xBaseUnit, 4),
MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
hwnd, (HMENU)info.id,
hInst, (LPVOID)info.data );
} }
}
TRACE(" END\n" );
return TRUE;
}
/***********************************************************************
* DIALOG_CreateControls32
*
* Create the control windows for a dialog.
*/
static BOOL DIALOG_CreateControls32( HWND hwnd, LPCSTR template,
const DLG_TEMPLATE *dlgTemplate, HINSTANCE hInst )
{
DIALOGINFO *dlgInfo = DIALOG_get_info( hwnd );
DLG_CONTROL_INFO info;
HWND hwndCtrl, hwndDefButton = 0;
INT items = dlgTemplate->nbItems;
TRACE(" BEGIN\n" );
while (items--)
{
template = (LPCSTR)DIALOG_GetControl32( (WORD *)template, &info,
dlgTemplate->dialogEx );
/* Is this it? */
if (info.style & WS_BORDER)
{
info.style &= ~WS_BORDER;
info.exStyle |= WS_EX_CLIENTEDGE;
}
hwndCtrl = CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
(LPCWSTR)info.className,
(LPCWSTR)info.windowName,
info.style | WS_CHILD,
MulDiv(info.x, dlgInfo->xBaseUnit, 4),
MulDiv(info.y, dlgInfo->yBaseUnit, 8),
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
hwnd, (HMENU)info.id,
hInst, (LPVOID)info.data );
if (!hwndCtrl) return FALSE; if (!hwndCtrl) return FALSE;
/* Send initialisation messages to the control */ /* Send initialisation messages to the control */
@ -697,6 +728,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
DIALOGINFO * dlgInfo; DIALOGINFO * dlgInfo;
BOOL ownerEnabled = TRUE; BOOL ownerEnabled = TRUE;
BOOL win32Template = (procType != WIN_PROC_16); BOOL win32Template = (procType != WIN_PROC_16);
BOOL res;
/* Parse dialog template */ /* Parse dialog template */
@ -722,7 +754,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (template.menuName) if (template.menuName)
{ {
if (!win32Template) dlgInfo->hMenu = LoadMenu16( hInst, template.menuName ); if (!win32Template) dlgInfo->hMenu = HMENU_32(LoadMenu16( HINSTANCE_16(hInst), template.menuName ));
else dlgInfo->hMenu = LoadMenuW( hInst, (LPCWSTR)template.menuName ); else dlgInfo->hMenu = LoadMenuW( hInst, (LPCWSTR)template.menuName );
} }
@ -813,7 +845,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
hwnd = WIN_Handle32( CreateWindowEx16(template.exStyle, template.className, hwnd = WIN_Handle32( CreateWindowEx16(template.exStyle, template.className,
template.caption, template.style & ~WS_VISIBLE, template.caption, template.style & ~WS_VISIBLE,
rect.left, rect.top, rect.right, rect.bottom, rect.left, rect.top, rect.right, rect.bottom,
HWND_16(owner), dlgInfo->hMenu, hInst, NULL )); HWND_16(owner), HMENU_16(dlgInfo->hMenu),
HINSTANCE_16(hInst), NULL ));
else else
hwnd = CreateWindowExW(template.exStyle, (LPCWSTR)template.className, hwnd = CreateWindowExW(template.exStyle, (LPCWSTR)template.className,
(LPCWSTR)template.caption, (LPCWSTR)template.caption,
@ -848,8 +881,12 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
/* Create controls */ /* Create controls */
if (DIALOG_CreateControls( hwnd, dlgTemplate, &template, if (win32Template)
hInst, win32Template )) res = DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst );
else
res = DIALOG_CreateControls16( hwnd, dlgTemplate, &template, HINSTANCE_16(hInst) );
if (res)
{ {
HWND hwndPreInitFocus; HWND hwndPreInitFocus;
@ -973,8 +1010,8 @@ HWND16 WINAPI CreateDialogIndirectParam16( HINSTANCE16 hInst,
HWND16 owner, DLGPROC16 dlgProc, HWND16 owner, DLGPROC16 dlgProc,
LPARAM param ) LPARAM param )
{ {
return HWND_16( DIALOG_CreateIndirect( hInst, dlgTemplate, WIN_Handle32(owner), return HWND_16( DIALOG_CreateIndirect( HINSTANCE_32(hInst), dlgTemplate, WIN_Handle32(owner),
(DLGPROC)dlgProc, param, WIN_PROC_16, FALSE )); (DLGPROC)dlgProc, param, WIN_PROC_16, FALSE ));
} }
@ -1083,7 +1120,7 @@ INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, LPCSTR template,
if ((data = LockResource16( hmem ))) if ((data = LockResource16( hmem )))
{ {
HWND owner = WIN_Handle32(owner16); HWND owner = WIN_Handle32(owner16);
hwnd = DIALOG_CreateIndirect( hInst, data, owner, hwnd = DIALOG_CreateIndirect( HINSTANCE_32(hInst), data, owner,
(DLGPROC)dlgProc, param, WIN_PROC_16, TRUE ); (DLGPROC)dlgProc, param, WIN_PROC_16, TRUE );
if (hwnd) ret = DIALOG_DoDialogBox( hwnd, owner ); if (hwnd) ret = DIALOG_DoDialogBox( hwnd, owner );
GlobalUnlock16( hmem ); GlobalUnlock16( hmem );
@ -1146,7 +1183,7 @@ INT16 WINAPI DialogBoxIndirectParam16( HINSTANCE16 hInst, HANDLE16 dlgTemplate,
LPCVOID ptr; LPCVOID ptr;
if (!(ptr = GlobalLock16( dlgTemplate ))) return -1; if (!(ptr = GlobalLock16( dlgTemplate ))) return -1;
hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, (DLGPROC)dlgProc, hwnd = DIALOG_CreateIndirect( HINSTANCE_32(hInst), ptr, owner, (DLGPROC)dlgProc,
param, WIN_PROC_16, TRUE ); param, WIN_PROC_16, TRUE );
GlobalUnlock16( dlgTemplate ); GlobalUnlock16( dlgTemplate );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner ); if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );

View file

@ -1120,9 +1120,9 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild )
if ( (menuInfo.fType & MFT_BITMAP) && if ( (menuInfo.fType & MFT_BITMAP) &&
(LOWORD(menuInfo.dwTypeData)!=0) && (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) if(TWEAK_WineLook > WIN31_LOOK)
@ -1245,7 +1245,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
else else
{ {
LPCLIENTCREATESTRUCT16 ccs = MapSL((SEGPTR)cs->lpCreateParams); LPCLIENTCREATESTRUCT16 ccs = MapSL((SEGPTR)cs->lpCreateParams);
ci->hWindowMenu = ccs->hWindowMenu; ci->hWindowMenu = HMENU_32(ccs->hWindowMenu);
ci->idFirstChild = ccs->idFirstChild; ci->idFirstChild = ccs->idFirstChild;
} }
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );

View file

@ -91,8 +91,8 @@ void STRUCT32_CREATESTRUCT32Ato16( const CREATESTRUCTA* from,
CREATESTRUCT16* to ) CREATESTRUCT16* to )
{ {
to->lpCreateParams = from->lpCreateParams; to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE16)from->hInstance; to->hInstance = HINSTANCE_16(from->hInstance);
to->hMenu = (HMENU16)from->hMenu; to->hMenu = HMENU_16(from->hMenu);
to->hwndParent = HWND_16(from->hwndParent); to->hwndParent = HWND_16(from->hwndParent);
to->cy = from->cy; to->cy = from->cy;
to->cx = from->cx; to->cx = from->cx;
@ -106,8 +106,8 @@ void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
CREATESTRUCTA *to ) CREATESTRUCTA *to )
{ {
to->lpCreateParams = from->lpCreateParams; to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE)from->hInstance; to->hInstance = HINSTANCE_32(from->hInstance);
to->hMenu = (HMENU)from->hMenu; to->hMenu = HMENU_32(from->hMenu);
to->hwndParent = WIN_Handle32(from->hwndParent); to->hwndParent = WIN_Handle32(from->hwndParent);
to->cy = from->cy; to->cy = from->cy;
to->cx = from->cx; to->cx = from->cx;
@ -121,7 +121,7 @@ void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from, void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
MDICREATESTRUCT16* to ) MDICREATESTRUCT16* to )
{ {
to->hOwner = (HINSTANCE16)from->hOwner; to->hOwner = HINSTANCE_16(from->hOwner);
to->x = from->x; to->x = from->x;
to->y = from->y; to->y = from->y;
to->cx = from->cx; to->cx = from->cx;
@ -133,7 +133,7 @@ void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCTA* from,
void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from, void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
MDICREATESTRUCTA *to ) MDICREATESTRUCTA *to )
{ {
to->hOwner = (HINSTANCE)from->hOwner; to->hOwner = HINSTANCE_32(from->hOwner);
to->x = from->x; to->x = from->x;
to->y = from->y; to->y = from->y;
to->cx = from->cx; to->cx = from->cx;

View file

@ -30,11 +30,12 @@
#include "sysmetrics.h" #include "sysmetrics.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
#include "wine/debug.h" #include "wownt32.h"
#include "winreg.h" #include "winreg.h"
#include "local.h" #include "local.h"
#include "user.h" #include "user.h"
#include "gdi.h" /* sic */ #include "gdi.h" /* sic */
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(syscolor); 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, * For a description of the GDI object magics and their flags,
* see "Undocumented Windows" (wrong about the OBJECT_NOSYSTEM flag, though). * 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; static WORD heap_sel = 0;
LPWORD ptr; LPWORD ptr;
@ -151,19 +152,19 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
SysColors[index] = color; SysColors[index] = color;
if (SysColorBrushes[index]) if (SysColorBrushes[index])
{ {
SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], FALSE); SYSCOLOR_MakeObjectSystem( HBRUSH_16(SysColorBrushes[index]), FALSE);
DeleteObject( SysColorBrushes[index] ); DeleteObject( SysColorBrushes[index] );
} }
SysColorBrushes[index] = CreateSolidBrush( color ); SysColorBrushes[index] = CreateSolidBrush( color );
SYSCOLOR_MakeObjectSystem(SysColorBrushes[index], TRUE); SYSCOLOR_MakeObjectSystem( HBRUSH_16(SysColorBrushes[index]), TRUE);
if (SysColorPens[index]) if (SysColorPens[index])
{ {
SYSCOLOR_MakeObjectSystem(SysColorPens[index], FALSE); SYSCOLOR_MakeObjectSystem( HPEN_16(SysColorPens[index]), FALSE);
DeleteObject( SysColorPens[index] ); DeleteObject( SysColorPens[index] );
} }
SysColorPens[index] = CreatePen( PS_SOLID, 1, color ); SysColorPens[index] = CreatePen( PS_SOLID, 1, color );
SYSCOLOR_MakeObjectSystem(SysColorPens[index], TRUE); SYSCOLOR_MakeObjectSystem( HPEN_16(SysColorPens[index]), TRUE);
} }

View file

@ -793,7 +793,7 @@ BOOL WIN_CreateDesktopWindow(void)
wine_server_call( req ); wine_server_call( req );
pWndDesktop->dwStyle = reply->old_style; pWndDesktop->dwStyle = reply->old_style;
pWndDesktop->dwExStyle = reply->old_ex_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->userdata = (ULONG_PTR)reply->old_user_data;
pWndDesktop->wIDmenu = reply->old_id; pWndDesktop->wIDmenu = reply->old_id;
} }
@ -1154,7 +1154,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
if (HIWORD(cs->hInstance)) if (HIWORD(cs->hInstance))
cs->hMenu = LoadMenuA(cs->hInstance,menuName); cs->hMenu = LoadMenuA(cs->hInstance,menuName);
else else
cs->hMenu = LoadMenu16(cs->hInstance,menuName); cs->hMenu = HMENU_32(LoadMenu16(HINSTANCE_16(cs->hInstance),menuName));
if (cs->hMenu) SetMenu( hwnd, cs->hMenu ); if (cs->hMenu) SetMenu( hwnd, cs->hMenu );
} }
@ -1250,7 +1250,7 @@ HWND16 WINAPI CreateWindowEx16( DWORD exStyle, LPCSTR className,
/* Create the window */ /* Create the window */
cs.lpCreateParams = data; cs.lpCreateParams = data;
cs.hInstance = (HINSTANCE)instance; cs.hInstance = HINSTANCE_32(instance);
cs.hMenu = HMENU_32(menu); cs.hMenu = HMENU_32(menu);
cs.hwndParent = WIN_Handle32( parent ); cs.hwndParent = WIN_Handle32( parent );
cs.style = style; cs.style = style;

View file

@ -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; HANDLE dst;
UINT sz = GlobalSize16(src); UINT sz = GlobalSize16(src);
@ -1093,7 +1093,7 @@ static HANDLE convert_handle_16_to_32(HANDLE16 src, unsigned int flags)
GlobalUnlock16(src); GlobalUnlock16(src);
GlobalUnlock(dst); 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->itemState = dis16->itemState;
dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem) dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem)
: WIN_Handle32( dis16->hwndItem ); : WIN_Handle32( dis16->hwndItem );
dis->hDC = dis16->hDC; dis->hDC = HDC_32(dis16->hDC);
dis->itemData = dis16->itemData; dis->itemData = dis16->itemData;
CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem ); CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem );
*plparam = (LPARAM)dis; *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)) if((LOWORD(*plparam) & MF_POPUP) && (LOWORD(*plparam) != 0xFFFF))
{ {
HMENU hmenu=HMENU_32(HIWORD(*plparam)); 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 */ if(Pos==0xFFFF) Pos=0; /* NO_SELECTED_ITEM */
*pwparam32 = MAKEWPARAM( Pos, LOWORD(*plparam) ); *pwparam32 = MAKEWPARAM( Pos, LOWORD(*plparam) );
} }
@ -1367,7 +1367,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
{ {
HANDLE16 lo16; HANDLE16 lo16;
ATOM hi; ATOM hi;
HANDLE lo32 = 0; UINT lo32 = 0;
*pwparam32 = (WPARAM)WIN_Handle32(wParam16); *pwparam32 = (WPARAM)WIN_Handle32(wParam16);
lo16 = LOWORD(*plparam); lo16 = LOWORD(*plparam);
@ -1686,18 +1686,18 @@ LRESULT WINPROC_UnmapMsg16To32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
return result; 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; HANDLE16 dst;
UINT sz = GlobalSize(src); UINT sz = GlobalSize((HANDLE)src);
LPSTR ptr16, ptr32; LPSTR ptr16, ptr32;
if (!(dst = GlobalAlloc16(flags, sz))) if (!(dst = GlobalAlloc16(flags, sz)))
return 0; return 0;
ptr32 = GlobalLock(src); ptr32 = GlobalLock((HANDLE)src);
ptr16 = GlobalLock16(dst); ptr16 = GlobalLock16(dst);
if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr16, ptr32, sz); if (ptr16 != NULL && ptr32 != NULL) memcpy(ptr16, ptr32, sz);
GlobalUnlock(src); GlobalUnlock((HANDLE)src);
GlobalUnlock16(dst); GlobalUnlock16(dst);
return dst; return dst;
@ -2149,7 +2149,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
case WM_DDE_DATA: case WM_DDE_DATA:
case WM_DDE_POKE: case WM_DDE_POKE:
{ {
unsigned lo32, hi; UINT lo32, hi;
HANDLE16 lo16 = 0; HANDLE16 lo16 = 0;
*pwparam16 = HWND_16((HWND)wParam32); *pwparam16 = HWND_16((HWND)wParam32);
@ -2170,7 +2170,7 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
UnpackDDElParam(msg32, *plparam, &lo, &hi); UnpackDDElParam(msg32, *plparam, &lo, &hi);
if (GlobalGetAtomNameA((ATOM)hi, buf, sizeof(buf)) > 0) flag |= 1; 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) switch (flag)
{ {
case 0: case 0: