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
May 2006
----- 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
863 discussions
Start a n
N
ew thread
Alexandre Julliard : user: Separate the 16 and 32-bit versions of WINPROC_AllocProc.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 41b5e687fd42db959f735ba5c3912e57621b2e09 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=41b5e687fd42db959f735ba…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 19:55:05 2006 +0200 user: Separate the 16 and 32-bit versions of WINPROC_AllocProc. --- dlls/user/class.c | 15 +++++ dlls/user/win.c | 2 - dlls/user/winproc.c | 143 +++++++++++++++++++++++++++++++-------------------- dlls/user/winproc.h | 1 dlls/user/wnd16.c | 6 +- 5 files changed, 106 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=41b5e687fd42db959f7…
1
0
0
0
Alexandre Julliard : user: Separate the 16 and 32-bit versions of WINPROC_GetProc.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 4c40190620110abe882501f893deda6d98a4026f URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=4c40190620110abe882501f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 18:40:46 2006 +0200 user: Separate the 16 and 32-bit versions of WINPROC_GetProc. --- dlls/user/class.c | 33 +++++++++++++++++++------- dlls/user/win.c | 4 ++- dlls/user/winproc.c | 64 +++++++++++++++++++++++---------------------------- dlls/user/winproc.h | 3 ++ dlls/user/wnd16.c | 2 +- 5 files changed, 58 insertions(+), 48 deletions(-) diff --git a/dlls/user/class.c b/dlls/user/class.c index 0e9d4ff..c851066 100644 --- a/dlls/user/class.c +++ b/dlls/user/class.c @@ -149,7 +149,20 @@ static BOOL set_server_info( HWND hwnd, * * Get the class winproc for a given proc type */ -static WNDPROC16 CLASS_GetProc( CLASS *classPtr, WINDOWPROCTYPE type ) +static WNDPROC16 CLASS_GetProc16( CLASS *classPtr ) +{ + WNDPROC proc = classPtr->winprocA; + if (!proc) proc = classPtr->winprocW; + return WINPROC_GetProc16( proc ); +} + + +/*********************************************************************** + * CLASS_GetProc + * + * Get the class winproc for a given proc type + */ +static WNDPROC CLASS_GetProc( CLASS *classPtr, WINDOWPROCTYPE type ) { WNDPROC proc = classPtr->winprocA; @@ -170,10 +183,9 @@ static WNDPROC16 CLASS_GetProc( CLASS *c * Set the class winproc for a given proc type. * Returns the previous window proc. */ -static WNDPROC16 CLASS_SetProc( CLASS *classPtr, WNDPROC newproc, WINDOWPROCTYPE type ) +static void CLASS_SetProc( CLASS *classPtr, WNDPROC newproc, WINDOWPROCTYPE type ) { WNDPROC *proc = &classPtr->winprocA; - WNDPROC16 ret; if (classPtr->winprocW) { @@ -182,7 +194,6 @@ static WNDPROC16 CLASS_SetProc( CLASS *c */ if (!*proc || type == WIN_PROC_32W) proc = &classPtr->winprocW; } - ret = WINPROC_GetProc( *proc, type ); *proc = WINPROC_AllocProc( newproc, type ); /* now clear the one that we didn't set */ if (classPtr->winprocA && classPtr->winprocW) @@ -192,7 +203,6 @@ static WNDPROC16 CLASS_SetProc( CLASS *c else classPtr->winprocA = 0; } - return ret; } @@ -730,7 +740,7 @@ LONG WINAPI GetClassLong16( HWND16 hwnd1 case GCLP_WNDPROC: if (!(class = get_class_ptr( hwnd, FALSE ))) return 0; if (class == CLASS_OTHER_PROCESS) break; - ret = (LONG)CLASS_GetProc( class, WIN_PROC_16 ); + ret = (LONG)CLASS_GetProc16( class ); release_class_ptr( class ); return ret; case GCLP_MENUNAME: @@ -942,7 +952,8 @@ LONG WINAPI SetClassLong16( HWND16 hwnd1 { case GCLP_WNDPROC: if (!(class = get_class_ptr( hwnd, TRUE ))) return 0; - retval = (LONG)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_16 ); + retval = (LONG)CLASS_GetProc16( class ); + CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_16 ); release_class_ptr( class ); return retval; case GCLP_MENUNAME: @@ -982,7 +993,8 @@ DWORD WINAPI SetClassLongW( HWND hwnd, I retval = 0; /* Old value is now meaningless anyway */ break; case GCLP_WNDPROC: - retval = (DWORD)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32W ); + retval = (DWORD)CLASS_GetProc( class, WIN_PROC_32W ); + CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32W ); break; case GCLP_HBRBACKGROUND: retval = (DWORD)class->hbrBackground; @@ -1048,7 +1060,10 @@ DWORD WINAPI SetClassLongA( HWND hwnd, I if (!(class = get_class_ptr( hwnd, TRUE ))) return 0; if (offset == GCLP_WNDPROC) - retval = (DWORD)CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32A ); + { + retval = (DWORD)CLASS_GetProc( class, WIN_PROC_32A ); + CLASS_SetProc( class, (WNDPROC)newval, WIN_PROC_32A ); + } else /* GCL_MENUNAME */ { CLASS_SetMenuNameA( class, (LPCSTR)newval ); diff --git a/dlls/user/win.c b/dlls/user/win.c index 2cacdb8..df0ffd8 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -2165,7 +2165,7 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd } } retvalue = GetWindowLongA( WIN_Handle32(hwnd), offset ); - if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc( (WNDPROC)retvalue, WIN_PROC_16 ); + if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc16( (WNDPROC)retvalue ); return retvalue; } @@ -2215,7 +2215,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd { WNDPROC new_proc = WINPROC_AllocProc( (WNDPROC)newval, WIN_PROC_16 ); WNDPROC old_proc = (WNDPROC)SetWindowLongA( WIN_Handle32(hwnd), offset, (LONG_PTR)new_proc ); - return (LONG)WINPROC_GetProc( (WNDPROC)old_proc, WIN_PROC_16 ); + return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc ); } else return SetWindowLongA( WIN_Handle32(hwnd), offset, newval ); } diff --git a/dlls/user/winproc.c b/dlls/user/winproc.c index 51f0ab8..571a23f 100644 --- a/dlls/user/winproc.c +++ b/dlls/user/winproc.c @@ -529,34 +529,43 @@ static WINDOWPROC *WINPROC_GetPtr( WNDPR /********************************************************************** + * WINPROC_GetProc16 + * + * Get a window procedure pointer that can be passed to the Windows program. + */ +WNDPROC16 WINPROC_GetProc16( WNDPROC proc ) +{ + WINDOWPROC *ptr = (WINDOWPROC *)proc; + + if (!proc) return 0; + + if (ptr->type == WIN_PROC_16) + return ptr->thunk.t_from32.proc; + else + return (WNDPROC16)MAKESEGPTR( get_winproc_selector(), + (char *)&ptr->thunk - (char *)winproc_array ); +} + + +/********************************************************************** * WINPROC_GetProc * * Get a window procedure pointer that can be passed to the Windows program. */ -WNDPROC16 WINPROC_GetProc( WNDPROC proc, WINDOWPROCTYPE type ) +WNDPROC WINPROC_GetProc( WNDPROC proc, WINDOWPROCTYPE type ) { WINDOWPROC *ptr = (WINDOWPROC *)proc; if (!proc) return NULL; - if (type == WIN_PROC_16) /* We want a 16:16 address */ - { - if (ptr->type == WIN_PROC_16) - return ptr->thunk.t_from32.proc; - else - return (WNDPROC16)MAKESEGPTR( get_winproc_selector(), - (char *)&ptr->thunk - (char *)winproc_array ); - } - else /* We want a 32-bit address */ - { - if (ptr->type == WIN_PROC_16) - return (WNDPROC16)&ptr->thunk; - else if (type != ptr->type) - /* Have to return the jmp address if types don't match */ - return (WNDPROC16)&ptr->jmp; - else - /* Some Win16 programs want to get back the proc they set */ - return (WNDPROC16)ptr->thunk.t_from16.proc; - } + + if (ptr->type == WIN_PROC_16) + return (WNDPROC)&ptr->thunk; + else if (type != ptr->type) + /* Have to return the jmp address if types don't match */ + return (WNDPROC)&ptr->jmp; + else + /* Some Win16 programs want to get back the proc they set */ + return (WNDPROC)ptr->thunk.t_from16.proc; } @@ -3205,11 +3214,6 @@ LRESULT WINAPI CallWindowProc16( WNDPROC if (!(proc = WINPROC_GetPtr( (WNDPROC)func ))) return WINPROC_CallWndProc16( func, hwnd, msg, wParam, lParam ); -#if testing - func = WINPROC_GetProc( (WNDPROC)proc, WIN_PROC_16 ); - return WINPROC_CallWndProc16( func, hwnd, msg, wParam, lParam ); -#endif - switch(proc->type) { case WIN_PROC_16: @@ -3267,11 +3271,6 @@ LRESULT WINAPI CallWindowProcA( if (!(proc = WINPROC_GetPtr( func ))) return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam ); -#if testing - func = WINPROC_GetProc( (WNDPROC)proc, WIN_PROC_32A ); - return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam ); -#endif - switch(proc->type) { case WIN_PROC_16: @@ -3308,11 +3307,6 @@ LRESULT WINAPI CallWindowProcW( WNDPROC if (!(proc = WINPROC_GetPtr( (WNDPROC)func ))) return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam ); -#if testing - func = WINPROC_GetProc( (WNDPROC)proc, WIN_PROC_32W ); - return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam ); -#endif - switch(proc->type) { case WIN_PROC_16: diff --git a/dlls/user/winproc.h b/dlls/user/winproc.h index f1fbe8e..f0204ae 100644 --- a/dlls/user/winproc.h +++ b/dlls/user/winproc.h @@ -52,7 +52,8 @@ typedef struct struct tagWINDOWPROC; -extern WNDPROC16 WINPROC_GetProc( WNDPROC proc, WINDOWPROCTYPE type ); +extern WNDPROC16 WINPROC_GetProc16( WNDPROC proc ); +extern WNDPROC WINPROC_GetProc( WNDPROC proc, WINDOWPROCTYPE type ); extern WNDPROC WINPROC_AllocProc( WNDPROC func, WINDOWPROCTYPE type ); extern WINDOWPROCTYPE WINPROC_GetProcType( WNDPROC proc ); diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index 20a0902..b923c83 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -1358,7 +1358,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANC if (ret) { WNDPROC proc = WINPROC_AllocProc( wc32.lpfnWndProc, WIN_PROC_32A ); - wc->lpfnWndProc = WINPROC_GetProc( proc, WIN_PROC_16 ); + wc->lpfnWndProc = WINPROC_GetProc16( proc ); wc->style = wc32.style; wc->cbClsExtra = wc32.cbClsExtra; wc->cbWndExtra = wc32.cbWndExtra;
1
0
0
0
Alexandre Julliard : user: Fixed offset check for the DWLP_DLGPROC case in SetWindowLong.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 5326e304d017669d2512ad69ab8a4057eb0ed118 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=5326e304d017669d2512ad6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 13:50:53 2006 +0200 user: Fixed offset check for the DWLP_DLGPROC case in SetWindowLong. --- dlls/user/win.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/user/win.c b/dlls/user/win.c index 9fef05b..2cacdb8 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -2006,7 +2006,7 @@ static LONG_PTR WIN_SetWindowLong( HWND case GWLP_USERDATA: break; case DWLP_DLGPROC: - if ((wndPtr->cbWndExtra + sizeof(LONG_PTR) >= DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) + if ((wndPtr->cbWndExtra - sizeof(LONG_PTR) >= DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)) { WNDPROC *ptr = (WNDPROC *)((char *)wndPtr->wExtra + DWLP_DLGPROC); retval = (ULONG_PTR)WINPROC_GetProc( *ptr, type );
1
0
0
0
Alexandre Julliard : user: Separate Get/ SetWindowLong16 implementation from the 32-bit one.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: a95c58b871e27ab2a4051b266f00ebbf41fa7e4d URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a95c58b871e27ab2a4051b2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 13:49:37 2006 +0200 user: Separate Get/SetWindowLong16 implementation from the 32-bit one. --- dlls/user/win.c | 86 ++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 66 insertions(+), 20 deletions(-) diff --git a/dlls/user/win.c b/dlls/user/win.c index 10a1a4f..9fef05b 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -1888,24 +1888,6 @@ static LONG_PTR WIN_GetWindowLong( HWND { if (offset > (int)(wndPtr->cbWndExtra - sizeof(LONG))) { - /* - * Some programs try to access last element from 16 bit - * code using illegal offset value. Hopefully this is - * what those programs really expect. - */ - if (type == WIN_PROC_16 && - wndPtr->cbWndExtra >= 4 && - offset == wndPtr->cbWndExtra - sizeof(WORD)) - { - INT offset2 = wndPtr->cbWndExtra - sizeof(LONG); - - ERR( "- replaced invalid offset %d with %d\n", - offset, offset2 ); - - retvalue = *(LONG_PTR *)(((char *)wndPtr->wExtra) + offset2); - WIN_ReleasePtr( wndPtr ); - return retvalue; - } WARN("Invalid offset %d\n", offset ); WIN_ReleasePtr( wndPtr ); SetLastError( ERROR_INVALID_INDEX ); @@ -2144,7 +2126,47 @@ static LONG_PTR WIN_SetWindowLong( HWND */ LONG WINAPI GetWindowLong16( HWND16 hwnd, INT16 offset ) { - return WIN_GetWindowLong( WIN_Handle32(hwnd), offset, WIN_PROC_16 ); + WND *wndPtr; + LONG_PTR retvalue; + BOOL is_winproc = (offset == GWLP_WNDPROC); + + if (offset >= 0) + { + if (!(wndPtr = WIN_GetPtr( WIN_Handle32(hwnd) ))) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return 0; + } + if (wndPtr != WND_OTHER_PROCESS && wndPtr != WND_DESKTOP) + { + if (offset > (int)(wndPtr->cbWndExtra - sizeof(LONG))) + { + /* + * Some programs try to access last element from 16 bit + * code using illegal offset value. Hopefully this is + * what those programs really expect. + */ + if (wndPtr->cbWndExtra >= 4 && offset == wndPtr->cbWndExtra - sizeof(WORD)) + { + INT offset2 = wndPtr->cbWndExtra - sizeof(LONG); + ERR( "- replaced invalid offset %d with %d\n", offset, offset2 ); + offset = offset2; + } + else + { + WARN("Invalid offset %d\n", offset ); + WIN_ReleasePtr( wndPtr ); + SetLastError( ERROR_INVALID_INDEX ); + return 0; + } + } + is_winproc = ((offset == DWLP_DLGPROC) && (wndPtr->flags & WIN_ISDIALOG)); + WIN_ReleasePtr( wndPtr ); + } + } + retvalue = GetWindowLongA( WIN_Handle32(hwnd), offset ); + if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc( (WNDPROC)retvalue, WIN_PROC_16 ); + return retvalue; } @@ -2171,7 +2193,31 @@ LONG WINAPI GetWindowLongW( HWND hwnd, I */ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval ) { - return WIN_SetWindowLong( WIN_Handle32(hwnd), offset, newval, WIN_PROC_16 ); + WND *wndPtr; + BOOL is_winproc = (offset == GWLP_WNDPROC); + + if (offset == DWLP_DLGPROC) + { + if (!(wndPtr = WIN_GetPtr( WIN_Handle32(hwnd) ))) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return 0; + } + if (wndPtr != WND_OTHER_PROCESS && wndPtr != WND_DESKTOP) + { + is_winproc = ((wndPtr->cbWndExtra - sizeof(LONG_PTR) >= DWLP_DLGPROC) && + (wndPtr->flags & WIN_ISDIALOG)); + WIN_ReleasePtr( wndPtr ); + } + } + + if (is_winproc) + { + WNDPROC new_proc = WINPROC_AllocProc( (WNDPROC)newval, WIN_PROC_16 ); + WNDPROC old_proc = (WNDPROC)SetWindowLongA( WIN_Handle32(hwnd), offset, (LONG_PTR)new_proc ); + return (LONG)WINPROC_GetProc( (WNDPROC)old_proc, WIN_PROC_16 ); + } + else return SetWindowLongA( WIN_Handle32(hwnd), offset, newval ); }
1
0
0
0
Alexandre Julliard : kernel: Added work-around in UnhandledExceptionFilter for no exec protections.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: feb7276c7366c93da3731a50032ee7526bdacc03 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=feb7276c7366c93da3731a5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 9 12:58:46 2006 +0200 kernel: Added work-around in UnhandledExceptionFilter for no exec protections. --- dlls/kernel/except.c | 54 +++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 46 insertions(+), 8 deletions(-) diff --git a/dlls/kernel/except.c b/dlls/kernel/except.c index 95c5ce9..779146e 100644 --- a/dlls/kernel/except.c +++ b/dlls/kernel/except.c @@ -392,16 +392,12 @@ static int start_debugger_atomic(PEXCEPT * If yes, we unprotect the resources to let broken apps continue * (Windows does this too). */ -inline static BOOL check_resource_write( const EXCEPTION_RECORD *rec ) +inline static BOOL check_resource_write( void *addr ) { - void *addr, *rsrc; + void *rsrc; DWORD size; MEMORY_BASIC_INFORMATION info; - if (rec->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) return FALSE; - if (rec->NumberParameters < 2) return FALSE; - if (!rec->ExceptionInformation[0]) return FALSE; /* not a write access */ - addr = (void *)rec->ExceptionInformation[1]; if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE; if (info.State == MEM_FREE || !(info.Type & MEM_IMAGE)) return FALSE; if (!(rsrc = RtlImageDirectoryEntryToData( (HMODULE)info.AllocationBase, TRUE, @@ -415,15 +411,57 @@ inline static BOOL check_resource_write( /******************************************************************* + * check_no_exec + * + * Check for executing a protected area. + */ +inline static BOOL check_no_exec( void *addr ) +{ + MEMORY_BASIC_INFORMATION info; + + if (!VirtualQuery( addr, &info, sizeof(info) )) return FALSE; + if (info.State == MEM_FREE) return FALSE; + + /* prot |= PAGE_EXECUTE would be a lot easier, but MS developers + * apparently don't grasp the notion of protection bits */ + switch(info.Protect) + { + case PAGE_READONLY: info.Protect = PAGE_EXECUTE_READ; break; + case PAGE_READWRITE: info.Protect = PAGE_EXECUTE_READWRITE; break; + case PAGE_WRITECOPY: info.Protect = PAGE_EXECUTE_WRITECOPY; break; + default: return FALSE; + } + /* FIXME: we should probably have a per-app option, and maybe a message box */ + FIXME( "No-exec fault triggered at %p, enabling work-around\n", addr ); + return VirtualProtect( addr, 1, info.Protect, NULL ); +} + + +/******************************************************************* * UnhandledExceptionFilter (KERNEL32.@) */ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers) { - if (check_resource_write( epointers->ExceptionRecord )) return EXCEPTION_CONTINUE_EXECUTION; + const EXCEPTION_RECORD *rec = epointers->ExceptionRecord; + + if (rec->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && rec->NumberParameters >= 2) + { + switch(rec->ExceptionInformation[0]) + { + case 1: /* write access */ + if (check_resource_write( (void *)rec->ExceptionInformation[1] )) + return EXCEPTION_CONTINUE_EXECUTION; + break; + case 8: /* execute access */ + if (check_no_exec( (void *)rec->ExceptionInformation[1] )) + return EXCEPTION_CONTINUE_EXECUTION; + break; + } + } if (!NtCurrentTeb()->Peb->BeingDebugged) { - if (epointers->ExceptionRecord->ExceptionCode == CONTROL_C_EXIT) + if (rec->ExceptionCode == CONTROL_C_EXIT) { /* do not launch the debugger on ^C, simply terminate the process */ TerminateProcess( GetCurrentProcess(), 1 );
1
0
0
0
Marcus Meissner : ntdll: Make the section with AddressOfEntryPoint in it executable.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 08c2555dd86969c157037b7850667175aa102f16 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=08c2555dd86969c157037b7…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Sat May 6 15:16:39 2006 +0200 ntdll: Make the section with AddressOfEntryPoint in it executable. --- dlls/ntdll/virtual.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 1723070..fcdb96b 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1072,6 +1072,12 @@ static NTSTATUS map_image( HANDLE hmappi if (sec->Characteristics & IMAGE_SCN_MEM_READ) vprot |= VPROT_READ; if (sec->Characteristics & IMAGE_SCN_MEM_WRITE) vprot |= VPROT_READ|VPROT_WRITECOPY; if (sec->Characteristics & IMAGE_SCN_MEM_EXECUTE) vprot |= VPROT_EXEC; + + /* Dumb game crack lets the AOEP point into a data section. Adjust. */ + if ((nt->OptionalHeader.AddressOfEntryPoint >= sec->VirtualAddress) && + (nt->OptionalHeader.AddressOfEntryPoint < sec->VirtualAddress + size)) + vprot |= VPROT_EXEC; + VIRTUAL_SetProt( view, ptr + sec->VirtualAddress, size, vprot ); }
1
0
0
0
Louis. Lenders : gdi32: Add stub for GetCharWidthI and GetFontUnicodeRanges .
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: ad2b0a0fd7fa414a7f20b85828d3361d6d8a9278 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ad2b0a0fd7fa414a7f20b85…
Author: Louis. Lenders <xerox_xerox2000(a)yahoo.co.uk> Date: Sun May 7 00:33:32 2006 +0100 gdi32: Add stub for GetCharWidthI and GetFontUnicodeRanges. --- dlls/gdi/font.c | 18 ++++++++++++++++++ dlls/gdi/gdi32.spec | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/gdi/font.c b/dlls/gdi/font.c index b0d8a98..ada4966 100644 --- a/dlls/gdi/font.c +++ b/dlls/gdi/font.c @@ -3068,3 +3068,21 @@ BOOL WINAPI EnableEUDC(BOOL fEnableEUDC) FIXME("(%d): stub\n", fEnableEUDC); return FALSE; } + +/*********************************************************************** + * GetCharWidthI (GDI32.@) + */ +BOOL WINAPI GetCharWidthI(HDC hdc, UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer) +{ + FIXME("(%p, %d, %d, %p, %p): stub\n", hdc, giFirst, cgi, pgi, lpBuffer); + return FALSE; +} + +/*********************************************************************** + * GetFontUnicodeRanges (GDI32.@) + */ +DWORD WINAPI GetFontUnicodeRanges(HDC hdc, LPGLYPHSET lpgs) +{ + FIXME("(%p, %p): stub\n", hdc, lpgs); + return 0; +} diff --git a/dlls/gdi/gdi32.spec b/dlls/gdi/gdi32.spec index 59c748d..1c245d8 100644 --- a/dlls/gdi/gdi32.spec +++ b/dlls/gdi/gdi32.spec @@ -244,7 +244,7 @@ # @ stub GetBrushAttributes @ stdcall GetCharWidthA(long long long long) GetCharWidth32A @ stdcall GetCharWidthFloatA(long long long ptr) @ stdcall GetCharWidthFloatW(long long long ptr) -# @ stub GetCharWidthI +@ stdcall GetCharWidthI(ptr long long ptr ptr) # @ stub GetCharWidthInfo @ stdcall GetCharWidthW(long long long long) GetCharWidth32W @ stub GetCharWidthWOW @@ -279,7 +279,7 @@ # @ stub GetFontAssocStatus @ stdcall GetFontLanguageInfo(long) @ stub GetFontResourceInfo @ stub GetFontResourceInfoW -# @ stub GetFontUnicodeRanges +@ stdcall GetFontUnicodeRanges(ptr ptr) @ stdcall GetGlyphIndicesA(long ptr long ptr long) @ stdcall GetGlyphIndicesW(long ptr long ptr long) @ stub GetGlyphOutline
1
0
0
0
Louis. Lenders : gdi32: Add defines for GLYPHSET and WCRANGE.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 1ca6fc12a8ec0c05190e5c5b7dba7e0acb19442a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=1ca6fc12a8ec0c05190e5c5…
Author: Louis. Lenders <xerox_xerox2000(a)yahoo.co.uk> Date: Sun May 7 00:29:54 2006 +0100 gdi32: Add defines for GLYPHSET and WCRANGE. --- include/wingdi.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/wingdi.h b/include/wingdi.h index 9375ff9..f2fcd21 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3244,6 +3244,19 @@ typedef struct _DRAWPATRECT WORD wPattern; } DRAWPATRECT, *PDRAWPATRECT; +typedef struct tagWCRANGE { + WCHAR wcLow; + USHORT cGlyphs; +} WCRANGE, *PWCRANGE, *LPWCRANGE; + +typedef struct tagGLYPHSET { + DWORD cbThis; + DWORD flAccel; + DWORD cGlyphsSupported; + DWORD cRanges; + WCRANGE ranges[1]; +} GLYPHSET, *PGLYPHSET, *LPGLYPHSET; + INT WINAPI AbortDoc(HDC); BOOL WINAPI AbortPath(HDC); INT WINAPI AddFontResourceA(LPCSTR);
1
0
0
0
Mike McCormack : x11drv: Fix a warning when opengl headers are missing.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: a0882e9bf7ef2bd872528b223f90385e0f850f45 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=a0882e9bf7ef2bd872528b2…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Tue May 9 17:37:37 2006 +0900 x11drv: Fix a warning when opengl headers are missing. --- dlls/x11drv/opengl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/x11drv/opengl.c b/dlls/x11drv/opengl.c index ba125b9..d0a3053 100644 --- a/dlls/x11drv/opengl.c +++ b/dlls/x11drv/opengl.c @@ -660,7 +660,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVIC * SwapBuffers (X11DRV.@) */ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { - ERR("No OpenGL support compiled in.\n"); + ERR_(opengl)("No OpenGL support compiled in.\n"); return FALSE; }
1
0
0
0
Tomas Carnecky : opengl: Properly use glXQueryDrawable() to get the Visual ID.
by Alexandre Julliard
09 May '06
09 May '06
Module: wine Branch: refs/heads/master Commit: 3a3a0b301367fa882868c952c181bd2d8f1a7e51 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=3a3a0b301367fa882868c95…
Author: Tomas Carnecky <tom(a)dbservice.com> Date: Tue May 9 00:38:00 2006 +0200 opengl: Properly use glXQueryDrawable() to get the Visual ID. --- dlls/opengl32/wgl.c | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index c7d3147..a9d0b27 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -509,22 +509,35 @@ static int describeContext(Wine_GLContex static int describeDrawable(Wine_GLContext* ctx, Drawable drawable) { int tmp; - int draw_vis_id; + int nElements; + int attribList[3] = { GLX_FBCONFIG_ID, 0, None }; + GLXFBConfig *fbCfgs; + if (3 > wine_glx.version || NULL == wine_glx.p_glXQueryDrawable) { /** glXQueryDrawable not available so returns not supported */ return -1; } + TRACE(" Drawable %p have :\n", (void*) drawable); - wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_FBCONFIG_ID, (unsigned int*) &tmp); - TRACE(" - FBCONFIG_ID as 0x%x\n", tmp); - wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_VISUAL_ID, (unsigned int*) &tmp); - TRACE(" - VISUAL_ID as 0x%x\n", tmp); - draw_vis_id = tmp; wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_WIDTH, (unsigned int*) &tmp); TRACE(" - WIDTH as %d\n", tmp); wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_HEIGHT, (unsigned int*) &tmp); TRACE(" - HEIGHT as %d\n", tmp); - return draw_vis_id; + wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_FBCONFIG_ID, (unsigned int*) &tmp); + TRACE(" - FBCONFIG_ID as 0x%x\n", tmp); + + attribList[1] = tmp; + fbCfgs = wine_glx.p_glXChooseFBConfig(ctx->display, DefaultScreen(ctx->display), attribList, &nElements); + if (fbCfgs == NULL) { + return -1; + } + + wine_glx.p_glXGetFBConfigAttrib(ctx->display, fbCfgs[0], GLX_VISUAL_ID, &tmp); + TRACE(" - VISUAL_ID as 0x%x\n", tmp); + + XFree(fbCfgs); + + return tmp; } /***********************************************************************
1
0
0
0
← Newer
1
...
62
63
64
65
66
67
68
...
87
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
Results per page:
10
25
50
100
200