ReactOS.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
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
List overview
Download
Ros-diffs
September 2009
----- 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
ros-diffs@reactos.org
16 participants
270 discussions
Start a n
N
ew thread
[jimtabor] 43056: - Patch by Smiley <johnyadams@hotmail.com>: remove redundant system calls when window structure is available to user space.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Sep 16 00:13:16 2009 New Revision: 43056 URL:
http://svn.reactos.org/svn/reactos?rev=43056&view=rev
Log: - Patch by Smiley <johnyadams(a)hotmail.com>: remove redundant system calls when window structure is available to user space. Modified: trunk/reactos/dll/win32/user32/include/user32p.h trunk/reactos/dll/win32/user32/windows/menu.c trunk/reactos/dll/win32/user32/windows/window.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c Modified: trunk/reactos/dll/win32/user32/include/user32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
============================================================================== --- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Wed Sep 16 00:13:16 2009 @@ -49,9 +49,6 @@ #define NtUserSetGUIThreadHandle(field, hwnd) \ (BOOL)NtUserCallTwoParam((DWORD)field, (DWORD)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE) -#define NtUserSetMenuItemRect(menu, mir) \ - (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT) - #define NtUserSetMenuBarHeight(menu, height) \ (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT) @@ -81,20 +78,11 @@ #define NtUserSwapMouseButton(fSwap) \ (BOOL)NtUserCallOneParam((DWORD)fSwap, ONEPARAM_ROUTINE_SWAPMOUSEBUTTON) -#define NtUserGetMenu(hWnd) \ - (HMENU)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_GETMENU) - #define NtUserSetMessageExtraInfo(lParam) \ (LPARAM)NtUserCallOneParam((DWORD)lParam, ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO) -#define NtUserIsWindowUnicode(hWnd) \ - (BOOL)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_ISWINDOWUNICODE) - #define NtUserGetWindowContextHelpId(hwnd) \ NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID) - -#define NtUserGetWindowInstance(hwnd) \ - (HINSTANCE)NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWINDOWINSTANCE) #define NtUserGetCursorPos(lpPoint) \ (BOOL)NtUserCallOneParam((DWORD)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOSITION) Modified: trunk/reactos/dll/win32/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Wed Sep 16 00:13:16 2009 @@ -4234,7 +4234,12 @@ HMENU WINAPI GetMenu(HWND hWnd) { - return NtUserGetMenu(hWnd); + PWND Wnd = ValidateHwnd(hWnd); + + if (!Wnd) + return NULL; + + return (HMENU)Wnd->IDMenu; } Modified: trunk/reactos/dll/win32/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Wed Sep 16 00:13:16 2009 @@ -1129,14 +1129,12 @@ LPSTR lpszFileName, UINT cchFileNameMax) { - HINSTANCE hWndInst; - - if(!(hWndInst = NtUserGetWindowInstance(hwnd))) - { + PWND Wnd = ValidateHwnd(hwnd); + + if (!Wnd) return 0; - } - - return GetModuleFileNameA(hWndInst, lpszFileName, cchFileNameMax); + + return GetModuleFileNameA(Wnd->hModule, lpszFileName, cchFileNameMax); } @@ -1148,14 +1146,12 @@ LPWSTR lpszFileName, UINT cchFileNameMax) { - HINSTANCE hWndInst; - - if(!(hWndInst = NtUserGetWindowInstance(hwnd))) - { + PWND Wnd = ValidateHwnd(hwnd); + + if (!Wnd) return 0; - } - - return GetModuleFileNameW(hWndInst, lpszFileName, cchFileNameMax); + + return GetModuleFileNameW( Wnd->hModule, lpszFileName, cchFileNameMax ); } Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Wed Sep 16 00:13:16 2009 @@ -3024,21 +3024,16 @@ #define NOPARAM_ROUTINE_ANYPOPUP 0xffff0006 #define NOPARAM_ROUTINE_CSRSS_INITIALIZED 0xffff0007 #define ONEPARAM_ROUTINE_CSRSS_GUICHECK 0xffff0008 -#define ONEPARAM_ROUTINE_GETMENU 0xfffe0001 // usermode -#define ONEPARAM_ROUTINE_ISWINDOWUNICODE 0xfffe0002 -#define ONEPARAM_ROUTINE_GETCARETINFO 0xfffe0007 #define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0xfffe0008 #define ONEPARAM_ROUTINE_ISWINDOWINDESTROY 0xfffe000c #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e -#define ONEPARAM_ROUTINE_GETWINDOWINSTANCE 0xfffe0010 #define ONEPARAM_ROUTINE_CREATECURICONHANDLE 0xfffe0025 // CREATE_EMPTY_CURSOR_OBJECT ? #define ONEPARAM_ROUTINE_MSQSETWAKEMASK 0xfffe0027 #define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM routine ? #define TWOPARAM_ROUTINE_GETWINDOWRGNBOX 0xfffd0048 // user mode #define TWOPARAM_ROUTINE_GETWINDOWRGN 0xfffd0049 // user mode #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 -#define TWOPARAM_ROUTINE_SETMENUITEMRECT 0xfffd0051 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 #define MSQ_STATE_CAPTURE 0x1 #define MSQ_STATE_ACTIVE 0x2 @@ -3048,8 +3043,6 @@ #define MSQ_STATE_CARET 0x6 #define TWOPARAM_ROUTINE_SETCARETPOS 0xfffd0060 #define TWOPARAM_ROUTINE_REGISTERLOGONPROC 0xfffd0062 -#define TWOPARAM_ROUTINE_ROS_ISACTIVEICON 0x1001 -#define TWOPARAM_ROUTINE_ROS_NCDESTROY 0x1002 #define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE 0x1004 DWORD Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Wed Sep 16 00:13:16 2009 @@ -178,35 +178,6 @@ } } - case ONEPARAM_ROUTINE_GETMENU: - { - PWINDOW_OBJECT Window; - DWORD Result; - - if(!(Window = UserGetWindowObject((HWND)Param))) - { - RETURN( FALSE); - } - - Result = (DWORD)Window->Wnd->IDMenu; - - RETURN( Result); - } - - case ONEPARAM_ROUTINE_ISWINDOWUNICODE: - { - PWINDOW_OBJECT Window; - DWORD Result; - - Window = UserGetWindowObject((HWND)Param); - if(!Window) - { - RETURN( FALSE); - } - Result = Window->Wnd->Unicode; - RETURN( Result); - } - case ONEPARAM_ROUTINE_WINDOWFROMDC: RETURN( (DWORD)IntWindowFromDC((HDC)Param)); @@ -225,20 +196,6 @@ case ONEPARAM_ROUTINE_SETCARETBLINKTIME: RETURN( (DWORD)IntSetCaretBlinkTime((UINT)Param)); - - case ONEPARAM_ROUTINE_GETWINDOWINSTANCE: - { - PWINDOW_OBJECT Window; - DWORD Result; - - if(!(Window = UserGetWindowObject((HWND)Param))) - { - RETURN( FALSE); - } - - Result = (DWORD)Window->Wnd->hModule; - RETURN( Result); - } case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO: RETURN( (DWORD)MsqSetMessageExtraInfo((LPARAM)Param)); @@ -457,25 +414,6 @@ IntReleaseMenuObject(MenuObject); RETURN( Ret); } - case TWOPARAM_ROUTINE_SETMENUITEMRECT: - { - BOOL Ret; - SETMENUITEMRECT smir; - PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1); - if(!MenuObject) - RETURN( 0); - - if(!NT_SUCCESS(MmCopyFromCaller(&smir, (PVOID)Param2, sizeof(SETMENUITEMRECT)))) - { - IntReleaseMenuObject(MenuObject); - RETURN( 0); - } - - Ret = IntSetMenuItemRect(MenuObject, smir.uItem, smir.fByPosition, &smir.rcRect); - - IntReleaseMenuObject(MenuObject); - RETURN( (DWORD)Ret); - } case TWOPARAM_ROUTINE_SETGUITHRDHANDLE: {
15 years, 3 months
1
0
0
0
[dchapyshev] 43055: - Add validation a computer name - Set limit for computer name length
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Sep 15 17:36:35 2009 New Revision: 43055 URL:
http://svn.reactos.org/svn/reactos?rev=43055&view=rev
Log: - Add validation a computer name - Set limit for computer name length Modified: trunk/reactos/dll/win32/netid/lang/bg-BG.rc trunk/reactos/dll/win32/netid/lang/cs-CZ.rc trunk/reactos/dll/win32/netid/lang/de-DE.rc trunk/reactos/dll/win32/netid/lang/el-GR.rc trunk/reactos/dll/win32/netid/lang/en-US.rc trunk/reactos/dll/win32/netid/lang/es-ES.rc trunk/reactos/dll/win32/netid/lang/fr-FR.rc trunk/reactos/dll/win32/netid/lang/id-ID.rc trunk/reactos/dll/win32/netid/lang/it-IT.rc trunk/reactos/dll/win32/netid/lang/nl-NL.rc trunk/reactos/dll/win32/netid/lang/no-NO.rc trunk/reactos/dll/win32/netid/lang/pl-PL.rc trunk/reactos/dll/win32/netid/lang/ru-RU.rc trunk/reactos/dll/win32/netid/lang/sk-SK.rc trunk/reactos/dll/win32/netid/lang/uk-UA.rc trunk/reactos/dll/win32/netid/netid.c Modified: trunk/reactos/dll/win32/netid/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/bg-BG…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/bg-BG.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Çàáåëåæêà: Ñàìî óïðàâíèöèòå ìîãàò äà ïðîìåíÿò îïîçíàâàòåëèòå íà êîìïþòúðà." 1022 "Çàáåëåæêà: Îïîçíàâàòåëÿò íà êîìïþòúðà íå ìîæå äà áúäå ñìåíåí, çàùîòî:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Ïî&äðîáíîñòè >>" 3220 "<< &Ïî&äðîáíîñòè" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/cs-CZ…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/cs-CZ.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -76,6 +76,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Poznámka: Identifikaci tohoto poèítaèe mohou zmìnit pouze administrátoøi." 1022 "Poznámka: Identifikace poèítaèe nemùe být zmìnìna z následujících dùvodù:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Detaily >>" 3220 "<< &Detaily" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/de-DE…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/de-DE.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -78,6 +78,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Hinweis: Nur Administratoren können die Identifikation des Computers ändern." 1022 "Hinweis: Die Identifikation des Computers kann aus folgendem Grund nicht geändert werden:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Details >>" 3220 "<< &Details" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/el-GR…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/el-GR.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Details >>" 3220 "<< &Details" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/en-US…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Details >>" 3220 "<< &Details" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/es-ES…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/es-ES.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -75,6 +75,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Nota: Sólo los Administradores pueden cambiar la identificación de este equipo." 1022 "Nota: La identificación de este equipo no puede ser cambiada porque:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Detalles >>" 3220 "<< &Detalles" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/fr-FR…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/fr-FR.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note : Seuls les administrateurs peuvent modifier l'identification de cet ordinateur." 1022 "Note : L'identification de l'ordinateur ne peut pas être modifiée car :" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Détails >>" 3220 "<< &Détails" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/id-ID…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/id-ID.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Details >>" 3220 "<< &Details" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/it-IT…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/it-IT.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -71,6 +71,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Nota: Solo gli Amministratori possono cambiare l'identificazione di questo computer." 1022 "Nota: L'identificazione di questo computer non può essere cambiata perchè:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Dettagli >>" 3220 "<< &Dettagli" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/nl-NL…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/nl-NL.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Let op: Alleen Administrators mogen de indentificatie van deze computer aanpassen." 1022 "Let op: De indentificatie van deze computer kan niet gewijzigd worden omdat:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Details >>" 3220 "<< &Details" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/no-NO…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/no-NO.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "OBS: Bare administratorer kan endre identifisering for denne datamaskinen." 1022 "OBS: Identifisering for datamaskinen kunne ikke endres fordi:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Detaljer >>" 3220 "<< &Detaljer" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/pl-PL…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/pl-PL.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -78,6 +78,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Uwaga: Tylko Administratorzy mog¹ zmieniaæ identyfikator tego komputera." 1022 "Uwaga: Identyfikator tego komputera nie zosta³ zmieniony, powód:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Szczegó³y >>" 3220 "<< &Szczegó³y" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/ru-RU…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/ru-RU.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -70,6 +70,7 @@ 25 "Ìîæíî èçìåíèòü èìÿ è ïðèíàäëåæíîñòü ýòîãî êîìïüþòåðà. Èçìåíåíèÿ ìîãóò ïîâëèÿòü íà äîñòóï ê ñåòåâûì ðåñóðñàì." 1021 "Ïðèìå÷àíèå: òîëüêî àäìèíèñòðàòîðû ìîãóò èçìåíèòü èäåíòèôèêàöèþ ýòîãî êîìïüþòåðà." 1022 "Ïðèìå÷àíèå: èäåíòèôèêàöèÿ ýòîãî êîìïüþòåðà íå ìîæåò áûòü èçìåíåíà, ïîòîìó ÷òî:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Ïîäðîáíî >>" 3220 "<< &Ïîäðîáíî" 4000 "Èíôîðìàöèÿ" Modified: trunk/reactos/dll/win32/netid/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/sk-SK…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/sk-SK.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -77,6 +77,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Poznámka: Iba správcovia môu zmeni identifikáciu tohto poèítaèa." 1022 "Poznámka: Identifikácia poèítaèa nemôe by zmenená, lebo:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Podrobnosti >>" 3220 "<< &Podrobnosti" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/uk-UA…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/uk-UA.rc [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -78,6 +78,7 @@ 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Ïðèì³òêà: çì³íèòè ³äåíòèô³êàö³þ öüîãî êîìï'þòåðà ìîæóòü ëèøå àäì³í³ñòðàòîðè." 1022 "Ïðèì³òêà: çì³íèòè ³äåíòèô³êàö³þ öüîãî êîìï'þòåðà íåìîæëèâî, îñê³ëüêè:" + 1030 "The new computer name ""%s"" contains characters which are not allowed. Characters which are not allowed include ` ~ ! @ # $ %% ^ & * ( ) = + _ [ ] { } \\ | ; : ' \" , . < > / and ?" 3210 "&Ïîäðîáèö³ >>" 3220 "<< &Ïîäðîáèö³" 4000 "Information" Modified: trunk/reactos/dll/win32/netid/netid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/netid.c?re…
============================================================================== --- trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] Tue Sep 15 17:36:35 2009 @@ -14,6 +14,12 @@ #include <prsht.h> #include "resource.h" +static INT_PTR CALLBACK +NetIDPageProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam); + static HINSTANCE hDllInstance; @@ -55,6 +61,28 @@ EnableWindow(GetDlgItem(hDlg, 1004), FALSE); EnableWindow(GetDlgItem(hDlg, 116), FALSE); EnableWindow(GetDlgItem(hDlg, 1007), FALSE); +} + +static +BOOL +IsValidComputerName(LPCWSTR s) +{ + int i; + + for (i = 0; i <= wcslen(s); i++) + { + if (s[i] == L'!' || s[i] == L'@' || s[i] == L'#' || s[i] == L'$' + || s[i] == L'^' || s[i] == L'&' || s[i] == L'\\' || s[i] == L'|' + || s[i] == L')' || s[i] == L'(' || s[i] == L'{' || s[i] == L'"' + || s[i] == L'}' || s[i] == L'~' || s[i] == L'/' || s[i] == L'\'' + || s[i] == L'=' || s[i] == L':' || s[i] == L';' || s[i] == L'+' + || s[i] == L'<' || s[i] == L'>' || s[i] == L'?' || s[i] == L'[' + || s[i] == L']' || s[i] == L'`' || s[i] == L'%' || s[i] == L'_' + || s[i] == L'.') + return FALSE; + } + + return TRUE; } static @@ -74,6 +102,8 @@ if (LoadString(hDllInstance, 25, MsgText, sizeof(MsgText) / sizeof(TCHAR))) SetDlgItemText(hDlg, 1017, MsgText); + + SendMessage(GetDlgItem(hDlg, 1002), EM_SETLIMITTEXT, MAX_COMPUTERNAME_LENGTH, 0); if (GetComputerName(ComputerName, &Size)) { @@ -143,6 +173,16 @@ { switch (LOWORD(wParam)) { + case 1002: + if (HIWORD(wParam) == EN_CHANGE) + { + TCHAR szText[MAX_COMPUTERNAME_LENGTH + 1]; + + GetWindowText(GetDlgItem(hDlg, 1002), szText, MAX_COMPUTERNAME_LENGTH + 1); + SetDlgItemText(hDlg, 1001, szText); + } + break; + case 1008: /* Domain radio button */ case 1004: /* Workgroup radio button */ if (SendDlgItemMessage(hDlg, 1008, BM_GETCHECK, 0, 0) == BST_CHECKED) @@ -172,13 +212,24 @@ { if (_tcscmp(ComputerName, NewComputerName) != 0) { - if (!SetComputerName(NewComputerName)) + if (!IsValidComputerName(NewComputerName)) + { + TCHAR szText[MAX_PATH], szMsgText[MAX_PATH]; + + LoadString(hDllInstance, 1030, szText, sizeof(szText) / sizeof(TCHAR)); + + swprintf(szMsgText, szText, NewComputerName); + MessageBox(hDlg, szMsgText, NULL, MB_OK | MB_ICONERROR); + SetFocus(GetDlgItem(hDlg, 1002)); + break; + } + else if (!SetComputerName(NewComputerName)) { TCHAR szMsgText[MAX_PATH]; LoadString(hDllInstance, 4001, szMsgText, sizeof(szMsgText) / sizeof(TCHAR)); - MessageBox(0, szMsgText, NULL, MB_OK | MB_ICONERROR); + MessageBox(hDlg, szMsgText, NULL, MB_OK | MB_ICONERROR); } else { @@ -188,6 +239,8 @@ LoadString(hDllInstance, 24, szMsgText, sizeof(szMsgText) / sizeof(TCHAR)); MessageBox(hDlg, szMsgText, szMsgTitle, MB_OK | MB_ICONINFORMATION); + + NetIDPageProc(GetParent(hDlg), WM_INITDIALOG, 0, 0); } } }
15 years, 3 months
1
0
0
0
[jimtabor] 43054: - Update win32k tests.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Sep 15 17:25:37 2009 New Revision: 43054 URL:
http://svn.reactos.org/svn/reactos?rev=43054&view=rev
Log: - Update win32k tests. Modified: trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.def Modified: trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.def URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32kdll/w32kdll_…
============================================================================== --- trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.def [iso-8859-1] (original) +++ trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.def [iso-8859-1] Tue Sep 15 17:25:37 2009 @@ -497,7 +497,7 @@ NtUserRealWaitMessageEx@8 NtUserRedrawWindow@16 NtUserRegisterClassExWOW@28 -NtUserRegisterUserApiHook@8 +NtUserRegisterUserApiHook@16 NtUserRegisterHotKey@16 NtUserRegisterRawInputDevices@12 NtUserRegisterTasklist@4
15 years, 3 months
1
0
0
0
[jimtabor] 43053: [User32] Theme Support Interface - This is part 1, Tested with Wine user32 tests, Seamonkey, FireFox and AbiWord. [References:] - http://www.reactos.org/wiki/RegisterUserApiHook - http://www.codeproject.com/KB/miscctrl/uxtheme.aspx - http://opcode0x90.wordpress.com/2007/05/11/user32__clientloadlibraryx/ - US Patent 6992681 and 6762767 - Theme aware management using fusion
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Sep 15 17:24:09 2009 New Revision: 43053 URL:
http://svn.reactos.org/svn/reactos?rev=43053&view=rev
Log: [User32] Theme Support Interface - This is part 1, Tested with Wine user32 tests, Seamonkey, FireFox and AbiWord. [References:] -
http://www.reactos.org/wiki/RegisterUserApiHook
-
http://www.codeproject.com/KB/miscctrl/uxtheme.aspx
-
http://opcode0x90.wordpress.com/2007/05/11/user32__clientloadlibraryx/
- US Patent 6992681 and 6762767 - Theme aware management using fusion Added: trunk/reactos/dll/win32/user32/misc/usrapihk.c (with props) Modified: trunk/reactos/dll/win32/user32/controls/scrollbar.c trunk/reactos/dll/win32/user32/include/user32.h trunk/reactos/dll/win32/user32/include/window.h trunk/reactos/dll/win32/user32/misc/desktop.c trunk/reactos/dll/win32/user32/misc/dllmain.c trunk/reactos/dll/win32/user32/misc/stubs.c trunk/reactos/dll/win32/user32/user32.pspec trunk/reactos/dll/win32/user32/user32.rbuild trunk/reactos/dll/win32/user32/windows/defwnd.c trunk/reactos/dll/win32/user32/windows/draw.c trunk/reactos/dll/win32/user32/windows/message.c trunk/reactos/dll/win32/user32/windows/nonclient.c trunk/reactos/dll/win32/user32/windows/paint.c trunk/reactos/dll/win32/user32/windows/window.c trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c trunk/reactos/subsystems/win32/win32k/w32ksvc.db Modified: trunk/reactos/dll/win32/user32/controls/scrollbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
============================================================================== --- trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1475,17 +1475,71 @@ /* * @implemented */ +BOOL WINAPI EnableScrollBar( HWND hwnd, UINT nBar, UINT flags ) +{ + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return NtUserEnableScrollBar(hwnd, nBar, flags); + + _SEH2_TRY + { + Ret = guah.EnableScrollBar(hwnd, nBar, flags); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} + +BOOL WINAPI +RealGetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info) +{ + if (SB_CTL == SBType) + { + return SendMessageW(Wnd, SBM_GETSCROLLINFO, 0, (LPARAM) Info); + } + else + { + return NtUserGetScrollInfo(Wnd, SBType, Info); + } +} + +/* + * @implemented + */ BOOL WINAPI GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info) { - if (SB_CTL == SBType) - { - return SendMessageW(Wnd, SBM_GETSCROLLINFO, 0, (LPARAM) Info); - } - else - { - return NtUserGetScrollInfo(Wnd, SBType, Info); - } + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealGetScrollInfo(Wnd, SBType, Info); + + _SEH2_TRY + { + Ret = guah.GetScrollInfo(Wnd, SBType, Info); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; } /* @@ -1526,20 +1580,48 @@ } } +INT WINAPI +RealSetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw) +{ + if (SB_CTL == SBType) + { + return SendMessageW(Wnd, SBM_SETSCROLLINFO, (WPARAM) bRedraw, (LPARAM) Info); + } + else + { + return NtUserSetScrollInfo(Wnd, SBType, Info, bRedraw); + } +} + /* * @implemented */ INT WINAPI SetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw) { - if (SB_CTL == SBType) - { - return SendMessageW(Wnd, SBM_SETSCROLLINFO, (WPARAM) bRedraw, (LPARAM) Info); - } - else - { - return NtUserSetScrollInfo(Wnd, SBType, Info, bRedraw); - } + BOOL Hook; + INT Ret = 0; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealSetScrollInfo(Wnd, SBType, Info, bRedraw); + + _SEH2_TRY + { + Ret = guah.SetScrollInfo(Wnd, SBType, Info, bRedraw); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; + } /* Modified: trunk/reactos/dll/win32/user32/include/user32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
============================================================================== --- trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -42,6 +42,76 @@ /* SEH Support with PSEH */ #include <pseh/pseh2.h> +/* Temporarily in here for now. */ +typedef struct _USERAPIHOOKINFO +{ + DWORD m_size; + LPCWSTR m_dllname1; + LPCWSTR m_funname1; + LPCWSTR m_dllname2; + LPCWSTR m_funname2; +} USERAPIHOOKINFO,*PUSERAPIHOOKINFO; + +typedef LRESULT(CALLBACK *WNDPROC_OWP)(HWND,UINT,WPARAM,LPARAM,ULONG_PTR,PDWORD); + +typedef struct _UAHOWP +{ + BYTE* MsgBitArray; + DWORD Size; +} UAHOWP, *PUAHOWP; + +typedef struct tagUSERAPIHOOK +{ + DWORD size; + WNDPROC DefWindowProcA; + WNDPROC DefWindowProcW; + UAHOWP DefWndProcArray; + FARPROC GetScrollInfo; + FARPROC SetScrollInfo; + FARPROC EnableScrollBar; + FARPROC AdjustWindowRectEx; + FARPROC SetWindowRgn; + WNDPROC_OWP PreWndProc; + WNDPROC_OWP PostWndProc; + UAHOWP WndProcArray; + WNDPROC_OWP PreDefDlgProc; + WNDPROC_OWP PostDefDlgProc; + UAHOWP DlgProcArray; + FARPROC GetSystemMetrics; + FARPROC SystemParametersInfoA; + FARPROC SystemParametersInfoW; + FARPROC ForceResetUserApiHook; + FARPROC DrawFrameControl; + FARPROC DrawCaption; + FARPROC MDIRedrawFrame; + FARPROC GetRealWindowOwner; +} USERAPIHOOK, *PUSERAPIHOOK; + +typedef enum _UAPIHK +{ + uahLoadInit, + uahStop, + uahShutdown +} UAPIHK, *PUAPIHK; + +extern RTL_CRITICAL_SECTION gcsUserApiHook; +extern USERAPIHOOK guah; +typedef DWORD (CALLBACK * USERAPIHOOKPROC)(UAPIHK State, ULONG_PTR Info); +BOOL FASTCALL BeginIfHookedUserApiHook(VOID); +BOOL FASTCALL EndUserApiHook(VOID); +BOOL FASTCALL IsInsideUserApiHook(VOID); +VOID FASTCALL ResetUserApiHook(PUSERAPIHOOK); +BOOL FASTCALL IsMsgOverride(UINT,PUAHOWP); + +#define LOADUSERAPIHOOK \ + if (!gfServerProcess && \ + !IsInsideUserApiHook() && \ + (gpsi->dwSRVIFlags & SRVINFO_APIHOOK) && \ + !RtlIsThreadWithinLoaderCallout()) \ + { \ + NtUserCallNoParam(NOPARAM_ROUTINE_LOADUSERAPIHOOK); \ + } \ + /* FIXME: Use ntgdi.h then cleanup... */ LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *); BOOL FASTCALL IsMetaFile(HDC); @@ -49,6 +119,7 @@ extern PPROCESSINFO g_ppi; extern ULONG_PTR g_ulSharedDelta; extern PSERVERINFO gpsi; +extern BOOL gfServerProcess; static __inline PVOID SharedPtrToUser(PVOID Ptr) Modified: trunk/reactos/dll/win32/user32/include/window.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/w…
============================================================================== --- trunk/reactos/dll/win32/user32/include/window.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/include/window.h [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -45,7 +45,7 @@ DWORD SCROLL_HitTest( HWND hwnd, INT nBar, POINT pt, BOOL bDragging ); -LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, +LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); @@ -66,3 +66,4 @@ HWND* WIN_ListChildren (HWND hWndparent); ULONG_PTR FASTCALL IntGetWndProc(PWND, BOOL); +DWORD WINAPI GetRealWindowOwner(HWND); Modified: trunk/reactos/dll/win32/user32/misc/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/desk…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/desktop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/desktop.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -90,18 +90,49 @@ #undef COPYS } +int WINAPI +RealGetSystemMetrics(int nIndex) +{ + GetConnected(); +// FIXME("Global Server Data -> %x\n",gpsi); + if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0; + return gpsi->aiSysMet[nIndex]; +} + /* * @implemented */ int WINAPI GetSystemMetrics(int nIndex) { - GetConnected(); -// FIXME("Global Sever Data -> %x\n",gpsi); - if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0; - return gpsi->aiSysMet[nIndex]; -} - + BOOL Hook; + int Ret = 0; + + if (!gpsi) // Fixme! Hax! Need Timos delay load support? + { + return RealGetSystemMetrics(nIndex); + } + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealGetSystemMetrics(nIndex); + + _SEH2_TRY + { + Ret = guah.GetSystemMetrics(nIndex); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} /* * @unimplemented @@ -110,11 +141,9 @@ { return SystemParametersInfoA(SPI_SETDESKWALLPAPER,0,(PVOID)filename,TRUE); } -/* - * @implemented - */ + BOOL WINAPI -SystemParametersInfoA(UINT uiAction, +RealSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni) @@ -275,6 +304,58 @@ return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni); } +BOOL WINAPI +RealSystemParametersInfoW(UINT uiAction, + UINT uiParam, + PVOID pvParam, + UINT fWinIni) +{ + switch(uiAction) + { + + case SPI_SETDESKWALLPAPER: + { + UNICODE_STRING ustrWallpaper; + + RtlInitUnicodeString(&ustrWallpaper, pvParam); + return NtUserSystemParametersInfo(SPI_SETDESKWALLPAPER, uiParam, &ustrWallpaper, fWinIni); + } + } + return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni); +} + + +/* + * @implemented + */ +BOOL WINAPI +SystemParametersInfoA(UINT uiAction, + UINT uiParam, + PVOID pvParam, + UINT fWinIni) +{ + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealSystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni); + + _SEH2_TRY + { + Ret = guah.SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} /* * @implemented @@ -285,20 +366,28 @@ PVOID pvParam, UINT fWinIni) { - switch(uiAction) - { - - case SPI_SETDESKWALLPAPER: - { - UNICODE_STRING ustrWallpaper; - - RtlInitUnicodeString(&ustrWallpaper, pvParam); - return NtUserSystemParametersInfo(SPI_SETDESKWALLPAPER, uiParam, &ustrWallpaper, fWinIni); - } - } - return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni); -} - + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealSystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni); + + _SEH2_TRY + { + Ret = guah.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} /* * @implemented Modified: trunk/reactos/dll/win32/user32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/dllm…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -13,6 +13,7 @@ PUSER_HANDLE_ENTRY gHandleEntries = NULL; PSERVERINFO gpsi = NULL; ULONG_PTR g_ulSharedDelta; +BOOL gfServerProcess = FALSE; WCHAR szAppInit[KEY_LENGTH]; @@ -244,6 +245,10 @@ gpsi = SharedPtrToUser(UserCon.siClient.psi); gHandleTable = SharedPtrToUser(UserCon.siClient.aheList); gHandleEntries = SharedPtrToUser(gHandleTable->handles); + + RtlInitializeCriticalSection(&gcsUserApiHook); + gfServerProcess = TRUE; // FIXME HAX! Used in CsrClientConnectToServer(,,,,&gfServerProcess); + //ERR("1 SI 0x%x : HT 0x%x : D 0x%x\n", UserCon.siClient.psi, UserCon.siClient.aheList, g_ulSharedDelta); /* Allocate an index for user32 thread local data. */ Modified: trunk/reactos/dll/win32/user32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/stub…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -485,25 +485,6 @@ return FALSE; } -typedef BOOL (CALLBACK *THEME_HOOK_FUNC) (DWORD state,PVOID arg2); //return type and 2nd parameter unknown -/* - * @unimplemented - */ -BOOL WINAPI RegisterUserApiHook(HINSTANCE instance,THEME_HOOK_FUNC proc) -{ - UNIMPLEMENTED; - return FALSE; -} - -/* - * @unimplemented - */ -BOOL WINAPI UnregisterUserApiHook(VOID) -{ - UNIMPLEMENTED; - return FALSE; -} - /* * @unimplemented */ Added: trunk/reactos/dll/win32/user32/misc/usrapihk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/usra…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/usrapihk.c (added) +++ trunk/reactos/dll/win32/user32/misc/usrapihk.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1,0 +1,397 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS user32.dll + * FILE: dll/win32/user32/misc/usrapihk.c + * PURPOSE: User32.dll User32 Api Hook interface and support functions + * PROGRAMMER: + * + * + * + * Information: + *
http://www.reactos.org/wiki/RegisterUserApiHook
+ * + */ +#include <user32.h> + +#include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(user32); + +BOOL WINAPI RealAdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD); +LRESULT WINAPI RealDefWindowProcA(HWND,UINT,WPARAM,LPARAM); +LRESULT WINAPI RealDefWindowProcW(HWND,UINT,WPARAM,LPARAM); +BOOL WINAPI RealDrawFrameControl(HDC,LPRECT,UINT,UINT); +BOOL WINAPI RealGetScrollInfo(HWND,INT,LPSCROLLINFO); +int WINAPI RealGetSystemMetrics(int); +BOOL WINAPI RealMDIRedrawFrame(HWND,DWORD); +INT WINAPI RealSetScrollInfo(HWND,int,LPCSCROLLINFO,BOOL); +BOOL WINAPI RealSystemParametersInfoA(UINT,UINT,PVOID,UINT); +BOOL WINAPI RealSystemParametersInfoW(UINT,UINT,PVOID,UINT); + +/* GLOBALS *******************************************************************/ + +DWORD gcLoadUserApiHook = 0; +LONG gcCallUserApiHook = 0; +DWORD gfUserApiHook; +HINSTANCE ghmodUserApiHook = NULL; +USERAPIHOOKPROC gpfnInitUserApi; +RTL_CRITICAL_SECTION gcsUserApiHook; +// API Hooked Message group bitmaps +BYTE grgbDwpLiteHookMsg[128]; +BYTE grgbWndLiteHookMsg[128]; +BYTE grgbDlgLiteHookMsg[128]; + +/* INTERNAL ******************************************************************/ + +/* + Pre and Post Message handler stub. + */ +LRESULT +WINAPI +DefaultOWP(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR lResult, PDWORD pData) +{ + return 0; +} + +/* + Check for API Hooked Message Overrides. Using message bitmapping.. One bit + corresponds to one message number. + */ +BOOL +FASTCALL +IsMsgOverride( UINT Msg, PUAHOWP puaowpOverride) +{ + UINT nMsg = Msg / 8; // Group Indexed, (Msg 1024) / 8 = (0 -> 127) bytes Max + + if ( puaowpOverride && nMsg < puaowpOverride->Size ) + { + return (puaowpOverride->MsgBitArray[nMsg] & (1 << (Msg & WM_SETFOCUS))); + } + return FALSE; +} + +VOID +FASTCALL +CopyMsgMask(PUAHOWP Dest, PUAHOWP Src, PVOID hkmsg, DWORD Size) +{ + DWORD nSize; + + if ( Src && Src->Size > 0 ) + { + Dest->MsgBitArray = hkmsg; + nSize = Src->Size; + if ( Size < nSize) nSize = Size; + Dest->Size = nSize; + RtlCopyMemory(Dest->MsgBitArray, Src->MsgBitArray, nSize); + return; + } + + Dest->MsgBitArray = NULL; + Dest->Size = 0; + return; +} + + +BOOL +FASTCALL +IsInsideUserApiHook(VOID) +{ + if ( ghmodUserApiHook && gfUserApiHook ) return TRUE; + return FALSE; +} + +BOOL +FASTCALL +BeginIfHookedUserApiHook(VOID) +{ + InterlockedIncrement(&gcCallUserApiHook); + if (IsInsideUserApiHook()) return TRUE; + + InterlockedDecrement(&gcCallUserApiHook); + return FALSE; +} + +BOOL +FASTCALL +ForceResetUserApiHook(HINSTANCE hInstance) +{ + if ( ghmodUserApiHook == hInstance && + RtlIsThreadWithinLoaderCallout() ) + { + ResetUserApiHook(&guah); + gpfnInitUserApi = NULL; + return TRUE; + } + return FALSE; +} + +VOID +FASTCALL +ResetUserApiHook(PUSERAPIHOOK puah) +{ + // Setup Structure..... + puah->size = sizeof(USERAPIHOOK); + puah->DefWindowProcA = (WNDPROC)RealDefWindowProcA; + puah->DefWindowProcW = (WNDPROC)RealDefWindowProcW; + puah->DefWndProcArray.MsgBitArray = NULL; + puah->DefWndProcArray.Size = 0; + puah->GetScrollInfo = (FARPROC)RealGetScrollInfo; + puah->SetScrollInfo = (FARPROC)RealSetScrollInfo; + puah->EnableScrollBar = (FARPROC)NtUserEnableScrollBar; + puah->AdjustWindowRectEx = (FARPROC)RealAdjustWindowRectEx; + puah->SetWindowRgn = (FARPROC)NtUserSetWindowRgn; + puah->PreWndProc = (WNDPROC_OWP)DefaultOWP; + puah->PostWndProc = (WNDPROC_OWP)DefaultOWP; + puah->WndProcArray.MsgBitArray = NULL; + puah->WndProcArray.Size = 0; + puah->PreDefDlgProc = (WNDPROC_OWP)DefaultOWP; + puah->PostDefDlgProc = (WNDPROC_OWP)DefaultOWP; + puah->DlgProcArray.MsgBitArray = NULL; + puah->DlgProcArray.Size = 0; + puah->GetSystemMetrics = (FARPROC)RealGetSystemMetrics; + puah->SystemParametersInfoA = (FARPROC)RealSystemParametersInfoA; + puah->SystemParametersInfoW = (FARPROC)RealSystemParametersInfoW; + puah->ForceResetUserApiHook = (FARPROC)ForceResetUserApiHook; + puah->DrawFrameControl = (FARPROC)RealDrawFrameControl; + puah->DrawCaption = (FARPROC)NtUserDrawCaption; + puah->MDIRedrawFrame = (FARPROC)RealMDIRedrawFrame; + puah->GetRealWindowOwner = (FARPROC)GetRealWindowOwner; +} + +BOOL +FASTCALL +EndUserApiHook(VOID) +{ + HMODULE hModule; + USERAPIHOOKPROC pfn; + BOOL Ret = FALSE; + + if ( !InterlockedDecrement(&gcCallUserApiHook) ) + { + if ( !gcLoadUserApiHook ) + { + RtlEnterCriticalSection(&gcsUserApiHook); + + pfn = gpfnInitUserApi; + hModule = ghmodUserApiHook; + ghmodUserApiHook = NULL; + gpfnInitUserApi = NULL; + + RtlLeaveCriticalSection(&gcsUserApiHook); + + if ( pfn ) Ret = pfn(uahStop, 0); + + if ( hModule ) Ret = FreeLibrary(hModule); + } + } + return Ret; +} + +BOOL +WINAPI +ClearUserApiHook(HINSTANCE hInstance) +{ + HMODULE hModule; + USERAPIHOOKPROC pfn = NULL, pfn1 = NULL; + + RtlEnterCriticalSection(&gcsUserApiHook); + hModule = ghmodUserApiHook; + if ( ghmodUserApiHook == hInstance ) + { + pfn1 = gpfnInitUserApi; + if ( --gcLoadUserApiHook == 1 ) + { + gfUserApiHook = 0; + ResetUserApiHook(&guah); + if ( gcCallUserApiHook ) + { + hInstance = NULL; + pfn1 = NULL; + pfn = gpfnInitUserApi; + gcLoadUserApiHook = 1; + } + else + { + hInstance = hModule; + ghmodUserApiHook = NULL; + gpfnInitUserApi = NULL; + } + } + } + RtlLeaveCriticalSection(&gcsUserApiHook); + + if ( pfn ) + { + pfn(uahShutdown, 0); // Shutdown. + + RtlEnterCriticalSection(&gcsUserApiHook); + pfn1 = gpfnInitUserApi; + + if ( --gcLoadUserApiHook == 1 ) + { + if ( gcCallUserApiHook ) + { + hInstance = NULL; + pfn1 = NULL; + } + else + { + hInstance = ghmodUserApiHook; + ghmodUserApiHook = NULL; + gpfnInitUserApi = NULL; + } + } + RtlLeaveCriticalSection(&gcsUserApiHook); + } + + if ( pfn1 ) pfn1(uahStop, 0); + + return hInstance != 0; +} + +BOOL +WINAPI +InitUserApiHook(HINSTANCE hInstance, USERAPIHOOKPROC pfn) +{ + USERAPIHOOK uah; + + ResetUserApiHook(&uah); + + RtlEnterCriticalSection(&gcsUserApiHook); + + if (!pfn(uahLoadInit,(ULONG_PTR)&uah) || // Swap data, User32 to and Uxtheme from! + uah.ForceResetUserApiHook != (FARPROC)ForceResetUserApiHook || + uah.size <= 0 ) + { + RtlLeaveCriticalSection(&gcsUserApiHook); + return FALSE; + } + + if ( ghmodUserApiHook ) + { + if ( ghmodUserApiHook != hInstance ) + { + RtlLeaveCriticalSection(&gcsUserApiHook); + pfn(uahStop, 0); + return FALSE; + } + gcLoadUserApiHook++; + } + else + { + ghmodUserApiHook = hInstance; + // Do not over write GetRealWindowOwner. + RtlCopyMemory(&guah, &uah, sizeof(USERAPIHOOK) - sizeof(LONG)); + gpfnInitUserApi = pfn; + gcLoadUserApiHook = 1; + gfUserApiHook = 1; + // Copy Message Masks + CopyMsgMask(&guah.DefWndProcArray, + &uah.DefWndProcArray, + &grgbDwpLiteHookMsg, + sizeof(grgbDwpLiteHookMsg)); + + CopyMsgMask(&guah.WndProcArray, + &uah.WndProcArray, + &grgbWndLiteHookMsg, + sizeof(grgbWndLiteHookMsg)); + + CopyMsgMask(&guah.DlgProcArray, + &uah.DlgProcArray, + &grgbDlgLiteHookMsg, + sizeof(grgbDlgLiteHookMsg)); + } + RtlLeaveCriticalSection(&gcsUserApiHook); + return TRUE; +} + +BOOL +WINAPI +RealMDIRedrawFrame(HWND hWnd, DWORD flags) +{ + return (BOOL)NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_REDRAWFRAME); +} + +BOOL +WINAPI +MDIRedrawFrame(HWND hWnd, DWORD flags) +{ + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealMDIRedrawFrame(hWnd, flags); + + _SEH2_TRY + { + Ret = guah.MDIRedrawFrame(hWnd, flags); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} + +USERAPIHOOK guah = +{ + sizeof(USERAPIHOOK), + (WNDPROC)RealDefWindowProcA, + (WNDPROC)RealDefWindowProcW, + {NULL, 0}, + (FARPROC)RealGetScrollInfo, + (FARPROC)RealSetScrollInfo, + (FARPROC)NtUserEnableScrollBar, + (FARPROC)RealAdjustWindowRectEx, + (FARPROC)NtUserSetWindowRgn, + (WNDPROC_OWP)DefaultOWP, + (WNDPROC_OWP)DefaultOWP, + {NULL, 0}, + (WNDPROC_OWP)DefaultOWP, + (WNDPROC_OWP)DefaultOWP, + {NULL, 0}, + (FARPROC)RealGetSystemMetrics, + (FARPROC)RealSystemParametersInfoA, + (FARPROC)RealSystemParametersInfoW, + (FARPROC)ForceResetUserApiHook, + (FARPROC)RealDrawFrameControl, + (FARPROC)NtUserDrawCaption, + (FARPROC)RealMDIRedrawFrame, + (FARPROC)GetRealWindowOwner, +}; + +/* FUNCTIONS *****************************************************************/ + +/* + * @implemented + */ +BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah) +{ + UNICODE_STRING m_dllname1; + UNICODE_STRING m_funname1; + + if (puah->m_size == sizeof(USERAPIHOOKINFO)) + { + WARN("RegisterUserApiHook: %S and %S",puah->m_dllname1, puah->m_funname1); + RtlInitUnicodeString(&m_dllname1, puah->m_dllname1); + RtlInitUnicodeString(&m_funname1, puah->m_funname1); + return NtUserRegisterUserApiHook( &m_dllname1, &m_funname1, 0, 0); + } + return FALSE; +} + +/* + * @implemented + */ +BOOL WINAPI UnregisterUserApiHook(VOID) +{ + // Direct call to Win32k! Here only as a prototype..... + UNIMPLEMENTED; + return FALSE; +} Propchange: trunk/reactos/dll/win32/user32/misc/usrapihk.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/user32/misc/usrapihk.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: trunk/reactos/dll/win32/user32/user32.pspec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/user32.ps…
============================================================================== --- trunk/reactos/dll/win32/user32/user32.pspec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/user32.pspec [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -194,7 +194,7 @@ @ stdcall EditWndProc(long long long long) EditWndProcA @ stdcall EmptyClipboard() NtUserEmptyClipboard @ stdcall EnableMenuItem(long long long) -@ stdcall EnableScrollBar(long long long) NtUserEnableScrollBar +@ stdcall EnableScrollBar(long long long) @ stdcall EnableWindow(long long) @ stdcall EndDeferWindowPos(long) @ stdcall EndDialog(long long) @@ -557,7 +557,7 @@ @ stdcall RegisterShellHookWindow(long) @ stdcall RegisterSystemThread(long long) @ stdcall RegisterTasklist(long) NtUserRegisterTasklist -@ stub RegisterUserApiHook +@ stdcall RegisterUserApiHook(ptr) @ stdcall RegisterWindowMessageA(str) @ stdcall RegisterWindowMessageW(wstr) @ stdcall ReleaseCapture() @@ -711,7 +711,7 @@ @ stdcall UnregisterDeviceNotification(long) @ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey @ stub UnregisterMessagePumpHook -@ stub UnregisterUserApiHook +@ stdcall UnregisterUserApiHook() NtUserUnregisterUserApiHook @ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) @ stdcall UpdateLayeredWindowIndirect(long ptr) @ stdcall UpdatePerUserSystemParameters(long long) Modified: trunk/reactos/dll/win32/user32/user32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/user32.rb…
============================================================================== --- trunk/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/user32.rbuild [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -43,6 +43,7 @@ <file>rtlstr.c</file> <file>stubs.c</file> <file>timer.c</file> + <file>usrapihk.c</file> <file>winhelp.c</file> <file>winsta.c</file> <file>wsprintf.c</file> Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1879,10 +1879,10 @@ LRESULT WINAPI -DefWindowProcA(HWND hWnd, - UINT Msg, - WPARAM wParam, - LPARAM lParam) +RealDefWindowProcA(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) { LRESULT Result = 0; PWND Wnd; @@ -2032,10 +2032,10 @@ LRESULT WINAPI -DefWindowProcW(HWND hWnd, - UINT Msg, - WPARAM wParam, - LPARAM lParam) +RealDefWindowProcW(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) { LRESULT Result = 0; PWND Wnd; @@ -2175,3 +2175,68 @@ return Result; } +LRESULT WINAPI +DefWindowProcA(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) +{ + BOOL Hook, msgOverride; + LRESULT Result = 0; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + if (Hook) + msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray); + + /* Bypass SEH and go direct. */ + if (!Hook || !msgOverride) + return RealDefWindowProcA(hWnd, Msg, wParam, lParam); + + _SEH2_TRY + { + Result = guah.DefWindowProcA(hWnd, Msg, wParam, lParam); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Result; +} + +LRESULT WINAPI +DefWindowProcW(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) +{ + BOOL Hook, msgOverride; + LRESULT Result = 0; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + if (Hook) + msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray); + + /* Bypass SEH and go direct. */ + if (!Hook || !msgOverride) + return RealDefWindowProcW(hWnd, Msg, wParam, lParam); + + _SEH2_TRY + { + Result = guah.DefWindowProcW(hWnd, Msg, wParam, lParam); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Result; +} Modified: trunk/reactos/dll/win32/user32/windows/draw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/draw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/draw.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1437,7 +1437,7 @@ * @implemented */ BOOL WINAPI -DrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState) +RealDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState) { if (GetMapMode(hDC) != MM_TEXT) return FALSE; @@ -1461,6 +1461,32 @@ return FALSE; } +BOOL WINAPI +DrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState) +{ + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealDrawFrameControl(hDC, rc, uType, uState); + + _SEH2_TRY + { + Ret = guah.DrawFrameControl(hDC, rc, uType, uState); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} + /* * @implemented */ Modified: trunk/reactos/dll/win32/user32/windows/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1138,6 +1138,7 @@ LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, + PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, @@ -1145,7 +1146,9 @@ { MSG AnsiMsg; MSG UnicodeMsg; - LRESULT Result; + BOOL Hook = FALSE, MsgOverride = FALSE, Dialog; + LRESULT Result = 0, PreResult = 0; + DWORD Data = 0; if (WndProc == NULL) { @@ -1153,33 +1156,116 @@ return FALSE; } + if (pWnd) + Dialog = (pWnd->fnid == FNID_DIALOG); + else + Dialog = FALSE; + + Hook = BeginIfHookedUserApiHook(); + if (Hook) + { + if (!Dialog) + MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray); + else + MsgOverride = IsMsgOverride( Msg, &guah.DlgProcArray); + } + if (IsAnsiProc) - { + { UnicodeMsg.hwnd = hWnd; UnicodeMsg.message = Msg; UnicodeMsg.wParam = wParam; UnicodeMsg.lParam = lParam; if (! MsgiUnicodeToAnsiMessage(&AnsiMsg, &UnicodeMsg)) - { - return FALSE; - } + { + goto Exit; + } + + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + PreResult = guah.PreWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data ); + else + PreResult = guah.PreDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + + if (PreResult) goto Exit; + Result = WndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam); + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + guah.PostWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data ); + else + guah.PostDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + if (! MsgiUnicodeToAnsiReply(&AnsiMsg, &UnicodeMsg, &Result)) - { - return FALSE; - } - return Result; - } + { + goto Exit; + } + } else - { - return WndProc(hWnd, Msg, wParam, lParam); - } + { + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + else + PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + + if (PreResult) goto Exit; + + Result = WndProc(hWnd, Msg, wParam, lParam); + + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + guah.PostWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + else + guah.PostDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + } + +Exit: + if (Hook) EndUserApiHook(); + return Result; } static LRESULT FASTCALL IntCallWindowProcA(BOOL IsAnsiProc, WNDPROC WndProc, + PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, @@ -1187,7 +1273,9 @@ { MSG AnsiMsg; MSG UnicodeMsg; - LRESULT Result; + BOOL Hook = FALSE, MsgOverride = FALSE, Dialog; + LRESULT Result = 0, PreResult = 0; + DWORD Data = 0; if (WndProc == NULL) { @@ -1195,29 +1283,111 @@ return FALSE; } + if (pWnd) + Dialog = (pWnd->fnid == FNID_DIALOG); + else + Dialog = FALSE; + + Hook = BeginIfHookedUserApiHook(); + if (Hook) + { + if (!Dialog) + MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray); + else + MsgOverride = IsMsgOverride( Msg, &guah.DlgProcArray); + } + if (IsAnsiProc) - { - return WndProc(hWnd, Msg, wParam, lParam); - } + { + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + else + PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + + if (PreResult) goto Exit; + + Result = WndProc(hWnd, Msg, wParam, lParam); + + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + guah.PostWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + else + guah.PostDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + } else - { + { AnsiMsg.hwnd = hWnd; AnsiMsg.message = Msg; AnsiMsg.wParam = wParam; AnsiMsg.lParam = lParam; if (! MsgiAnsiToUnicodeMessage(&UnicodeMsg, &AnsiMsg)) - { - return FALSE; - } + { + goto Exit; + } + + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + PreResult = guah.PreWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data ); + else + PreResult = guah.PreDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + + if (PreResult) goto Exit; + Result = WndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam); + if (Hook && MsgOverride) + { + _SEH2_TRY + { + if (!Dialog) + guah.PostWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data ); + else + guah.PostDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data ); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + } + if (! MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result)) - { - return FALSE; - } - return Result; - } + { + goto Exit; + } + } + +Exit: + if (Hook) EndUserApiHook(); + return Result; } @@ -1267,9 +1437,9 @@ the same. */ if (!Ansi) - return IntCallWindowProcW(IsAnsi, WndProc, hWnd, Msg, wParam, lParam); + return IntCallWindowProcW(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam); else - return IntCallWindowProcA(IsAnsi, WndProc, hWnd, Msg, wParam, lParam); + return IntCallWindowProcA(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam); } @@ -1283,6 +1453,7 @@ WPARAM wParam, LPARAM lParam) { + PWND pWnd; PCALLPROCDATA CallProc; if (lpPrevWndFunc == NULL) @@ -1291,8 +1462,10 @@ return 0; } + pWnd = ValidateHwnd(hWnd); + if (!IsCallProcHandle(lpPrevWndFunc)) - return IntCallWindowProcA(TRUE, lpPrevWndFunc, hWnd, Msg, wParam, lParam); + return IntCallWindowProcA(TRUE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam); else { CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc); @@ -1300,6 +1473,7 @@ { return IntCallWindowProcA(!(CallProc->wType & UserGetCPDA2U), CallProc->pfnClientPrevious, + pWnd, hWnd, Msg, wParam, @@ -1324,6 +1498,7 @@ WPARAM wParam, LPARAM lParam) { + PWND pWnd; PCALLPROCDATA CallProc; /* FIXME - can the first parameter be NULL? */ @@ -1333,8 +1508,10 @@ return 0; } + pWnd = ValidateHwnd(hWnd); + if (!IsCallProcHandle(lpPrevWndFunc)) - return IntCallWindowProcW(FALSE, lpPrevWndFunc, hWnd, Msg, wParam, lParam); + return IntCallWindowProcW(FALSE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam); else { CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc); @@ -1342,6 +1519,7 @@ { return IntCallWindowProcW(!(CallProc->wType & UserGetCPDA2U), CallProc->pfnClientPrevious, + pWnd, hWnd, Msg, wParam, @@ -1821,13 +1999,14 @@ MSG UMMsg, KMMsg; NTUSERSENDMESSAGEINFO Info; LRESULT Result; + PWND Window; + PTHREADINFO ti = GetW32ThreadInfo(); + + Window = ValidateHwnd(Wnd); + if (!Window) return FALSE; if (Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST)) { - PWND Window; - PTHREADINFO ti = GetW32ThreadInfo(); - - Window = ValidateHwnd(Wnd); if (Window != NULL && Window->head.pti == ti && !IsThreadHooked(GetWin32ClientInfo())) { /* NOTE: We can directly send messages to the window procedure @@ -1861,6 +2040,7 @@ /* We need to send the message ourselves */ Result = IntCallWindowProcW( Info.Ansi, Info.Proc, + Window, UMMsg.hwnd, UMMsg.message, UMMsg.wParam, @@ -1885,13 +2065,14 @@ MSG KMMsg; LRESULT Result; NTUSERSENDMESSAGEINFO Info; + PWND Window; + PTHREADINFO ti = GetW32ThreadInfo(); + + Window = ValidateHwnd(Wnd); + if (!Window) return FALSE; if (Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST)) { - PWND Window; - PTHREADINFO ti = GetW32ThreadInfo(); - - Window = ValidateHwnd(Wnd); if (Window != NULL && Window->head.pti == ti && !IsThreadHooked(GetWin32ClientInfo())) { /* NOTE: We can directly send messages to the window procedure @@ -1934,7 +2115,7 @@ the Unicode message though */ MsgiUMToKMCleanup(&UcMsg, &KMMsg); MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg); - Result = IntCallWindowProcA(Info.Ansi, Info.Proc, Wnd, Msg, wParam, lParam); + Result = IntCallWindowProcA(Info.Ansi, Info.Proc, Window, Wnd, Msg, wParam, lParam); } else { @@ -1943,6 +2124,7 @@ message to avoid another conversion */ Result = IntCallWindowProcW( Info.Ansi, Info.Proc, + Window, UcMsg.hwnd, UcMsg.message, UcMsg.wParam, @@ -2048,21 +2230,28 @@ } if (! Info.HandledByKernel) { + PWND pWnd; + pWnd = ValidateHwnd(hWnd); /* We need to send the message ourselves */ if (Info.Ansi) { /* Ansi message and Ansi window proc, that's easy. Clean up the Unicode message though */ MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg); - Result = IntCallWindowProcA(Info.Ansi, Info.Proc, hWnd, Msg, wParam, lParam); + Result = IntCallWindowProcA(Info.Ansi, Info.Proc, pWnd, hWnd, Msg, wParam, lParam); } else { /* Unicode winproc. Although we started out with an Ansi message we already converted it to Unicode for the kernel call. Reuse that message to avoid another conversion */ - Result = IntCallWindowProcW(Info.Ansi, Info.Proc, UcMsg.hwnd, - UcMsg.message, UcMsg.wParam, UcMsg.lParam); + Result = IntCallWindowProcW( Info.Ansi, + Info.Proc, + pWnd, + UcMsg.hwnd, + UcMsg.message, + UcMsg.wParam, + UcMsg.lParam); if (! MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result)) { SPY_ExitMessage(SPY_RESULT_OK, hWnd, Msg, Result, wParam, lParam); @@ -2112,8 +2301,10 @@ lpdwResult, &Info); if (! Info.HandledByKernel) { + PWND pWnd; + pWnd = ValidateHwnd(hWnd); /* We need to send the message ourselves */ - Result = IntCallWindowProcW(Info.Ansi, Info.Proc, hWnd, Msg, wParam, lParam); + Result = IntCallWindowProcW(Info.Ansi, Info.Proc, pWnd, hWnd, Msg, wParam, lParam); if(lpdwResult) *lpdwResult = Result; @@ -2322,6 +2513,8 @@ { PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs; MSG KMMsg, UMMsg; + PWND pWnd = NULL; + PCLIENTINFO pci = GetWin32ClientInfo(); /* Make sure we don't try to access mem beyond what we were given */ if (ArgumentLength < sizeof(WINDOWPROC_CALLBACK_ARGUMENTS)) @@ -2362,8 +2555,12 @@ { } + if (pci->CallbackWnd.hWnd == UMMsg.hwnd) + pWnd = pci->CallbackWnd.pvWnd; + CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc, CallbackArgs->Proc, + pWnd, UMMsg.hwnd, UMMsg.message, UMMsg.wParam, Modified: trunk/reactos/dll/win32/user32/windows/nonclient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/n…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/nonclient.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/nonclient.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1058,6 +1058,34 @@ /* PUBLIC FUNCTIONS ***********************************************************/ +BOOL WINAPI +RealAdjustWindowRectEx(LPRECT lpRect, + DWORD dwStyle, + BOOL bMenu, + DWORD dwExStyle) +{ + SIZE BorderSize; + + if (bMenu) + { + lpRect->top -= GetSystemMetrics(SM_CYMENU); + } + if ((dwStyle & WS_CAPTION) == WS_CAPTION) + { + if (dwExStyle & WS_EX_TOOLWINDOW) + lpRect->top -= GetSystemMetrics(SM_CYSMCAPTION); + else + lpRect->top -= GetSystemMetrics(SM_CYCAPTION); + } + UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE); + InflateRect( + lpRect, + BorderSize.cx, + BorderSize.cy); + + return TRUE; +} + /* * @implemented */ @@ -1067,26 +1095,27 @@ BOOL bMenu, DWORD dwExStyle) { - SIZE BorderSize; - - if (bMenu) - { - lpRect->top -= GetSystemMetrics(SM_CYMENU); - } - if ((dwStyle & WS_CAPTION) == WS_CAPTION) - { - if (dwExStyle & WS_EX_TOOLWINDOW) - lpRect->top -= GetSystemMetrics(SM_CYSMCAPTION); - else - lpRect->top -= GetSystemMetrics(SM_CYCAPTION); - } - UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE); - InflateRect( - lpRect, - BorderSize.cx, - BorderSize.cy); - - return TRUE; + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return RealAdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle); + + _SEH2_TRY + { + Ret = guah.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; } @@ -1110,7 +1139,27 @@ BOOL WINAPI DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags) { - return NtUserDrawCaption(hWnd, hDC, lprc, uFlags); + BOOL Hook, Ret = FALSE; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return NtUserDrawCaption(hWnd, hDC, lprc, uFlags); + + _SEH2_TRY + { + Ret = guah.DrawCaption(hWnd, hDC, lprc, uFlags); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; } /* Modified: trunk/reactos/dll/win32/user32/windows/paint.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -131,7 +131,6 @@ lprcUpdate); } - /* * @implemented */ @@ -142,9 +141,29 @@ HRGN hRgn, BOOL bRedraw) { - return (int)NtUserSetWindowRgn(hWnd, hRgn, bRedraw); -} - + BOOL Hook; + int Ret = 0; + + LOADUSERAPIHOOK + + Hook = BeginIfHookedUserApiHook(); + + /* Bypass SEH and go direct. */ + if (!Hook) return (int)NtUserSetWindowRgn(hWnd, hRgn, bRedraw); + + _SEH2_TRY + { + Ret = guah.SetWindowRgn(hWnd, hRgn, bRedraw); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + } + _SEH2_END; + + EndUserApiHook(); + + return Ret; +} /* * @implemented Modified: trunk/reactos/dll/win32/user32/windows/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -1875,6 +1875,12 @@ return (HWND)NtUserGetThreadState(THREADSTATE_FOCUSWINDOW); } +DWORD WINAPI +GetRealWindowOwner(HWND hwnd) +{ + return NtUserQueryWindow(hwnd, QUERY_WINDOW_REAL_ID); +} + /* * @implemented */ Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -560,6 +560,7 @@ #define COLOR_LAST COLOR_MENUBAR #define MAX_MB_STRINGS 11 +#define SRVINFO_APIHOOK 0x0010 #define SRVINFO_METRICS 0x0020 typedef struct tagOEMBITMAPINFO @@ -2359,11 +2360,13 @@ IN UINT uiNumDevices, IN UINT cbSize); -DWORD +BOOL NTAPI NtUserRegisterUserApiHook( - DWORD dwUnknown1, - DWORD dwUnknown2); + PUNICODE_STRING m_dllname1, + PUNICODE_STRING m_funname1, + DWORD dwUnknown3, + DWORD dwUnknown4); BOOL NTAPI @@ -2875,7 +2878,7 @@ NtUserUnregisterHotKey(HWND hWnd, int id); -DWORD +BOOL NTAPI NtUserUnregisterUserApiHook(VOID); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -949,13 +949,17 @@ return 0; } -DWORD +BOOL APIENTRY NtUserRegisterUserApiHook( - DWORD dwUnknown1, - DWORD dwUnknown2) -{ - UNIMPLEMENTED; + PUNICODE_STRING m_dllname1, + PUNICODE_STRING m_funname1, + DWORD dwUnknown3, + DWORD dwUnknown4) +{ + UserEnterExclusive(); + UNIMPLEMENTED; + UserLeave(); return 0; } @@ -1080,7 +1084,7 @@ return 0; } -DWORD +BOOL APIENTRY NtUserUnregisterUserApiHook(VOID) { Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Tue Sep 15 17:24:09 2009 @@ -493,7 +493,7 @@ NtUserRealWaitMessageEx 2 NtUserRedrawWindow 4 NtUserRegisterClassExWOW 7 -NtUserRegisterUserApiHook 2 +NtUserRegisterUserApiHook 4 NtUserRegisterHotKey 4 NtUserRegisterRawInputDevices 3 NtUserRegisterTasklist 1
15 years, 3 months
1
0
0
0
[dchapyshev] 43052: - Partially implement "Computer Name Changes" dialog. Computer name can be changed now. See issue #3304 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Tue Sep 15 15:45:34 2009 New Revision: 43052 URL:
http://svn.reactos.org/svn/reactos?rev=43052&view=rev
Log: - Partially implement "Computer Name Changes" dialog. Computer name can be changed now. See issue #3304 for more details. Modified: trunk/reactos/dll/win32/netid/lang/bg-BG.rc trunk/reactos/dll/win32/netid/lang/cs-CZ.rc trunk/reactos/dll/win32/netid/lang/de-DE.rc trunk/reactos/dll/win32/netid/lang/el-GR.rc trunk/reactos/dll/win32/netid/lang/en-US.rc trunk/reactos/dll/win32/netid/lang/es-ES.rc trunk/reactos/dll/win32/netid/lang/fr-FR.rc trunk/reactos/dll/win32/netid/lang/id-ID.rc trunk/reactos/dll/win32/netid/lang/it-IT.rc trunk/reactos/dll/win32/netid/lang/nl-NL.rc trunk/reactos/dll/win32/netid/lang/no-NO.rc trunk/reactos/dll/win32/netid/lang/pl-PL.rc trunk/reactos/dll/win32/netid/lang/ru-RU.rc trunk/reactos/dll/win32/netid/lang/sk-SK.rc trunk/reactos/dll/win32/netid/lang/uk-UA.rc trunk/reactos/dll/win32/netid/netid.c Modified: trunk/reactos/dll/win32/netid/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/bg-BG…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/bg-BG.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Äîáðå äîøëè â ðàáîòíà ãðóïà %1." 23 "Äîáðå äîøëè â èìåíèå %1." 24 "Òðÿáâà äà ïðåçàïóñíåòå êîìïþòúðà, çà äà âëÿçàò ïðîìåíèòå â äåéñòâèå." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Çàáåëåæêà: Ñàìî óïðàâíèöèòå ìîãàò äà ïðîìåíÿò îïîçíàâàòåëèòå íà êîìïþòúðà." 1022 "Çàáåëåæêà: Îïîçíàâàòåëÿò íà êîìïþòúðà íå ìîæå äà áúäå ñìåíåí, çàùîòî:" 3210 "&Ïî&äðîáíîñòè >>" 3220 "<< &Ïî&äðîáíîñòè" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/cs-CZ…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/cs-CZ.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -73,8 +73,11 @@ 22 "Vítejte v pracovní skupinì %1." 23 "Vítejte v doménì %1." 24 "Aby se zmìny mohly projevit, musí být poèítaè restartován." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Poznámka: Identifikaci tohoto poèítaèe mohou zmìnit pouze administrátoøi." 1022 "Poznámka: Identifikace poèítaèe nemùe být zmìnìna z následujících dùvodù:" 3210 "&Detaily >>" 3220 "<< &Detaily" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/de-DE…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/de-DE.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -75,8 +75,11 @@ 22 "Willkommen in der Arbeitsgruppe %1" 23 "Willkommen in der Domäne %1" 24 "Sie müssen den Computer neustarten, damit die Änderungen wirksam werden." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Hinweis: Nur Administratoren können die Identifikation des Computers ändern." 1022 "Hinweis: Die Identifikation des Computers kann aus folgendem Grund nicht geändert werden:" 3210 "&Details >>" 3220 "<< &Details" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/el-GR…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/el-GR.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Welcome to the %1 workgroup." 23 "Welcome to the %1 domain." 24 "You must restart this computer for the changes to take effect." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" 3210 "&Details >>" 3220 "<< &Details" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/en-US…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/en-US.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Welcome to the %1 workgroup." 23 "Welcome to the %1 domain." 24 "You must restart this computer for the changes to take effect." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" 3210 "&Details >>" 3220 "<< &Details" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/es-ES…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/es-ES.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -72,8 +72,11 @@ 22 "Bienvenido al grupo de trabajo %1." 23 "Bienvenido al dominio %1." 24 "Debe reiniciar el equipo para que los cambios tengan efecto." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Nota: Sólo los Administradores pueden cambiar la identificación de este equipo." 1022 "Nota: La identificación de este equipo no puede ser cambiada porque:" 3210 "&Detalles >>" 3220 "<< &Detalles" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/fr-FR…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/fr-FR.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Bienvenue dans le groupe de travail %1." 23 "Bienvenue dans le domaine %1." 24 "Vous devez redémarrer votre ordinateur pour que les changements soient pris en compte." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note : Seuls les administrateurs peuvent modifier l'identification de cet ordinateur." 1022 "Note : L'identification de l'ordinateur ne peut pas être modifiée car :" 3210 "&Détails >>" 3220 "<< &Détails" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/id-ID.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/id-ID…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/id-ID.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/id-ID.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Welcome to the %1 workgroup." 23 "Welcome to the %1 domain." 24 "You must restart this computer for the changes to take effect." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Note: Only Administrators can change the identification of this computer." 1022 "Note: The identification of the computer cannot be changed because:" 3210 "&Details >>" 3220 "<< &Details" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/it-IT…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/it-IT.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -68,8 +68,11 @@ 22 "Benvenuto al gruppo di lavoro %1." 23 "Benvenuto al dominio %1." 24 "Il computer deve essre riavviato per rendere operative queste modifiche." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Nota: Solo gli Amministratori possono cambiare l'identificazione di questo computer." 1022 "Nota: L'identificazione di questo computer non può essere cambiata perchè:" 3210 "&Dettagli >>" 3220 "<< &Dettagli" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/nl-NL…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/nl-NL.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Welkom bij de werkgoep %1." 23 "Welkom bij het domein %1." 24 "U moet de computer herstarten om de wijzigingen van kracht te laten gaan." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Let op: Alleen Administrators mogen de indentificatie van deze computer aanpassen." 1022 "Let op: De indentificatie van deze computer kan niet gewijzigd worden omdat:" 3210 "&Details >>" 3220 "<< &Details" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/no-NO…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/no-NO.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Velkommen til %1 arbeidsgruppen." 23 "Velkommen til %1 domene." 24 "Du må starte denne datamaskinen på nytt for at endringene skal tre i kraft." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "OBS: Bare administratorer kan endre identifisering for denne datamaskinen." 1022 "OBS: Identifisering for datamaskinen kunne ikke endres fordi:" 3210 "&Detaljer >>" 3220 "<< &Detaljer" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/pl-PL…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/pl-PL.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -75,8 +75,11 @@ 22 "Witamy w grupie roboczej %1." 23 "Witamy w domenie %1." 24 "Musisz zrestartowaæ komputer aby zmiany odnios³y skutek." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Uwaga: Tylko Administratorzy mog¹ zmieniaæ identyfikator tego komputera." 1022 "Uwaga: Identyfikator tego komputera nie zosta³ zmieniony, powód:" 3210 "&Szczegó³y >>" 3220 "<< &Szczegó³y" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/ru-RU…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/ru-RU.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -67,8 +67,11 @@ 22 "Äîáðî ïîæàëîâàòü â ðàáî÷óþ ãðóïïó %1." 23 "Äîáðî ïîæàëîâàòü â äîìåí %1." 24 "Íåîáõîäèìî ïåðåçàïóñòèòü êîìïüþòåð äëÿ òîãî, ÷òîáû ýòè èçìåíåíèÿ âñòóïèëè â ñèëó." + 25 "Ìîæíî èçìåíèòü èìÿ è ïðèíàäëåæíîñòü ýòîãî êîìïüþòåðà. Èçìåíåíèÿ ìîãóò ïîâëèÿòü íà äîñòóï ê ñåòåâûì ðåñóðñàì." 1021 "Ïðèìå÷àíèå: òîëüêî àäìèíèñòðàòîðû ìîãóò èçìåíèòü èäåíòèôèêàöèþ ýòîãî êîìïüþòåðà." 1022 "Ïðèìå÷àíèå: èäåíòèôèêàöèÿ ýòîãî êîìïüþòåðà íå ìîæåò áûòü èçìåíåíà, ïîòîìó ÷òî:" 3210 "&Ïîäðîáíî >>" 3220 "<< &Ïîäðîáíî" + 4000 "Èíôîðìàöèÿ" + 4001 "Íå óäàëîñü óñòàíîâèòü íîâîå èìÿ êîìïüþòåðà!" END Modified: trunk/reactos/dll/win32/netid/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/sk-SK…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/sk-SK.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -74,8 +74,11 @@ 22 "Vitajte v pracovnej skupine %1." 23 "Vitajte v doméne %1." 24 "Aby sa prejavili vykonané zmeny, musíte retartova poèítaè." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Poznámka: Iba správcovia môu zmeni identifikáciu tohto poèítaèa." 1022 "Poznámka: Identifikácia poèítaèa nemôe by zmenená, lebo:" 3210 "&Podrobnosti >>" 3220 "<< &Podrobnosti" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/uk-UA…
============================================================================== --- trunk/reactos/dll/win32/netid/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/lang/uk-UA.rc [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -75,8 +75,11 @@ 22 "Âàñ â³òຠðîáî÷à ãðóïà %1." 23 "Âàñ â³òຠäîìåí %1." 24 "Ñë³ä ïåðåçàïóñòèòè êîìï'þòåð, ùîá ö³ çì³íè íàáðàëè ñèëè." + 25 "You can change the name and the membership of this computer. Changes may affect access to network resources." 1021 "Ïðèì³òêà: çì³íèòè ³äåíòèô³êàö³þ öüîãî êîìï'þòåðà ìîæóòü ëèøå àäì³í³ñòðàòîðè." 1022 "Ïðèì³òêà: çì³íèòè ³äåíòèô³êàö³þ öüîãî êîìï'þòåðà íåìîæëèâî, îñê³ëüêè:" 3210 "&Ïîäðîáèö³ >>" 3220 "<< &Ïîäðîáèö³" + 4000 "Information" + 4001 "Can't set new a computer name!" END Modified: trunk/reactos/dll/win32/netid/netid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/netid.c?re…
============================================================================== --- trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netid/netid.c [iso-8859-1] Tue Sep 15 15:45:34 2009 @@ -3,16 +3,210 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/netid/netid.c * PURPOSE: Network ID Page - * COPYRIGHT: Copyright Thomas Weidenmueller <w3seek(a)reactos.org> + * COPYRIGHT: Thomas Weidenmueller <w3seek(a)reactos.org> + * Dmitry Chapyshev <dmitry(a)reactos.org> * */ #include <windows.h> +#include <tchar.h> #include <lm.h> #include <prsht.h> #include "resource.h" static HINSTANCE hDllInstance; + + +static +INT_PTR CALLBACK +DNSSuffixPropDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + switch (Msg) + { + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDCANCEL: + case IDOK: + EndDialog(hDlg, LOWORD(wParam)); + break; + } + } + break; + } + + return FALSE; +} + +static VOID +SetRadioBtnState(HWND hDlg, BOOL IsDomain) +{ + SendDlgItemMessage(hDlg, 1008, BM_SETCHECK, (WPARAM)IsDomain, 0); + SendDlgItemMessage(hDlg, 1004, BM_SETCHECK, (WPARAM)!IsDomain, 0); + EnableWindow(GetDlgItem(hDlg, 116), IsDomain); + EnableWindow(GetDlgItem(hDlg, 1007), !IsDomain); +} + +static VOID +DisableControls(HWND hDlg) +{ + EnableWindow(GetDlgItem(hDlg, 1008), FALSE); + EnableWindow(GetDlgItem(hDlg, 1004), FALSE); + EnableWindow(GetDlgItem(hDlg, 116), FALSE); + EnableWindow(GetDlgItem(hDlg, 1007), FALSE); +} + +static +INT_PTR CALLBACK +NetworkPropDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + switch (Msg) + { + case WM_INITDIALOG: + { + LPWKSTA_INFO_101 wki = NULL; + DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; + TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + TCHAR MsgText[MAX_PATH * 2]; + LPWSTR JoinName; + NETSETUP_JOIN_STATUS JoinStatus; + + if (LoadString(hDllInstance, 25, MsgText, sizeof(MsgText) / sizeof(TCHAR))) + SetDlgItemText(hDlg, 1017, MsgText); + + if (GetComputerName(ComputerName, &Size)) + { + SetDlgItemText(hDlg, 1002, ComputerName); + SetDlgItemText(hDlg, 1001, ComputerName); + } + + if (NetGetJoinInformation(NULL, &JoinName, &JoinStatus) != NERR_Success) + { + SetRadioBtnState(hDlg, FALSE); + + if (NetWkstaGetInfo(NULL, + 101, + (LPBYTE*)&wki) == NERR_Success) + { + SetDlgItemText(hDlg, + 1007, + wki->wki101_langroup); + } + else DisableControls(hDlg); + + if (wki) NetApiBufferFree(wki); + } + else + { + switch (JoinStatus) + { + case NetSetupDomainName: + SetDlgItemText(hDlg, 116, JoinName); + SetRadioBtnState(hDlg, TRUE); + break; + + case NetSetupWorkgroupName: + SetDlgItemText(hDlg, 1007, JoinName); + SetRadioBtnState(hDlg, FALSE); + break; + + case NetSetupUnjoined: + break; + + case NetSetupUnknownStatus: + default: + { + SetRadioBtnState(hDlg, FALSE); + + if (NetWkstaGetInfo(NULL, + 101, + (LPBYTE*)&wki) == NERR_Success) + { + SetDlgItemText(hDlg, + 1007, + wki->wki101_langroup); + } + else DisableControls(hDlg); + + if (wki) NetApiBufferFree(wki); + break; + } + } + + if (JoinName) NetApiBufferFree(JoinName); + } + } + break; + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case 1008: /* Domain radio button */ + case 1004: /* Workgroup radio button */ + if (SendDlgItemMessage(hDlg, 1008, BM_GETCHECK, 0, 0) == BST_CHECKED) + SetRadioBtnState(hDlg, TRUE); + else + SetRadioBtnState(hDlg, FALSE); + break; + + case 1003: + DialogBox(hDllInstance, + MAKEINTRESOURCE(IDD_PROPPAGEDNSANDNETBIOS), + hDlg, + DNSSuffixPropDlgProc); + break; + + case IDOK: + { + DWORD Size = MAX_COMPUTERNAME_LENGTH + 1; + TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + TCHAR NewComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + + if (GetComputerName(ComputerName, &Size)) + { + if (GetWindowText(GetDlgItem(hDlg, 1002), + NewComputerName, + (MAX_COMPUTERNAME_LENGTH + 1))) + { + if (_tcscmp(ComputerName, NewComputerName) != 0) + { + if (!SetComputerName(NewComputerName)) + { + TCHAR szMsgText[MAX_PATH]; + + LoadString(hDllInstance, 4001, szMsgText, sizeof(szMsgText) / sizeof(TCHAR)); + + MessageBox(0, szMsgText, NULL, MB_OK | MB_ICONERROR); + } + else + { + TCHAR szMsgTitle[MAX_PATH], szMsgText[MAX_PATH]; + + LoadString(hDllInstance, 4000, szMsgTitle, sizeof(szMsgTitle) / sizeof(TCHAR)); + LoadString(hDllInstance, 24, szMsgText, sizeof(szMsgText) / sizeof(TCHAR)); + + MessageBox(hDlg, szMsgText, szMsgTitle, MB_OK | MB_ICONINFORMATION); + } + } + } + } + + EndDialog(hDlg, LOWORD(wParam)); + } + break; + + case IDCANCEL: + EndDialog(hDlg, LOWORD(wParam)); + break; + } + } + break; + } + + return FALSE; +} static INT_PTR CALLBACK NetIDPageProc(IN HWND hwndDlg, @@ -23,7 +217,6 @@ INT_PTR Ret = 0; UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); switch (uMsg) { @@ -48,12 +241,23 @@ wki->wki101_langroup); } - if (wki != NULL) - NetApiBufferFree(wki); + if (wki) NetApiBufferFree(wki); Ret = TRUE; break; } + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_NETWORK_PROPERTY: + DialogBox(hDllInstance, + MAKEINTRESOURCE(IDD_PROPPAGECOMPNAMECHENGE), + hwndDlg, + NetworkPropDlgProc); + break; + } + break; } return Ret; @@ -66,7 +270,7 @@ psp.dwSize = sizeof(psp); psp.dwFlags = PSP_DEFAULT; - psp.hInstance= hDllInstance; + psp.hInstance = hDllInstance; psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGECOMPUTER); psp.pfnDlgProc = NetIDPageProc;
15 years, 3 months
1
0
0
0
[janderwald] 43051: - Check if a shortcut to shortcut is made and resolve it in that case - Fixes bug 4720
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Sep 15 00:55:44 2009 New Revision: 43051 URL:
http://svn.reactos.org/svn/reactos?rev=43051&view=rev
Log: - Check if a shortcut to shortcut is made and resolve it in that case - Fixes bug 4720 Modified: trunk/reactos/dll/cpl/appwiz/createlink.c Modified: trunk/reactos/dll/cpl/appwiz/createlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/createlink.…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/createlink.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/appwiz/createlink.c [iso-8859-1] Tue Sep 15 00:55:44 2009 @@ -12,13 +12,109 @@ #include "appwiz.h" +BOOL +IsShortcut(HKEY hKey) +{ + WCHAR Value[10]; + DWORD Size; + DWORD Type; + + Size = sizeof(Value); + if (RegQueryValueExW(hKey, L"IsShortcut", NULL, &Type, (LPBYTE)Value, &Size) != ERROR_SUCCESS) + return FALSE; + + if (Type != REG_SZ) + return FALSE; + + return (wcsicmp(Value, L"yes") == 0); +} + +BOOL +IsExtensionAShortcut(LPWSTR lpExtension) +{ + HKEY hKey; + WCHAR Buffer[100]; + DWORD Size; + DWORD Type; + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, lpExtension, 0, KEY_READ, &hKey) != ERROR_SUCCESS) + return FALSE; + + if (IsShortcut(hKey)) + { + RegCloseKey(hKey); + return TRUE; + } + + Size = sizeof(Buffer); + if (RegQueryValueEx(hKey, NULL, NULL, &Type, (LPBYTE)Buffer, &Size) != ERROR_SUCCESS || Type != REG_SZ) + { + RegCloseKey(hKey); + return FALSE; + } + + RegCloseKey(hKey); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, Buffer, 0, KEY_READ, &hKey) != ERROR_SUCCESS) + return FALSE; + + if (IsShortcut(hKey)) + { + RegCloseKey(hKey); + return TRUE; + } + + RegCloseKey(hKey); + return FALSE; +} BOOL CreateShortcut(PCREATE_LINK_CONTEXT pContext) { - IShellLinkW *pShellLink; + IShellLinkW *pShellLink, *pSourceShellLink; IPersistFile *pPersistFile; HRESULT hr; + WCHAR Path[MAX_PATH]; + LPWSTR lpExtension; + + /* get the extension */ + lpExtension = wcsrchr(pContext->szTarget, '.'); + + if (IsExtensionAShortcut(lpExtension)) + { + hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL, &IID_IShellLink, (void**)&pSourceShellLink); + + if (hr != S_OK) + return FALSE; + + hr = pSourceShellLink->lpVtbl->QueryInterface(pSourceShellLink, &IID_IPersistFile, (void**)&pPersistFile); + if (hr != S_OK) + { + pSourceShellLink->lpVtbl->Release(pSourceShellLink); + return FALSE; + } + + hr = pPersistFile->lpVtbl->Load(pPersistFile, (LPCOLESTR)pContext->szTarget, STGM_READ); + pPersistFile->lpVtbl->Release(pPersistFile); + + if (hr != S_OK) + { + pSourceShellLink->lpVtbl->Release(pSourceShellLink); + return FALSE; + } + + hr = pSourceShellLink->lpVtbl->GetPath(pSourceShellLink, Path, sizeof(Path) / sizeof(WCHAR), NULL, 0); + pSourceShellLink->lpVtbl->Release(pSourceShellLink); + + if (hr != S_OK) + { + return FALSE; + } + } + else + { + wcscpy(Path, pContext->szTarget); + } hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL, &IID_IShellLink, (void**)&pShellLink); @@ -27,7 +123,7 @@ return FALSE; - pShellLink->lpVtbl->SetPath(pShellLink, pContext->szTarget); + pShellLink->lpVtbl->SetPath(pShellLink, Path); pShellLink->lpVtbl->SetDescription(pShellLink, pContext->szDescription); pShellLink->lpVtbl->SetWorkingDirectory(pShellLink, pContext->szWorkingDirectory);
15 years, 3 months
1
0
0
0
[dchapyshev] 43050: - Handle potential null-pointer access. Found by Amine Khaldi.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Sep 14 13:13:54 2009 New Revision: 43050 URL:
http://svn.reactos.org/svn/reactos?rev=43050&view=rev
Log: - Handle potential null-pointer access. Found by Amine Khaldi. Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c [iso-8859-1] Mon Sep 14 13:13:54 2009 @@ -1573,6 +1573,7 @@ PEHCI_QTD_CONTENT ptdc; PEHCI_QH_CONTENT pqhc; PEHCI_ELEM_LINKS pelnk; + PEHCI_ELEM_LINKS plnk; if (ehci == NULL || purb == NULL) return STATUS_INVALID_PARAMETER; @@ -1685,7 +1686,17 @@ RemoveEntryList(&td_list); elem_pool_lock(qh_pool, TRUE); - pqh = (PEHCI_QH) ((ULONG) elem_pool_alloc_elem(qh_pool)->phys_part & PHYS_PART_ADDR_MASK); + + plnk = elem_pool_alloc_elem(qh_pool); + if (plnk == NULL) + { + // free the qtds + elem_safe_free(pthis, TRUE); + if (qh_pool) elem_pool_unlock(qh_pool, TRUE); + return STATUS_UNSUCCESSFUL; + } + + pqh = (PEHCI_QH) ((ULONG) plnk->phys_part & PHYS_PART_ADDR_MASK); elem_pool_unlock(qh_pool, TRUE); if (pqh == NULL)
15 years, 3 months
1
0
0
0
[mjmartin] 43049: NtAllocateVirtualMemory: Add check to make sure that BaseAddress + RegionSize is inside MemoryArea. For AllocationType of MEM_RESET add FIXME's and return STATUS_SUCCESS, without modifying attributes of region. Fixes 2 virtual tests for kernel32_winetest.
by mjmartin@svn.reactos.org
Author: mjmartin Date: Mon Sep 14 11:21:05 2009 New Revision: 43049 URL:
http://svn.reactos.org/svn/reactos?rev=43049&view=rev
Log: NtAllocateVirtualMemory: Add check to make sure that BaseAddress + RegionSize is inside MemoryArea. For AllocationType of MEM_RESET add FIXME's and return STATUS_SUCCESS, without modifying attributes of region. Fixes 2 virtual tests for kernel32_winetest. Modified: trunk/reactos/ntoskrnl/mm/anonmem.c Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Mon Sep 14 11:21:05 2009 @@ -729,6 +729,36 @@ { MemoryAreaLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)MemoryArea->StartingAddress; + + if (((ULONG)BaseAddress + RegionSize) > (ULONG)MemoryArea->EndingAddress) + { + DPRINT("BaseAddress + RegionSize %x is larger than MemoryArea's EndingAddress %x\n", + (ULONG)BaseAddress + RegionSize, MemoryArea->EndingAddress); + + MmUnlockAddressSpace(AddressSpace); + ObDereferenceObject(Process); + + return STATUS_MEMORY_NOT_ALLOCATED; + } + + if (AllocationType == MEM_RESET) + { + if (MmIsPagePresent(Process, BaseAddress)) + { + /* FIXME: mark pages as not modified */ + } + else + { + /* FIXME: if pages are in paging file discard them and bring in pages of zeros */ + } + + MmUnlockAddressSpace(AddressSpace); + ObDereferenceObject(Process); + + /* MEM_RESET does not modify any attributes of region */ + return STATUS_SUCCESS; + } + if (MemoryArea->Type == MEMORY_AREA_VIRTUAL_MEMORY && MemoryAreaLength >= RegionSize) {
15 years, 3 months
1
0
0
0
[cgutman] 43048: - Rework our aging neighbor cache system that never quite worked correctly - Fixes several memory leaks - Fix the event timer and NCE timeouts - We now keep our neighbor cache updated and remove stale entries
by cgutman@svn.reactos.org
Author: cgutman Date: Mon Sep 14 06:20:05 2009 New Revision: 43048 URL:
http://svn.reactos.org/svn/reactos?rev=43048&view=rev
Log: - Rework our aging neighbor cache system that never quite worked correctly - Fixes several memory leaks - Fix the event timer and NCE timeouts - We now keep our neighbor cache updated and remove stale entries Modified: trunk/reactos/drivers/network/tcpip/include/neighbor.h trunk/reactos/lib/drivers/ip/network/arp.c trunk/reactos/lib/drivers/ip/network/ip.c trunk/reactos/lib/drivers/ip/network/neighbor.c Modified: trunk/reactos/drivers/network/tcpip/include/neighbor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/neighbor.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/neighbor.h [iso-8859-1] Mon Sep 14 06:20:05 2009 @@ -29,7 +29,6 @@ typedef struct NEIGHBOR_CACHE_ENTRY { DEFINE_TAG struct NEIGHBOR_CACHE_ENTRY *Next; /* Pointer to next entry */ - struct NEIGHBOR_CACHE_TABLE *Table; /* Pointer to table */ UCHAR State; /* State of NCE */ UINT EventTimer; /* Ticks since last event */ UINT EventCount; /* Number of events */ @@ -41,28 +40,18 @@ } NEIGHBOR_CACHE_ENTRY, *PNEIGHBOR_CACHE_ENTRY; /* NCE states */ -#define NUD_NONE 0x00 #define NUD_INCOMPLETE 0x01 #define NUD_REACHABLE 0x02 -#define NUD_STALE 0x04 -#define NUD_DELAY 0x08 -#define NUD_PROBE 0x10 -#define NUD_FAILED 0x20 -#define NUD_NOARP 0x40 -#define NUD_PERMANENT 0x80 +#define NUD_PERMANENT 0x04 -#define NUD_IN_TIMER (NUD_INCOMPLETE | NUD_DELAY | NUD_PROBE) -#define NUD_VALID (NUD_REACHABLE | NUD_NOARP | NUD_STALE | NUD_DELAY | \ - NUD_PROBE | NUD_PERMANENT) -#define NUD_CONNECTED (NUD_PERMANENT | NUD_NOARP | NUD_REACHABLE) +#define NUD_BROADCAST (NUD_PERMANENT | NUD_REACHABLE) +#define NUD_LOCAL (NUD_PERMANENT | NUD_REACHABLE) +/* Number of seconds before the NCE times out */ +#define ARP_TIMEOUT 30 -/* Maximum number of retransmissions of multicast solicits */ -#define MAX_MULTICAST_SOLICIT 3 /* 3 transmissions */ - -/* Number of ticks between address resolution messages */ -#define RETRANS_TIMER IP_TICKS_SECOND /* One second */ - +/* Number of seconds between ARP transmissions */ +#define ARP_RATE 10 extern NEIGHBOR_CACHE_TABLE NeighborCache[NB_HASHMASK + 1]; @@ -84,7 +73,8 @@ PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, - UCHAR Type); + UCHAR Type, + UINT EventTimer); VOID NBUpdateNeighbor( PNEIGHBOR_CACHE_ENTRY NCE, Modified: trunk/reactos/lib/drivers/ip/network/arp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/arp…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/arp.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/arp.c [iso-8859-1] Mon Sep 14 06:20:05 2009 @@ -210,6 +210,7 @@ /* Check if we know the sender */ AddrInitIPv4(&Address, *((PULONG)SenderProtoAddress)); + NCE = NBLocateNeighbor(&Address); if (NCE) { /* We know the sender. Update the hardware address @@ -220,7 +221,7 @@ may want to communicate with us soon, so add his address to our address cache */ NCE = NBAddNeighbor(Interface, &Address, SenderHWAddress, - Header->HWAddrLen, NUD_REACHABLE); + Header->HWAddrLen, NUD_REACHABLE, ARP_TIMEOUT); } if (Header->Opcode != ARP_OPCODE_REQUEST) Modified: trunk/reactos/lib/drivers/ip/network/ip.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/ip.…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/ip.c [iso-8859-1] Mon Sep 14 06:20:05 2009 @@ -212,7 +212,7 @@ /* Add a permanent neighbor for this NTE */ NCE = NBAddNeighbor(IF, &IF->Unicast, IF->Address, IF->AddressLength, - NUD_PERMANENT); + NUD_LOCAL, 0); if (!NCE) { TI_DbgPrint(MIN_TRACE, ("Could not create NCE.\n")); return; Modified: trunk/reactos/lib/drivers/ip/network/neighbor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/nei…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/neighbor.c [iso-8859-1] Mon Sep 14 06:20:05 2009 @@ -30,8 +30,7 @@ PNEIGHBOR_PACKET Packet; UINT HashValue; - if(!(NCE->State & NUD_CONNECTED)) - return; + ASSERT(NCE->State & NUD_REACHABLE); HashValue = *(PULONG)(&NCE->Address.Address); HashValue ^= HashValue >> 16; @@ -89,58 +88,6 @@ } } -VOID NCETimeout( - PNEIGHBOR_CACHE_ENTRY NCE) -/* - * FUNCTION: Neighbor cache entry timeout handler - * NOTES: - * The neighbor cache lock must be held - */ -{ - TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE)); - TI_DbgPrint(DEBUG_NCACHE, ("NCE->State is (0x%X).\n", NCE->State)); - - switch (NCE->State) - { - case NUD_INCOMPLETE: - /* Retransmission timer expired */ - if (NCE->EventCount++ > MAX_MULTICAST_SOLICIT) - { - /* We have retransmitted too many times */ - - /* Calling IPSendComplete with cache lock held is not - a great thing to do. We don't get here very often - so maybe it's not that big a problem */ - - /* Flush packet queue */ - NBFlushPacketQueue( NCE, NDIS_STATUS_REQUEST_ABORTED ); - NCE->EventCount = 0; - } - else - { - /* Retransmit request */ - NBSendSolicit(NCE); - } - break; - - case NUD_DELAY: - /* FIXME: Delayed state */ - TI_DbgPrint(DEBUG_NCACHE, ("NCE delay state.\n")); - break; - - case NUD_PROBE: - /* FIXME: Probe state */ - TI_DbgPrint(DEBUG_NCACHE, ("NCE probe state.\n")); - break; - - default: - /* Should not happen since the event timer is not used in the other states */ - TI_DbgPrint(MIN_TRACE, ("Invalid NCE state (%d).\n", NCE->State)); - break; - } -} - - VOID NBTimeout(VOID) /* * FUNCTION: Neighbor address cache timeout handler @@ -151,21 +98,33 @@ { UINT i; KIRQL OldIrql; + PNEIGHBOR_CACHE_ENTRY *PrevNCE; PNEIGHBOR_CACHE_ENTRY NCE; for (i = 0; i <= NB_HASHMASK; i++) { TcpipAcquireSpinLock(&NeighborCache[i].Lock, &OldIrql); - for (NCE = NeighborCache[i].Cache; - NCE != NULL; NCE = NCE->Next) { + for (PrevNCE = &NeighborCache[i].Cache; + (NCE = *PrevNCE) != NULL;) { /* Check if event timer is running */ if (NCE->EventTimer > 0) { - NCE->EventTimer--; - if (NCE->EventTimer == 0) { - /* Call timeout handler for NCE */ - NCETimeout(NCE); + NCE->EventCount++; + if (NCE->EventCount % ARP_RATE == 0) + NBSendSolicit(NCE); + if (NCE->EventTimer - NCE->EventCount == 0) { + ASSERT(!(NCE->State & NUD_PERMANENT)); + + /* Flush packet queue */ + NBFlushPacketQueue( NCE, NDIS_STATUS_REQUEST_ABORTED ); + + *PrevNCE = NCE->Next; + + exFreePool(NCE); + + continue; } } + PrevNCE = &NCE->Next; } TcpipReleaseSpinLock(&NeighborCache[i].Lock, OldIrql); @@ -211,6 +170,8 @@ /* Flush wait queue */ NBFlushPacketQueue( CurNCE, NDIS_STATUS_NOT_ACCEPTED ); + exFreePool(CurNCE); + CurNCE = NextNCE; } @@ -233,18 +194,7 @@ { TI_DbgPrint(DEBUG_NCACHE, ("Called. NCE (0x%X).\n", NCE)); - if (NCE->State & NUD_INCOMPLETE) - { - /* This is the first solicitation of this neighbor. Broadcast - a request for the neighbor */ - - TI_DbgPrint(MID_TRACE,("NCE: %x\n", NCE)); - - ARPTransmit(&NCE->Address, NCE->Interface); - } else { - /* FIXME: Unicast solicitation since we have a cached address */ - TI_DbgPrint(MIN_TRACE, ("Uninplemented unicast solicitation.\n")); - } + ARPTransmit(&NCE->Address, NCE->Interface); } PNEIGHBOR_CACHE_ENTRY NBAddNeighbor( @@ -252,7 +202,8 @@ PIP_ADDRESS Address, PVOID LinkAddress, UINT LinkAddressLength, - UCHAR State) + UCHAR State, + UINT EventTimer) /* * FUNCTION: Adds a neighbor to the neighbor cache * ARGUMENTS: @@ -298,7 +249,8 @@ else memset(NCE->LinkAddress, 0xff, LinkAddressLength); NCE->State = State; - NCE->EventTimer = 0; /* Not in use */ + NCE->EventTimer = EventTimer; + NCE->EventCount = 0; InitializeListHead( &NCE->PacketQueue ); TI_DbgPrint(MID_TRACE,("NCE: %x\n", NCE)); @@ -309,8 +261,6 @@ HashValue ^= HashValue >> 4; HashValue &= NB_HASHMASK; - NCE->Table = &NeighborCache[HashValue]; - TcpipAcquireSpinLock(&NeighborCache[HashValue].Lock, &OldIrql); NCE->Next = NeighborCache[HashValue].Cache; @@ -350,10 +300,11 @@ RtlCopyMemory(NCE->LinkAddress, LinkAddress, NCE->LinkAddressLength); NCE->State = State; + NCE->EventCount = 0; TcpipReleaseSpinLock(&NeighborCache[HashValue].Lock, OldIrql); - if( NCE->State & NUD_CONNECTED ) + if( NCE->State & NUD_REACHABLE ) NBSendPackets( NCE ); } @@ -425,16 +376,12 @@ AddrIsUnspecified(Address) ) { TI_DbgPrint(MID_TRACE,("Packet targeted at broadcast addr\n")); NCE = NBAddNeighbor(Interface, Address, NULL, - Interface->AddressLength, NUD_CONNECTED); - if (!NCE) return NULL; - NCE->EventTimer = 0; - NCE->EventCount = 0; + Interface->AddressLength, NUD_BROADCAST, 0); } else { NCE = NBAddNeighbor(Interface, Address, NULL, - Interface->AddressLength, NUD_INCOMPLETE); + Interface->AddressLength, NUD_INCOMPLETE, ARP_TIMEOUT); if (!NCE) return NULL; - NCE->EventTimer = 1; - NCE->EventCount = 0; + NBSendSolicit(NCE); } } @@ -483,12 +430,11 @@ TcpipReleaseSpinLock(&NeighborCache[HashValue].Lock, OldIrql); - if( NCE->State & NUD_CONNECTED ) + if( NCE->State & NUD_REACHABLE ) NBSendPackets( NCE ); return TRUE; } - VOID NBRemoveNeighbor( PNEIGHBOR_CACHE_ENTRY NCE) @@ -559,10 +505,8 @@ ArpTable[Size].LogAddr = CurNCE->Address.Address.IPv4Address; if( CurNCE->State & NUD_PERMANENT ) ArpTable[Size].Type = ARP_ENTRY_STATIC; - else if( CurNCE->State & NUD_CONNECTED ) + else if( CurNCE->State & NUD_REACHABLE ) ArpTable[Size].Type = ARP_ENTRY_DYNAMIC; - else if( !(CurNCE->State & NUD_VALID) ) - ArpTable[Size].Type = ARP_ENTRY_INVALID; else ArpTable[Size].Type = ARP_ENTRY_OTHER; }
15 years, 3 months
1
0
0
0
[dchapyshev] 43047: - Fix starting Imdisk applet. Patch by Johnny Adams (johnyadams[at]hotmail[dot]com) See issue #4481 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Sep 14 04:28:50 2009 New Revision: 43047 URL:
http://svn.reactos.org/svn/reactos?rev=43047&view=rev
Log: - Fix starting Imdisk applet. Patch by Johnny Adams (johnyadams[at]hotmail[dot]com) See issue #4481 for more details. Modified: trunk/reactos/dll/win32/shell32/control.c Modified: trunk/reactos/dll/win32/shell32/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.…
============================================================================== --- trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] Mon Sep 14 04:28:50 2009 @@ -415,8 +415,8 @@ } } if (applet->info[sp].dwSize) { - if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts)) - applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData); + if (!applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData)) + applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts); } Control_UnloadApplet(applet); }
15 years, 3 months
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
27
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
Results per page:
10
25
50
100
200