ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2012
----- 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
14 participants
198 discussions
Start a n
N
ew thread
[akhaldi] 57018: [UNIATA] * Sync with UniATA v0.42e2. * Hello AHCI support, you've been missed ! (that's WIP but still)
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Aug 1 20:30:19 2012 New Revision: 57018 URL:
http://svn.reactos.org/svn/reactos?rev=57018&view=rev
Log: [UNIATA] * Sync with UniATA v0.42e2. * Hello AHCI support, you've been missed ! (that's WIP but still) Modified: trunk/reactos/drivers/storage/ide/uniata/atapi.h trunk/reactos/drivers/storage/ide/uniata/bm_devs.h trunk/reactos/drivers/storage/ide/uniata/bsmaster.h trunk/reactos/drivers/storage/ide/uniata/config.h trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/ide/uniata/id_badblock.cpp trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp trunk/reactos/drivers/storage/ide/uniata/id_init.cpp trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.h trunk/reactos/drivers/storage/ide/uniata/scsi.h trunk/reactos/drivers/storage/ide/uniata/tools.h trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/drivers/storage/ide/uniata/atapi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/bm_devs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/bsmaster.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/config.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_badblock.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_init.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_probe.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_queue.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/scsi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/tools.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
Modified: trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
12 years, 4 months
1
0
0
0
[akhaldi] 57017: [ATACTL] * Sync with the latest UniATA version.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Aug 1 20:27:41 2012 New Revision: 57017 URL:
http://svn.reactos.org/svn/reactos?rev=57017&view=rev
Log: [ATACTL] * Sync with the latest UniATA version. Modified: trunk/reactos/base/applications/atactl/atactl.cpp Modified: trunk/reactos/base/applications/atactl/atactl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/atactl/a…
============================================================================== --- trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] Wed Aug 1 20:27:41 2012 @@ -784,6 +784,9 @@ chs[0] = ident->NumberOfCylinders; chs[1] = ident->NumberOfHeads; chs[2] = ident->SectorsPerTrack; + if(!max_lba) { + max_lba = (ULONG)(chs[0])*(ULONG)(chs[1])*(ULONG)(chs[2]); + } } if(io_mode != -1) { printf(" %.12s\n", mode_str);
12 years, 4 months
1
0
0
0
[jimtabor] 57016: - Fix Linux build.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Aug 1 12:05:33 2012 New Revision: 57016 URL:
http://svn.reactos.org/svn/reactos?rev=57016&view=rev
Log: - Fix Linux build. Modified: trunk/reactos/base/applications/atactl/atactl.cpp Modified: trunk/reactos/base/applications/atactl/atactl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/atactl/a…
============================================================================== --- trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/atactl/atactl.cpp [iso-8859-1] Wed Aug 1 12:05:33 2012 @@ -1,5 +1,5 @@ #include <windows.h> -#include <WinIoCtl.h> +#include <winioctl.h> #include <stdio.h> //#include <ntdddisk.h> //#include <ntddscsi.h>
12 years, 4 months
1
0
0
0
[tkreuzer] 57015: [FREELDR] Don't use fancy CMake features for MSVC builds that would require custom CMake installations. Period. ; -)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 1 11:43:47 2012 New Revision: 57015 URL:
http://svn.reactos.org/svn/reactos?rev=57015&view=rev
Log: [FREELDR] Don't use fancy CMake features for MSVC builds that would require custom CMake installations. Period. ;-) Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Wed Aug 1 11:43:47 2012 @@ -150,7 +150,7 @@ #TBD endif() -if(CMAKE_VERSION VERSION_GREATER 2.8.7) +if(NOT MSVC AND CMAKE_VERSION VERSION_GREATER 2.8.7) add_library(freeldr_common OBJECT ${FREELDR_COMMON_SOURCE}) else() add_library(freeldr_common ${FREELDR_COMMON_SOURCE}) @@ -171,7 +171,7 @@ endif() -if(CMAKE_VERSION VERSION_GREATER 2.8.7) +if(NOT MSVC AND CMAKE_VERSION VERSION_GREATER 2.8.7) add_library(freeldr_pe SHARED $<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE}) add_library(freeldr_pe_dbg SHARED EXCLUDE_FROM_ALL $<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE}) else() @@ -200,7 +200,7 @@ target_link_libraries(freeldr_pe_dbg mini_hal) endif() -if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7) +if(MSVC OR NOT CMAKE_VERSION VERSION_GREATER 2.8.7) target_link_libraries(freeldr_pe freeldr_common) target_link_libraries(freeldr_pe_dbg freeldr_common) endif() @@ -231,7 +231,7 @@ list(APPEND SETUPLDR_SOURCE windows/setupldr.c) endif() -if(CMAKE_VERSION VERSION_GREATER 2.8.7) +if(NOT MSVC AND CMAKE_VERSION VERSION_GREATER 2.8.7) add_library(setupldr_pe SHARED $<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE}) add_library(setupldr_pe_dbg SHARED EXCLUDE_FROM_ALL $<TARGET_OBJECTS:freeldr_common> ${FREELDR_BASE_SOURCE} ${SETUPLDR_SOURCE}) else() @@ -263,7 +263,7 @@ target_link_libraries(setupldr_pe_dbg mini_hal) endif() -if(NOT CMAKE_VERSION VERSION_GREATER 2.8.7) +if(MSVC OR NOT CMAKE_VERSION VERSION_GREATER 2.8.7) target_link_libraries(setupldr_pe freeldr_common) target_link_libraries(setupldr_pe_dbg freeldr_common) endif()
12 years, 4 months
1
0
0
0
[tkreuzer] 57014: Fix build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 1 09:23:20 2012 New Revision: 57014 URL:
http://svn.reactos.org/svn/reactos?rev=57014&view=rev
Log: Fix build Modified: trunk/reactos/win32ss/user/ntuser/class.h Modified: trunk/reactos/win32ss/user/ntuser/class.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/class.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/class.h [iso-8859-1] Wed Aug 1 09:23:20 2012 @@ -48,10 +48,8 @@ IN PCALLPROCDATA CallProc); BOOL -NTAPI -IntGetAtomFromStringOrAtom( - _In_ PUNICODE_STRING ClassName, - _Out_ RTL_ATOM *Atom); +IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName, + OUT RTL_ATOM *Atom); BOOL IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
12 years, 4 months
1
0
0
0
[tkreuzer] 57013: [WIN32K] - Use trivial Clip object, if NULL one is passed in IntEngAlphaBlend - In NtGdiDescribePixelFormat allow passing NULL for the output pixel descriptor and copy the result ...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 1 09:17:55 2012 New Revision: 57013 URL:
http://svn.reactos.org/svn/reactos?rev=57013&view=rev
Log: [WIN32K] - Use trivial Clip object, if NULL one is passed in IntEngAlphaBlend - In NtGdiDescribePixelFormat allow passing NULL for the output pixel descriptor and copy the result *to* the caller not from the caller. - Fix some format strings - Update some annotations Modified: trunk/reactos/win32ss/gdi/eng/alphablend.c trunk/reactos/win32ss/gdi/eng/pdevobj.c trunk/reactos/win32ss/gdi/ntgdi/arc.c trunk/reactos/win32ss/gdi/ntgdi/dcutil.c trunk/reactos/win32ss/gdi/ntgdi/wingl.c trunk/reactos/win32ss/user/ntuser/class.h Modified: trunk/reactos/win32ss/gdi/eng/alphablend.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/alphablend…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/alphablend.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/alphablend.c [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -141,7 +141,7 @@ Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top); Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top); ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom); - + /* Aplha blend one rect */ Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj); @@ -170,7 +170,7 @@ Rect.top = InputRect.top + (CombinedRect.top - OutputRect.top) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top); Rect.bottom = InputRect.bottom + (CombinedRect.bottom - OutputRect.bottom) * (InputRect.bottom - InputRect.top) / (OutputRect.bottom - OutputRect.top); ASSERT(InputRect.left < InputRect.right && InputRect.top < InputRect.bottom); - + /* Alpha blend one rect */ Ret = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_AlphaBlend( OutputObj, InputObj, &CombinedRect, &Rect, ClipRegion, ColorTranslation, BlendObj) && Ret; @@ -192,49 +192,51 @@ return Ret; } -BOOL APIENTRY -IntEngAlphaBlend(IN SURFOBJ *psoDest, - IN SURFOBJ *psoSource, - IN CLIPOBJ *ClipRegion, - IN XLATEOBJ *ColorTranslation, - IN PRECTL DestRect, - IN PRECTL SourceRect, - IN BLENDOBJ *BlendObj) +BOOL +APIENTRY +IntEngAlphaBlend( + _Inout_ SURFOBJ *psoDest, + _In_ SURFOBJ *psoSource, + _In_opt_ CLIPOBJ *pco, + _In_opt_ XLATEOBJ *pxlo, + _In_ RECTL *prclDest, + _In_ RECTL *prclSrc, + _In_ BLENDOBJ *pBlendObj) { BOOL ret = FALSE; SURFACE *psurfDest; - //SURFACE *psurfSource; ASSERT(psoDest); - psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); - ASSERT(psoSource); - //psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj); - - ASSERT(DestRect); - ASSERT(SourceRect); + ASSERT(prclDest); + ASSERT(prclSrc); + //ASSERT(pBlendObj); + + /* If no clip object is given, use trivial one */ + if (!pco) pco = &gxcoTrivial.ClipObj; /* Check if there is anything to draw */ - if (ClipRegion != NULL && - (ClipRegion->rclBounds.left >= ClipRegion->rclBounds.right || - ClipRegion->rclBounds.top >= ClipRegion->rclBounds.bottom)) + if ((pco->rclBounds.left >= pco->rclBounds.right) || + (pco->rclBounds.top >= pco->rclBounds.bottom)) { /* Nothing to do */ return TRUE; } + psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj); + /* Call the driver's DrvAlphaBlend if available */ if (psurfDest->flags & HOOK_ALPHABLEND) { ret = GDIDEVFUNCS(psoDest).AlphaBlend( - psoDest, psoSource, ClipRegion, ColorTranslation, - DestRect, SourceRect, BlendObj); - } - - if (! ret) - { - ret = EngAlphaBlend(psoDest, psoSource, ClipRegion, ColorTranslation, - DestRect, SourceRect, BlendObj); + psoDest, psoSource, pco, pxlo, + prclDest, prclSrc, pBlendObj); + } + + if (!ret) + { + ret = EngAlphaBlend(psoDest, psoSource, pco, pxlo, + prclDest, prclSrc, pBlendObj); } return ret; Modified: trunk/reactos/win32ss/gdi/eng/pdevobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/pdevobj.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/pdevobj.c [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -291,14 +291,14 @@ { /* ... use the device's default one */ pdm = pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm; - DPRINT("Using iDefaultMode = %ld\n", pGraphicsDevice->iDefaultMode); + DPRINT("Using iDefaultMode = %lu\n", pGraphicsDevice->iDefaultMode); } /* Try to get a diplay driver */ ppdev->pldev = EngLoadImageEx(pdm->dmDeviceName, LDEV_DEVICE_DISPLAY); if (!ppdev->pldev) { - DPRINT1("Could not load display driver '%ls', '%s'\n", + DPRINT1("Could not load display driver '%ls', '%ls'\n", pGraphicsDevice->pDiplayDrivers, pdm->dmDeviceName); ExFreePoolWithTag(ppdev, GDITAG_PDEV); @@ -617,18 +617,13 @@ EngGetDriverName(IN HDEV hdev) { PPDEVOBJ ppdev = (PPDEVOBJ)hdev; - PLDEVOBJ pldev; - - if (!hdev) - return NULL; - - pldev = ppdev->pldev; - ASSERT(pldev); - - if (!pldev->pGdiDriverInfo) - return NULL; - - return pldev->pGdiDriverInfo->DriverName.Buffer; + + ASSERT(ppdev); + ASSERT(ppdev->pldev); + ASSERT(ppdev->pldev->pGdiDriverInfo); + ASSERT(ppdev->pldev->pGdiDriverInfo->DriverName.Buffer); + + return ppdev->pldev->pGdiDriverInfo->DriverName.Buffer; } Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/arc.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -57,12 +57,17 @@ { INT tmp = Bottom; Bottom = Top; Top = tmp; } - if ((Left == Right) || - (Top == Bottom) || - (((arctype != GdiTypeArc) || (arctype != GdiTypeArcTo)) && - ((Right - Left == 1) || - (Bottom - Top == 1)))) - return TRUE; + + /* Check if the target rect is empty */ + if ((Left == Right) || (Top == Bottom)) return TRUE; + + // FIXME: this needs to be verified + if ((arctype == GdiTypeChord ) || (arctype == GdiTypePie)) + { + if ((Right - Left == 1) || (Bottom - Top == 1)) + return TRUE; + } + pdcattr = dc->pdcattr; Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -332,13 +332,13 @@ return Ret; } -BOOL +BOOL _Success_(return != FALSE) APIENTRY NtGdiGetAndSetDCDword( - HDC hDC, - UINT u, - DWORD dwIn, - DWORD *Result) + _In_ HDC hdc, + _In_ UINT u, + _In_ DWORD dwIn, + _Out_ DWORD *pdwResult) { BOOL Ret = TRUE; PDC pdc; @@ -347,13 +347,13 @@ DWORD SafeResult = 0; NTSTATUS Status = STATUS_SUCCESS; - if (!Result) + if (!pdwResult) { EngSetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - pdc = DC_LockDc(hDC); + pdc = DC_LockDc(hdc); if (!pdc) { EngSetLastError(ERROR_INVALID_HANDLE); @@ -442,8 +442,8 @@ { _SEH2_TRY { - ProbeForWrite(Result, sizeof(DWORD), 1); - *Result = SafeResult; + ProbeForWrite(pdwResult, sizeof(DWORD), 1); + *pdwResult = SafeResult; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Modified: trunk/reactos/win32ss/gdi/ntgdi/wingl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/wingl.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/wingl.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/wingl.c [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: subsystems/win32/win32k/objects/wingl.c * PURPOSE: WinGL API - * PROGRAMMER: + * PROGRAMMER: */ #include <win32k.h> @@ -38,23 +38,23 @@ return Ret; } - + _Success_(return != 0) INT APIENTRY -NtGdiDescribePixelFormat(HDC hDC, - INT PixelFormat, - UINT BufSize, - LPPIXELFORMATDESCRIPTOR pfd) +NtGdiDescribePixelFormat( + _In_ HDC hdc, + _In_ INT ipfd, + _In_ UINT cjpfd, + _When_(cjpfd != 0, _Out_) PPIXELFORMATDESCRIPTOR ppfd) { PDC pdc; PPDEVOBJ ppdev; INT Ret = 0; PIXELFORMATDESCRIPTOR pfdSafe; - NTSTATUS Status = STATUS_SUCCESS; - if (!BufSize) return 0; + if ((ppfd == NULL) && (cjpfd != 0)) return 0; - pdc = DC_LockDc(hDC); + pdc = DC_LockDc(hdc); if (!pdc) { EngSetLastError(ERROR_INVALID_HANDLE); @@ -63,10 +63,8 @@ if (!pdc->ipfdDevMax) IntGetipfdDevMax(pdc); - if ( BufSize < sizeof(PIXELFORMATDESCRIPTOR) || - PixelFormat < 1 || - PixelFormat > pdc->ipfdDevMax ) - { + if ((ipfd < 1) || (ipfd > pdc->ipfdDevMax)) + { EngSetLastError(ERROR_INVALID_PARAMETER); goto Exit; } @@ -83,25 +81,25 @@ { Ret = ppdev->DriverFunctions.DescribePixelFormat( ppdev->dhpdev, - PixelFormat, - sizeof(PIXELFORMATDESCRIPTOR), + ipfd, + sizeof(pfdSafe), &pfdSafe); } - _SEH2_TRY + if (Ret && cjpfd) { - ProbeForWrite( pfd, - sizeof(PIXELFORMATDESCRIPTOR), - 1); - RtlCopyMemory(&pfdSafe, pfd, sizeof(PIXELFORMATDESCRIPTOR)); + _SEH2_TRY + { + cjpfd = min(cjpfd, sizeof(PIXELFORMATDESCRIPTOR)); + ProbeForWrite(ppfd, cjpfd, 1); + RtlCopyMemory(ppfd, &pfdSafe, cjpfd); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + } + _SEH2_END; } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if (!NT_SUCCESS(Status)) SetLastNtError(Status); Exit: DC_UnlockDc(pdc); @@ -133,7 +131,7 @@ if ( ipfd < 1 || ipfd > pdc->ipfdDevMax ) - { + { EngSetLastError(ERROR_INVALID_PARAMETER); goto Exit; } Modified: trunk/reactos/win32ss/user/ntuser/class.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/class.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/class.h [iso-8859-1] Wed Aug 1 09:17:55 2012 @@ -48,8 +48,10 @@ IN PCALLPROCDATA CallProc); BOOL -IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName, - OUT RTL_ATOM *Atom); +NTAPI +IntGetAtomFromStringOrAtom( + _In_ PUNICODE_STRING ClassName, + _Out_ RTL_ATOM *Atom); BOOL IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
12 years, 4 months
1
0
0
0
[tkreuzer] 57012: [INCLUDE/CRT] Partly revert r56995. Firstly it breaks MSVC builds, secondly the stuff doesn't belong into this header. MS headers don't have __fpclassify etc and our headers are n...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 1 08:23:54 2012 New Revision: 57012 URL:
http://svn.reactos.org/svn/reactos?rev=57012&view=rev
Log: [INCLUDE/CRT] Partly revert r56995. Firstly it breaks MSVC builds, secondly the stuff doesn't belong into this header. MS headers don't have __fpclassify etc and our headers are not supposed to contain any fancy additions. If you need it for 3rd party code, put it somewhere else. Modified: trunk/reactos/include/crt/math.h Modified: trunk/reactos/include/crt/math.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/math.h?rev=570…
============================================================================== --- trunk/reactos/include/crt/math.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/math.h [iso-8859-1] Wed Aug 1 08:23:54 2012 @@ -240,6 +240,8 @@ #pragma pack(pop) +#endif /* !_INC_MATH */ + #if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED) #define _MATH_DEFINES_DEFINED @@ -259,141 +261,41 @@ #endif /* _USE_MATH_DEFINES */ -#ifdef __cplusplus -extern "C" { -#endif - #ifndef __NO_ISOCEXT #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ || !defined __STRICT_ANSI__ || defined __GLIBCPP__ -/* 7.12.3.1 */ -/* - Return values for fpclassify. - These are based on Intel x87 fpu condition codes - in the high byte of status word and differ from - the return values for MS IEEE 754 extension _fpclass() -*/ -#define FP_NAN 0x0100 -#define FP_NORMAL 0x0400 -#define FP_INFINITE (FP_NAN | FP_NORMAL) -#define FP_ZERO 0x4000 -#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) -/* 0x0200 is signbit mask */ - -/* - We can't inline float or double, because we want to ensure truncation - to semantic type before classification. - (A normal long double value might become subnormal when - converted to double, and zero when converted to float.) -*/ - - extern int __cdecl __fpclassifyl (long double); - extern int __cdecl __fpclassifyf (float); - extern int __cdecl __fpclassify (double); - -#ifndef __CRT__NO_INLINE - __CRT_INLINE int __cdecl __fpclassifyl (long double x) { - unsigned short sw; - __asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); - } - __CRT_INLINE int __cdecl __fpclassify (double x) { -#ifdef __x86_64__ - __mingw_dbl_type_t hlp; - unsigned int l, h; - - hlp.x = x; - h = hlp.lh.high; - l = hlp.lh.low | (h & 0xfffff); - h &= 0x7ff00000; - if ((h | l) == 0) - return FP_ZERO; - if (!h) - return FP_SUBNORMAL; - if (h == 0x7ff00000) - return (l ? FP_NAN : FP_INFINITE); - return FP_NORMAL; -#else - unsigned short sw; - __asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -#endif - } - __CRT_INLINE int __cdecl __fpclassifyf (float x) { -#ifdef __x86_64__ - __mingw_flt_type_t hlp; - - hlp.x = x; - hlp.val &= 0x7fffffff; - if (hlp.val == 0) - return FP_ZERO; - if (hlp.val < 0x800000) - return FP_SUBNORMAL; - if (hlp.val >= 0x7f800000) - return (hlp.val > 0x7f800000 ? FP_NAN : FP_INFINITE); - return FP_NORMAL; -#else - unsigned short sw; - __asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -#endif - } -#endif - -#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \ - : sizeof (x) == sizeof (double) ? __fpclassify (x) \ - : __fpclassifyl (x)) - -/* 7.12.3.2 */ -#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) - -/* 7.12.3.3 */ -#define isinf(x) (fpclassify(x) == FP_INFINITE) - -/* Inverse hyperbolic trig functions */ -/* 7.12.5.1 */ + /* Inverse hyperbolic trig functions */ + /* 7.12.5.1 */ extern double __cdecl acosh (double); extern float __cdecl acoshf (float); extern long double __cdecl acoshl (long double); -/* 7.12.5.2 */ + /* 7.12.5.2 */ extern double __cdecl asinh (double); extern float __cdecl asinhf (float); extern long double __cdecl asinhl (long double); -/* 7.12.5.3 */ + /* 7.12.5.3 */ extern double __cdecl atanh (double); extern float __cdecl atanhf (float); extern long double __cdecl atanhl (long double); -/* 7.12.6.2 */ + /* 7.12.6.2 */ extern double __cdecl exp2(double); extern float __cdecl exp2f(float); extern long double __cdecl exp2l(long double); -/* 7.12.6.10 */ + /* 7.12.6.10 */ extern double __cdecl log2 (double); extern float __cdecl log2f (float); extern long double __cdecl log2l (long double); -/* 7.12.9.6 */ -/* round away from zero, regardless of fpu control word settings */ - extern double __cdecl round (double); - extern float __cdecl roundf (float); - extern long double __cdecl roundl (long double); - -/* 7.12.9.8 */ -/* round towards zero, regardless of fpu control word settings */ + /* 7.12.9.8 */ + /* round towards zero, regardless of fpu control word settings */ extern double __cdecl trunc (double); extern float __cdecl truncf (float); extern long double __cdecl truncl (long double); #endif /* __STDC_VERSION__ >= 199901L */ #endif /* __NO_ISOCEXT */ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* !_INC_MATH */
12 years, 4 months
1
0
0
0
[ion] 57011: [NTOSKRNL]: Implement last bits of session space support (minus session pool). Processes now have a ->Session pointer! Implement and enable MmSessionId in a bunch of places. [NTOSKRNL]...
by ion@svn.reactos.org
Author: ion Date: Wed Aug 1 07:54:37 2012 New Revision: 57011 URL:
http://svn.reactos.org/svn/reactos?rev=57011&view=rev
Log: [NTOSKRNL]: Implement last bits of session space support (minus session pool). Processes now have a ->Session pointer! Implement and enable MmSessionId in a bunch of places. [NTOSKRNL]: Set MiSessionSpaceWs address and use where needed. [NTOSKRNL]: Initialize the session working set, and add support to MiLockWorkingSet and MiUnlockWorkingSet for session WS. [NTOSKRNL]: Implement MiSessionAddProcess and MiSessionRemoveProcess which does the work required for this. [NTOSKRNL]: Fix IoGetIrpRequestorProcess. In my private branch, MmMapViewInSessionSpace is working fine for the user and GDI heaps. Will enable after TestBot tests. Modified: trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/io/iomgr/irp.c trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c trunk/reactos/ntoskrnl/mm/ARM3/miarm.h trunk/reactos/ntoskrnl/mm/ARM3/mminit.c trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/ntoskrnl/mm/ARM3/section.c trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/ntoskrnl/ps/security.c Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -496,6 +496,12 @@ IN PVOID Address ); +ULONG +NTAPI +MmGetSessionId( + IN PEPROCESS Process +); + /* marea.c *******************************************************************/ NTSTATUS Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/irp.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -1615,7 +1615,14 @@ /* Return the requestor process */ if (Irp->Tail.Overlay.Thread) { - return Irp->Tail.Overlay.Thread->ThreadsProcess; + if (Irp->ApcEnvironment == OriginalApcEnvironment) + { + return Irp->Tail.Overlay.Thread->ThreadsProcess; + } + else if (Irp->ApcEnvironment == AttachedApcEnvironment) + { + return (PEPROCESS)Irp->Tail.Overlay.Thread->Tcb.ApcState.Process; + } } return NULL; @@ -1631,10 +1638,8 @@ PEPROCESS Process; /* Return the requestor process' id */ - if ((Process = IoGetRequestorProcess(Irp))) - { - return PtrToUlong(Process->UniqueProcessId); - } + Process = IoGetRequestorProcess(Irp); + if (Process) return PtrToUlong(Process->UniqueProcessId); return 0; } @@ -1650,10 +1655,10 @@ PEPROCESS Process; /* Return the session */ - if ((Process = IoGetRequestorProcess(Irp))) - { - // FIXME: broken - *pSessionId = PtrToUlong(Process->Session); + if (Irp->Tail.Overlay.Thread) + { + Process = Irp->Tail.Overlay.Thread->ThreadsProcess; + *pSessionId = MmGetSessionId(Process); return STATUS_SUCCESS; } Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -110,6 +110,7 @@ MiSessionImagePteStart = MiAddressToPte(MiSessionImageStart); MiSessionImagePteEnd = MiAddressToPte(MiSessionImageEnd); MiSessionBasePte = MiAddressToPte(MmSessionBase); + MiSessionSpaceWs = (PVOID)((ULONG_PTR)MiSessionViewStart + MmSessionViewSize); MiSessionLastPte = MiAddressToPte(MiSessionSpaceEnd); /* Initialize session space */ Modified: trunk/reactos/ntoskrnl/mm/ARM3/miarm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/miarm.h?r…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/miarm.h [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -687,6 +687,7 @@ extern PVOID MiSessionPoolEnd; // 0xBE000000 extern PVOID MiSessionPoolStart; // 0xBD000000 extern PVOID MiSessionViewStart; // 0xBE000000 +extern PVOID MiSessionSpaceWs; extern ULONG MmMaximumDeadKernelStacks; extern SLIST_HEADER MmDeadStackSListHead; extern MM_AVL_TABLE MmSectionBasedRoot; @@ -1059,9 +1060,10 @@ } else if (WorkingSet->Flags.SessionSpace) { - /* We don't implement this yet */ - UNIMPLEMENTED; - while (TRUE); + /* Own the session working set */ + ASSERT((Thread->OwnsSessionWorkingSetExclusive == FALSE) && + (Thread->OwnsSessionWorkingSetShared == FALSE)); + Thread->OwnsSessionWorkingSetExclusive = TRUE; } else { @@ -1093,9 +1095,10 @@ } else if (WorkingSet->Flags.SessionSpace) { - /* We don't implement this yet */ - UNIMPLEMENTED; - while (TRUE); + /* Release the session working set */ + ASSERT((Thread->OwnsSessionWorkingSetExclusive == TRUE) || + (Thread->OwnsSessionWorkingSetShared == TRUE)); + Thread->OwnsSessionWorkingSetExclusive = 0; } else { @@ -1608,6 +1611,24 @@ NTAPI MiInitializeSystemSpaceMap( IN PMMSESSION InputSession OPTIONAL +); + +VOID +NTAPI +MiSessionRemoveProcess( + VOID +); + +VOID +NTAPI +MiReleaseProcessReferenceToSessionDataPage( + IN PMM_SESSION_SPACE SessionGlobal +); + +VOID +NTAPI +MiSessionAddProcess( + IN PEPROCESS NewProcess ); NTSTATUS Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -128,6 +128,7 @@ PVOID MiSessionSpaceEnd; // 0xC0000000 PVOID MiSessionImageEnd; // 0xC0000000 PVOID MiSessionImageStart; // 0xBF800000 +PVOID MiSessionSpaceWs; PVOID MiSessionViewStart; // 0xBE000000 PVOID MiSessionPoolEnd; // 0xBE000000 PVOID MiSessionPoolStart; // 0xBD000000 Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -153,9 +153,79 @@ FASTCALL MiCheckPdeForSessionSpace(IN PVOID Address) { - /* Code not yet tested */ - ASSERT(FALSE); - return STATUS_NOT_IMPLEMENTED; + MMPTE TempPde; + PMMPTE PointerPde; + PVOID SessionPageTable; + ULONG Index; + + /* Is this a session PTE? */ + if (MI_IS_SESSION_PTE(Address)) + { + /* Make sure the PDE for session space is valid */ + PointerPde = MiAddressToPde(MmSessionSpace); + if (!PointerPde->u.Hard.Valid) + { + /* This means there's no valid session, bail out */ + DbgPrint("MiCheckPdeForSessionSpace: No current session for PTE %p\n", + Address); + DbgBreakPoint(); + return STATUS_ACCESS_VIOLATION; + } + + /* Now get the session-specific page table for this address */ + SessionPageTable = MiPteToAddress(Address); + PointerPde = MiPteToAddress(Address); + if (PointerPde->u.Hard.Valid) return STATUS_WAIT_1; + + /* It's not valid, so find it in the page table array */ + Index = ((ULONG_PTR)SessionPageTable - (ULONG_PTR)MmSessionBase) >> 22; + TempPde.u.Long = MmSessionSpace->PageTables[Index].u.Long; + if (TempPde.u.Hard.Valid) + { + /* The copy is valid, so swap it in */ + InterlockedExchange((PLONG)PointerPde, TempPde.u.Long); + return STATUS_WAIT_1; + } + + /* We don't seem to have allocated a page table for this address yet? */ + DbgPrint("MiCheckPdeForSessionSpace: No Session PDE for PTE %p, %p\n", + PointerPde->u.Long, SessionPageTable); + DbgBreakPoint(); + return STATUS_ACCESS_VIOLATION; + } + + /* Is the address also a session address? If not, we're done */ + if (!MI_IS_SESSION_ADDRESS(Address)) return STATUS_SUCCESS; + + /* It is, so again get the PDE for session space */ + PointerPde = MiAddressToPde(MmSessionSpace); + if (!PointerPde->u.Hard.Valid) + { + /* This means there's no valid session, bail out */ + DbgPrint("MiCheckPdeForSessionSpace: No current session for VA %p\n", + Address); + DbgBreakPoint(); + return STATUS_ACCESS_VIOLATION; + } + + /* Now get the PDE for the address itself */ + PointerPde = MiAddressToPde(Address); + if (!PointerPde->u.Hard.Valid) + { + /* Do the swap, we should be good to go */ + Index = ((ULONG_PTR)Address - (ULONG_PTR)MmSessionBase) >> 22; + PointerPde->u.Long = MmSessionSpace->PageTables[Index].u.Long; + if (PointerPde->u.Hard.Valid) return STATUS_WAIT_1; + + /* We had not allocated a page table for this session address yet, fail! */ + DbgPrint("MiCheckPdeForSessionSpace: No Session PDE for VA %p, %p\n", + PointerPde->u.Long, Address); + DbgBreakPoint(); + return STATUS_ACCESS_VIOLATION; + } + + /* It's valid, so there's nothing to do */ + return STATUS_SUCCESS; } NTSTATUS @@ -305,16 +375,14 @@ /* Check if we need a zero page */ NeedZero = (OldIrql != MM_NOIRQL); -#if 0 /* Session-backed image views must be zeroed */ if ((Process == HYDRA_PROCESS) && ((MI_IS_SESSION_IMAGE_ADDRESS(Address)) || - ((Address >= (PVOID)MiSessionViewStart) && - (Address < (PVOID)MiSessionSpaceWs)))) + ((Address >= MiSessionViewStart) && (Address < MiSessionSpaceWs)))) { NeedZero = TRUE; } -#endif + /* Hardcode unknown color */ Color = 0xFFFFFFFF; } @@ -1200,18 +1268,22 @@ KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); return STATUS_SUCCESS; } - else - { - /* Not yet handled */ - ASSERT(FALSE); - } } /* Check if this was a session PTE that needs to remap the session PDE */ if (MI_IS_SESSION_PTE(Address)) { - /* Not yet handled */ - ASSERT(FALSE); + /* Do the remapping */ + Status = MiCheckPdeForSessionSpace(Address); + if (!NT_SUCCESS(Status)) + { + /* It failed, this address is invalid */ + KeBugCheckEx(PAGE_FAULT_IN_NONPAGED_AREA, + (ULONG_PTR)Address, + StoreInstruction, + (ULONG_PTR)TrapInformation, + 6); + } } /* Check for a fault on the page table or hyperspace */ @@ -1249,8 +1321,17 @@ } else { - /* Not yet handled */ - ASSERT(FALSE); + /* Use the session process and working set */ + CurrentProcess = HYDRA_PROCESS; + WorkingSet = &MmSessionSpace->GlobalVirtualAddress->Vm; + + /* Make sure we don't have a recursive working set lock */ + if ((CurrentThread->OwnsSessionWorkingSetExclusive) || + (CurrentThread->OwnsSessionWorkingSetShared)) + { + /* Fail */ + return STATUS_IN_PAGE_ERROR | 0x10000000; + } } /* Acquire the working set lock */ @@ -1282,8 +1363,28 @@ } } - /* Case not yet handled */ - ASSERT(!IsSessionAddress); + /* Check for read-only write in session space */ + if ((IsSessionAddress) && + (StoreInstruction) && + !(TempPte.u.Hard.Write)) + { + /* Sanity check */ + ASSERT(MI_IS_SESSION_IMAGE_ADDRESS(Address)); + + /* Was this COW? */ + if (TempPte.u.Hard.CopyOnWrite == 0) + { + /* Then this is not allowed */ + KeBugCheckEx(ATTEMPTED_WRITE_TO_READONLY_MEMORY, + (ULONG_PTR)Address, + (ULONG_PTR)TempPte.u.Long, + (ULONG_PTR)TrapInformation, + 13); + } + + /* Otherwise, handle COW */ + ASSERT(FALSE); + } /* Release the working set */ MiUnlockWorkingSet(CurrentThread, WorkingSet); @@ -1315,8 +1416,16 @@ /* Get the prototype PTE! */ ProtoPte = MiProtoPteToPte(&TempPte); - /* Case not yet handled */ - ASSERT(!IsSessionAddress); + /* Do we need to locate the prototype PTE in session space? */ + if ((IsSessionAddress) && + (TempPte.u.Soft.PageFileHigh == MI_PTE_LOOKUP_NEEDED)) + { + /* Yep, go find it as well as the VAD for it */ + ProtoPte = MiCheckVirtualAddress(Address, + &ProtectionCode, + &Vad); + ASSERT(ProtoPte != NULL); + } } else { Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -577,9 +577,7 @@ // // Get the Locale ID // -#if ROS_HAS_SESSIONS return ((PMM_SESSION_SPACE)Process->Session)->LocaleId; -#endif } } @@ -698,7 +696,7 @@ // // Session ID // - if (Process->Session) Peb->SessionId = 0; // MmGetSessionId(Process); + MmGetSessionId(Process); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -1317,6 +1315,9 @@ /* Let go of the system PTE */ MiReleaseSystemPtes(PointerPte, 1, SystemPteSpace); + + /* Add the process to the session */ + MiSessionAddProcess(Process); return TRUE; } #endif @@ -1331,6 +1332,9 @@ /* Only support this */ ASSERT(Process->AddressSpaceInitialized == 2); + + /* Remove from the session */ + MiSessionRemoveProcess(); /* Lock the process address space from changes */ MmLockAddressSpace(&Process->Vm); @@ -1383,6 +1387,7 @@ /* Free the VAD memory */ ExFreePool(Vad); } + /* Delete the shared user data section */ MiDeleteVirtualAddresses(USER_SHARED_DATA, USER_SHARED_DATA, NULL); @@ -1447,8 +1452,8 @@ /* Release the PFN lock */ KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - /* No support for sessions yet */ - ASSERT(Process->Session == 0); + /* Drop a reference on the session */ + if (Process->Session) MiReleaseProcessReferenceToSessionDataPage(Process->Session); /* Clear out the PDE pages */ Process->Pcb.DirectoryTableBase[0] = 0; @@ -1526,6 +1531,257 @@ OldIrql = KeAcquireQueuedSpinLock(LockQueueExpansionLock); Process->Vm.Flags.SessionLeader = TRUE; KeReleaseQueuedSpinLock(LockQueueExpansionLock, OldIrql); +} + +ULONG +NTAPI +MmGetSessionId(IN PEPROCESS Process) +{ + PMM_SESSION_SPACE SessionGlobal; + + /* The session leader is always session zero */ + if (Process->Vm.Flags.SessionLeader == 1) return 0; + + /* Otherwise, get the session global, and read the session ID from it */ + SessionGlobal = (PMM_SESSION_SPACE)Process->Session; + if (!SessionGlobal) return 0; + return SessionGlobal->SessionId; +} + +VOID +NTAPI +MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal) +{ + ULONG i, SessionId; + PMMPTE PointerPte; + PFN_NUMBER PageFrameIndex[MI_SESSION_DATA_PAGES_MAXIMUM]; + PMMPFN Pfn1; + KIRQL OldIrql; + + /* Is there more than just this reference? If so, bail out */ + if (InterlockedDecrement(&SessionGlobal->ProcessReferenceToSession)) return; + + /* Get the session ID */ + SessionId = SessionGlobal->SessionId; + DPRINT1("Last process in sessino %d going down!!!\n", SessionId); + + /* Free the session page tables */ + ExFreePool(SessionGlobal->PageTables); + ASSERT(!MI_IS_PHYSICAL_ADDRESS(SessionGlobal)); + + /* Capture the data page PFNs */ + PointerPte = MiAddressToPte(SessionGlobal); + for (i = 0; i < MiSessionDataPages; i++) + { + PageFrameIndex[i] = PFN_FROM_PTE(PointerPte + i); + } + + /* Release them */ + MiReleaseSystemPtes(PointerPte, MiSessionDataPages, SystemPteSpace); + + /* Mark them as deleted */ + for (i = 0; i < MiSessionDataPages; i++) + { + Pfn1 = MI_PFN_ELEMENT(PageFrameIndex[i]); + MI_SET_PFN_DELETED(Pfn1); + } + + /* Loop every data page and drop a reference count */ + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + for (i = 0; i < MiSessionDataPages; i++) + { + /* Sanity check that the page is correct, then decrement it */ + Pfn1 = MI_PFN_ELEMENT(PageFrameIndex[i]); + ASSERT(Pfn1->u2.ShareCount == 1); + ASSERT(Pfn1->u3.e2.ReferenceCount == 1); + MiDecrementShareCount(Pfn1, PageFrameIndex[i]); + } + + /* Done playing with pages, release the lock */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + + /* Decrement the number of data pages */ + InterlockedDecrement(&MmSessionDataPages); + + /* Free this session ID from the session bitmap */ + KeAcquireGuardedMutex(&MiSessionIdMutex); + ASSERT(RtlCheckBit(MiSessionIdBitmap, SessionId)); + RtlClearBit(MiSessionIdBitmap, SessionId); + KeReleaseGuardedMutex(&MiSessionIdMutex); +} + +VOID +NTAPI +MiSessionRemoveProcess(VOID) +{ + PEPROCESS CurrentProcess = PsGetCurrentProcess(); + + /* If the process isn't already in a session, or if it's the leader... */ + if (!(CurrentProcess->Flags & PSF_PROCESS_IN_SESSION_BIT) || + (CurrentProcess->Vm.Flags.SessionLeader)) + { + /* Then there's nothing to do */ + return; + } + + /* Sanity check */ + ASSERT(MmIsAddressValid(MmSessionSpace) == TRUE); + + /* Remove the process from the list ,and dereference the session */ + RemoveEntryList(&CurrentProcess->SessionProcessLinks); + //MiDereferenceSession(); +} + +VOID +NTAPI +MiSessionAddProcess(IN PEPROCESS NewProcess) +{ + PMM_SESSION_SPACE SessionGlobal; + + /* The current process must already be in a session */ + if (!(PsGetCurrentProcess()->Flags & PSF_PROCESS_IN_SESSION_BIT)) return; + + /* Sanity check */ + ASSERT(MmIsAddressValid(MmSessionSpace) == TRUE); + + /* Get the global session */ + SessionGlobal = MmSessionSpace->GlobalVirtualAddress; + + /* Increment counters */ + InterlockedIncrement((PLONG)&SessionGlobal->ReferenceCount); + InterlockedIncrement(&SessionGlobal->ResidentProcessCount); + InterlockedIncrement(&SessionGlobal->ProcessReferenceToSession); + + /* Set the session pointer */ + ASSERT(NewProcess->Session == NULL); + NewProcess->Session = SessionGlobal; + + /* Insert it into the process list */ + InsertTailList(&SessionGlobal->ProcessList, &NewProcess->SessionProcessLinks); + + /* Set the flag */ + PspSetProcessFlag(NewProcess, PSF_PROCESS_IN_SESSION_BIT); +} + +NTSTATUS +NTAPI +MiSessionInitializeWorkingSetList(VOID) +{ + KIRQL OldIrql; + PMMPTE PointerPte, PointerPde; + MMPTE TempPte; + ULONG Color, Index; + PFN_NUMBER PageFrameIndex; + PMM_SESSION_SPACE SessionGlobal; + BOOLEAN AllocatedPageTable; + PMMWSL WorkingSetList; + + /* Get pointers to session global and the session working set list */ + SessionGlobal = MmSessionSpace->GlobalVirtualAddress; + WorkingSetList = (PMMWSL)MiSessionSpaceWs; + + /* Fill out the two pointers */ + MmSessionSpace->Vm.VmWorkingSetList = WorkingSetList; + MmSessionSpace->Wsle = (PMMWSLE)WorkingSetList->UsedPageTableEntries; + + /* Get the PDE for the working set, and check if it's already allocated */ + PointerPde = MiAddressToPde(WorkingSetList); + if (PointerPde->u.Hard.Valid == 1) + { + /* Nope, we'll have to do it */ + ASSERT(PointerPde->u.Hard.Global == 0); + AllocatedPageTable = FALSE; + } + else + { + /* Yep, that makes our job easier */ + AllocatedPageTable = TRUE; + } + + /* Get the PTE for the working set */ + PointerPte = MiAddressToPte(WorkingSetList); + + /* Initialize the working set lock, and lock the PFN database */ + ExInitializePushLock(&SessionGlobal->Vm.WorkingSetMutex); + //MmLockPageableSectionByHandle(ExPageLockHandle); + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + + /* Check if we need a page table */ + if (AllocatedPageTable == TRUE) + { + /* Get a zeroed colored zero page */ + Color = MI_GET_NEXT_COLOR(); + PageFrameIndex = MiRemoveZeroPageSafe(Color); + if (!PageFrameIndex) + { + /* No zero pages, grab a free one */ + PageFrameIndex = MiRemoveAnyPage(Color); + + /* Zero it outside the PFN lock */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + MiZeroPhysicalPage(PageFrameIndex); + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + } + + /* Write a valid PDE for it */ + TempPte.u.Long = ValidKernelPdeLocal.u.Long; + TempPte.u.Hard.PageFrameNumber = PageFrameIndex; + MI_WRITE_VALID_PTE(PointerPde, TempPte); + + /* Add this into the list */ + Index = ((ULONG_PTR)WorkingSetList - (ULONG_PTR)MmSessionBase) >> 22; + MmSessionSpace->PageTables[Index] = TempPte; + + /* Initialize the page directory page, and now zero the working set list itself */ + MiInitializePfnForOtherProcess(PageFrameIndex, + PointerPde, + MmSessionSpace->SessionPageDirectoryIndex); + KeZeroPages(PointerPte, PAGE_SIZE); + } + + /* Get a zeroed colored zero page */ + Color = MI_GET_NEXT_COLOR(); + PageFrameIndex = MiRemoveZeroPageSafe(Color); + if (!PageFrameIndex) + { + /* No zero pages, grab a free one */ + PageFrameIndex = MiRemoveAnyPage(Color); + + /* Zero it outside the PFN lock */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + MiZeroPhysicalPage(PageFrameIndex); + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + } + + /* Write a valid PTE for it */ + TempPte.u.Long = ValidKernelPteLocal.u.Long; + TempPte.u.Hard.Dirty = TRUE; + TempPte.u.Hard.PageFrameNumber = PageFrameIndex; + + /* Initialize the working set list page */ + MiInitializePfnAndMakePteValid(PageFrameIndex, PointerPte, TempPte); + + /* Now we can release the PFN database lock */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + + /* Fill out the working set structure */ + MmSessionSpace->Vm.Flags.SessionSpace = 1; + MmSessionSpace->Vm.MinimumWorkingSetSize = 20; + MmSessionSpace->Vm.MaximumWorkingSetSize = 384; + WorkingSetList->LastEntry = 20; + WorkingSetList->HashTable = NULL; + WorkingSetList->HashTableSize = 0; + WorkingSetList->Wsle = MmSessionSpace->Wsle; + + /* FIXME: Handle list insertions */ + ASSERT(SessionGlobal->WsListEntry.Flink == NULL); + ASSERT(SessionGlobal->WsListEntry.Blink == NULL); + ASSERT(SessionGlobal->Vm.WorkingSetExpansionLinks.Flink == NULL); + ASSERT(SessionGlobal->Vm.WorkingSetExpansionLinks.Blink == NULL); + + /* All done, return */ + //MmUnlockPageableImageSection(ExPageLockHandle); + return STATUS_SUCCESS; } NTSTATUS @@ -1770,12 +2026,31 @@ MiSessionLeader(Process); } - /* FIXME: Actually create a session */ + /* Create the session */ KeEnterCriticalRegion(); Status = MiSessionCreateInternal(SessionId); + if (!NT_SUCCESS(Status)) + { + KeLeaveCriticalRegion(); + return Status; + } + + /* Set up the session working set */ + Status = MiSessionInitializeWorkingSetList(); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + //MiDereferenceSession(); + ASSERT(FALSE); + KeLeaveCriticalRegion(); + return Status; + } + + /* All done */ KeLeaveCriticalRegion(); /* Set and assert the flags, and return */ + MmSessionSpace->u.Flags.Initialized = 1; PspSetProcessFlag(Process, PSF_PROCESS_IN_SESSION_BIT); ASSERT(MiSessionLeaderExists == 1); return Status; Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -827,7 +827,7 @@ /* Get the start and end PDE, then loop each one */ StartPde = MiAddressToPde(StartVa); EndPde = MiAddressToPde((PVOID)((ULONG_PTR)EndVa - 1)); - Index = (ULONG_PTR)StartVa >> 22; + Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22; while (StartPde <= EndPde) { /* If we don't already have a page table for it, increment count */ @@ -843,7 +843,7 @@ /* Reset the start PDE and index */ StartPde = MiAddressToPde(StartVa); - Index = (ULONG_PTR)StartVa >> 22; + Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22; /* Loop each PDE while holding the working set lock */ // MiLockWorkingSet(PsGetCurrentThread(), @@ -2330,7 +2330,6 @@ /* Use the system space API, but with the session view instead */ ASSERT(MmIsAddressValid(MmSessionSpace) == TRUE); - ASSERT(FALSE); return MiMapViewInSystemSpace(Section, &MmSessionSpace->Session, MappedBase, Modified: trunk/reactos/ntoskrnl/ps/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -1114,8 +1114,7 @@ NTAPI PsGetCurrentProcessSessionId(VOID) { - // FIXME: this is broken! - return PtrToUlong(PsGetCurrentProcess()->Session); + return MmGetSessionId(PsGetCurrentProcess()); } /* Modified: trunk/reactos/ntoskrnl/ps/security.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/security.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ps/security.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/security.c [iso-8859-1] Wed Aug 1 07:54:37 2012 @@ -86,7 +86,7 @@ Status = SeSubProcessToken(ParentToken, &NewToken, TRUE, - 0);//MmGetSessionId(Process)); + MmGetSessionId(Process)); /* Dereference the Parent */ ObFastDereferenceObject(&Parent->Token, ParentToken);
12 years, 4 months
1
0
0
0
← Newer
1
...
17
18
19
20
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Results per page:
10
25
50
100
200