winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1233 discussions
Start a n
N
ew thread
Roderick Colenbrander : winex11: Fix a null pointer crash when XRender isn' t around.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 48db6abae1108c81144180ebc8902921bada015b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48db6abae1108c81144180ebc…
Author: Roderick Colenbrander <thunderbird2k(a)gmail.com> Date: Mon Dec 21 16:45:13 2009 +0100 winex11: Fix a null pointer crash when XRender isn't around. --- dlls/winex11.drv/xrender.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 1f5e512..214be7b 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -2093,7 +2093,8 @@ void X11DRV_XRender_CopyBrush(X11DRV_PDEVICE *physDev, X_PHYSBITMAP *physBitmap, physDev->brush.pixmap = XCreatePixmap(gdi_display, root_window, width, height, depth); /* Use XCopyArea when the physBitmap and brush.pixmap have the same format. */ - if(physBitmap->pixmap_depth == 1 || src_format->format == dst_format->format) + if( (physBitmap->pixmap_depth == 1) || (!X11DRV_XRender_Installed && physDev->depth == physBitmap->pixmap_depth) || + (src_format->format == dst_format->format) ) { XCopyArea( gdi_display, physBitmap->pixmap, physDev->brush.pixmap, get_bitmap_gc(physBitmap->pixmap_depth), 0, 0, width, height, 0, 0 );
1
0
0
0
Alexandre Julliard : user32: Avoid including winuser16.h in 32-bit files.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: ce05f498437a591faa94958f32ea95ee7276e784 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce05f498437a591faa94958f3…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 22 12:50:07 2009 +0100 user32: Avoid including winuser16.h in 32-bit files. --- dlls/user32/defwnd.c | 3 ++- dlls/user32/desktop.c | 1 - dlls/user32/dialog.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index 39e27b3..ae104e2 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -33,7 +33,6 @@ #include "user_private.h" #include "controls.h" #include "wine/unicode.h" -#include "wine/winuser16.h" #include "wine/server.h" #include "wine/exception.h" #include "wine/debug.h" @@ -44,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win); #define KEYDATA_ALT 0x2000 #define KEYDATA_PREVSTATE 0x4000 +#define DRAG_FILE 0x454C4946 + static short iF10Key = 0; static short iMenuSysKey = 0; static const WCHAR imm32W[] = { 'i','m','m','3','2','\0' }; diff --git a/dlls/user32/desktop.c b/dlls/user32/desktop.c index df4ac70..ea9bded 100644 --- a/dlls/user32/desktop.c +++ b/dlls/user32/desktop.c @@ -31,7 +31,6 @@ #include "winbase.h" #include "wingdi.h" #include "controls.h" -#include "wine/winuser16.h" static HBRUSH hbrushPattern; static HBITMAP hbitmapWallPaper; diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c index a7040ea..021955b 100644 --- a/dlls/user32/dialog.c +++ b/dlls/user32/dialog.c @@ -34,7 +34,6 @@ #include "wingdi.h" #include "winuser.h" #include "winnls.h" -#include "wine/winuser16.h" #include "wine/unicode.h" #include "controls.h" #include "win.h" @@ -566,7 +565,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, size.cx = rect.right - rect.left; size.cy = rect.bottom - rect.top; - if (template.x == CW_USEDEFAULT16) + if (template.x == (SHORT)0x8000 /*CW_USEDEFAULT16*/) { pos.x = pos.y = CW_USEDEFAULT; }
1
0
0
0
Alexandre Julliard : user32: Reimplement MapWindowPoints16 and move it to wnd16.c.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: df3e5a87627d74daf0a3bef7060d1e6e44016f47 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=df3e5a87627d74daf0a3bef70…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 22 12:45:54 2009 +0100 user32: Reimplement MapWindowPoints16 and move it to wnd16.c. --- dlls/user32/winpos.c | 18 ------------------ dlls/user32/wnd16.c | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 915cb59..65e9389 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -507,24 +507,6 @@ static void WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, POINT *offset ) /******************************************************************* - * MapWindowPoints (USER.258) - */ -void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo, - LPPOINT16 lppt, UINT16 count ) -{ - POINT offset; - - WINPOS_GetWinOffset( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), &offset ); - while (count--) - { - lppt->x += offset.x; - lppt->y += offset.y; - lppt++; - } -} - - -/******************************************************************* * MapWindowPoints (USER32.@) */ INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count ) diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index 6968683..dfcd71f 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -1260,6 +1260,30 @@ HWND16 WINAPI GetOpenClipboardWindow16(void) } +/******************************************************************* + * MapWindowPoints (USER.258) + */ +void WINAPI MapWindowPoints16( HWND16 hwndFrom, HWND16 hwndTo, LPPOINT16 lppt, UINT16 count ) +{ + POINT buffer[8], *ppt = buffer; + UINT i; + + if (count > 8) ppt = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*ppt) ); + for (i = 0; i < count; i++) + { + ppt[i].x = lppt[i].x; + ppt[i].y = lppt[i].y; + } + MapWindowPoints( WIN_Handle32(hwndFrom), WIN_Handle32(hwndTo), ppt, count ); + for (i = 0; i < count; i++) + { + lppt[i].x = ppt[i].x; + lppt[i].y = ppt[i].y; + } + if (ppt != buffer) HeapFree( GetProcessHeap(), 0, ppt ); +} + + /************************************************************************** * BeginDeferWindowPos (USER.259) */
1
0
0
0
Alexandre Julliard : user32: Move DestroyIcon32 implementation to user16.c.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 1d1f8e2a2c861567cf9785c8a6a1a61037ea23d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d1f8e2a2c861567cf9785c8a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 22 13:48:19 2009 +0100 user32: Move DestroyIcon32 implementation to user16.c. --- dlls/user32/cursoricon.c | 57 +++++++++------------------------------------- dlls/user32/user16.c | 40 +++++++++++++++++++++++++++++++- dlls/user32/user32.spec | 5 ---- 3 files changed, 50 insertions(+), 52 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 118b8b6..1320523 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -84,10 +84,6 @@ typedef struct #include "poppack.h" -#define CID_RESOURCE 0x0001 -#define CID_WIN32 0x0004 -#define CID_NONSHARED 0x0008 - static RECT CURSOR_ClipRect; /* Cursor clipping rect */ static HDC screen_dc; @@ -1470,52 +1466,16 @@ HICON WINAPI CopyIcon( HICON hIcon ) } -/********************************************************************** - * DestroyIcon32 (USER.610) - * - * This routine is actually exported from Win95 USER under the name - * DestroyIcon32 ... The behaviour implemented here should mimic - * the Win95 one exactly, especially the return values, which - * depend on the setting of various flags. - */ -WORD WINAPI DestroyIcon32( HGLOBAL16 handle, UINT16 flags ) -{ - WORD retv; - - TRACE_(icon)("(%04x, %04x)\n", handle, flags ); - - /* Check whether destroying active cursor */ - - if ( get_user_thread_info()->cursor == HICON_32(handle) ) - { - WARN_(cursor)("Destroying active cursor!\n" ); - return FALSE; - } - - /* Try shared cursor/icon first */ - - if ( !(flags & CID_NONSHARED) ) - { - INT count = CURSORICON_DelSharedIcon(HICON_32(handle)); - - if ( count != -1 ) - return (flags & CID_WIN32)? TRUE : (count == 0); - - /* FIXME: OEM cursors/icons should be recognized */ - } - - /* Now assume non-shared cursor/icon */ - - retv = GlobalFree16( handle ); - return (flags & CID_RESOURCE)? retv : TRUE; -} - /*********************************************************************** * DestroyIcon (USER32.@) */ BOOL WINAPI DestroyIcon( HICON hIcon ) { - return DestroyIcon32(HICON_16(hIcon), CID_WIN32); + TRACE_(icon)("%p\n", hIcon ); + + if (CURSORICON_DelSharedIcon( hIcon ) == -1) + GlobalFree16( HICON_16(hIcon) ); + return TRUE; } @@ -1524,7 +1484,12 @@ BOOL WINAPI DestroyIcon( HICON hIcon ) */ BOOL WINAPI DestroyCursor( HCURSOR hCursor ) { - return DestroyIcon32(HCURSOR_16(hCursor), CID_WIN32); + if (get_user_thread_info()->cursor == hCursor) + { + WARN_(cursor)("Destroying active cursor!\n" ); + return FALSE; + } + return DestroyIcon( hCursor ); } /*********************************************************************** diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index 4daaafd..6305945 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -55,7 +55,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(user); #define USUD_LOCALHEAP 0x0004 #define USUD_FIRSTCLASS 0x0005 -WORD WINAPI DestroyIcon32(HGLOBAL16, UINT16); +#define CID_RESOURCE 0x0001 +#define CID_WIN32 0x0004 +#define CID_NONSHARED 0x0008 WORD USER_HeapSel = 0; /* USER heap selector */ @@ -2854,6 +2856,42 @@ DWORD WINAPI FormatMessage16( #undef ADD_TO_T +/********************************************************************** + * DestroyIcon32 (USER.610) + * + * This routine is actually exported from Win95 USER under the name + * DestroyIcon32 ... The behaviour implemented here should mimic + * the Win95 one exactly, especially the return values, which + * depend on the setting of various flags. + */ +WORD WINAPI DestroyIcon32( HGLOBAL16 handle, UINT16 flags ) +{ + WORD retv; + + /* Check whether destroying active cursor */ + + if (GetCursor16() == handle) + { + WARN("Destroying active cursor!\n" ); + return FALSE; + } + + /* Try shared cursor/icon first */ + + if (!(flags & CID_NONSHARED)) + { + INT count = release_shared_icon( handle ); + if (count != -1) + return (flags & CID_WIN32) ? TRUE : (count == 0); + } + + /* Now assume non-shared cursor/icon */ + + retv = GlobalFree16( handle ); + return (flags & CID_RESOURCE)? retv : TRUE; +} + + /*********************************************************************** * ChangeDisplaySettings (USER.620) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 4492e58..7f87a20 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -772,11 +772,6 @@ @ stdcall wvsprintfW(ptr wstr ptr) ################################################################ -# Wine extensions: Win16 functions that are needed by other dlls -# -@ stdcall DestroyIcon32(long long) - -################################################################ # Wine dll separation hacks, these will go away, don't use them # @ cdecl HOOK_CallHooks(long long long long long)
1
0
0
0
Alexandre Julliard : kernel32: Load the DestroyIcon32 function from 16-bit user.exe.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: ff04a5e8302858c9c79ad4543a8a99700dd1185a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ff04a5e8302858c9c79ad4543…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 22 13:48:03 2009 +0100 kernel32: Load the DestroyIcon32 function from 16-bit user.exe. --- dlls/kernel32/resource16.c | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/resource16.c b/dlls/kernel32/resource16.c index 5d745f8..3292990 100644 --- a/dlls/kernel32/resource16.c +++ b/dlls/kernel32/resource16.c @@ -1105,15 +1105,13 @@ DWORD WINAPI SizeofResource16( HMODULE16 hModule, HRSRC16 hRsrc ) } -typedef WORD (WINAPI *pDestroyIcon32Proc)( HGLOBAL16 handle, UINT16 flags ); - /********************************************************************** * FreeResource (KERNEL.63) */ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) { - pDestroyIcon32Proc proc; - HMODULE user; + FARPROC16 proc; + HMODULE16 user; NE_MODULE *pModule = NE_GetPtr( FarGetOwner16( handle ) ); TRACE("(%04x)\n", handle ); @@ -1149,9 +1147,17 @@ BOOL16 WINAPI FreeResource16( HGLOBAL16 handle ) /* If this failed, call USER.DestroyIcon32; this will check whether it is a shared cursor/icon; if not it will call GlobalFree16() */ - user = GetModuleHandleA( "user32.dll" ); - if (user && (proc = (pDestroyIcon32Proc)GetProcAddress( user, "DestroyIcon32" ))) - return proc( handle, 1 /*CID_RESOURCE*/ ); + user = GetModuleHandle16( "user" ); + if (user && (proc = GetProcAddress16( user, "DestroyIcon32" ))) + { + WORD args[2]; + DWORD result; + + args[1] = handle; + args[0] = 1; /* CID_RESOURCE */ + WOWCallback16Ex( (SEGPTR)proc, WCB16_PASCAL, sizeof(args), args, &result ); + return LOWORD(result); + } else return GlobalFree16( handle ); }
1
0
0
0
Alexandre Julliard : user32: Move freeing of a 16-bit module' s classes to wnd16.c.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 0fbe20a254bd947813480b348230a6f3d6bc97a2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0fbe20a254bd947813480b348…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Dec 22 12:33:26 2009 +0100 user32: Move freeing of a 16-bit module's classes to wnd16.c. --- dlls/user32/class.c | 32 -------------------------- dlls/user32/controls.h | 2 +- dlls/user32/user16.c | 5 ++- dlls/user32/wnd16.c | 59 ++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 59 insertions(+), 39 deletions(-) diff --git a/dlls/user32/class.c b/dlls/user32/class.c index f7e0f25..36315b0 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -255,38 +255,6 @@ static void CLASS_FreeClass( CLASS *classPtr ) /*********************************************************************** - * CLASS_FreeModuleClasses - */ -void CLASS_FreeModuleClasses( HMODULE16 hModule ) -{ - struct list *ptr, *next; - - TRACE("0x%08x\n", hModule); - - USER_Lock(); - for (ptr = list_head( &class_list ); ptr; ptr = next) - { - CLASS *class = LIST_ENTRY( ptr, CLASS, entry ); - next = list_next( &class_list, ptr ); - if (class->hInstance == HINSTANCE_32(hModule)) - { - BOOL ret; - - SERVER_START_REQ( destroy_class ) - { - req->atom = class->atomName; - req->instance = wine_server_client_ptr( class->hInstance ); - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - if (ret) CLASS_FreeClass( class ); - } - } - USER_Unlock(); -} - - -/*********************************************************************** * CLASS_FindClass * * Return a pointer to the class. diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 956c32e..c3fd4ec 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -126,6 +126,7 @@ extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDE /* 16-bit support */ extern HWND create_window16(CREATESTRUCTW*,LPCWSTR,HINSTANCE,UINT) DECLSPEC_HIDDEN; +extern void free_module_classes(HINSTANCE16) DECLSPEC_HIDDEN; extern void register_wow_handlers(void) DECLSPEC_HIDDEN; extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wow_handlers32 *orig ); @@ -138,7 +139,6 @@ extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN; extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN; extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN; extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN; -extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN; /* defwnd proc */ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index c6fd3d7..4daaafd 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -1527,9 +1527,10 @@ void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code, { if (code == USIG16_DLL_UNLOAD) { + hModule = GetExePtr(hModule); /* HOOK_FreeModuleHooks( hModule ); */ - CLASS_FreeModuleClasses( hModule ); - free_module_icons( GetExePtr(hModule) ); + free_module_classes( hModule ); + free_module_icons( hModule ); } } diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index ad99e6d..6968683 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -23,6 +23,7 @@ #include "win.h" #include "controls.h" #include "user_private.h" +#include "wine/list.h" #include "wine/server.h" /* size of buffer needed to store an atom string */ @@ -34,6 +35,15 @@ static HWND16 hwndSysModal; +struct class_entry +{ + struct list entry; + ATOM atom; + HINSTANCE16 inst; +}; + +static struct list class_list = LIST_INIT( class_list ); + struct wnd_enum_info { WNDENUMPROC16 proc; @@ -62,6 +72,19 @@ static inline HWND full_insert_after_hwnd( HWND16 hwnd ) return ret; } +void free_module_classes( HINSTANCE16 inst ) +{ + struct class_entry *class, *next; + + LIST_FOR_EACH_ENTRY_SAFE( class, next, &class_list, struct class_entry, entry ) + { + if (class->inst != inst) continue; + list_remove( &class->entry ); + UnregisterClassA( (LPCSTR)MAKEINTATOM(class->atom), HINSTANCE_32(class->inst) ); + HeapFree( GetProcessHeap(), 0, class ); + } +} + /************************************************************************** * MessageBox (USER.1) */ @@ -1532,22 +1555,34 @@ BOOL16 WINAPI SetWindowPlacement16( HWND16 hwnd, const WINDOWPLACEMENT16 *wp16 ) */ ATOM WINAPI RegisterClassEx16( const WNDCLASSEX16 *wc ) { + struct class_entry *class; WNDCLASSEXA wc32; + HINSTANCE16 inst; + ATOM atom; + + inst = GetExePtr( wc->hInstance ); + if (!inst) inst = GetModuleHandle16( NULL ); wc32.cbSize = sizeof(wc32); wc32.style = wc->style; wc32.lpfnWndProc = WINPROC_AllocProc16( wc->lpfnWndProc ); wc32.cbClsExtra = wc->cbClsExtra; wc32.cbWndExtra = wc->cbWndExtra; - wc32.hInstance = HINSTANCE_32(GetExePtr(wc->hInstance)); - if (!wc32.hInstance) wc32.hInstance = HINSTANCE_32(GetModuleHandle16(NULL)); + wc32.hInstance = HINSTANCE_32(inst); wc32.hIcon = HICON_32(wc->hIcon); wc32.hCursor = HCURSOR_32(wc->hCursor); wc32.hbrBackground = HBRUSH_32(wc->hbrBackground); wc32.lpszMenuName = MapSL(wc->lpszMenuName); wc32.lpszClassName = MapSL(wc->lpszClassName); wc32.hIconSm = HICON_32(wc->hIconSm); - return RegisterClassExA( &wc32 ); + atom = RegisterClassExA( &wc32 ); + if ((class = HeapAlloc( GetProcessHeap(), 0, sizeof(*class) ))) + { + class->atom = atom; + class->inst = inst; + list_add_tail( &class_list, &class->entry ); + } + return atom; } @@ -1617,8 +1652,24 @@ INT16 WINAPI GetPriorityClipboardFormat16( UINT16 *list, INT16 count ) */ BOOL16 WINAPI UnregisterClass16( LPCSTR className, HINSTANCE16 hInstance ) { + ATOM atom; + if (hInstance == GetModuleHandle16("user")) hInstance = 0; - return UnregisterClassA( className, HINSTANCE_32(GetExePtr( hInstance )) ); + else hInstance = GetExePtr( hInstance ); + + if ((atom = GlobalFindAtomA( className ))) + { + struct class_entry *class; + LIST_FOR_EACH_ENTRY( class, &class_list, struct class_entry, entry ) + { + if (class->inst != hInstance) continue; + if (class->atom != atom) continue; + list_remove( &class->entry ); + HeapFree( GetProcessHeap(), 0, class ); + break; + } + } + return UnregisterClassA( className, HINSTANCE_32(hInstance) ); }
1
0
0
0
Alexandre Julliard : user32: Move freeing of a 16-bit module' s icons to user16.c.
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: e3bcc11bebd24fbd804c8cf16eba7d587e2f850a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3bcc11bebd24fbd804c8cf16…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 21 18:24:17 2009 +0100 user32: Move freeing of a 16-bit module's icons to user16.c. --- dlls/user32/cursoricon.c | 27 --------------------------- dlls/user32/user16.c | 15 ++++++++++++++- dlls/user32/user_private.h | 1 - 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 0473315..118b8b6 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -447,33 +447,6 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon ) } /********************************************************************** - * CURSORICON_FreeModuleIcons - */ -void CURSORICON_FreeModuleIcons( HMODULE16 hMod16 ) -{ - ICONCACHE **ptr = &IconAnchor; - HMODULE hModule = HMODULE_32(GetExePtr( hMod16 )); - - EnterCriticalSection( &IconCrst ); - - while ( *ptr ) - { - if ( (*ptr)->hModule == hModule ) - { - ICONCACHE *freePtr = *ptr; - *ptr = freePtr->next; - - GlobalFree16(HICON_16(freePtr->hIcon)); - HeapFree( GetProcessHeap(), 0, freePtr ); - continue; - } - ptr = &(*ptr)->next; - } - - LeaveCriticalSection( &IconCrst ); -} - -/********************************************************************** * get_icon_size */ BOOL get_icon_size( HICON handle, SIZE *size ) diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index 0957ba2..c6fd3d7 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -303,6 +303,19 @@ static int release_shared_icon( HICON16 icon ) return -1; } +static void free_module_icons( HINSTANCE16 inst ) +{ + struct cache_entry *cache, *next; + + LIST_FOR_EACH_ENTRY_SAFE( cache, next, &icon_cache, struct cache_entry, entry ) + { + if (cache->inst != inst) continue; + list_remove( &cache->entry ); + GlobalFree16( cache->icon ); + HeapFree( GetProcessHeap(), 0, cache ); + } +} + /********************************************************************** * InitApp (USER.5) @@ -1516,7 +1529,7 @@ void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code, { /* HOOK_FreeModuleHooks( hModule ); */ CLASS_FreeModuleClasses( hModule ); - CURSORICON_FreeModuleIcons( hModule ); + free_module_icons( GetExePtr(hModule) ); } } diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index fc92f25..41379f0 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -326,7 +326,6 @@ typedef struct #include "poppack.h" -extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule ) DECLSPEC_HIDDEN; extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN; /* Mingw's assert() imports MessageBoxA and gets confused by user32 exporting it */
1
0
0
0
Alexandre Julliard : user32: Reimplement loading of 16-bit cursors and icons using 16-bit resource functions .
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: d5b270eaddc9d3de249e410b98ce6fe5d177ccc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5b270eaddc9d3de249e410b9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 21 17:38:44 2009 +0100 user32: Reimplement loading of 16-bit cursors and icons using 16-bit resource functions. --- dlls/user32/user16.c | 137 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 129 insertions(+), 8 deletions(-) diff --git a/dlls/user32/user16.c b/dlls/user32/user16.c index b338720..0957ba2 100644 --- a/dlls/user32/user16.c +++ b/dlls/user32/user16.c @@ -33,6 +33,7 @@ #include "user_private.h" #include "win.h" #include "controls.h" +#include "wine/list.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(user); @@ -248,6 +249,62 @@ static INT parse_format( LPCSTR format, WPRINTF_FORMAT *res ) /********************************************************************** + * Management of the 16-bit cursor/icon cache + */ + +struct cache_entry +{ + struct list entry; + HINSTANCE16 inst; + HRSRC16 rsrc; + HRSRC16 group; + HICON16 icon; + INT count; +}; + +static struct list icon_cache = LIST_INIT( icon_cache ); + +static void add_shared_icon( HINSTANCE16 inst, HRSRC16 rsrc, HRSRC16 group, HICON16 icon ) +{ + struct cache_entry *cache = HeapAlloc( GetProcessHeap(), 0, sizeof(*cache) ); + + if (!cache) return; + cache->inst = inst; + cache->rsrc = rsrc; + cache->group = group; + cache->icon = icon; + cache->count = 1; + list_add_tail( &icon_cache, &cache->entry ); +} + +static HICON16 find_shared_icon( HINSTANCE16 inst, HRSRC16 rsrc ) +{ + struct cache_entry *cache; + + LIST_FOR_EACH_ENTRY( cache, &icon_cache, struct cache_entry, entry ) + { + if (cache->inst != inst || cache->rsrc != rsrc) continue; + cache->count++; + return cache->icon; + } + return 0; +} + +static int release_shared_icon( HICON16 icon ) +{ + struct cache_entry *cache; + + LIST_FOR_EACH_ENTRY( cache, &icon_cache, struct cache_entry, entry ) + { + if (cache->icon != icon) continue; + if (!cache->count) return 0; + return --cache->count; + } + return -1; +} + + +/********************************************************************** * InitApp (USER.5) */ INT16 WINAPI InitApp16( HINSTANCE16 hInstance ) @@ -755,7 +812,7 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand, */ HCURSOR16 WINAPI LoadCursor16(HINSTANCE16 hInstance, LPCSTR name) { - return HCURSOR_16(LoadCursorA(HINSTANCE_32(hInstance), name)); + return LoadImage16( hInstance, name, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -764,7 +821,7 @@ HCURSOR16 WINAPI LoadCursor16(HINSTANCE16 hInstance, LPCSTR name) */ HICON16 WINAPI LoadIcon16(HINSTANCE16 hInstance, LPCSTR name) { - return HICON_16(LoadIconA(HINSTANCE_32(hInstance), name)); + return LoadImage16( hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } /********************************************************************** @@ -1685,11 +1742,67 @@ DWORD WINAPI GetMenuContextHelpId16( HMENU16 hMenu ) * LoadImage (USER.389) * */ -HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, - INT16 desiredx, INT16 desiredy, UINT16 loadflags) +HANDLE16 WINAPI LoadImage16(HINSTANCE16 hinst, LPCSTR name, UINT16 type, INT16 cx, INT16 cy, UINT16 flags) { - return HANDLE_16(LoadImageA(HINSTANCE_32(hinst), name, type, desiredx, - desiredy, loadflags)); + if (!hinst || (flags & LR_LOADFROMFILE)) + return HICON_16( LoadImageA( 0, name, type, cx, cy, flags )); + + hinst = GetExePtr( hinst ); + + if (flags & LR_DEFAULTSIZE) + { + if (type == IMAGE_ICON) + { + if (!cx) cx = GetSystemMetrics(SM_CXICON); + if (!cy) cy = GetSystemMetrics(SM_CYICON); + } + else if (type == IMAGE_CURSOR) + { + if (!cx) cx = GetSystemMetrics(SM_CXCURSOR); + if (!cy) cy = GetSystemMetrics(SM_CYCURSOR); + } + } + + switch (type) + { + case IMAGE_BITMAP: + return HBITMAP_16( LoadImageA( HINSTANCE_32(hinst), name, type, cx, cy, flags )); + + case IMAGE_ICON: + case IMAGE_CURSOR: + { + HANDLE16 handle; + HICON16 hIcon = 0; + HRSRC16 hRsrc, hGroupRsrc; + BYTE *dir, *bits; + INT id = 0; + + if (!(hRsrc = FindResource16( hinst, name, + (LPCSTR)(type == IMAGE_ICON ? RT_GROUP_ICON : RT_GROUP_CURSOR )))) + return 0; + hGroupRsrc = hRsrc; + + if (!(handle = LoadResource16( hinst, hRsrc ))) return 0; + if ((dir = LockResource16( handle ))) id = LookupIconIdFromDirectory( dir, type == IMAGE_ICON ); + FreeResource16( handle ); + if (!id) return 0; + + if (!(hRsrc = FindResource16( hinst, MAKEINTRESOURCEA(id), + (LPCSTR)(type == IMAGE_ICON ? RT_ICON : RT_CURSOR) ))) return 0; + + if ((flags & LR_SHARED) && (hIcon = find_shared_icon( hinst, hRsrc ) ) != 0) return hIcon; + + if (!(handle = LoadResource16( hinst, hRsrc ))) return 0; + bits = LockResource16( handle ); + hIcon = CreateIconFromResourceEx16( bits, 0, type == IMAGE_ICON, 0x00030000, cx, cy, flags ); + FreeResource16( handle ); + + if (hIcon && (flags & LR_SHARED)) add_shared_icon( hinst, hRsrc, hGroupRsrc, hIcon ); + return hIcon; + } + default: + return 0; + } } /****************************************************************************** @@ -2199,7 +2312,15 @@ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) */ BOOL16 WINAPI DestroyIcon16(HICON16 hIcon) { - return DestroyIcon32(hIcon, 0); + int count; + + TRACE("%04x\n", hIcon ); + + count = release_shared_icon( hIcon ); + if (count != -1) return !count; + /* assume non-shared */ + GlobalFree16( hIcon ); + return TRUE; } /*********************************************************************** @@ -2207,7 +2328,7 @@ BOOL16 WINAPI DestroyIcon16(HICON16 hIcon) */ BOOL16 WINAPI DestroyCursor16(HCURSOR16 hCursor) { - return DestroyIcon32(hCursor, 0); + return DestroyIcon16( hCursor ); }
1
0
0
0
Alexandre Julliard : user32: Always return the actual pointer instead of a winproc handle in WINPROC_GetProc16 .
by Alexandre Julliard
22 Dec '09
22 Dec '09
Module: wine Branch: master Commit: 5a35c490a186d3760840a72af89cd6aafd926f05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a35c490a186d3760840a72af…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Dec 21 19:48:12 2009 +0100 user32: Always return the actual pointer instead of a winproc handle in WINPROC_GetProc16. --- dlls/user32/msg16.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/user32/msg16.c b/dlls/user32/msg16.c index b1cc938..0866875 100644 --- a/dlls/user32/msg16.c +++ b/dlls/user32/msg16.c @@ -163,7 +163,8 @@ static WNDPROC16 alloc_win16_thunk( WNDPROC handle ) WINPROC_THUNK *thunk; UINT index = LOWORD( handle ); - if (index >= MAX_WINPROCS32) return (WNDPROC16)handle; /* already a 16-bit proc */ + if (index >= MAX_WINPROCS32) /* already a 16-bit proc */ + return winproc16_array[index - MAX_WINPROCS32]; if (!thunk_array) /* allocate the array and its selector */ {
1
0
0
0
Louis Lenders : mapistub: Add new stubbed dll mapistub.dll.
by Alexandre Julliard
21 Dec '09
21 Dec '09
Module: wine Branch: master Commit: 13a9c037f4c5bc88be241a66e6dcc374ae39eae0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=13a9c037f4c5bc88be241a66e…
Author: Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> Date: Thu Dec 17 17:41:18 2009 +0100 mapistub: Add new stubbed dll mapistub.dll. --- configure | 9 ++ configure.ac | 1 + dlls/mapistub/Makefile.in | 13 +++ dlls/mapistub/main.c | 48 +++++++++++ dlls/mapistub/mapistub.spec | 190 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 261 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=13a9c037f4c5bc88be241…
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
124
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Results per page:
10
25
50
100
200