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
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2010
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
522 discussions
Start a n
N
ew thread
[dreimer] 45086: Update Script: - Removed the 7z command line tool loading routine. It's included in RosBE now. - Added some status messages to see the update command finished its job or not. Credits for this go to gabriel_it.
by dreimer@svn.reactos.org
Author: dreimer Date: Fri Jan 15 16:15:26 2010 New Revision: 45086 URL:
http://svn.reactos.org/svn/reactos?rev=45086&view=rev
Log: Update Script: - Removed the 7z command line tool loading routine. It's included in RosBE now. - Added some status messages to see the update command finished its job or not. Credits for this go to gabriel_it. Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 trunk/tools/RosBE/RosBE-Windows/Root/update.cmd Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/update.ps1 [iso-8859-1] Fri Jan 15 16:15:26 2010 @@ -80,12 +80,6 @@ # Save the recent dir to cd back there at the end. $_ROSBE_OPATH = "$pwd" -if (!(Test-Path "$_ROSBE_BASEDIR\Tools\7z.exe")) { - set-location "$_ROSBE_BASEDIR\Tools" - get-webfile $_ROSBE_URL/7z.exe $PWD\7z.exe - set-location $_ROSBE_OPATH -} - set-location $_ROSBE_BASEDIR # First check for a new Updater. @@ -111,16 +105,20 @@ UPDCHECK $_ROSBE_STATCOUNT += 1 } + "Update finished..." } elseif ("$($args[2])" -eq "reset") { remove-item "$ENV:APPDATA\RosBE\Updates\*.*" -force -recurse -EA SilentlyContinue remove-item "$ENV:APPDATA\RosBE\Updates\tmp\*.*" -force -recurse -EA SilentlyContinue + "Update Statistics resetted..." } elseif ("$($args[2])" -eq "nr") { $_ROSBE_STATCOUNT = $($args[3]) UPDCHECK + echo Update Nr:$($args[3]) installed... } elseif ("$($args[2])" -eq "delete") { $_ROSBE_STATCOUNT = $($args[3]) remove-item "$ENV:APPDATA\RosBE\Updates\$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force -recurse -EA SilentlyContinue remove-item "$ENV:APPDATA\RosBE\Updates\tmp\$_ROSBE_VERSION-$_ROSBE_STATCOUNT.*" -force -recurse -EA SilentlyContinue + "Update-$($args[3]) Statistics resetted..." } elseif ("$($args[2])" -eq "info") { $_ROSBE_STATCOUNT = $($args[3]) set-location tmp Modified: trunk/tools/RosBE/RosBE-Windows/Root/update.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/upd…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/update.cmd [iso-8859-1] Fri Jan 15 16:15:26 2010 @@ -22,12 +22,6 @@ :: Save the recent dir to cd back there at the end. set _ROSBE_OPATH=%CD% -if not exist "%_ROSBE_BASEDIR%\Tools\7z.exe" ( - cd /d "%_ROSBE_BASEDIR%\Tools" - wget.exe -N --ignore-length --no-verbose %_ROSBE_URL%/7z.exe 1> NUL 2> NUL - cd /d %_ROSBE_OPATH% -) - cd /d %_ROSBE_BASEDIR% :: First check for a new Updater @@ -49,16 +43,20 @@ set _ROSBE_MULTIUPD=1 set _ROSBE_STATCOUNT=1 call :WHILE + echo Update finished... ) else if /i "%1" == "reset" ( del /F /Q "%APPDATA%\RosBE\Updates\*.*" 1> NUL 2> NUL del /F /Q "%APPDATA%\RosBE\Updates\tmp\*.*" 1> NUL 2> NUL + echo Update Statistics resetted... ) else if /i "%1" == "nr" ( set _ROSBE_STATCOUNT=%2 call :UPDCHECK + echo Update Nr:%2 installed... ) else if /i "%1" == "delete" ( set _ROSBE_STATCOUNT=%2 del /F /Q "%APPDATA%\RosBE\Updates\%_ROSBE_VERSION%-!_ROSBE_STATCOUNT!.*" 1> NUL 2> NUL del /F /Q "%APPDATA%\RosBE\Updates\tmp\%_ROSBE_VERSION%-!_ROSBE_STATCOUNT!.*" 1> NUL 2> NUL + echo Update-%2 Statistics resetted... ) else if /i "%1" == "info" ( set _ROSBE_STATCOUNT=%2 cd tmp @@ -72,7 +70,7 @@ ) ) cd.. -del /F /Q tmp\*.* 1> NUL 2> NUL + del /F /Q tmp\*.* 1> NUL 2> NUL ) else if /i "%1" == "status" ( set _ROSBE_STATCOUNT=1 if not exist "tmp" mkdir tmp 1> NUL 2> NUL
14 years, 11 months
1
0
0
0
[jimtabor] 45085: [Win32k|User32] - Switch to the new user handle manager. Added more handle types to win32k. One or two step to WND, desktop heap supported. - Test with every application in my test suite. Needs more testing and clean up. Bleeding edge!
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Jan 15 14:47:25 2010 New Revision: 45085 URL:
http://svn.reactos.org/svn/reactos?rev=45085&view=rev
Log: [Win32k|User32] - Switch to the new user handle manager. Added more handle types to win32k. One or two step to WND, desktop heap supported. - Test with every application in my test suite. Needs more testing and clean up. Bleeding edge! Modified: trunk/reactos/dll/win32/user32/misc/misc.c trunk/reactos/subsystems/win32/win32k/include/class.h trunk/reactos/subsystems/win32/win32k/include/object.h trunk/reactos/subsystems/win32/win32k/include/userfuncs.h trunk/reactos/subsystems/win32/win32k/include/window.h trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/event.c trunk/reactos/subsystems/win32/win32k/ntuser/hook.c trunk/reactos/subsystems/win32/win32k/ntuser/menu.c trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c trunk/reactos/subsystems/win32/win32k/ntuser/object.c trunk/reactos/subsystems/win32/win32k/ntuser/timer.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/dll/win32/user32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/misc…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -322,13 +322,13 @@ static const BOOL g_ObjectHeapTypeShared[VALIDATE_TYPE_EVENT + 1] = { FALSE, /* VALIDATE_TYPE_FREE (not used) */ - TRUE, /* VALIDATE_TYPE_WIN */ /* FIXME: FALSE once WINDOW_OBJECT is deleted! */ - TRUE, /* VALIDATE_TYPE_MENU */ + TRUE, /* VALIDATE_TYPE_WIN FALSE */ + TRUE, /* VALIDATE_TYPE_MENU FALSE */ TRUE, /* VALIDATE_TYPE_CURSOR */ TRUE, /* VALIDATE_TYPE_MWPOS */ - TRUE, /* VALIDATE_TYPE_HOOK */ + TRUE, /* VALIDATE_TYPE_HOOK FALSE */ FALSE, /* (not used) */ - TRUE, /* VALIDATE_TYPE_CALLPROC */ + TRUE, /* VALIDATE_TYPE_CALLPROC FALSE */ TRUE, /* VALIDATE_TYPE_ACCEL */ FALSE, /* (not used) */ FALSE, /* (not used) */ @@ -357,7 +357,10 @@ uType = pEntry->type; // Must have an entry and must be the same type! - if ( (!pEntry) || (pEntry->type != uType) || !pEntry->ptr ) + if ( (!pEntry) || + (pEntry->type != uType) || + !pEntry->ptr || + (pEntry->flags & HANDLEENTRY_INDESTROY) ) { switch ( uType ) { // Test (with wine too) confirms these results! @@ -442,6 +445,13 @@ return NULL; } +// HACK HACK HACK! +typedef struct _WNDX +{ + THRDESKHEAD head; + PWND pWnd; +} WNDX, *PWNDX; + // // Validate a window handle and return the pointer to the object. // @@ -460,9 +470,6 @@ Wnd = ValidateHandle((HANDLE)hwnd, VALIDATE_TYPE_WIN); if (Wnd != NULL) { - /* FIXME: Check if handle table entry is marked as deleting and - return NULL in this case! */ - #if 0 return Wnd; #else @@ -473,8 +480,8 @@ !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!! */ - if (*((PVOID*)Wnd) != NULL) - return DesktopPtrToUser(*((PVOID*)Wnd)); + if ( ((PWNDX)Wnd)->pWnd != NULL) + return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd ); #endif } @@ -499,9 +506,6 @@ Wnd = ValidateHandleNoErr((HANDLE)hwnd, VALIDATE_TYPE_WIN); if (Wnd != NULL) { - /* FIXME: Check if handle table entry is marked as deleting and - return NULL in this case! */ - #if 0 return Wnd; #else @@ -512,8 +516,8 @@ !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!! */ - if (*((PVOID*)Wnd) != NULL) - return DesktopPtrToUser(*((PVOID*)Wnd)); + if ( ((PWNDX)Wnd)->pWnd != NULL) + return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd ); #endif } Modified: trunk/reactos/subsystems/win32/win32k/include/class.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/class.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/class.h [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -28,11 +28,11 @@ IN OUT PCALLPROCDATA CallProc); PCALLPROCDATA -CloneCallProc(IN PDESKTOPINFO Desktop, +CloneCallProc(IN PDESKTOP Desktop, IN PCALLPROCDATA CallProc); PCALLPROCDATA -CreateCallProc(IN PDESKTOPINFO Desktop, +CreateCallProc(IN PDESKTOP Desktop, IN WNDPROC WndProc, IN BOOL Unicode, IN PPROCESSINFO pi); Modified: trunk/reactos/subsystems/win32/win32k/include/object.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -7,12 +7,6 @@ #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */ #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */ - -#define USER_HEADER_TO_BODY(ObjectHeader) \ - ((PVOID)(((PUSER_OBJECT_HEADER)ObjectHeader) + 1)) - -#define USER_BODY_TO_HEADER(ObjectBody) \ - ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1)) #define HANDLEENTRY_INDESTROY 1 @@ -48,37 +42,31 @@ otWindow, otMenu, otCursorIcon, - otDWP, + otSMWP, otHook, - otCallProc = 7, + otClipBoardData, + otCallProc, otAccel, - otMonitor = 12, - otEvent = 15, - otTimer - + otDDEaccess, + otDDEconv, + otDDExact, + otMonitor, + otKBDlayout, + otKBDfile, + otEvent, + otTimer, + otInputContext, + otHidData, + otDeviceInfo, + otTouchInput, + otGestureInfo } USER_OBJECT_TYPE; - - -typedef struct _USER_OBJECT_HEADER -/* - * Header for user object - */ -{ -// USER_OBJECT_TYPE Type; - LONG RefCount; - BOOL destroyed; - HANDLE hSelf; -// CSHORT Size; -} USER_OBJECT_HEADER, *PUSER_OBJECT_HEADER; - typedef struct _USER_REFERENCE_ENTRY { SINGLE_LIST_ENTRY Entry; PVOID obj; } USER_REFERENCE_ENTRY, *PUSER_REFERENCE_ENTRY; - - #include <malloc.h> @@ -109,11 +97,11 @@ VOID FASTCALL UserReferenceObject(PVOID obj); PVOID FASTCALL UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type); BOOL FASTCALL UserDereferenceObject(PVOID obj); -PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, HANDLE* h,USER_OBJECT_TYPE type , ULONG size); +PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, struct _DESKTOP* pDesktop, HANDLE* h,USER_OBJECT_TYPE type , ULONG size); BOOL FASTCALL UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type ); PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE type ); HANDLE UserAllocHandle(PUSER_HANDLE_TABLE ht, PVOID object, USER_OBJECT_TYPE type ); -BOOL UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ); +BOOL FASTCALL UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ); PVOID UserGetNextHandle(PUSER_HANDLE_TABLE ht, HANDLE* handle, USER_OBJECT_TYPE type ); PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle ); BOOL FASTCALL UserCreateHandleTable(VOID); @@ -152,8 +140,6 @@ UserDereferenceObject(obj); } -HANDLE FASTCALL UserObjectToHandle(PVOID obj); - VOID FASTCALL CreateStockObjects (VOID); VOID FASTCALL CreateSysColorObjects (VOID); Modified: trunk/reactos/subsystems/win32/win32k/include/userfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/userfuncs.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/userfuncs.h [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -9,7 +9,7 @@ #define ASSERT_REFS_CO(_obj_) \ { \ - LONG ref = USER_BODY_TO_HEADER(_obj_)->RefCount;\ + LONG ref = ((PHEAD)_obj_)->cLockObj;\ if (!(ref >= 1)){ \ DPRINT1("ASSERT: obj 0x%x, refs %i\n", _obj_, ref); \ ASSERT(FALSE); \ @@ -21,7 +21,7 @@ { \ PSINGLE_LIST_ENTRY e; \ BOOL gotit=FALSE; \ - LONG ref = USER_BODY_TO_HEADER(_obj_)->RefCount;\ + LONG ref = ((PHEAD)_obj_)->cLockObj;\ if (!(ref >= 1)){ \ DPRINT1("obj 0x%x, refs %i\n", _obj_, ref); \ ASSERT(FALSE); \ @@ -38,7 +38,7 @@ } #endif -#define DUMP_REFS(obj) DPRINT1("obj 0x%x, refs %i\n",obj, USER_BODY_TO_HEADER(obj)->RefCount) +#define DUMP_REFS(obj) DPRINT1("obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj) PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd); Modified: trunk/reactos/subsystems/win32/win32k/include/window.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -20,10 +20,7 @@ typedef struct _WINDOW_OBJECT { - /* NOTE: Do *NOT* Move this pointer anywhere in this structure! This - is a pointer to the WINDOW structure that eventually replaces - the WINDOW_OBJECT structure! USER32 expects this pointer to - be here until WINDOW_OBJECT has completely been superseded! */ + THRDESKHEAD head; PWND Wnd; /* Pointer to the thread information */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -86,7 +86,7 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(Accel)->RefCount >= 0); + ASSERT(Accel->head.cLockObj >= 0); return Accel; } @@ -357,7 +357,7 @@ RETURN( (HACCEL) NULL ); } - Accel = UserCreateObject(gHandleTable, (PHANDLE)&hAccel, otAccel, sizeof(ACCELERATOR_TABLE)); + Accel = UserCreateObject(gHandleTable, NULL, (PHANDLE)&hAccel, otAccel, sizeof(ACCELERATOR_TABLE)); if (Accel == NULL) { Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -20,35 +20,30 @@ GetCallProcHandle(IN PCALLPROCDATA CallProc) { /* FIXME - check for 64 bit architectures... */ - return (WNDPROC)((ULONG_PTR)UserObjectToHandle(CallProc) | 0xFFFF0000); + return (WNDPROC)((ULONG_PTR)UserHMGetHandle(CallProc) | 0xFFFF0000); } VOID DestroyCallProc(IN PDESKTOPINFO Desktop, IN OUT PCALLPROCDATA CallProc) { - /* FIXME - use new object manager! */ - HANDLE Handle = UserObjectToHandle(CallProc); - - UserDeleteObject(Handle, - otCallProc); + UserDeleteObject(UserHMGetHandle(CallProc), otCallProc); } PCALLPROCDATA -CloneCallProc(IN PDESKTOPINFO Desktop, +CloneCallProc(IN PDESKTOP Desktop, IN PCALLPROCDATA CallProc) { PCALLPROCDATA NewCallProc; HANDLE Handle; - /* FIXME - use new object manager! */ NewCallProc = (PCALLPROCDATA)UserCreateObject(gHandleTable, + Desktop, &Handle, otCallProc, sizeof(CALLPROCDATA)); if (NewCallProc != NULL) { - NewCallProc->head.h = Handle; NewCallProc->pfnClientPrevious = CallProc->pfnClientPrevious; NewCallProc->wType = CallProc->wType; NewCallProc->spcpdNext = NULL; @@ -58,7 +53,7 @@ } PCALLPROCDATA -CreateCallProc(IN PDESKTOPINFO Desktop, +CreateCallProc(IN PDESKTOP Desktop, IN WNDPROC WndProc, IN BOOL Unicode, IN PPROCESSINFO pi) @@ -66,14 +61,13 @@ PCALLPROCDATA NewCallProc; HANDLE Handle; - /* FIXME - use new object manager! */ NewCallProc = (PCALLPROCDATA)UserCreateObject(gHandleTable, + Desktop, &Handle, otCallProc, sizeof(CALLPROCDATA)); if (NewCallProc != NULL) { - NewCallProc->head.h = Handle; NewCallProc->pfnClientPrevious = WndProc; NewCallProc->wType |= Unicode ? UserGetCPDA2U : UserGetCPDU2A ; NewCallProc->spcpdNext = NULL; @@ -90,7 +84,6 @@ /* NOTE: Accessing the WNDPROC_INFO structure may raise an exception! */ - /* FIXME - use new object manager! */ CallProc = UserGetObject(gHandleTable, hCallProc, otCallProc); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -95,7 +95,7 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(CurIcon)->RefCount >= 1); + ASSERT(CurIcon->head.cLockObj >= 1); return CurIcon; } @@ -348,7 +348,7 @@ PCURICON_OBJECT CurIcon; HANDLE hCurIcon; - CurIcon = UserCreateObject(gHandleTable, &hCurIcon, otCursorIcon, sizeof(CURICON_OBJECT)); + CurIcon = UserCreateObject(gHandleTable, NULL, &hCurIcon, otCursorIcon, sizeof(CURICON_OBJECT)); if (!CurIcon) { Modified: trunk/reactos/subsystems/win32/win32k/ntuser/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -138,7 +138,7 @@ RemoveEntryList(&pEH->Chain); GlobalEvents->Counts--; if (!GlobalEvents->Counts) gpsi->dwInstalledEventHooks = 0; - UserDeleteObject(pEH->head.h, otEvent); + UserDeleteObject(UserHMGetHandle(pEH), otEvent); KeLeaveCriticalRegion(); return TRUE; } @@ -160,14 +160,14 @@ pEH = pEP->pEH; - Result = co_IntCallEventProc( pEH->head.h, - event, - hwnd, - pEP->idObject, - pEP->idChild, - (DWORD_PTR)(NtCurrentTeb()->ClientId).UniqueThread, - (DWORD)EngGetTickCount(), - pEH->Proc); + Result = co_IntCallEventProc( UserHMGetHandle(pEH), + event, + hwnd, + pEP->idObject, + pEP->idChild, + (DWORD_PTR)(NtCurrentTeb()->ClientId).UniqueThread, + (DWORD)EngGetTickCount(), + pEH->Proc); return Result; } @@ -323,7 +323,7 @@ } } - pEH = UserCreateObject(gHandleTable, &Handle, otEvent, sizeof(EVENTHOOK)); + pEH = UserCreateObject(gHandleTable, NULL, &Handle, otEvent, sizeof(EVENTHOOK)); if (pEH) { InsertTailList(&GlobalEvents->Events, &pEH->Chain); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -62,9 +62,9 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(Hook)->RefCount >= 0); - - USER_BODY_TO_HEADER(Hook)->RefCount++; + ASSERT(Hook->head.cLockObj >= 0); + + Hook->head.cLockObj++; return Hook; } @@ -98,13 +98,12 @@ } } - Hook = UserCreateObject(gHandleTable, &Handle, otHook, sizeof(HOOK)); + Hook = UserCreateObject(gHandleTable, NULL, &Handle, otHook, sizeof(HOOK)); if (NULL == Hook) { return NULL; } - Hook->head.h = Handle; Hook->Thread = Thread; Hook->HookId = HookId; @@ -222,7 +221,7 @@ } /* Close handle */ - UserDeleteObject(Hook->head.h, otHook); + UserDeleteObject(UserHMGetHandle(Hook), otHook); } /* remove a hook, freeing it if the chain is not in use */ @@ -1283,7 +1282,7 @@ Hook->Proc = HookProc; Hook->Ansi = Ansi; - Handle = Hook->head.h; + Handle = UserHMGetHandle(Hook); /* Clear the client threads next hook. */ ClientInfo->phkCurrent = 0; @@ -1334,7 +1333,7 @@ RETURN( FALSE); } - ASSERT(Hook == HookObj->head.h); + ASSERT(Hook == UserHMGetHandle(HookObj)); IntRemoveHook(HookObj, WinStaObj, FALSE); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -115,7 +115,7 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(Menu)->RefCount >= 0); + ASSERT(Menu->head.cLockObj >= 0); return Menu; } @@ -179,9 +179,9 @@ PMENU_OBJECT Menu = UserGetMenuObject(hMenu); if (Menu) { - ASSERT(USER_BODY_TO_HEADER(Menu)->RefCount >= 0); - - USER_BODY_TO_HEADER(Menu)->RefCount++; + ASSERT(Menu->head.cLockObj >= 0); + + Menu->head.cLockObj++; } return Menu; } @@ -297,10 +297,11 @@ PMENU_OBJECT Menu; PPROCESSINFO CurrentWin32Process; - Menu = (PMENU_OBJECT)UserCreateObject( - gHandleTable, Handle, - otMenu, sizeof(MENU_OBJECT)); - + Menu = (PMENU_OBJECT)UserCreateObject( gHandleTable, + NULL, + Handle, + otMenu, + sizeof(MENU_OBJECT)); if(!Menu) { *Handle = 0; @@ -407,10 +408,11 @@ if(!Source) return NULL; - Menu = (PMENU_OBJECT)UserCreateObject( - gHandleTable, &hMenu, - otMenu, sizeof(MENU_OBJECT)); - + Menu = (PMENU_OBJECT)UserCreateObject( gHandleTable, + NULL, + &hMenu, + otMenu, + sizeof(MENU_OBJECT)); if(!Menu) return NULL; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -89,13 +89,12 @@ HANDLE Handle; PMONITOR Monitor; - Monitor = UserCreateObject(gHandleTable, &Handle, otMonitor, sizeof (MONITOR)); + Monitor = UserCreateObject(gHandleTable, NULL, &Handle, otMonitor, sizeof (MONITOR)); if (Monitor == NULL) { return NULL; } - Monitor->head.h = Handle; ExInitializeFastMutex(&Monitor->Lock); return Monitor; @@ -139,7 +138,7 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(Monitor)->RefCount >= 0); + ASSERT(Monitor->head.cLockObj >= 0); return Monitor; } @@ -179,7 +178,7 @@ { DPRINT("Couldn't duplicate monitor name!\n"); UserDereferenceObject(Monitor); - UserDeleteObject(Monitor->head.h, otMonitor); + UserDeleteObject(UserHMGetHandle(Monitor), otMonitor); return STATUS_INSUFFICIENT_RESOURCES; } @@ -406,7 +405,7 @@ if (iCount < listSize) { if (hMonitorList != NULL) - hMonitorList[iCount] = Monitor->head.h; + hMonitorList[iCount] = UserHMGetHandle(Monitor); if (monitorRectList != NULL) monitorRectList[iCount] = IntersectionRect; } @@ -418,7 +417,7 @@ if (iCount < listSize) { if (hMonitorList != NULL) - hMonitorList[iCount] = NearestMonitor->head.h; + hMonitorList[iCount] = UserHMGetHandle(NearestMonitor); } iCount++; } @@ -427,7 +426,7 @@ if (iCount < listSize) { if (hMonitorList != NULL) - hMonitorList[iCount] = PrimaryMonitor->head.h; + hMonitorList[iCount] = UserHMGetHandle(PrimaryMonitor); } iCount++; } @@ -763,7 +762,7 @@ { PMONITOR MonitorObj = IntGetPrimaryMonitor(); if (MonitorObj) - hMonitor = MonitorObj->head.h; + hMonitor = UserHMGetHandle(MonitorObj); } else if (dwFlags == MONITOR_DEFAULTTONEAREST) { @@ -828,7 +827,7 @@ { PMONITOR monitorObj = IntGetPrimaryMonitor(); if (monitorObj) - return monitorObj->head.h; + return UserHMGetHandle(monitorObj); } else if (dwFlags == MONITOR_DEFAULTTONEAREST) { Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -168,6 +168,7 @@ switch (type) { case otWindow: + case otInputContext: pi = GetW32ThreadInfo(); break; @@ -250,26 +251,6 @@ return entry->ptr; } -/* free a user handle */ -BOOL UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ) -{ - PUSER_HANDLE_ENTRY entry; - PVOID object; - - if (!(entry = handle_to_entry( ht, handle ))) - { - SetLastNtError( STATUS_INVALID_HANDLE ); - return FALSE; - } - - object = free_user_entry(ht, entry ); - - /* We removed the handle, which was a reference! */ - return UserDereferenceObject(object); - - return TRUE; -} - /* return the next user handle after 'handle' that is of a given type */ PVOID UserGetNextHandle(PUSER_HANDLE_TABLE ht, HANDLE* handle, USER_OBJECT_TYPE type ) { @@ -296,111 +277,6 @@ return NULL; } -PVOID FASTCALL -UserCreateObject(PUSER_HANDLE_TABLE ht, HANDLE* h,USER_OBJECT_TYPE type , ULONG size) -{ - - HANDLE hi; - PUSER_OBJECT_HEADER hdr = UserHeapAlloc(size + sizeof(USER_OBJECT_HEADER));//ExAllocatePool(PagedPool, size + sizeof(USER_OBJECT_HEADER)); - if (!hdr) - return NULL; - - - hi = UserAllocHandle(ht, USER_HEADER_TO_BODY(hdr), type ); - if (!hi) - { - //ExFreePool(hdr); - UserHeapFree(hdr); - return NULL; - } - - RtlZeroMemory(hdr, size + sizeof(USER_OBJECT_HEADER)); - hdr->hSelf = hi; - hdr->RefCount = 2; // we need this, because we create 2 refs: handle and pointer! - - if (h) - *h = hi; - return USER_HEADER_TO_BODY(hdr); -} - -BOOL FASTCALL -UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type ) -{ - PUSER_OBJECT_HEADER hdr; - PVOID body = UserGetObject(gHandleTable, h, type); - if (!body) - return FALSE; - - hdr = USER_BODY_TO_HEADER(body); - ASSERT(hdr->RefCount >= 1); - - hdr->destroyed = TRUE; - return UserFreeHandle(gHandleTable, h); -} - - -VOID FASTCALL UserReferenceObject(PVOID obj) -{ - PUSER_OBJECT_HEADER hdr = USER_BODY_TO_HEADER(obj); - - ASSERT(hdr->RefCount >= 0); - - hdr->RefCount++; -} - - -PVOID FASTCALL UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type) -{ - PVOID object; - - object = UserGetObject(gHandleTable, handle, type); - if(object) - { - UserReferenceObject(object); - } - - return object; -} - - -HANDLE FASTCALL UserObjectToHandle(PVOID obj) -{ - PUSER_OBJECT_HEADER hdr = USER_BODY_TO_HEADER(obj); - return hdr->hSelf; -} - - -BOOL FASTCALL UserDereferenceObject(PVOID obj) -{ - PUSER_OBJECT_HEADER hdr = USER_BODY_TO_HEADER(obj); - - ASSERT(hdr->RefCount >= 1); - - hdr->RefCount--; - - // You can not have a zero here! - if (!hdr->destroyed && hdr->RefCount == 0) - { - hdr->RefCount++; // BOUNCE!!!!! - DPRINT1("warning! Dereference to zero without deleting! Obj -> 0x%x\n", obj); - } - - if (hdr->RefCount == 0 && hdr->destroyed) - { -// DPRINT1("info: something destroyed bcaise of deref, in use=%i\n",gpsi->cHandleEntries); - - memset(hdr, 0x55, sizeof(USER_OBJECT_HEADER)); - - return UserHeapFree(hdr); - //ExFreePool(hdr); - - return TRUE; - } - - return FALSE; -} - - BOOL FASTCALL UserCreateHandleTable(VOID) { @@ -434,24 +310,31 @@ // PVOID FASTCALL -NewUserCreateObject( PUSER_HANDLE_TABLE ht, - HANDLE* h, - USER_OBJECT_TYPE type, - ULONG size) +UserCreateObject( PUSER_HANDLE_TABLE ht, + PDESKTOP pDesktop, + HANDLE* h, + USER_OBJECT_TYPE type, + ULONG size) { HANDLE hi; PVOID Object; PTHREADINFO pti; PPROCESSINFO ppi; BOOL dt; + PDESKTOP rpdesk = pDesktop; pti = GetW32ThreadInfo(); ppi = pti->ppi; + if (!pDesktop) rpdesk = pti->rpdesk; switch (type) { - case otWindow: - Object = DesktopHeapAlloc(pti->rpdesk, size); +// case otWindow: +// case otMenu: +// case otHook: +// case otCallProc: + case otInputContext: + Object = DesktopHeapAlloc(rpdesk, size); dt = TRUE; break; @@ -469,7 +352,7 @@ if (!hi) { if (dt) - DesktopHeapFree(pti->rpdesk, Object); + DesktopHeapFree(rpdesk, Object); else UserHeapFree(Object); return NULL; @@ -481,7 +364,8 @@ { case otWindow: case otHook: - ((PTHRDESKHEAD)Object)->rpdesk = pti->rpdesk; + case otInputContext: + ((PTHRDESKHEAD)Object)->rpdesk = rpdesk; ((PTHRDESKHEAD)Object)->pSelf = Object; case otEvent: ((PTHROBJHEAD)Object)->pti = pti; @@ -489,7 +373,7 @@ case otMenu: case otCallProc: - ((PPROCDESKHEAD)Object)->rpdesk = pti->rpdesk; + ((PPROCDESKHEAD)Object)->rpdesk = rpdesk; ((PPROCDESKHEAD)Object)->pSelf = Object; break; @@ -509,9 +393,10 @@ return Object; } + BOOL FASTCALL -NewUserDereferenceObject(PVOID obj) +UserDereferenceObject(PVOID obj) { ASSERT(((PHEAD)obj)->cLockObj >= 1); @@ -524,7 +409,7 @@ BOOL FASTCALL -NewUserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ) +UserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ) { PUSER_HANDLE_ENTRY entry; PVOID object; @@ -538,23 +423,30 @@ entry->flags = HANDLEENTRY_INDESTROY; - if (NewUserDereferenceObject(entry->ptr)) + if (UserDereferenceObject(entry->ptr)) { type = entry->type; object = free_user_entry(ht, entry ); - if (type == otWindow) // If more, go switch. + switch (type) { - return DesktopHeapFree(GetW32ThreadInfo()->rpdesk, object); +// case otWindow: +// case otMenu: +// case otHook: +// case otCallProc: + case otInputContext: + return DesktopHeapFree(((PTHRDESKHEAD)object)->rpdesk, object); + + default: + return UserHeapFree(object); } - return UserHeapFree(object); } return FALSE; } BOOL FASTCALL -NewUserDeleteObject(HANDLE h, USER_OBJECT_TYPE type ) +UserDeleteObject(HANDLE h, USER_OBJECT_TYPE type ) { PVOID body = UserGetObject(gHandleTable, h, type); @@ -562,12 +454,12 @@ ASSERT( ((PHEAD)body)->cLockObj >= 1); - return NewUserFreeHandle(gHandleTable, h); + return UserFreeHandle(gHandleTable, h); } VOID FASTCALL -NewUserReferenceObject(PVOID obj) +UserReferenceObject(PVOID obj) { ASSERT(((PHEAD)obj)->cLockObj >= 0); @@ -576,14 +468,14 @@ PVOID FASTCALL -NewUserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type) +UserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type) { PVOID object; object = UserGetObject(gHandleTable, handle, type); if (object) { - NewUserReferenceObject(object); + UserReferenceObject(object); } return object; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -49,13 +49,13 @@ if (!FirstpTmr) { - FirstpTmr = UserCreateObject(gHandleTable, &Handle, otTimer, sizeof(TIMER)); + FirstpTmr = UserCreateObject(gHandleTable, NULL, &Handle, otTimer, sizeof(TIMER)); if (FirstpTmr) InitializeListHead(&FirstpTmr->ptmrList); Ret = FirstpTmr; } else { - Ret = UserCreateObject(gHandleTable, &Handle, otTimer, sizeof(TIMER)); + Ret = UserCreateObject(gHandleTable, NULL, &Handle, otTimer, sizeof(TIMER)); if (Ret) InsertTailList(&FirstpTmr->ptmrList, &Ret->ptmrList); } return Ret; @@ -69,7 +69,7 @@ if (pTmr) { RemoveEntryList(&pTmr->ptmrList); - UserDeleteObject( USER_BODY_TO_HEADER(pTmr)->hSelf, otTimer); + UserDeleteObject( UserHMGetHandle(pTmr), otTimer); return TRUE; } return FALSE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Jan 15 14:47:25 2010 @@ -93,9 +93,9 @@ Window = UserGetWindowObject(hWnd); if (Window) { - ASSERT(USER_BODY_TO_HEADER(Window)->RefCount >= 0); - - USER_BODY_TO_HEADER(Window)->RefCount++; + ASSERT(Window->head.cLockObj >= 0); + + Window->head.cLockObj++; } return Window; } @@ -129,7 +129,7 @@ return NULL; } - ASSERT(USER_BODY_TO_HEADER(Window)->RefCount >= 0); + ASSERT(Window->head.cLockObj >= 0); return Window; } @@ -1806,6 +1806,7 @@ /* Create the window object. */ Window = (PWINDOW_OBJECT) UserCreateObject( gHandleTable, + pti->rpdesk, (PHANDLE)&hWnd, otWindow, sizeof(WINDOW_OBJECT));
14 years, 11 months
1
0
0
0
[tkreuzer] 45084: Reduce difference to trunk
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Jan 15 14:09:00 2010 New Revision: 45084 URL:
http://svn.reactos.org/svn/reactos?rev=45084&view=rev
Log: Reduce difference to trunk Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Fri Jan 15 14:09:00 2010 @@ -1004,9 +1004,9 @@ /* Call the generic handler with the system module list */ Status = ExpQueryModuleInformation(&PsLoadedModuleList, &MmLoadedUserImageList, - (PRTL_PROCESS_MODULES)Buffer, - Size, - ReqSize); + (PRTL_PROCESS_MODULES)Buffer, + Size, + ReqSize); /* Release list lock and return status */ ExReleaseResourceLite(&PsLoadedModuleResource); @@ -1238,7 +1238,6 @@ QSI_DEF(SystemInterruptInformation) { PKPRCB Prcb; - PKPCR Pcr; LONG i; ULONG ti; PSYSTEM_INTERRUPT_INFORMATION sii = (PSYSTEM_INTERRUPT_INFORMATION)Buffer; @@ -1253,16 +1252,7 @@ for (i = 0; i < KeNumberProcessors; i++) { Prcb = KiProcessorBlock[i]; -#ifdef _M_AMD64 - Pcr = CONTAINING_RECORD(Prcb, KPCR, CurrentPrcb); -#else - Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb); -#endif -#ifdef _M_ARM // This code should probably be done differently - sii->ContextSwitches = Pcr->ContextSwitches; -#else - sii->ContextSwitches = ((PKIPCR)Pcr)->ContextSwitches; -#endif + sii->ContextSwitches = KeGetContextSwitches(Prcb); sii->DpcCount = Prcb->DpcData[0].DpcCount; sii->DpcRate = Prcb->DpcRequestRate; sii->TimeIncrement = ti; @@ -1382,11 +1372,11 @@ PVOID SectionPointer = Buffer; /* Validate size */ - if(Size != sizeof(PVOID)) + if (Size != sizeof(PVOID)) { /* Incorrect length, fail */ return STATUS_INFO_LENGTH_MISMATCH; - } + } /* Only kernel mode can call this function */ if (ExGetPreviousMode() != KernelMode) return STATUS_PRIVILEGE_NOT_HELD; @@ -1394,7 +1384,7 @@ /* Unload the image */ MmUnloadSystemImage(SectionPointer); return STATUS_SUCCESS; - } +} /* Class 28 - Time Adjustment Information */ QSI_DEF(SystemTimeAdjustmentInformation)
14 years, 11 months
1
0
0
0
[tkreuzer] 45083: [NTOS] Enable fx save restore support earlier and uncomment it in trap handlers.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Jan 15 12:27:54 2010 New Revision: 45083 URL:
http://svn.reactos.org/svn/reactos?rev=45083&view=rev
Log: [NTOS] Enable fx save restore support earlier and uncomment it in trap handlers. Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/cpu.c [iso-8859-1] Fri Jan 15 12:27:54 2010 @@ -277,9 +277,6 @@ /* Disable fpu monitoring */ __writecr0(__readcr0() & ~CR0_MP); - /* Enable fx save restore support */ - __writecr4(__readcr4() | CR4_FXSR); - } VOID Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Fri Jan 15 12:27:54 2010 @@ -679,6 +679,9 @@ /* LDT is unused */ // __lldt(0); + /* Enable fx save restore support */ + __writecr4(__readcr4() | CR4_FXSR); + /* Align stack to 16 bytes */ LoaderBlock->KernelStack &= ~(16 - 1); Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Fri Jan 15 12:27:54 2010 @@ -117,12 +117,12 @@ .if (TRAPFLAGS & TRAPFLAG_XMM) /* Save xmm registers */ -// movdqa [rbp + KTRAP_FRAME_Xmm0], xmm0 -// movdqa [rbp + KTRAP_FRAME_Xmm1], xmm1 -// movdqa [rbp + KTRAP_FRAME_Xmm2], xmm2 -// movdqa [rbp + KTRAP_FRAME_Xmm3], xmm3 -// movdqa [rbp + KTRAP_FRAME_Xmm4], xmm4 -// movdqa [rbp + KTRAP_FRAME_Xmm5], xmm5 + movdqa [rbp + KTRAP_FRAME_Xmm0], xmm0 + movdqa [rbp + KTRAP_FRAME_Xmm1], xmm1 + movdqa [rbp + KTRAP_FRAME_Xmm2], xmm2 + movdqa [rbp + KTRAP_FRAME_Xmm3], xmm3 + movdqa [rbp + KTRAP_FRAME_Xmm4], xmm4 + movdqa [rbp + KTRAP_FRAME_Xmm5], xmm5 .endif .if (TRAPFLAGS & TRAPFLAG_SEGMENTS) @@ -221,12 +221,12 @@ .if (TRAPFLAGS & TRAPFLAG_XMM) /* Restore xmm registers */ -// movdqa xmm0, [rbp + KTRAP_FRAME_Xmm0] -// movdqa xmm1, [rbp + KTRAP_FRAME_Xmm1] -// movdqa xmm2, [rbp + KTRAP_FRAME_Xmm2] -// movdqa xmm3, [rbp + KTRAP_FRAME_Xmm3] -// movdqa xmm4, [rbp + KTRAP_FRAME_Xmm4] -// movdqa xmm5, [rbp + KTRAP_FRAME_Xmm5] + movdqa xmm0, [rbp + KTRAP_FRAME_Xmm0] + movdqa xmm1, [rbp + KTRAP_FRAME_Xmm1] + movdqa xmm2, [rbp + KTRAP_FRAME_Xmm2] + movdqa xmm3, [rbp + KTRAP_FRAME_Xmm3] + movdqa xmm4, [rbp + KTRAP_FRAME_Xmm4] + movdqa xmm5, [rbp + KTRAP_FRAME_Xmm5] .endif /* Restore rbp */
14 years, 11 months
1
0
0
0
[tkreuzer] 45082: [NTOS] Implement InterruptDispatchTable, containing 256 dispatch stubs, that push the Vector on the stack and then jump to KiUnexpectedInterrupt. This way we have the vector as ErrorCode on the stack and we can report it with KeBugCheckWithTf.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Jan 15 01:13:38 2010 New Revision: 45082 URL:
http://svn.reactos.org/svn/reactos?rev=45082&view=rev
Log: [NTOS] Implement InterruptDispatchTable, containing 256 dispatch stubs, that push the Vector on the stack and then jump to KiUnexpectedInterrupt. This way we have the vector as ErrorCode on the stack and we can report it with KeBugCheckWithTf. Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/except.c [iso-8859-1] Fri Jan 15 01:13:38 2010 @@ -12,6 +12,8 @@ #include <ntoskrnl.h> #define NDEBUG #include <debug.h> + +extern ULONG64 InterruptDispatchTable[256]; /* GLOBALS *******************************************************************/ @@ -73,7 +75,7 @@ } else { - Offset = (ULONG64)KiUnexpectedInterrupt; + Offset = (ULONG64)&InterruptDispatchTable[i]; KiIdt[i].Dpl = 0; KiIdt[i].IstIndex = 0; } Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Fri Jan 15 01:13:38 2010 @@ -28,10 +28,10 @@ .ascii "BreakpointTrap at %p\n\0" _MsgUnexpectedInterrupt: -.ascii "UnexpectedInterrupt\n\0" +.ascii "UnexpectedInterrupt Vector=0x%02lx\n\0" _MsgInvalidOpcodeFault: -.ascii "General protection fault at %p!\n\0" +.ascii "Invalid opcode fault at %p!\n\0" _MsgDoubleFault: .ascii "Double fault at %p, rbp=%p!\n\0" @@ -242,6 +242,17 @@ .text .code64 +.align 8 +.global _InterruptDispatchTable +_InterruptDispatchTable: +.set Vector, 0 +.rept 256 + push Vector + jmp _KiUnexpectedInterrupt + .align 8 + .set Vector, Vector+1 +.endr + // rbp = TrapFrame, eax = ExceptionCode, edx = NumParams, r9,r10,r11 = params _InternalDispatchException: @@ -779,23 +790,20 @@ .proc KiUnexpectedInterrupt .pushframe 0 - /* Push pseudo error code */ - push 0 - .allocstack 0x8 + + /* The error code is the vector */ cli ENTER_TRAP_FRAME TRAPFLAG_ALL - lea rcx, _MsgUnexpectedInterrupt[rip] - call _FrLdrDbgPrint[rip] - + /* Set bugcheck parameters */ mov ecx, TRAP_CAUSE_UNKNOWN -// mov rdx, // The unexpected interrupt -// mov rdx, // The unknown floating-point exception -// mov r8, // The enabled and asserted status bits - xor r9, r9 // Reserved - mov [rbp + KTRAP_FRAME_P5], rbp // trap frame + mov rdx, [rbp + KTRAP_FRAME_ErrorCode] // the vector + mov r8, 0 // The unknown floating-point exception + mov r9, 0 // The enabled and asserted status bits + sub rsp, 8 + mov [rbp + KTRAP_FRAME_P5 + 8], rbp // trap frame call _KeBugCheckWithTf .endproc
14 years, 11 months
1
0
0
0
[fireball] 45081: [winetests] - Sync gdi32 and user32 winetests to Wine-1.1.36.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jan 14 23:35:53 2010 New Revision: 45081 URL:
http://svn.reactos.org/svn/reactos?rev=45081&view=rev
Log: [winetests] - Sync gdi32 and user32 winetests to Wine-1.1.36. Added: trunk/rostests/winetests/user32/uitools.c (with props) Modified: trunk/rostests/winetests/gdi32/font.c trunk/rostests/winetests/gdi32/metafile.c trunk/rostests/winetests/user32/clipboard.c trunk/rostests/winetests/user32/dialog.c trunk/rostests/winetests/user32/edit.c trunk/rostests/winetests/user32/listbox.c trunk/rostests/winetests/user32/menu.c trunk/rostests/winetests/user32/msg.c trunk/rostests/winetests/user32/sysparams.c trunk/rostests/winetests/user32/testlist.c trunk/rostests/winetests/user32/user32.rbuild trunk/rostests/winetests/user32/winstation.c Modified: trunk/rostests/winetests/gdi32/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdi32/font.c?re…
============================================================================== --- trunk/rostests/winetests/gdi32/font.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdi32/font.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -2848,6 +2848,29 @@ DeleteDC(hdc); } +static void test_oemcharset(void) +{ + HDC hdc; + LOGFONTA lf; + HFONT hfont, old_hfont; + int charset; + + hdc = CreateCompatibleDC(0); + ZeroMemory(&lf, sizeof(lf)); + lf.lfHeight = 12; + lf.lfCharSet = OEM_CHARSET; + lf.lfPitchAndFamily = FIXED_PITCH | FF_MODERN; + lstrcpyA(lf.lfFaceName, "Terminal"); + hfont = CreateFontIndirectA(&lf); + old_hfont = SelectObject(hdc, hfont); + charset = GetTextCharset(hdc); +todo_wine + ok(charset == OEM_CHARSET, "expected %d charset, got %d\n", OEM_CHARSET, charset); + SelectObject(hdc, old_hfont); + DeleteObject(hfont); + DeleteDC(hdc); +} + static void test_GetGlyphOutline(void) { MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} }; @@ -2978,6 +3001,39 @@ width, height, ratio, width, ave_width, scale); ok(ratio >= 90 && ratio <= 110, "expected width/height ratio 90-110, got %d\n", ratio); +} + +static void test_CreateFontIndirect(void) +{ + LOGFONTA lf, getobj_lf; + int ret, i; + HFONT hfont; + char TestName[][16] = {"Arial", "Arial Bold", "Arial Italic", "Arial Baltic"}; + + memset(&lf, 0, sizeof(lf)); + lf.lfCharSet = ANSI_CHARSET; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfHeight = 16; + lf.lfWidth = 16; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfItalic = FALSE; + lf.lfWeight = FW_DONTCARE; + + for (i = 0; i < sizeof(TestName)/sizeof(TestName[0]); i++) + { + lstrcpyA(lf.lfFaceName, TestName[i]); + hfont = CreateFontIndirectA(&lf); + ok(hfont != 0, "CreateFontIndirectA failed\n"); + ret = GetObject(hfont, sizeof(getobj_lf), &getobj_lf); + ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic); + ok(lf.lfWeight == getobj_lf.lfWeight || + broken((SHORT)lf.lfWeight == getobj_lf.lfWeight), /* win9x */ + "lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight); + ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName) || + broken(!memcmp(lf.lfFaceName, getobj_lf.lfFaceName, LF_FACESIZE-1)), /* win9x doesn't ensure '\0' termination */ + "font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName); + DeleteObject(hfont); + } } START_TEST(font) @@ -3023,4 +3079,6 @@ test_GetTextMetrics2("Arial", -11); test_GetTextMetrics2("Arial", -55); test_GetTextMetrics2("Arial", -110); -} + test_CreateFontIndirect(); + test_oemcharset(); +} Modified: trunk/rostests/winetests/gdi32/metafile.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/gdi32/metafile.…
============================================================================== --- trunk/rostests/winetests/gdi32/metafile.c [iso-8859-1] (original) +++ trunk/rostests/winetests/gdi32/metafile.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -1030,6 +1030,63 @@ 0x14, 0x00, 0x00, 0x00 }; +static const unsigned char EMF_BITBLT[] = +{ + 0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6a, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, + 0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00, + 0xa0, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x23, 0x04, 0x00, 0x00, 0x3b, 0x02, 0x00, 0x00, + 0x75, 0x01, 0x00, 0x00, 0xc9, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0xb1, 0x05, 0x00, + 0x28, 0x11, 0x03, 0x00, 0x4c, 0x00, 0x00, 0x00, + 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0xcc, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x64, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x8c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4c, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x62, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 +}; + + /* For debugging or dumping the raw metafiles produced by * new test functions. */ @@ -1380,6 +1437,70 @@ offset2 += emr2->nSize; } return 0; +} + + +/* tests blitting to an EMF */ +static void test_emf_BitBlt(void) +{ + HDC hdcDisplay, hdcMetafile, hdcBitmap; + HBITMAP hBitmap, hOldBitmap; + HENHMETAFILE hMetafile; +#define BMP_DIM 4 + BITMAPINFOHEADER bmih = + { + sizeof(BITMAPINFOHEADER), + BMP_DIM,/* biWidth */ + BMP_DIM,/* biHeight */ + 1, /* biPlanes */ + 24, /* biBitCount */ + BI_RGB, /* biCompression */ + 0, /* biXPelsPerMeter */ + 0, /* biYPelsPerMeter */ + 0, /* biClrUsed */ + 0, /* biClrImportant */ + }; + void *bits; + BOOL ret; + + hdcDisplay = CreateDCA("DISPLAY", NULL, NULL, NULL); + ok( hdcDisplay != 0, "CreateDCA error %d\n", GetLastError() ); + + hdcBitmap = CreateCompatibleDC(hdcDisplay); + ok( hdcBitmap != 0, "CreateCompatibleDC failed\n" ); + bmih.biXPelsPerMeter = MulDiv(GetDeviceCaps(hdcDisplay, LOGPIXELSX), 100, 3937); + bmih.biYPelsPerMeter = MulDiv(GetDeviceCaps(hdcDisplay, LOGPIXELSY), 100, 3937); + hBitmap = CreateDIBSection(hdcDisplay, (const BITMAPINFO *)&bmih, + DIB_RGB_COLORS, &bits, NULL, 0); + hOldBitmap = SelectObject(hdcBitmap, hBitmap); + + hdcMetafile = CreateEnhMetaFileA(hdcBitmap, NULL, NULL, NULL); + ok( hdcMetafile != 0, "CreateEnhMetaFileA failed\n" ); + + /* First fill the bitmap DC with something recognizable, like BLACKNESS */ + ret = BitBlt(hdcBitmap, 0, 0, BMP_DIM, BMP_DIM, 0, 0, 0, BLACKNESS); + ok( ret, "BitBlt(BLACKNESS) failed\n" ); + + ret = BitBlt(hdcMetafile, 0, 0, BMP_DIM, BMP_DIM, hdcBitmap, 0, 0, SRCCOPY); + ok( ret, "BitBlt(SRCCOPY) failed\n" ); + ret = BitBlt(hdcMetafile, 0, 0, BMP_DIM, BMP_DIM, 0, 0, 0, WHITENESS); + ok( ret, "BitBlt(WHITENESS) failed\n" ); + + hMetafile = CloseEnhMetaFile(hdcMetafile); + ok( hMetafile != 0, "CloseEnhMetaFile failed\n" ); + + if(compare_emf_bits(hMetafile, EMF_BITBLT, sizeof(EMF_BITBLT), + "emf_BitBlt", FALSE) != 0) + { + dump_emf_bits(hMetafile, "emf_BitBlt"); + dump_emf_records(hMetafile, "emf_BitBlt"); + } + + SelectObject(hdcBitmap, hOldBitmap); + DeleteObject(hBitmap); + DeleteDC(hdcBitmap); + DeleteDC(hdcDisplay); +#undef BMP_DIM } /* Test a blank metafile. May be used as a template for new tests. */ @@ -1953,8 +2074,11 @@ SetRect(&rc_sclip, 100, 100, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); hrgn = CreateRectRgn(rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom); SelectClipRgn(hdc, hrgn); - GetClipBox(hdc, &rc_res); - todo_wine ok(EqualRect(&rc_res, &rc_sclip), + ret = GetClipBox(hdc, &rc_res); +todo_wine + ok(ret == SIMPLEREGION, "got %d\n", ret); + if(ret == SIMPLEREGION) + ok(EqualRect(&rc_res, &rc_sclip), "expected rc_res (%d, %d) - (%d, %d), got (%d, %d) - (%d, %d)\n", rc_sclip.left, rc_sclip.top, rc_sclip.right, rc_sclip.bottom, rc_res.left, rc_res.top, rc_res.right, rc_res.bottom); @@ -2625,6 +2749,7 @@ /* For enhanced metafiles (enhmfdrv) */ test_ExtTextOut(); test_SaveDC(); + test_emf_BitBlt(); /* For win-format metafiles (mfdrv) */ test_mf_SaveDC(); Modified: trunk/rostests/winetests/user32/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/clipboar…
============================================================================== --- trunk/rostests/winetests/user32/clipboard.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/clipboard.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -56,7 +56,8 @@ SetLastError(0xdeadbeef); ok(!CloseClipboard(), "CloseClipboard should fail if clipboard wasn't open\n"); - test_last_error(ERROR_CLIPBOARD_NOT_OPEN); + ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "wrong error %u\n", GetLastError()); ok(OpenClipboard(0), "OpenClipboard failed\n"); ok(!GetClipboardOwner(), "clipboard should still be not owned\n"); @@ -188,7 +189,8 @@ SetLastError(0xdeadbeef); ok(!EmptyClipboard(), "EmptyClipboard should fail if clipboard wasn't open\n"); - test_last_error(ERROR_CLIPBOARD_NOT_OPEN); + ok(GetLastError() == ERROR_CLIPBOARD_NOT_OPEN || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "Wrong error %u\n", GetLastError()); } static HGLOBAL create_text(void) Modified: trunk/rostests/winetests/user32/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/dialog.c…
============================================================================== --- trunk/rostests/winetests/user32/dialog.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/dialog.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -464,7 +464,6 @@ static LRESULT CALLBACK main_window_procA (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { - LRESULT result; switch (uiMsg) { /* Add blank case statements for these to ensure we don't use them @@ -485,20 +484,19 @@ break; } - result=DefWindowProcA (hwnd, uiMsg, wParam, lParam); - return result; + return DefWindowProcA (hwnd, uiMsg, wParam, lParam); } static LRESULT CALLBACK disabled_test_proc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { - LRESULT result; - DWORD dw; - HWND hwndOk; - switch (uiMsg) { case WM_INITDIALOG: + { + DWORD dw; + HWND hwndOk; + dw = SendMessage(hwnd, DM_GETDEFID, 0, 0); assert(DC_HASDEFID == HIWORD(dw)); hwndOk = GetDlgItem(hwnd, LOWORD(dw)); @@ -508,6 +506,7 @@ PostMessage(hwnd, WM_KEYDOWN, VK_RETURN, 0); PostMessage(hwnd, WM_COMMAND, IDCANCEL, 0); break; + } case WM_COMMAND: if (wParam == IDOK) { @@ -523,14 +522,12 @@ break; } - result=DefWindowProcA (hwnd, uiMsg, wParam, lParam); - return result; + return DefWindowProcA (hwnd, uiMsg, wParam, lParam); } static LRESULT CALLBACK testDlgWinProc (HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam) { - LRESULT result; switch (uiMsg) { /* Add blank case statements for these to ensure we don't use them @@ -544,8 +541,7 @@ (LPCREATESTRUCTA) lParam) ? 0 : (LRESULT) -1); } - result=DefWindowProcA (hwnd, uiMsg, wParam, lParam); - return result; + return DefDlgProcA (hwnd, uiMsg, wParam, lParam); } static BOOL RegisterWindowClasses (void) Modified: trunk/rostests/winetests/user32/edit.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/edit.c?r…
============================================================================== --- trunk/rostests/winetests/user32/edit.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/edit.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -1070,11 +1070,11 @@ mid = lo + (hi - lo) / 2; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(0 == ret, "expected 0 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1088,11 +1088,11 @@ mid = lo + (hi - lo) / 2; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(0 == ret, "expected 0 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1106,11 +1106,11 @@ mid = lo + (hi - lo) / 2; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(0 == ret, "expected 0 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1124,11 +1124,11 @@ mid = lo + (hi - lo) / 2 +1; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1142,11 +1142,11 @@ mid = lo + (hi - lo) / 2 +1; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1160,11 +1160,11 @@ mid = lo + (hi - lo) / 2 +1; for (i = lo; i < mid; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { - ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); + ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, i)); ok(1 == ret, "expected 1 got %d\n", ret); } ret = SendMessage(hwEdit, EM_POSFROMCHAR, 2, 0); @@ -1524,7 +1524,7 @@ /* Edit controls that are in a parent window */ hwEdit = create_child_editcontrol(style | WS_VISIBLE, 0); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 0); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 0); @@ -1534,7 +1534,7 @@ destroy_child_editcontrol(hwEdit); hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, 0); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, b); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , b); @@ -1545,7 +1545,7 @@ destroy_child_editcontrol(hwEdit); hwEdit = create_child_editcontrol(style | WS_VISIBLE, WS_EX_CLIENTEDGE); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1); @@ -1555,7 +1555,7 @@ destroy_child_editcontrol(hwEdit); hwEdit = create_child_editcontrol(style | WS_BORDER | WS_VISIBLE, WS_EX_CLIENTEDGE); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1); @@ -1568,7 +1568,7 @@ /* Edit controls that are popup windows */ hwEdit = create_editcontrol(style | WS_POPUP, 0); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 0); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 0); @@ -1578,7 +1578,7 @@ DestroyWindow(hwEdit); hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, 0); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, b); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , b); @@ -1589,7 +1589,7 @@ DestroyWindow(hwEdit); hwEdit = create_editcontrol(style | WS_POPUP, WS_EX_CLIENTEDGE); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1); @@ -1599,7 +1599,7 @@ DestroyWindow(hwEdit); hwEdit = create_editcontrol(style | WS_POPUP | WS_BORDER, WS_EX_CLIENTEDGE); - SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, (LPARAM) FALSE); + SendMessage(hwEdit, WM_SETFONT, (WPARAM) font, FALSE); if (single_line) check_pos(hwEdit, metrics.tmHeight - 1, 0, metrics.tmHeight - 1, 1); check_pos(hwEdit, metrics.tmHeight , 0, metrics.tmHeight , 1); @@ -2179,7 +2179,7 @@ len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0); ok(11 == len, "expected 11, got %d\n", len); - r = SendMessage(hwEdit, WM_GETDLGCODE, (WPARAM)NULL, (LPARAM)NULL); + r = SendMessage(hwEdit, WM_GETDLGCODE, 0, 0); ok(0x8d == r, "expected 0x8d, got 0x%x\n", r); r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001); @@ -2187,7 +2187,7 @@ len = SendMessage(hwEdit, WM_GETTEXTLENGTH, 0, 0); ok(13 == len, "expected 13, got %d\n", len); - r = SendMessage(hwEdit, WM_GETDLGCODE, (WPARAM)NULL, (LPARAM)&msg); + r = SendMessage(hwEdit, WM_GETDLGCODE, 0, (LPARAM)&msg); ok(0x8d == r, "expected 0x8d, got 0x%x\n", r); r = SendMessage(hwEdit, WM_CHAR, VK_RETURN, 0x1c0001); ok(1 == r, "expected 1, got %d\n", r); Modified: trunk/rostests/winetests/user32/listbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
============================================================================== --- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -146,7 +146,7 @@ listbox_query (hLB, &answer); listbox_ok (test, init, answer); - SendMessage (hLB, LB_GETITEMRECT, (WPARAM) 1, (LPARAM) &second_item); + SendMessage (hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item); buttonpress(hLB, (WORD)second_item.left, (WORD)second_item.top); listbox_query (hLB, &answer); @@ -354,7 +354,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_1, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -363,7 +363,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_3, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -372,7 +372,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -381,7 +381,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_1, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -390,7 +390,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -399,7 +399,7 @@ listbox_query(hLB, &answer); listbox_test_query(test_2, answer); - SendMessage(hLB, LB_SETSEL, FALSE, (LPARAM)-1); + SendMessage(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); @@ -1112,7 +1112,7 @@ "expected conversion to uppercase, got %s\n", pathBuffer); /* Loaded path should have overwritten the label text */ - SendMessage(g_label, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)pathBuffer); + SendMessage(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer); trace("Static control after DlgDirList: %s\n", pathBuffer); ok (strcmp("default contents", pathBuffer), "DlgDirList() did not modify static control!\n"); Modified: trunk/rostests/winetests/user32/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/menu.c?r…
============================================================================== --- trunk/rostests/winetests/user32/menu.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/menu.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -390,8 +390,9 @@ ok( ret == itemid , "TrackPopupMenu returned %d error is %d\n", ret, gle); } ok( gle == 0 || - broken( gle == ERROR_INVALID_PARAMETER), /* win2k0 */ - "Last error is %d\n", gle); + broken(gle == 0xdeadbeef) || /* wow64 */ + broken(gle == ERROR_INVALID_PARAMETER), /* win2k0 */ + "Last error is %d\n", gle); } /* clean up */ DestroyMenu( hmenu); Modified: trunk/rostests/winetests/user32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/msg.c?re…
============================================================================== --- trunk/rostests/winetests/user32/msg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/msg.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -161,7 +161,7 @@ { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, /* Win9x: SWP_NOSENDCHANGING */ { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_NCACTIVATE, sent }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ACTIVATE, sent|wparam, 1 }, { HCBT_SETFOCUS, hook }, @@ -268,7 +268,7 @@ { WM_NCPAINT, sent|optional }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, - { WM_WINDOWPOSCHANGED, sent|wparam, /*SWP_NOZORDER|*/SWP_NOACTIVATE, 0, + { WM_WINDOWPOSCHANGED, sent|wparam|optional, /*SWP_NOZORDER|*/SWP_NOACTIVATE, 0, SWP_NOMOVE|SWP_NOCLIENTMOVE|SWP_NOSIZE|SWP_NOCLIENTSIZE }, { WM_MOVE, sent|defwinproc|optional }, { WM_SIZE, sent|defwinproc|optional }, @@ -631,9 +631,10 @@ { WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { WM_SIZE, sent|optional }, /* XP doesn't send it */ { WM_MOVE, sent|optional }, /* XP doesn't send it */ - { WM_NCACTIVATE, sent|wparam, 0 }, - { WM_ACTIVATE, sent|wparam, 0 }, - { WM_ACTIVATEAPP, sent|wparam, 0 }, + { WM_NCACTIVATE, sent|wparam|optional, 0 }, + { WM_ACTIVATE, sent|wparam|optional, 0 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, + { HCBT_SETFOCUS, hook|optional }, { WM_KILLFOCUS, sent|wparam, 0 }, { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, { WM_IME_NOTIFY, sent|wparam|optional|defwinproc, 1 }, @@ -1776,7 +1777,8 @@ message == WM_GETOBJECT || message == WM_TIMECHANGE || message == WM_DISPLAYCHANGE || - message == WM_DEVICECHANGE); + message == WM_DEVICECHANGE || + message == WM_DWMNCRENDERINGCHANGED); } @@ -5384,6 +5386,7 @@ UpdateWindow(hwnd); SetFocus(0); flush_events(); + SetFocus(0); flush_sequence(); log_all_parent_messages++; @@ -6866,8 +6869,8 @@ { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_APPS, 0xc0000001 }, /* XP */ { WM_KEYUP, wparam|lparam, VK_APPS, 0xc0000001 }, { WM_KEYUP, sent|wparam|lparam, VK_APPS, 0xc0000001 }, - { WM_CONTEXTMENU, lparam, /*hwnd*/0, (LPARAM)-1 }, - { WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, (LPARAM)-1 }, + { WM_CONTEXTMENU, lparam, /*hwnd*/0, -1 }, + { WM_CONTEXTMENU, sent|lparam, /*hwnd*/0, -1 }, { 0 } }; static const struct message WmVkF10Seq[] = { @@ -9324,17 +9327,21 @@ skip( "queuing key events not supported\n" ); goto done; } - ok(qstatus == MAKELONG(QS_KEY, QS_KEY), + ok(qstatus == MAKELONG(QS_KEY, QS_KEY) || + /* keybd_event seems to trigger a sent message on NT4 */ + qstatus == MAKELONG(QS_KEY|QS_SENDMESSAGE, QS_KEY|QS_SENDMESSAGE), "wrong qstatus %08x\n", qstatus); PostMessageA(info.hwnd, WM_CHAR, 'z', 0); qstatus = GetQueueStatus(qs_all_input); - ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), + ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY) || + qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY|QS_SENDMESSAGE), "wrong qstatus %08x\n", qstatus); InvalidateRect(info.hwnd, NULL, FALSE); qstatus = GetQueueStatus(qs_all_input); - ok(qstatus == MAKELONG(QS_PAINT, QS_PAINT|QS_POSTMESSAGE|QS_KEY), + ok(qstatus == MAKELONG(QS_PAINT, QS_PAINT|QS_POSTMESSAGE|QS_KEY) || + qstatus == MAKELONG(QS_PAINT, QS_PAINT|QS_POSTMESSAGE|QS_KEY|QS_SENDMESSAGE), "wrong qstatus %08x\n", qstatus); trace("signalling to send message\n"); @@ -9896,7 +9903,7 @@ /* Timer proc messages are not dispatched to the window proc, * and therefore not logged. */ - if (msg.message == WM_TIMER || msg.message == WM_SYSTIMER) + if ((msg.message == WM_TIMER || msg.message == WM_SYSTIMER) && msg.hwnd) { struct recvd_message s_msg; @@ -10291,8 +10298,8 @@ }; static const struct message WmHide_1[] = { { WM_SHOWWINDOW, sent|wparam, 0 }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE, 0, SWP_NOACTIVATE }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE, 0, SWP_NOACTIVATE }, { HCBT_ACTIVATE, hook|optional }, { HCBT_SETFOCUS, hook|optional }, /* win2000 sends it */ { 0 } @@ -10840,6 +10847,7 @@ { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE }, { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, { WM_NCACTIVATE, sent|wparam, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ACTIVATE, sent|wparam, 1 }, @@ -12014,10 +12022,271 @@ flush_events(); } +static const struct +{ + DWORD exp, broken; + BOOL todo; +} wait_idle_expect[] = +{ +/* 0 */ { WAIT_TIMEOUT, WAIT_TIMEOUT, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, WAIT_TIMEOUT, FALSE }, + { WAIT_TIMEOUT, WAIT_TIMEOUT, FALSE }, +/* 5 */ { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, 0, FALSE }, + { WAIT_TIMEOUT, WAIT_TIMEOUT, FALSE }, + { 0, 0, FALSE }, + { 0, 0, FALSE }, +/* 10 */ { 0, 0, FALSE }, + { 0, 0, FALSE }, + { 0, WAIT_TIMEOUT, FALSE }, + { 0, 0, FALSE }, +}; + +static DWORD CALLBACK do_wait_idle_child_thread( void *arg ) +{ + MSG msg; + + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + Sleep( 200 ); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); + return 0; +} + +static void do_wait_idle_child( int arg ) +{ + WNDCLASS cls; + MSG msg; + HWND hwnd = 0; + HANDLE thread; + DWORD id; + HANDLE start_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_start" ); + HANDLE end_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_end" ); + + memset( &cls, 0, sizeof(cls) ); + cls.lpfnWndProc = DefWindowProc; + cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.lpszClassName = "TestClass"; + RegisterClass( &cls ); + + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */ + + ok( start_event != 0, "failed to create start event, error %u\n", GetLastError() ); + ok( end_event != 0, "failed to create end event, error %u\n", GetLastError() ); + + switch (arg) + { + case 0: + SetEvent( start_event ); + break; + case 1: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, 0, 0, 0, PM_REMOVE ); + break; + case 2: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + PostThreadMessage( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd ); + PeekMessage( &msg, 0, 0, 0, PM_REMOVE ); + break; + case 3: + SetEvent( start_event ); + Sleep( 200 ); + SendMessage( HWND_BROADCAST, WM_WININICHANGE, 0, 0 ); + break; + case 4: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg ); + break; + case 5: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + break; + case 6: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + while (PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE )) + { + GetMessage( &msg, 0, 0, 0 ); + DispatchMessage( &msg ); + } + break; + case 7: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + SetTimer( hwnd, 3, 1, NULL ); + Sleep( 200 ); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessage( &msg ); + break; + case 8: + SetEvent( start_event ); + Sleep( 200 ); + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); + break; + case 9: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + for (;;) GetMessage( &msg, 0, 0, 0 ); + break; + case 10: + SetEvent( start_event ); + Sleep( 200 ); + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); + SetTimer( hwnd, 3, 1, NULL ); + Sleep( 200 ); + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + break; + case 11: + SetEvent( start_event ); + Sleep( 200 ); + return; /* exiting the process makes WaitForInputIdle return success too */ + case 12: + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + Sleep( 200 ); + MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ); + SetEvent( start_event ); + break; + case 13: + SetEvent( start_event ); + PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); + Sleep( 200 ); + thread = CreateThread( NULL, 0, do_wait_idle_child_thread, NULL, 0, &id ); + WaitForSingleObject( thread, 10000 ); + CloseHandle( thread ); + break; + } + WaitForSingleObject( end_event, 2000 ); + CloseHandle( start_event ); + CloseHandle( end_event ); + if (hwnd) DestroyWindow( hwnd ); +} + +static LRESULT CALLBACK wait_idle_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) +{ + if (msg == WM_WININICHANGE) Sleep( 200 ); /* make sure the child waits */ + return DefWindowProcA( hwnd, msg, wp, lp ); +} + +static DWORD CALLBACK wait_idle_thread( void *arg ) +{ + WNDCLASS cls; + MSG msg; + HWND hwnd; + + memset( &cls, 0, sizeof(cls) ); + cls.lpfnWndProc = wait_idle_proc; + cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.lpszClassName = "TestClass"; + RegisterClass( &cls ); + + hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL); + while (GetMessage( &msg, 0, 0, 0 )) DispatchMessage( &msg ); + return 0; +} + +static void test_WaitForInputIdle( char *argv0 ) +{ + char path[MAX_PATH]; + PROCESS_INFORMATION pi; + STARTUPINFOA startup; + BOOL ret; + HANDLE start_event, end_event, thread; + unsigned int i; + DWORD id; + const IMAGE_DOS_HEADER *dos = (const IMAGE_DOS_HEADER *)GetModuleHandleA(0); + const IMAGE_NT_HEADERS *nt = (const IMAGE_NT_HEADERS *)((const char *)dos + dos->e_lfanew); + BOOL console_app = (nt->OptionalHeader.Subsystem != IMAGE_SUBSYSTEM_WINDOWS_GUI); + + if (console_app) /* build the test with -mwindows for better coverage */ + trace( "not built as a GUI app, WaitForInputIdle may not be fully tested\n" ); + + start_event = CreateEventA(NULL, 0, 0, "test_WaitForInputIdle_start"); + end_event = CreateEventA(NULL, 0, 0, "test_WaitForInputIdle_end"); + ok(start_event != 0, "failed to create start event, error %u\n", GetLastError()); + ok(end_event != 0, "failed to create end event, error %u\n", GetLastError()); + + memset( &startup, 0, sizeof(startup) ); + startup.cb = sizeof(startup); + startup.dwFlags = STARTF_USESHOWWINDOW; + startup.wShowWindow = SW_SHOWNORMAL; + + thread = CreateThread( NULL, 0, wait_idle_thread, NULL, 0, &id ); + + for (i = 0; i < sizeof(wait_idle_expect)/sizeof(wait_idle_expect[0]); i++) + { + ResetEvent( start_event ); + ResetEvent( end_event ); + sprintf( path, "%s msg %u", argv0, i ); + ret = CreateProcessA( NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &startup, &pi ); + ok( ret, "CreateProcess '%s' failed err %u.\n", path, GetLastError() ); + if (ret) + { + ret = WaitForSingleObject( start_event, 5000 ); + ok( ret == WAIT_OBJECT_0, "%u: WaitForSingleObject failed\n", i ); + if (ret == WAIT_OBJECT_0) + { + ret = WaitForInputIdle( pi.hProcess, 1000 ); + if (ret == WAIT_FAILED) + ok( console_app || + ret == wait_idle_expect[i].exp || + broken(ret == wait_idle_expect[i].broken), + "%u: WaitForInputIdle error %08x expected %08x\n", + i, ret, wait_idle_expect[i].exp ); + else if (wait_idle_expect[i].todo) + todo_wine + ok( ret == wait_idle_expect[i].exp || broken(ret == wait_idle_expect[i].broken), + "%u: WaitForInputIdle error %08x expected %08x\n", + i, ret, wait_idle_expect[i].exp ); + else + ok( ret == wait_idle_expect[i].exp || broken(ret == wait_idle_expect[i].broken), + "%u: WaitForInputIdle error %08x expected %08x\n", + i, ret, wait_idle_expect[i].exp ); + SetEvent( end_event ); + WaitForSingleObject( pi.hProcess, 1000 ); /* give it a chance to exit on its own */ + } + TerminateProcess( pi.hProcess, 0 ); /* just in case */ + winetest_wait_child_process( pi.hProcess ); + ret = WaitForInputIdle( pi.hProcess, 100 ); + ok( ret == WAIT_FAILED, "%u: WaitForInputIdle after exit error %08x\n", i, ret ); + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + } + CloseHandle( start_event ); + PostThreadMessage( id, WM_QUIT, 0, 0 ); + WaitForSingleObject( thread, 10000 ); + CloseHandle( thread ); +} + START_TEST(msg) { + char **test_argv; BOOL ret; BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, "IsWinEventHookInstalled");*/ + + int argc = winetest_get_mainargs( &test_argv ); + if (argc >= 3) + { + unsigned int arg; + /* Child process. */ + sscanf (test_argv[2], "%d", (unsigned int *) &arg); + do_wait_idle_child( arg ); + return; + } init_procs(); @@ -12059,6 +12328,7 @@ test_ShowWindow(); test_PeekMessage(); test_PeekMessage2(); + test_WaitForInputIdle( test_argv[0] ); test_scrollwindowex(); test_messages(); test_setwindowpos(); Modified: trunk/rostests/winetests/user32/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/sysparam…
============================================================================== --- trunk/rostests/winetests/user32/sysparams.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/sysparams.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -2764,6 +2764,27 @@ } } +static void test_GetSysColorBrush(void) +{ + HBRUSH hbr; + + SetLastError(0xdeadbeef); + hbr = GetSysColorBrush(-1); + ok(hbr == NULL, "Expected NULL brush\n"); + ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError()); + /* greater than max index */ + hbr = GetSysColorBrush(COLOR_MENUBAR); + if (hbr) + { + SetLastError(0xdeadbeef); + hbr = GetSysColorBrush(COLOR_MENUBAR + 1); + ok(hbr == NULL, "Expected NULL brush\n"); + ok(GetLastError() == 0xdeadbeef, "Expected last error not set, got %x\n", GetLastError()); + } + else + win_skip("COLOR_MENUBAR unsupported\n"); +} + START_TEST(sysparams) { int argc; @@ -2794,6 +2815,7 @@ test_GetSystemMetrics( ); trace("testing EnumDisplaySettings vs GetDeviceCaps\n"); test_EnumDisplaySettings( ); + test_GetSysColorBrush( ); change_counter = 0; change_last_param = 0; Modified: trunk/rostests/winetests/user32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/testlist…
============================================================================== --- trunk/rostests/winetests/user32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/testlist.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -26,6 +26,7 @@ extern void func_static(void); extern void func_sysparams(void); extern void func_text(void); +extern void func_uitools(void); extern void func_win(void); extern void func_winstation(void); extern void func_wsprintf(void); @@ -52,6 +53,7 @@ { "static", func_static }, { "sysparams", func_sysparams }, { "text", func_text }, + { "uitools", func_uitools }, { "win", func_win }, { "winstation", func_winstation }, { "wsprintf", func_wsprintf }, Added: trunk/rostests/winetests/user32/uitools.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/uitools.…
============================================================================== --- trunk/rostests/winetests/user32/uitools.c (added) +++ trunk/rostests/winetests/user32/uitools.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -1,0 +1,69 @@ +/* Unit test suite for user interface functions + * + * Copyright 2009 Nikolay Sivov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/test.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" + +static void test_FillRect(void) +{ + HDC hdc, hdcmem; + DWORD bits[64]; + HBITMAP hbmp, oldhbmp; + COLORREF col; + HBRUSH old_brush; + RECT r; + + /* fill bitmap data with white */ + memset(bits, 0xff, sizeof(bits)); + + hdc = GetDC(0); + ok( hdc != NULL, "CreateDC rets %p\n", hdc); + /* create a memory dc */ + hdcmem = CreateCompatibleDC(hdc); + ok(hdcmem != NULL, "CreateCompatibleDC rets %p\n", hdcmem); + /* test monochrome bitmap: should always work */ + hbmp = CreateBitmap(32, 32, 1, 1, bits); + ok(hbmp != NULL, "CreateBitmap returns %p\n", hbmp); + oldhbmp = SelectObject(hdcmem, hbmp); + ok(oldhbmp != NULL, "SelectObject returned NULL\n"); /* a memdc always has a bitmap selected */ + col = GetPixel(hdcmem, 0, 0); + ok( col == 0xffffff, "GetPixel returned %08x, expected 0xffffff\n", col); + + /* select black brush */ + old_brush = SelectObject(hdcmem, GetStockObject(BLACK_BRUSH)); + r.left = r.top = 0; + r.right = r.bottom = 5; + FillRect(hdcmem, &r, 0); + SelectObject(hdcmem, old_brush); + /* bitmap filled with last selected brush */ + col = GetPixel(hdcmem, 0, 0); + ok(col == 0, "GetPixel returned %08x, expected 0\n", col); + + SelectObject(hdcmem, oldhbmp); + DeleteObject(hbmp); + DeleteDC(hdcmem); + ReleaseDC(0, hdc); +} + +START_TEST(uitools) +{ + test_FillRect(); +} Propchange: trunk/rostests/winetests/user32/uitools.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/winetests/user32/user32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/user32.r…
============================================================================== --- trunk/rostests/winetests/user32/user32.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/user32.rbuild [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -28,6 +28,7 @@ <file>static.c</file> <file>sysparams.c</file> <file>text.c</file> + <file>uitools.c</file> <file>win.c</file> <file>winstation.c</file> <file>wsprintf.c</file> Modified: trunk/rostests/winetests/user32/winstation.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/winstati…
============================================================================== --- trunk/rostests/winetests/user32/winstation.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/winstation.c [iso-8859-1] Thu Jan 14 23:35:53 2010 @@ -76,7 +76,8 @@ ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() ); SetLastError( 0xdeadbeef ); ok( !CloseDesktop( d1 ), "CloseDesktop succeeded\n" ); - ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "bad last error %d\n", GetLastError() ); print_object( d1 ); d2 = CreateDesktop( "foobar2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); trace( "created desktop %p\n", d2 ); @@ -84,7 +85,8 @@ SetLastError( 0xdeadbeef ); ok( !SetThreadDesktop( d2 ), "set thread desktop succeeded with existing window\n" ); - ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "bad last error %d\n", GetLastError() ); DestroyWindow( hwnd ); ok( SetThreadDesktop( d2 ), "set thread desktop failed\n" ); @@ -139,7 +141,8 @@ ok( w2 != w1, "CreateWindowStation returned default handle\n" ); SetLastError( 0xdeadbeef ); ok( !CloseDesktop( (HDESK)w2 ), "CloseDesktop succeeded on win station\n" ); - ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "bad last error %d\n", GetLastError() ); ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" ); w2 = CreateWindowStation("WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); @@ -200,7 +203,8 @@ SetLastError( 0xdeadbeef ); ok( !CloseDesktop(d1), "closing thread desktop succeeded\n" ); - ok( GetLastError() == ERROR_BUSY, "bad last error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "bad last error %d\n", GetLastError() ); SetLastError( 0xdeadbeef ); if (CloseHandle( d1 )) /* succeeds on nt4 */ @@ -225,7 +229,8 @@ ok( d2 != 0, "create foobar desktop failed\n" ); SetLastError( 0xdeadbeef ); ok( !CloseWindowStation( (HWINSTA)d2 ), "CloseWindowStation succeeded on desktop\n" ); - ok( GetLastError() == ERROR_INVALID_HANDLE, "bad last error %d\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_HANDLE || broken(GetLastError() == 0xdeadbeef), /* wow64 */ + "bad last error %d\n", GetLastError() ); SetLastError( 0xdeadbeef ); d3 = CreateDesktop( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
14 years, 11 months
1
0
0
0
[fireball] 45080: [PSDK] - Add WM_DWM* message defines.
by fireball@svn.reactos.org
Author: fireball Date: Thu Jan 14 23:33:25 2010 New Revision: 45080 URL:
http://svn.reactos.org/svn/reactos?rev=45080&view=rev
Log: [PSDK] - Add WM_DWM* message defines. Modified: trunk/reactos/include/psdk/winuser.h Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winuser.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winuser.h [iso-8859-1] Thu Jan 14 23:33:25 2010 @@ -1803,6 +1803,12 @@ #define WM_HOTKEY 786 #define WM_PRINT 791 #define WM_PRINTCLIENT 792 + +#define WM_DWMCOMPOSITIONCHANGED 0x031E +#define WM_DWMNCRENDERINGCHANGED 0x031F +#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 +#define WM_DWMWINDOWMAXIMIZEDCHANGE 0x0321 + #define WM_HANDHELDFIRST 856 #define WM_HANDHELDLAST 863 #define WM_AFXFIRST 864
14 years, 11 months
1
0
0
0
[jimtabor] 45079: [Win32k|User32] - Started the user handle rewrite.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Jan 14 14:33:04 2010 New Revision: 45079 URL:
http://svn.reactos.org/svn/reactos?rev=45079&view=rev
Log: [Win32k|User32] - Started the user handle rewrite. Modified: trunk/reactos/dll/win32/user32/include/user32p.h trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/include/accelerator.h trunk/reactos/subsystems/win32/win32k/include/cursoricon.h trunk/reactos/subsystems/win32/win32k/include/menu.h trunk/reactos/subsystems/win32/win32k/include/object.h trunk/reactos/subsystems/win32/win32k/include/timer.h trunk/reactos/subsystems/win32/win32k/ntuser/object.c trunk/reactos/subsystems/win32/win32k/ntuser/timer.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] Thu Jan 14 14:33:04 2010 @@ -180,6 +180,8 @@ #define USER_BODY_TO_HEADER(ObjectBody) \ ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1)) +#define HANDLEENTRY_INDESTROY 1 + typedef struct _USER_HANDLE_ENTRY { void *ptr; /* pointer to object */ @@ -189,7 +191,8 @@ PTHREADINFO pti; // pointer to Win32ThreadInfo PPROCESSINFO ppi; // pointer to W32ProcessInfo }; - unsigned short type; /* object type (0 if free) */ + unsigned char type; /* object type (0 if free) */ + unsigned char flags; unsigned short generation; /* generation counter */ } USER_HANDLE_ENTRY, * PUSER_HANDLE_ENTRY; 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] Thu Jan 14 14:33:04 2010 @@ -94,12 +94,18 @@ typedef struct _PROCDESKHEAD { - HANDLE h; - DWORD cLockObj; + HEAD; DWORD hTaskWow; struct _DESKTOP *rpdesk; PVOID pSelf; } PROCDESKHEAD, *PPROCDESKHEAD; + +typedef struct _PROCMARKHEAD +{ + HEAD; + ULONG hTaskWow; + PPROCESSINFO ppi; +} PROCMARKHEAD, *PPROCMARKHEAD; #define UserHMGetHandle(obj) ((obj)->head.h) Modified: trunk/reactos/subsystems/win32/win32k/include/accelerator.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/accelerator.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/accelerator.h [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -7,6 +7,7 @@ typedef struct _ACCELERATOR_TABLE { + HEAD head; int Count; LPACCEL Table; } ACCELERATOR_TABLE, *PACCELERATOR_TABLE; Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -11,6 +11,7 @@ typedef struct _CURICON_OBJECT { + PROCMARKHEAD head; LIST_ENTRY ListEntry; HANDLE Self; LIST_ENTRY ProcessList; Modified: trunk/reactos/subsystems/win32/win32k/include/menu.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/menu.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/menu.h [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -29,6 +29,7 @@ typedef struct _MENU_OBJECT { + PROCDESKHEAD head; PEPROCESS Process; LIST_ENTRY ListEntry; PMENU_ITEM MenuItemList; Modified: trunk/reactos/subsystems/win32/win32k/include/object.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -14,7 +14,7 @@ #define USER_BODY_TO_HEADER(ObjectBody) \ ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1)) - +#define HANDLEENTRY_INDESTROY 1 typedef struct _USER_HANDLE_ENTRY { @@ -25,7 +25,8 @@ PTHREADINFO pti; // pointer to Win32ThreadInfo PPROCESSINFO ppi; // pointer to W32ProcessInfo }; - unsigned short type; /* object type (0 if free) */ + unsigned char type; /* object type (0 if free) */ + unsigned char flags; unsigned short generation; /* generation counter */ } USER_HANDLE_ENTRY, * PUSER_HANDLE_ENTRY; Modified: trunk/reactos/subsystems/win32/win32k/include/timer.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/timer.h [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -3,6 +3,7 @@ typedef struct _TIMER { + HEAD head; LIST_ENTRY ptmrList; PTHREADINFO pti; PWINDOW_OBJECT pWnd; // hWnd Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -151,6 +151,7 @@ ret = entry->ptr; entry->ptr = ht->freelist; entry->type = 0; + entry->flags = 0; entry->pi = NULL; ht->freelist = entry; @@ -198,6 +199,7 @@ return 0; entry->ptr = object; entry->type = type; + entry->flags = 0; entry->pi = UserHandleOwnerByType(type); if (++entry->generation >= 0xffff) entry->generation = 1; @@ -294,8 +296,6 @@ return NULL; } - - PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, HANDLE* h,USER_OBJECT_TYPE type , ULONG size) { @@ -401,7 +401,6 @@ } - BOOL FASTCALL UserCreateHandleTable(VOID) { @@ -429,3 +428,162 @@ return TRUE; } + +// +// New +// +PVOID +FASTCALL +NewUserCreateObject( PUSER_HANDLE_TABLE ht, + HANDLE* h, + USER_OBJECT_TYPE type, + ULONG size) +{ + HANDLE hi; + PVOID Object; + PTHREADINFO pti; + PPROCESSINFO ppi; + BOOL dt; + + pti = GetW32ThreadInfo(); + ppi = pti->ppi; + + switch (type) + { + case otWindow: + Object = DesktopHeapAlloc(pti->rpdesk, size); + dt = TRUE; + break; + + default: + Object = UserHeapAlloc(size); + dt = FALSE; + break; + } + + if (!Object) + return NULL; + + + hi = UserAllocHandle(ht, Object, type ); + if (!hi) + { + if (dt) + DesktopHeapFree(pti->rpdesk, Object); + else + UserHeapFree(Object); + return NULL; + } + + RtlZeroMemory(Object, size); + + switch (type) + { + case otWindow: + case otHook: + ((PTHRDESKHEAD)Object)->rpdesk = pti->rpdesk; + ((PTHRDESKHEAD)Object)->pSelf = Object; + case otEvent: + ((PTHROBJHEAD)Object)->pti = pti; + break; + + case otMenu: + case otCallProc: + ((PPROCDESKHEAD)Object)->rpdesk = pti->rpdesk; + ((PPROCDESKHEAD)Object)->pSelf = Object; + break; + + case otCursorIcon: + ((PPROCMARKHEAD)Object)->ppi = ppi; + break; + + default: + break; + } + /* Now set default headers. */ + ((PHEAD)Object)->h = hi; + ((PHEAD)Object)->cLockObj = 2; // we need this, because we create 2 refs: handle and pointer! + + if (h) + *h = hi; + return Object; +} + +BOOL +FASTCALL +NewUserDereferenceObject(PVOID obj) +{ + ASSERT(((PHEAD)obj)->cLockObj >= 1); + + if (--((PHEAD)obj)->cLockObj <= 0) + { + return TRUE; + } + return FALSE; +} + +BOOL +FASTCALL +NewUserFreeHandle(PUSER_HANDLE_TABLE ht, HANDLE handle ) +{ + PUSER_HANDLE_ENTRY entry; + PVOID object; + USER_OBJECT_TYPE type; + + if (!(entry = handle_to_entry( ht, handle ))) + { + SetLastNtError( STATUS_INVALID_HANDLE ); + return FALSE; + } + + entry->flags = HANDLEENTRY_INDESTROY; + + if (NewUserDereferenceObject(entry->ptr)) + { + type = entry->type; + object = free_user_entry(ht, entry ); + + if (type == otWindow) // If more, go switch. + { + return DesktopHeapFree(GetW32ThreadInfo()->rpdesk, object); + } + return UserHeapFree(object); + } + return FALSE; +} + +BOOL +FASTCALL +NewUserDeleteObject(HANDLE h, USER_OBJECT_TYPE type ) +{ + PVOID body = UserGetObject(gHandleTable, h, type); + + if (!body) return FALSE; + + ASSERT( ((PHEAD)body)->cLockObj >= 1); + + return NewUserFreeHandle(gHandleTable, h); +} + +VOID +FASTCALL +NewUserReferenceObject(PVOID obj) +{ + ASSERT(((PHEAD)obj)->cLockObj >= 0); + + ((PHEAD)obj)->cLockObj++; +} + +PVOID +FASTCALL +NewUserReferenceObjectByHandle(HANDLE handle, USER_OBJECT_TYPE type) +{ + PVOID object; + + object = UserGetObject(gHandleTable, handle, type); + if (object) + { + NewUserReferenceObject(object); + } + return object; +} Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Thu Jan 14 14:33:04 2010 @@ -82,6 +82,7 @@ UINT flags, BOOL Distroy) { + PLIST_ENTRY pLE; PTIMER pTmr = FirstpTmr; KeEnterCriticalRegion(); do @@ -100,7 +101,8 @@ break; } - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); KeLeaveCriticalRegion(); @@ -111,6 +113,7 @@ FASTCALL FindSystemTimer(PMSG pMsg) { + PLIST_ENTRY pLE; PTIMER pTmr = FirstpTmr; KeEnterCriticalRegion(); do @@ -121,7 +124,8 @@ (pTmr->flags & TMRF_SYSTEM) ) break; - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); KeLeaveCriticalRegion(); @@ -135,6 +139,7 @@ WPARAM wParam, LPARAM lParam) { + PLIST_ENTRY pLE; PTIMER pTmr = FirstpTmr; if (!pTmr) return FALSE; @@ -144,11 +149,11 @@ { if ( (lParam == (LPARAM)pTmr->pfn) && (pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) && -// (pTmr->head.pti->ppi == pti->ppi) ) (pTmr->pti->ppi == pti->ppi) ) break; - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); KeLeaveCriticalRegion(); @@ -265,6 +270,7 @@ FASTCALL PostTimerMessages(PWINDOW_OBJECT Window) { + PLIST_ENTRY pLE; PUSER_MESSAGE_QUEUE ThreadQueue; MSG Msg; PTHREADINFO pti; @@ -299,7 +305,8 @@ Hit = TRUE; } - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); KeLeaveCriticalRegion(); @@ -312,6 +319,7 @@ { LARGE_INTEGER TickCount, DueTime; LONG Time; + PLIST_ENTRY pLE; PTIMER pTmr = FirstpTmr; if (!pTmr) return; @@ -327,7 +335,8 @@ { if (pTmr->flags & TMRF_WAITING) { - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); continue; } @@ -363,7 +372,8 @@ else pTmr->cmsCountdown -= Time - TimeLast; } - pTmr = (PTIMER)pTmr->ptmrList.Flink; + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); // Restart the timer thread!
14 years, 11 months
1
0
0
0
[tkreuzer] 45078: Fix merge artifacts
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 14 10:53:02 2010 New Revision: 45078 URL:
http://svn.reactos.org/svn/reactos?rev=45078&view=rev
Log: Fix merge artifacts Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ex/init.c [iso-8859-1] Thu Jan 14 10:53:02 2010 @@ -1726,7 +1726,7 @@ KeyValuePartialInformation, &KeyPartialInfo, sizeof(KeyPartialInfo), - &Size); + &Length); if (!NT_SUCCESS(Status)) AlternateShell = FALSE; } @@ -1878,17 +1878,17 @@ ZwClose(ProcessInfo->ProcessHandle); /* Free the initial process environment */ - Length = 0; + Size = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&Environment, - &Length, + &Size, MEM_RELEASE); /* Free the initial process parameters */ - Length = 0; + Size = 0; ZwFreeVirtualMemory(NtCurrentProcess(), (PVOID*)&ProcessParameters, - &Length, + &Size, MEM_RELEASE); /* Increase init phase */
14 years, 11 months
1
0
0
0
[tkreuzer] 45077: reduce difference to trunk
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Jan 14 10:47:01 2010 New Revision: 45077 URL:
http://svn.reactos.org/svn/reactos?rev=45077&view=rev
Log: reduce difference to trunk Modified: branches/ros-amd64-bringup/reactos/lib/pseh/framebased.c Modified: branches/ros-amd64-bringup/reactos/lib/pseh/framebased.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/p…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/pseh/framebased.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/pseh/framebased.c [iso-8859-1] Thu Jan 14 10:47:01 2010 @@ -94,7 +94,7 @@ } \ } -#ifdef __i386__ +#ifdef _X86_ #define _SEH_TRACE_CONTEXT(FRAME_, CONTEXT_) \ { \ if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_CONTEXT) \
14 years, 11 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
53
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Results per page:
10
25
50
100
200