ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
146 discussions
Start a n
N
ew thread
[greatlrd] 24266: Fixed some bugs in win32k function BITMAP_GetObject.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 09:25:11 2006 New Revision: 24266 URL:
http://svn.reactos.org/svn/reactos?rev=24266&view=rev
Log: Fixed some bugs in win32k function BITMAP_GetObject. Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Mon Sep 25 09:25:11 2006 @@ -1556,8 +1556,12 @@ INT STDCALL BITMAP_GetObject(BITMAPOBJ * bmp, INT count, LPVOID buffer) { + if( !buffer ) return sizeof(BITMAP); + if (count < sizeof(BITMAP)) return 0; + if(bmp->dib) { + if(count < (INT) sizeof(DIBSECTION)) { if (count > (INT) sizeof(BITMAP)) count = sizeof(BITMAP); @@ -1579,7 +1583,8 @@ Bitmap.bmWidthBytes = abs(bmp->SurfObj.lDelta); Bitmap.bmPlanes = 1; Bitmap.bmBitsPixel = BitsPerFormat(bmp->SurfObj.iBitmapFormat); - Bitmap.bmBits = bmp->SurfObj.pvBits; + //Bitmap.bmBits = bmp->SurfObj.pvBits; + Bitmap.bmBits = NULL; /* not set accoring wine test confirm in win2k */ memcpy(buffer, &Bitmap, count); return count; }
18 years, 3 months
1
0
0
0
[arty] 24265: Add missing file from the branch. Preparing to move build hosts.
by arty@svn.reactos.org
Author: arty Date: Mon Sep 25 05:43:46 2006 New Revision: 24265 URL:
http://svn.reactos.org/svn/reactos?rev=24265&view=rev
Log: Add missing file from the branch. Preparing to move build hosts. Added: branches/powerpc/reactos/lib/rtl/bitmap.c Added: branches/powerpc/reactos/lib/rtl/bitmap.c URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/lib/rtl/bitmap.…
============================================================================== --- branches/powerpc/reactos/lib/rtl/bitmap.c (added) +++ branches/powerpc/reactos/lib/rtl/bitmap.c Mon Sep 25 05:43:46 2006 @@ -1,0 +1,979 @@ +/* COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/rtl/bitmap.c + * PURPOSE: Bitmap functions + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include <rtl.h> + +#define NDEBUG +#include <debug.h> + +/* MACROS *******************************************************************/ + +/* Bits set from LSB to MSB; used as mask for runs < 8 bits */ +static const BYTE NTDLL_maskBits[8] = { 0, 1, 3, 7, 15, 31, 63, 127 }; + +/* Number of set bits for each value of a nibble; used for counting */ +static const BYTE NTDLL_nibbleBitCount[16] = { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 +}; + +/* First set bit in a nibble; used for determining least significant bit */ +static const BYTE NTDLL_leastSignificant[16] = { + 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 +}; + +/* Last set bit in a nibble; used for determining most significant bit */ +static const signed char NTDLL_mostSignificant[16] = { + -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 +}; + +/* PRIVATE FUNCTIONS *********************************************************/ + +static +int +NTDLL_RunSortFn(const void *lhs, + const void *rhs) +{ + if (((const RTL_BITMAP_RUN*)lhs)->NumberOfBits > ((const RTL_BITMAP_RUN*)rhs)->NumberOfBits) + return -1; + return 1; +} + +static +ULONG +WINAPI +NTDLL_FindRuns(PRTL_BITMAP lpBits, + PRTL_BITMAP_RUN lpSeries, + ULONG ulCount, + BOOLEAN bLongest, + ULONG (*fn)(PRTL_BITMAP,ULONG,PULONG)) +{ + BOOL bNeedSort = ulCount > 1 ? TRUE : FALSE; + ULONG ulPos = 0, ulRuns = 0; + + if (!ulCount) + return ~0U; + + while (ulPos < lpBits->SizeOfBitMap) + { + /* Find next set/clear run */ + ULONG ulSize, ulNextPos = fn(lpBits, ulPos, &ulSize); + + if (ulNextPos == ~0U) + break; + + if (bLongest && ulRuns == ulCount) + { + /* Sort runs with shortest at end, if they are out of order */ + if (bNeedSort) + qsort(lpSeries, ulRuns, sizeof(RTL_BITMAP_RUN), NTDLL_RunSortFn); + + /* Replace last run if this one is bigger */ + if (ulSize > lpSeries[ulRuns - 1].NumberOfBits) + { + lpSeries[ulRuns - 1].StartingIndex = ulNextPos; + lpSeries[ulRuns - 1].NumberOfBits = ulSize; + + /* We need to re-sort the array, _if_ we didn't leave it sorted */ + if (ulRuns > 1 && ulSize > lpSeries[ulRuns - 2].NumberOfBits) + bNeedSort = TRUE; + } + } + else + { + /* Append to found runs */ + lpSeries[ulRuns].StartingIndex = ulNextPos; + lpSeries[ulRuns].NumberOfBits = ulSize; + ulRuns++; + + if (!bLongest && ulRuns == ulCount) + break; + } + ulPos = ulNextPos + ulSize; + } + return ulRuns; +} + +static +ULONG +NTDLL_FindSetRun(PRTL_BITMAP lpBits, + ULONG ulStart, + PULONG lpSize) +{ + LPBYTE lpOut; + ULONG ulFoundAt = 0, ulCount = 0; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)lpBits->Buffer) + (ulStart >> 3u); + + while (1) + { + /* Check bits in first byte */ + const BYTE bMask = (0xff << (ulStart & 7)) & 0xff; + const BYTE bFirst = *lpOut & bMask; + + if (bFirst) + { + /* Have a set bit in first byte */ + if (bFirst != bMask) + { + /* Not every bit is set */ + ULONG ulOffset; + + if (bFirst & 0x0f) + ulOffset = NTDLL_leastSignificant[bFirst & 0x0f]; + else + ulOffset = 4 + NTDLL_leastSignificant[bFirst >> 4]; + ulStart += ulOffset; + ulFoundAt = ulStart; + for (;ulOffset < 8; ulOffset++) + { + if (!(bFirst & (1 << ulOffset))) + { + *lpSize = ulCount; + return ulFoundAt; /* Set from start, but not until the end */ + } + ulCount++; + ulStart++; + } + /* Set to the end - go on to count further bits */ + lpOut++; + break; + } + /* every bit from start until the end of the byte is set */ + ulFoundAt = ulStart; + ulCount = 8 - (ulStart & 7); + ulStart = (ulStart & ~7u) + 8; + lpOut++; + break; + } + ulStart = (ulStart & ~7u) + 8; + lpOut++; + if (ulStart >= lpBits->SizeOfBitMap) + return ~0U; + } + + /* Count blocks of 8 set bits */ + while (*lpOut == 0xff) + { + ulCount += 8; + ulStart += 8; + if (ulStart >= lpBits->SizeOfBitMap) + { + *lpSize = ulCount - (ulStart - lpBits->SizeOfBitMap); + return ulFoundAt; + } + lpOut++; + } + + /* Count remaining contiguous bits, if any */ + if (*lpOut & 1) + { + ULONG ulOffset = 0; + + for (;ulOffset < 7u; ulOffset++) + { + if (!(*lpOut & (1 << ulOffset))) + break; + ulCount++; + } + } + *lpSize = ulCount; + return ulFoundAt; +} + +static +ULONG +NTDLL_FindClearRun(PRTL_BITMAP lpBits, + ULONG ulStart, + PULONG lpSize) +{ + LPBYTE lpOut; + ULONG ulFoundAt = 0, ulCount = 0; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)lpBits->Buffer) + (ulStart >> 3u); + + while (1) + { + /* Check bits in first byte */ + const BYTE bMask = (0xff << (ulStart & 7)) & 0xff; + const BYTE bFirst = (~*lpOut) & bMask; + + if (bFirst) + { + /* Have a clear bit in first byte */ + if (bFirst != bMask) + { + /* Not every bit is clear */ + ULONG ulOffset; + + if (bFirst & 0x0f) + ulOffset = NTDLL_leastSignificant[bFirst & 0x0f]; + else + ulOffset = 4 + NTDLL_leastSignificant[bFirst >> 4]; + ulStart += ulOffset; + ulFoundAt = ulStart; + for (;ulOffset < 8; ulOffset++) + { + if (!(bFirst & (1 << ulOffset))) + { + *lpSize = ulCount; + return ulFoundAt; /* Clear from start, but not until the end */ + } + ulCount++; + ulStart++; + } + /* Clear to the end - go on to count further bits */ + lpOut++; + break; + } + /* Every bit from start until the end of the byte is clear */ + ulFoundAt = ulStart; + ulCount = 8 - (ulStart & 7); + ulStart = (ulStart & ~7u) + 8; + lpOut++; + break; + } + ulStart = (ulStart & ~7u) + 8; + lpOut++; + if (ulStart >= lpBits->SizeOfBitMap) + return ~0U; + } + + /* Count blocks of 8 clear bits */ + while (!*lpOut) + { + ulCount += 8; + ulStart += 8; + if (ulStart >= lpBits->SizeOfBitMap) + { + *lpSize = ulCount - (ulStart - lpBits->SizeOfBitMap); + return ulFoundAt; + } + lpOut++; + } + + /* Count remaining contiguous bits, if any */ + if (!(*lpOut & 1)) + { + ULONG ulOffset = 0; + + for (;ulOffset < 7u; ulOffset++) + { + if (*lpOut & (1 << ulOffset)) + break; + ulCount++; + } + } + *lpSize = ulCount; + return ulFoundAt; +} + +/* FUNCTIONS ****************************************************************/ + +/* + * @implemented + */ +VOID +NTAPI +RtlInitializeBitMap(IN PRTL_BITMAP BitMapHeader, + IN PULONG BitMapBuffer, + IN ULONG SizeOfBitMap) +{ + /* Setup the bitmap header */ + BitMapHeader->SizeOfBitMap = SizeOfBitMap; + BitMapHeader->Buffer = BitMapBuffer; +} + +/* + * @implemented + */ +BOOLEAN +NTAPI +RtlAreBitsClear(IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG Length) +{ + LPBYTE lpOut; + ULONG ulRemainder; + + if (!BitMapHeader || !Length || + StartingIndex >= BitMapHeader->SizeOfBitMap || + Length > BitMapHeader->SizeOfBitMap - StartingIndex) + return FALSE; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)BitMapHeader->Buffer) + (StartingIndex >> 3u); + + /* Check bits in first byte, if StartingIndex isn't a byte boundary */ + if (StartingIndex & 7) + { + if (Length > 7) + { + /* Check from start bit to the end of the byte */ + if (*lpOut & ((0xff << (StartingIndex & 7)) & 0xff)) + return FALSE; + lpOut++; + Length -= (8 - (StartingIndex & 7)); + } + else + { + /* Check from the start bit, possibly into the next byte also */ + USHORT initialWord = NTDLL_maskBits[Length] << (StartingIndex & 7); + + if (*lpOut & (initialWord & 0xff)) + return FALSE; + if ((initialWord & 0xff00) && (lpOut[1] & (initialWord >> 8))) + return FALSE; + return TRUE; + } + } + + /* Check bits in blocks of 8 bytes */ + ulRemainder = Length & 7; + Length >>= 3; + while (Length--) + { + if (*lpOut++) + return FALSE; + } + + /* Check remaining bits, if any */ + if (ulRemainder && *lpOut & NTDLL_maskBits[ulRemainder]) + return FALSE; + return TRUE; +} + + +/* + * @implemented + */ +BOOLEAN NTAPI +RtlAreBitsSet(PRTL_BITMAP BitMapHeader, + ULONG StartingIndex, + ULONG Length) +{ + LPBYTE lpOut; + ULONG ulRemainder; + + + if (!BitMapHeader || !Length || + StartingIndex >= BitMapHeader->SizeOfBitMap || + Length > BitMapHeader->SizeOfBitMap - StartingIndex) + return FALSE; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)BitMapHeader->Buffer) + (StartingIndex >> 3u); + + /* Check bits in first byte, if StartingIndex isn't a byte boundary */ + if (StartingIndex & 7) + { + if (Length > 7) + { + /* Check from start bit to the end of the byte */ + if ((*lpOut & + ((0xff << (StartingIndex & 7))) & 0xff) != ((0xff << (StartingIndex & 7) & 0xff))) + return FALSE; + lpOut++; + Length -= (8 - (StartingIndex & 7)); + } + else + { + /* Check from the start bit, possibly into the next byte also */ + USHORT initialWord = NTDLL_maskBits[Length] << (StartingIndex & 7); + + if ((*lpOut & (initialWord & 0xff)) != (initialWord & 0xff)) + return FALSE; + if ((initialWord & 0xff00) && + ((lpOut[1] & (initialWord >> 8)) != (initialWord >> 8))) + return FALSE; + return TRUE; + } + } + + /* Check bits in blocks of 8 bytes */ + ulRemainder = Length & 7; + Length >>= 3; + while (Length--) + { + if (*lpOut++ != 0xff) + return FALSE; + } + + /* Check remaining bits, if any */ + if (ulRemainder && + (*lpOut & NTDLL_maskBits[ulRemainder]) != NTDLL_maskBits[ulRemainder]) + return FALSE; + return TRUE; +} + + +/* + * @implemented + */ +VOID NTAPI +RtlClearAllBits(IN OUT PRTL_BITMAP BitMapHeader) +{ + memset(BitMapHeader->Buffer, 0, ((BitMapHeader->SizeOfBitMap + 31) & ~31) >> 3); +} + +/* + * @implemented + */ +VOID +NTAPI +RtlClearBit(PRTL_BITMAP BitMapHeader, + ULONG BitNumber) +{ + PULONG Ptr; + + if (BitNumber >= BitMapHeader->SizeOfBitMap) return; + + Ptr = (PULONG)BitMapHeader->Buffer + (BitNumber / 32); + *Ptr &= ~(1 << (BitNumber % 32)); +} + +/* + * @implemented + */ +VOID +NTAPI +RtlClearBits(IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToClear) +{ + LPBYTE lpOut; + + if (!BitMapHeader || !NumberToClear || + StartingIndex >= BitMapHeader->SizeOfBitMap || + NumberToClear > BitMapHeader->SizeOfBitMap - StartingIndex) + return; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)BitMapHeader->Buffer) + (StartingIndex >> 3u); + + /* Clear bits in first byte, if StartingIndex isn't a byte boundary */ + if (StartingIndex & 7) + { + if (NumberToClear > 7) + { + /* Clear from start bit to the end of the byte */ + *lpOut++ &= ~(0xff << (StartingIndex & 7)); + NumberToClear -= (8 - (StartingIndex & 7)); + } + else + { + /* Clear from the start bit, possibly into the next byte also */ + USHORT initialWord = ~(NTDLL_maskBits[NumberToClear] << (StartingIndex & 7)); + + *lpOut++ &= (initialWord & 0xff); + *lpOut &= (initialWord >> 8); + return; + } + } + + /* Clear bits (in blocks of 8) on whole byte boundaries */ + if (NumberToClear >> 3) + { + memset(lpOut, 0, NumberToClear >> 3); + lpOut = lpOut + (NumberToClear >> 3); + } + + /* Clear remaining bits, if any */ + if (NumberToClear & 0x7) + *lpOut &= ~NTDLL_maskBits[NumberToClear & 0x7]; +} + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindClearBits(PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex) +{ + ULONG ulPos, ulEnd; + + if (!BitMapHeader || !NumberToFind || NumberToFind > BitMapHeader->SizeOfBitMap) + return ~0U; + + ulEnd = BitMapHeader->SizeOfBitMap; + + if (HintIndex + NumberToFind > BitMapHeader->SizeOfBitMap) + HintIndex = 0; + + ulPos = HintIndex; + + while (ulPos < ulEnd) + { + /* FIXME: This could be made a _lot_ more efficient */ + if (RtlAreBitsClear(BitMapHeader, ulPos, NumberToFind)) + return ulPos; + + /* Start from the beginning if we hit the end and started from HintIndex */ + if (ulPos == ulEnd - 1 && HintIndex) + { + ulEnd = HintIndex; + ulPos = HintIndex = 0; + } + else + ulPos++; + } + return ~0U; +} + + + + + + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindClearRuns(PRTL_BITMAP BitMapHeader, + PRTL_BITMAP_RUN RunArray, + ULONG SizeOfRunArray, + BOOLEAN LocateLongestRuns) +{ + return NTDLL_FindRuns(BitMapHeader, RunArray, SizeOfRunArray, LocateLongestRuns, NTDLL_FindClearRun); +} + + +/* + * @unimplemented + */ +ULONG NTAPI +RtlFindLastBackwardRunClear(IN PRTL_BITMAP BitMapHeader, + IN ULONG FromIndex, + IN PULONG StartingRunIndex) +{ + UNIMPLEMENTED; + return 0; +} + +/* + * @implemented + */ +ULONG NTAPI +RtlFindNextForwardRunClear(IN PRTL_BITMAP BitMapHeader, + IN ULONG FromIndex, + IN PULONG StartingRunIndex) +{ + ULONG ulSize = 0; + + if (BitMapHeader && FromIndex < BitMapHeader->SizeOfBitMap && StartingRunIndex) + *StartingRunIndex = NTDLL_FindClearRun(BitMapHeader, FromIndex, &ulSize); + + return ulSize; +} + +/* + * @implemented + */ +ULONG NTAPI +RtlFindFirstRunSet(IN PRTL_BITMAP BitMapHeader, + IN PULONG StartingIndex) +{ + ULONG Size; + ULONG Index; + ULONG Count; + PULONG Ptr; + ULONG Mask; + + Size = BitMapHeader->SizeOfBitMap; + if (*StartingIndex > Size) + { + *StartingIndex = (ULONG)-1; + return 0; + } + + Index = *StartingIndex; + Ptr = (PULONG)BitMapHeader->Buffer + (Index / 32); + Mask = 1 << (Index & 0x1F); + + /* Skip clear bits */ + for (; Index < Size && ~*Ptr & Mask; Index++) + { + Mask <<= 1; + + if (Mask == 0) + { + Mask = 1; + Ptr++; + } + } + + /* Return index of first set bit */ + if (Index >= Size) + { + *StartingIndex = (ULONG)-1; + return 0; + } + else + { + *StartingIndex = Index; + } + + /* Count set bits */ + for (Count = 0; Index < Size && *Ptr & Mask; Index++) + { + Count++; + Mask <<= 1; + + if (Mask == 0) + { + Mask = 1; + Ptr++; + } + } + + return Count; +} + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindLongestRunClear(PRTL_BITMAP BitMapHeader, + PULONG StartingIndex) +{ + RTL_BITMAP_RUN br; + + if (RtlFindClearRuns(BitMapHeader, &br, 1, TRUE) == 1) + { + if (StartingIndex) + *StartingIndex = br.StartingIndex; + return br.NumberOfBits; + } + return 0; +} + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindLongestRunSet(PRTL_BITMAP BitMapHeader, + PULONG StartingIndex) +{ + RTL_BITMAP_RUN br; + + if (NTDLL_FindRuns(BitMapHeader, &br, 1, TRUE, NTDLL_FindSetRun) == 1) + { + if (StartingIndex) + *StartingIndex = br.StartingIndex; + return br.NumberOfBits; + } + return 0; +} + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindSetBits(PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex) +{ + ULONG ulPos, ulEnd; + + if (!BitMapHeader || !NumberToFind || NumberToFind > BitMapHeader->SizeOfBitMap) + return ~0U; + + ulEnd = BitMapHeader->SizeOfBitMap; + + if (HintIndex + NumberToFind > BitMapHeader->SizeOfBitMap) + HintIndex = 0; + + ulPos = HintIndex; + + while (ulPos < ulEnd) + { + /* FIXME: This could be made a _lot_ more efficient */ + if (RtlAreBitsSet(BitMapHeader, ulPos, NumberToFind)) + return ulPos; + + /* Start from the beginning if we hit the end and had a hint */ + if (ulPos == ulEnd - 1 && HintIndex) + { + ulEnd = HintIndex; + ulPos = HintIndex = 0; + } + else + ulPos++; + } + return ~0U; +} + + +/* + * @implemented + */ +ULONG NTAPI +RtlFindSetBitsAndClear(PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex) +{ + ULONG ulPos; + + ulPos = RtlFindSetBits(BitMapHeader, NumberToFind, HintIndex); + if (ulPos != ~0U) + RtlClearBits(BitMapHeader, ulPos, NumberToFind); + return ulPos; +} + + + + + +/* + * @implemented + */ +ULONG NTAPI +RtlNumberOfSetBits(PRTL_BITMAP BitMapHeader) +{ + ULONG ulSet = 0; + + if (BitMapHeader) + { + LPBYTE lpOut = (BYTE *)BitMapHeader->Buffer; + ULONG Length, ulRemainder; + BYTE bMasked; + + Length = BitMapHeader->SizeOfBitMap >> 3; + ulRemainder = BitMapHeader->SizeOfBitMap & 0x7; + + while (Length--) + { + ulSet += NTDLL_nibbleBitCount[*lpOut >> 4]; + ulSet += NTDLL_nibbleBitCount[*lpOut & 0xf]; + lpOut++; + } + + bMasked = *lpOut & NTDLL_maskBits[ulRemainder]; + ulSet += NTDLL_nibbleBitCount[bMasked >> 4]; + ulSet += NTDLL_nibbleBitCount[bMasked & 0xf]; + } + return ulSet; +} + + +/* + * @implemented + */ +VOID NTAPI +RtlSetAllBits(IN OUT PRTL_BITMAP BitMapHeader) +{ + memset(BitMapHeader->Buffer, 0xff, ((BitMapHeader->SizeOfBitMap + 31) & ~31) >> 3); +} + + +/* + * @implemented + */ +VOID NTAPI +RtlSetBit(PRTL_BITMAP BitMapHeader, + ULONG BitNumber) +{ + PULONG Ptr; + + if (BitNumber >= BitMapHeader->SizeOfBitMap) + return; + + Ptr = (PULONG)BitMapHeader->Buffer + (BitNumber / 32); + + *Ptr |= (1 << (BitNumber % 32)); +} + + +/* + * @implemented + */ +VOID NTAPI +RtlSetBits(PRTL_BITMAP BitMapHeader, + ULONG StartingIndex, + ULONG NumberToSet) +{ + LPBYTE lpOut; + + if (!BitMapHeader || !NumberToSet || + StartingIndex >= BitMapHeader->SizeOfBitMap || + NumberToSet > BitMapHeader->SizeOfBitMap - StartingIndex) + return; + + /* FIXME: It might be more efficient/cleaner to manipulate four bytes + * at a time. But beware of the pointer arithmetics... + */ + lpOut = ((BYTE*)BitMapHeader->Buffer) + (StartingIndex >> 3u); + + /* Set bits in first byte, if StartingIndex isn't a byte boundary */ + if (StartingIndex & 7) + { + if (NumberToSet > 7) + { + /* Set from start bit to the end of the byte */ + *lpOut++ |= 0xff << (StartingIndex & 7); + NumberToSet -= (8 - (StartingIndex & 7)); + } + else + { + /* Set from the start bit, possibly into the next byte also */ + USHORT initialWord = NTDLL_maskBits[NumberToSet] << (StartingIndex & 7); + + *lpOut++ |= (initialWord & 0xff); + *lpOut |= (initialWord >> 8); + return; + } + } + + /* Set bits up to complete byte count */ + if (NumberToSet >> 3) + { + memset(lpOut, 0xff, NumberToSet >> 3); + lpOut = lpOut + (NumberToSet >> 3); + } + + /* Set remaining bits, if any */ + *lpOut |= NTDLL_maskBits[NumberToSet & 0x7]; +} + + +/* + * @implemented + */ +BOOLEAN NTAPI +RtlTestBit(PRTL_BITMAP BitMapHeader, + ULONG BitNumber) +{ + PULONG Ptr; + + if (BitNumber >= BitMapHeader->SizeOfBitMap) + return FALSE; + + Ptr = (PULONG)BitMapHeader->Buffer + (BitNumber / 32); + + return (*Ptr & (1 << (BitNumber % 32))); +} + +/* + * @implemented + */ +ULONG NTAPI +RtlFindFirstRunClear(PRTL_BITMAP BitMapHeader, + PULONG StartingIndex) +{ + return RtlFindNextForwardRunClear(BitMapHeader, 0, StartingIndex); +} + +/* + * @implemented + */ +ULONG NTAPI +RtlNumberOfClearBits(PRTL_BITMAP BitMapHeader) +{ + + if (BitMapHeader) + return BitMapHeader->SizeOfBitMap - RtlNumberOfSetBits(BitMapHeader); + return 0; +} + +/* + * @implemented + */ +ULONG NTAPI +RtlFindClearBitsAndSet(PRTL_BITMAP BitMapHeader, + ULONG NumberToFind, + ULONG HintIndex) +{ + ULONG ulPos; + + ulPos = RtlFindClearBits(BitMapHeader, NumberToFind, HintIndex); + if (ulPos != ~0U) + RtlSetBits(BitMapHeader, ulPos, NumberToFind); + return ulPos; +} + +/* + * @implemented + */ +CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG ulLong) +{ + signed char ret = 32; + DWORD dw; + + if (!(dw = (ulLong >> 32))) + { + ret = 0; + dw = (DWORD)ulLong; + } + if (dw & 0xffff0000) + { + dw >>= 16; + ret += 16; + } + if (dw & 0xff00) + { + dw >>= 8; + ret += 8; + } + if (dw & 0xf0) + { + dw >>= 4; + ret += 4; + } + return ret + NTDLL_mostSignificant[dw]; +} + +/* + * @implemented + */ +CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG ulLong) +{ + signed char ret = 0; + DWORD dw; + + if (!(dw = (DWORD)ulLong)) + { + ret = 32; + if (!(dw = ulLong >> 32)) return -1; + } + if (!(dw & 0xffff)) + { + dw >>= 16; + ret += 16; + } + if (!(dw & 0xff)) + { + dw >>= 8; + ret += 8; + } + if (!(dw & 0x0f)) + { + dw >>= 4; + ret += 4; + } + return ret + NTDLL_leastSignificant[dw & 0x0f]; +} + +/* EOF */
18 years, 3 months
1
0
0
0
[greatlrd] 24264: update winetest gdi32 with more wine test
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 02:27:00 2006 New Revision: 24264 URL:
http://svn.reactos.org/svn/reactos?rev=24264&view=rev
Log: update winetest gdi32 with more wine test Added: trunk/reactos/regtests/winetests/gdi32/mapping.c (with props) trunk/reactos/regtests/winetests/gdi32/palette.c (with props) Modified: trunk/reactos/regtests/winetests/gdi32/gdi32.rbuild trunk/reactos/regtests/winetests/gdi32/testlist.c Modified: trunk/reactos/regtests/winetests/gdi32/gdi32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/gdi32/g…
============================================================================== --- trunk/reactos/regtests/winetests/gdi32/gdi32.rbuild (original) +++ trunk/reactos/regtests/winetests/gdi32/gdi32.rbuild Mon Sep 25 02:27:00 2006 @@ -12,6 +12,8 @@ <file>dc.c</file> <file>gdiobj.c</file> <file>font.c</file> + <file>mapping.c</file> <file>metafile.c</file> + <file>palette.c</file> <file>testlist.c</file> </module> Added: trunk/reactos/regtests/winetests/gdi32/mapping.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/gdi32/m…
============================================================================== --- trunk/reactos/regtests/winetests/gdi32/mapping.c (added) +++ trunk/reactos/regtests/winetests/gdi32/mapping.c Mon Sep 25 02:27:00 2006 @@ -1,0 +1,160 @@ +/* + * Unit tests for mapping functions + * + * Copyright (c) 2005 Huw Davies + * + * 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 <assert.h> +#include <stdio.h> +#include <math.h> + +#include "wine/test.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "winerror.h" + + +void test_modify_world_transform(void) +{ + HDC hdc = GetDC(0); + int ret; + + ret = SetGraphicsMode(hdc, GM_ADVANCED); + if(!ret) /* running in win9x so quit */ + { + ReleaseDC(0, hdc); + return; + } + + ret = ModifyWorldTransform(hdc, NULL, MWT_IDENTITY); + ok(ret, "ret = %d\n", ret); + + ret = ModifyWorldTransform(hdc, NULL, MWT_LEFTMULTIPLY); + ok(!ret, "ret = %d\n", ret); + + ret = ModifyWorldTransform(hdc, NULL, MWT_RIGHTMULTIPLY); + ok(!ret, "ret = %d\n", ret); + + ReleaseDC(0, hdc); +} + +void test_SetWindowExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LONG expected_vp_cy) +{ + SIZE windowExt, viewportExt; + POINT windowOrg, windowOrgAfter, viewportOrg, viewportOrgAfter; + + GetWindowOrgEx(hdc, &windowOrg); + GetViewportOrgEx(hdc, &viewportOrg); + + SetWindowExtEx(hdc, cx, cy, NULL); + GetWindowExtEx(hdc, &windowExt); + ok(windowExt.cx == cx && windowExt.cy == cy, + "Window extension: Expected %ldx%ld, got %ldx%ld\n", + cx, cy, windowExt.cx, windowExt.cy); + + GetViewportExtEx(hdc, &viewportExt); + ok(viewportExt.cx == expected_vp_cx && viewportExt.cy == expected_vp_cy, + "Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n", + expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy); + + GetWindowOrgEx(hdc, &windowOrgAfter); + ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y, + "Window origin changed from (%ld,%ld) to (%ld,%ld)\n", + windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y); + + GetViewportOrgEx(hdc, &viewportOrgAfter); + ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y, + "Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n", + viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y); +} + +void test_SetViewportExt(HDC hdc, LONG cx, LONG cy, LONG expected_vp_cx, LONG expected_vp_cy) +{ + SIZE windowExt, windowExtAfter, viewportExt; + POINT windowOrg, windowOrgAfter, viewportOrg, viewportOrgAfter; + + GetWindowOrgEx(hdc, &windowOrg); + GetViewportOrgEx(hdc, &viewportOrg); + GetWindowExtEx(hdc, &windowExt); + + SetViewportExtEx(hdc, cx, cy, NULL); + GetViewportExtEx(hdc, &viewportExt); + ok(viewportExt.cx == expected_vp_cx && viewportExt.cy == expected_vp_cy, + "Viewport extents have not been properly adjusted: Expected %ldx%ld, got %ldx%ld\n", + expected_vp_cx, expected_vp_cy, viewportExt.cx, viewportExt.cy); + + GetWindowExtEx(hdc, &windowExtAfter); + ok(windowExt.cx == windowExtAfter.cx && windowExt.cy == windowExtAfter.cy, + "Window extension changed from %ldx%ld to %ldx%ld\n", + windowExt.cx, windowExt.cy, windowExtAfter.cx, windowExtAfter.cy); + + GetWindowOrgEx(hdc, &windowOrgAfter); + ok(windowOrg.x == windowOrgAfter.x && windowOrg.y == windowOrgAfter.y, + "Window origin changed from (%ld,%ld) to (%ld,%ld)\n", + windowOrg.x, windowOrg.y, windowOrgAfter.x, windowOrgAfter.y); + + GetViewportOrgEx(hdc, &viewportOrgAfter); + ok(viewportOrg.x == viewportOrgAfter.x && viewportOrg.y == viewportOrgAfter.y, + "Viewport origin changed from (%ld,%ld) to (%ld,%ld)\n", + viewportOrg.x, viewportOrg.y, viewportOrgAfter.x, viewportOrgAfter.y); +} + +void test_isotropic_mapping(void) +{ + SIZE win, vp; + HDC hdc = GetDC(0); + + SetMapMode(hdc, MM_ISOTROPIC); + + /* MM_ISOTROPIC is set up like MM_LOMETRIC. + Initial values after SetMapMode(): + (1 inch = 25.4 mm) + + Windows 9x: Windows NT: + Window Ext: 254 x -254 HORZSIZE*10 x VERTSIZE*10 + Viewport Ext: LOGPIXELSX x LOGPIXELSY HORZRES x -VERTRES + + To test without rounding errors, we have to use multiples of + these values! + */ + + GetWindowExtEx(hdc, &win); + GetViewportExtEx(hdc, &vp); + + test_SetViewportExt(hdc, 10 * vp.cx, 10 * vp.cy, 10 * vp.cx, 10 * vp.cy); + test_SetWindowExt(hdc, win.cx, win.cy, 10 * vp.cx, 10 * vp.cy); + test_SetWindowExt(hdc, 2 * win.cx, win.cy, 10 * vp.cx, 5 * vp.cy); + test_SetWindowExt(hdc, win.cx, win.cy, 5 * vp.cx, 5 * vp.cy); + test_SetViewportExt(hdc, 4 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); + test_SetViewportExt(hdc, vp.cx, 2 * vp.cy, vp.cx, vp.cy); + test_SetViewportExt(hdc, 2 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); + test_SetViewportExt(hdc, 4 * vp.cx, 2 * vp.cy, 2 * vp.cx, 2 * vp.cy); + test_SetWindowExt(hdc, 4 * win.cx, 2 * win.cy, 2 * vp.cx, vp.cy); + test_SetViewportExt(hdc, -2 * vp.cx, -4 * vp.cy, -2 * vp.cx, -vp.cy); + test_SetViewportExt(hdc, -2 * vp.cx, -1 * vp.cy, -2 * vp.cx, -vp.cy); + test_SetWindowExt(hdc, -4 * win.cx, -2 * win.cy, -2 * vp.cx, -vp.cy); + test_SetWindowExt(hdc, 4 * win.cx, -4 * win.cy, -vp.cx, -vp.cy); + + ReleaseDC(0, hdc); +} + +START_TEST(mapping) +{ + test_modify_world_transform(); + test_isotropic_mapping(); +} Propchange: trunk/reactos/regtests/winetests/gdi32/mapping.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/regtests/winetests/gdi32/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/gdi32/p…
============================================================================== --- trunk/reactos/regtests/winetests/gdi32/palette.c (added) +++ trunk/reactos/regtests/winetests/gdi32/palette.c Mon Sep 25 02:27:00 2006 @@ -1,0 +1,126 @@ +/* + * Unit test suite for palettes + * + * Copyright 2005 Glenn Wurster + * + * 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 <stdarg.h> +#include <assert.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "mmsystem.h" + +#include "wine/test.h" + +static const PALETTEENTRY logpalettedata[8] = { + { 0x10, 0x20, 0x30, PC_NOCOLLAPSE }, + { 0x20, 0x30, 0x40, PC_NOCOLLAPSE }, + { 0x30, 0x40, 0x50, PC_NOCOLLAPSE }, + { 0x40, 0x50, 0x60, PC_NOCOLLAPSE }, + { 0x50, 0x60, 0x70, PC_NOCOLLAPSE }, + { 0x60, 0x70, 0x80, PC_NOCOLLAPSE }, + { 0x70, 0x80, 0x90, PC_NOCOLLAPSE }, + { 0x80, 0x90, 0xA0, PC_NOCOLLAPSE }, +}; + +static void test_DIB_PAL_COLORS(void) { + HDC hdc = GetDC( NULL ); + HDC memhdc = CreateCompatibleDC( hdc ); + HBITMAP hbmp, hbmpOld; + char bmpbuf[sizeof(BITMAPINFO) + 10 * sizeof(WORD)]; + PBITMAPINFO bmp = (PBITMAPINFO)bmpbuf; + WORD * bmpPalPtr; + char logpalettebuf[sizeof(LOGPALETTE) + sizeof(logpalettedata)]; + PLOGPALETTE logpalette = (PLOGPALETTE)logpalettebuf; + HPALETTE hpal, hpalOld; + COLORREF setColor, chkColor, getColor; + int i; + + /* Initalize the logical palette with a few colours */ + logpalette->palVersion = 0x300; + logpalette->palNumEntries = 8; + memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) ); + hpal = CreatePalette( logpalette ); + hpalOld = SelectPalette( memhdc, hpal, FALSE ); + ok( hpalOld != NULL, "error=%ld\n", GetLastError() ); + + /* Create a DIB BMP which references colours in the logical palette */ + memset( bmp, 0x00, sizeof(BITMAPINFO) ); + bmp->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmp->bmiHeader.biWidth = 1; + bmp->bmiHeader.biHeight = 1; + bmp->bmiHeader.biPlanes = 1; + bmp->bmiHeader.biBitCount = 8; + bmp->bmiHeader.biCompression = BI_RGB; + bmp->bmiHeader.biClrUsed = 10; + bmp->bmiHeader.biClrImportant = 0; + bmpPalPtr = (WORD *)&bmp->bmiColors; + for( i = 0; i < 8; i++ ) { + *bmpPalPtr++ = i; + } + *bmpPalPtr++ = 8; /* Pointer to logical palette index just outside range */ + *bmpPalPtr++ = 19; /* Pointer to bad logical palette index */ + + hbmp = CreateDIBSection( memhdc, bmp, DIB_PAL_COLORS, 0, 0, 0 ); + ok( hbmp != NULL, "error=%ld\n", GetLastError() ); + hbmpOld = SelectObject( memhdc, hbmp ); + ok( hbmpOld != NULL, "error=%ld\n", GetLastError() ); + + /* Test with a RGB to DIB_PAL_COLORS */ + setColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[1].peRed, logpalettedata[1].peGreen, logpalettedata[1].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test with a valid DIBINDEX to DIB_PAL_COLORS */ + setColor = DIBINDEX( 2 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[2].peRed, logpalettedata[2].peGreen, logpalettedata[2].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test with a invalid DIBINDEX to DIB_PAL_COLORS */ + setColor = DIBINDEX( 12 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( 0, 0, 0 ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + /* Test for double wraparound on logical palette references from */ + /* DIBINDEX by DIB_PAL_COLORS. */ + setColor = DIBINDEX( 9 ); + SetPixel( memhdc, 0, 0, setColor ); + chkColor = RGB( logpalettedata[3].peRed, logpalettedata[3].peGreen, logpalettedata[3].peBlue ); + getColor = GetPixel( memhdc, 0, 0 ); + ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); + + SelectPalette( memhdc, hpalOld, FALSE ); + DeleteObject( hpal ); + SelectObject( memhdc, hbmpOld ); + DeleteObject( hbmp ); + DeleteDC( memhdc ); + ReleaseDC( NULL, hdc ); +} + +START_TEST(palette) +{ + test_DIB_PAL_COLORS(); +} Propchange: trunk/reactos/regtests/winetests/gdi32/palette.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/regtests/winetests/gdi32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/gdi32/t…
============================================================================== --- trunk/reactos/regtests/winetests/gdi32/testlist.c (original) +++ trunk/reactos/regtests/winetests/gdi32/testlist.c Mon Sep 25 02:27:00 2006 @@ -27,9 +27,9 @@ { "font", func_font }, { "gdiobj", func_gdiobj }, // { "generated", func_generated }, -// { "mapping", func_mapping }, + { "mapping", func_mapping }, { "metafile", func_metafile }, -// { "palette", func_palette }, + { "palette", func_palette }, // { "pen", func_pen }, { 0, 0 } };
18 years, 3 months
1
0
0
0
[greatlrd] 24263: fixed another build break by me :(
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 01:17:31 2006 New Revision: 24263 URL:
http://svn.reactos.org/svn/reactos?rev=24263&view=rev
Log: fixed another build break by me :( Modified: trunk/reactos/include/psdk/wingdi.h Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wingdi.h (original) +++ trunk/reactos/include/psdk/wingdi.h Mon Sep 25 01:17:31 2006 @@ -2149,6 +2149,7 @@ BYTE tmPitchAndFamily; BYTE tmCharSet; } TEXTMETRICW,*PTEXTMETRICW,*LPTEXTMETRICW; + typedef struct _RGNDATAHEADER { DWORD dwSize; DWORD iType; @@ -2558,15 +2559,7 @@ WCHAR DeviceKey[128]; } DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW; -#if (_WIN32_WINNT >= 0x0500) -typedef struct _RGNDATAHEADER { - DWORD dwSize; - DWORD iType; - DWORD nCount; - DWORD nRgnSize; - RECT rcBound; -} RGNDATAHEADER, *PRGNDATAHEADER; -#endif + typedef BOOL (CALLBACK *ABORTPROC)(HDC,int); typedef int (CALLBACK *MFENUMPROC)(HDC,HANDLETABLE*,METARECORD*,int,LPARAM);
18 years, 3 months
1
0
0
0
[greatlrd] 24262: sorry I broken the build it fixed now
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 01:10:36 2006 New Revision: 24262 URL:
http://svn.reactos.org/svn/reactos?rev=24262&view=rev
Log: sorry I broken the build it fixed now Modified: trunk/reactos/include/psdk/wingdi.h Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wingdi.h (original) +++ trunk/reactos/include/psdk/wingdi.h Mon Sep 25 01:10:36 2006 @@ -1188,14 +1188,7 @@ #define CS_DELETE_TRANSFORM 0x00000003 #endif -#if(WINVER >= 0x0400) -typedef struct tagEMRGLSRECORD -{ - EMR emr; - DWORD cbData; - BYTE Data[1]; -} EMRGLSRECORD, *PEMRGLSRECORD; -#endif + #if (WINVER > 0x500) #define GRADIENT_FILL_RECT_H 0x00 @@ -1496,6 +1489,15 @@ DWORD iType; DWORD nSize; } EMR,*PEMR; + +#if(WINVER >= 0x0400) +typedef struct tagEMRGLSRECORD +{ + EMR emr; + DWORD cbData; + BYTE Data[1]; +} EMRGLSRECORD, *PEMRGLSRECORD; +#endif typedef struct tagEMRANGLEARC { EMR emr; POINTL ptlCenter; @@ -1771,11 +1773,7 @@ DWORD offData; } EMRFORMAT; -typedef struct tagEMRPIXELFORMAT -{ - EMR emr; - PIXELFORMATDESCRIPTOR pfd; -} EMRPIXELFORMAT, *PEMRPIXELFORMAT; + typedef struct tagEMRSETCOLORSPACE { EMR emr; @@ -1935,10 +1933,8 @@ LONG yNum; LONG yDenom; } EMRSCALEVIEWPORTEXTEX,*PEMRSCALEVIEWPORTEXTEX,EMRSCALEWINDOWEXTEX,*PEMRSCALEWINDOWEXTEX; -typedef struct tagEMRSELECTCOLORSPACE { - EMR emr; - DWORD ihCS; -} EMRSELECTCOLORSPACE,*PEMRSELECTCOLORSPACE,EMRDELETECOLORSPACE,*PEMRDELETECOLORSPACE; + + typedef struct tagEMRSELECTOBJECT { EMR emr; DWORD ihObject; @@ -2344,6 +2340,13 @@ DWORD dwVisibleMask; DWORD dwDamageMask; } PIXELFORMATDESCRIPTOR,*PPIXELFORMATDESCRIPTOR,*LPPIXELFORMATDESCRIPTOR; + +typedef struct tagEMRPIXELFORMAT +{ + EMR emr; + PIXELFORMATDESCRIPTOR pfd; +} EMRPIXELFORMAT, *PEMRPIXELFORMAT; + typedef struct tagMETAFILEPICT { LONG mm; LONG xExt;
18 years, 3 months
1
0
0
0
[greatlrd] 24261: adding more missing struct need them later in winetest
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 00:53:47 2006 New Revision: 24261 URL:
http://svn.reactos.org/svn/reactos?rev=24261&view=rev
Log: adding more missing struct need them later in winetest Modified: trunk/reactos/include/psdk/wingdi.h Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wingdi.h (original) +++ trunk/reactos/include/psdk/wingdi.h Mon Sep 25 00:53:47 2006 @@ -1187,6 +1187,16 @@ #define CS_DISABLE 0x00000002 #define CS_DELETE_TRANSFORM 0x00000003 #endif + +#if(WINVER >= 0x0400) +typedef struct tagEMRGLSRECORD +{ + EMR emr; + DWORD cbData; + BYTE Data[1]; +} EMRGLSRECORD, *PEMRGLSRECORD; +#endif + #if (WINVER > 0x500) #define GRADIENT_FILL_RECT_H 0x00 #define GRADIENT_FILL_RECT_V 0x01 @@ -1760,6 +1770,19 @@ DWORD cbData; DWORD offData; } EMRFORMAT; + +typedef struct tagEMRPIXELFORMAT +{ + EMR emr; + PIXELFORMATDESCRIPTOR pfd; +} EMRPIXELFORMAT, *PEMRPIXELFORMAT; +typedef struct tagEMRSETCOLORSPACE +{ + EMR emr; + DWORD ihCS; +} EMRSETCOLORSPACE, *PEMRSETCOLORSPACE, EMRSELECTCOLORSPACE, *PEMRSELECTCOLORSPACE, + EMRDELETECOLORSPACE, *PEMRDELETECOLORSPACE; + typedef struct tagEMRFRAMERGN { EMR emr; RECTL rclBounds;
18 years, 3 months
1
0
0
0
[greatlrd] 24260: adding more missing struct
by greatlrd@svn.reactos.org
Author: greatlrd Date: Mon Sep 25 00:28:57 2006 New Revision: 24260 URL:
http://svn.reactos.org/svn/reactos?rev=24260&view=rev
Log: adding more missing struct Modified: trunk/reactos/include/psdk/wingdi.h Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wingdi.h (original) +++ trunk/reactos/include/psdk/wingdi.h Mon Sep 25 00:28:57 2006 @@ -1339,7 +1339,7 @@ typedef struct tagFONTSIGNATURE { DWORD fsUsb[4]; DWORD fsCsb[2]; -} FONTSIGNATURE,*LPFONTSIGNATURE; +} FONTSIGNATURE, *PFONTSIGNATURE,*LPFONTSIGNATURE; typedef struct { UINT ciCharset; UINT ciACP; @@ -2029,7 +2029,14 @@ typedef struct tagEMRSELECTCLIPPATH { EMR emr; DWORD iMode; -} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH,EMRSETBKMODE,*PEMRSETBKMODE,EMRSETMAPMODE,*PEMRSETMAPMODE,EMRSETPOLYFILLMODE,*PEMRSETPOLYFILLMODE,EMRSETROP2,*PEMRSETROP2,EMRSETSTRETCHBLTMODE,*PEMRSETSTRETCHBLTMODE,EMRSETTEXTALIGN,*PEMRSETTEXTALIGN,EMRENABLEICM,*PEMRENABLEICM; +} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH, EMRSETBKMODE,*PEMRSETBKMODE, EMRSETMAPMODE, *PEMRSETMAPMODE, + EMRSETPOLYFILLMODE, *PEMRSETPOLYFILLMODE, EMRSETROP2, *PEMRSETROP2, EMRSETSTRETCHBLTMODE, *PEMRSETSTRETCHBLTMODE, + EMRSETICMMODE, *PEMRSETICMMODE, EMRSETTEXTALIGN, +#if(WINVER >= 0x0500) + EMRSETLAYOUT, *PEMRSETLAYOUT, +#endif + *PEMRSETTEXTALIGN; + #include "pshpack2.h" typedef struct tagMETAHEADER { WORD mtType; @@ -2065,7 +2072,7 @@ #if (WINVER >= 0x0500) SIZEL szlMicrometers; #endif -} ENHMETAHEADER,*LPENHMETAHEADER; +} ENHMETAHEADER,*PENHMETAHEADER,*LPENHMETAHEADER; typedef struct tagMETARECORD { DWORD rdSize; WORD rdFunction; @@ -2078,7 +2085,7 @@ } ENHMETARECORD,*LPENHMETARECORD; typedef struct tagHANDLETABLE { HGDIOBJ objectHandle[1]; -} HANDLETABLE,*LPHANDLETABLE; +} HANDLETABLE,*PHANDLETABLE, *LPHANDLETABLE; typedef struct tagTEXTMETRICA { LONG tmHeight; LONG tmAscent; @@ -2524,6 +2531,16 @@ WCHAR DeviceID[128]; WCHAR DeviceKey[128]; } DISPLAY_DEVICEW, *PDISPLAY_DEVICEW, *LPDISPLAY_DEVICEW; + +#if (_WIN32_WINNT >= 0x0500) +typedef struct _RGNDATAHEADER { + DWORD dwSize; + DWORD iType; + DWORD nCount; + DWORD nRgnSize; + RECT rcBound; +} RGNDATAHEADER, *PRGNDATAHEADER; +#endif typedef BOOL (CALLBACK *ABORTPROC)(HDC,int); typedef int (CALLBACK *MFENUMPROC)(HDC,HANDLETABLE*,METARECORD*,int,LPARAM);
18 years, 3 months
1
0
0
0
[arty] 24259: Fix use of unicode for unix host regardless of -fshort-wchar.
by arty@svn.reactos.org
Author: arty Date: Mon Sep 25 00:14:44 2006 New Revision: 24259 URL:
http://svn.reactos.org/svn/reactos?rev=24259&view=rev
Log: Fix use of unicode for unix host regardless of -fshort-wchar. Modified: trunk/reactos/tools/buildno/buildno.cpp Modified: trunk/reactos/tools/buildno/buildno.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/buildno/buildno.cpp?…
============================================================================== --- trunk/reactos/tools/buildno/buildno.cpp (original) +++ trunk/reactos/tools/buildno/buildno.cpp Mon Sep 25 00:14:44 2006 @@ -38,6 +38,7 @@ static char * argv0 = ""; static char * filename = ""; +static char * kernel_version_build_type = 0; #ifdef DBG void @@ -54,6 +55,15 @@ printf ("%s->tm_isdst = %d\n\n", tag, t->tm_isdst); } #endif + +int count_wide_string( wchar_t *str ) +{ + int i; + + for( i = 0; str[i]; i++ ); + + return i; +} void write_h (int build, char *buildstr) @@ -80,7 +90,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); s = s + sprintf (s, "#define KERNEL_RELEASE_STR\t\"%d.%d", KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR); @@ -88,7 +98,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\"\n", kernel_version_build_type); s = s + sprintf (s, "#define KERNEL_VERSION_RC\t\"%d.%d", KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR); @@ -96,7 +106,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d", KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR); @@ -104,7 +114,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\"\n", kernel_version_build_type); s = s + sprintf (s, "#define REACTOS_DLL_VERSION_MAJOR\t%d\n", dllversion); s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_RC\t\"%d.%d", dllversion, KERNEL_VERSION_MINOR); @@ -112,7 +122,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_STR\t\"%d.%d", dllversion, KERNEL_VERSION_MINOR); @@ -120,7 +130,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\"\n", kernel_version_build_type); s = s + sprintf (s, "#define REACTOS_DLL_VERSION_RC\t\"%d.%d", dllversion, KERNEL_VERSION_MINOR); @@ -128,7 +138,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\\0\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\\0\"\n", kernel_version_build_type); s = s + sprintf (s, "#define REACTOS_DLL_VERSION_STR\t\"%d.%d", dllversion, KERNEL_VERSION_MINOR); @@ -136,7 +146,7 @@ { s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); } - s = s + sprintf (s, "-%S\"\n", KERNEL_VERSION_BUILD_TYPE); + s = s + sprintf (s, "-%s\"\n", kernel_version_build_type); s = s + sprintf (s, "#endif\n/* EOF */\n"); h = fopen (filename, "wb"); @@ -284,6 +294,7 @@ int main (int argc, char * argv []) { + int i, length; int print_only = FALSE; int quiet = FALSE; @@ -341,6 +352,14 @@ printf ( "\nReactOS Build Number Generator\n\n"); } + /* Convert kernel_version_build_type to a host-friendly string */ + length = count_wide_string(KERNEL_VERSION_BUILD_TYPE); + kernel_version_build_type = (char *)malloc(length+1); + for( i = 0; KERNEL_VERSION_BUILD_TYPE[i]; i++ ) { + kernel_version_build_type[i] = KERNEL_VERSION_BUILD_TYPE[i]; + } + kernel_version_build_type[i] = 0; + time (& t1); /* current build time */ t1_tm = gmtime (& t1); @@ -378,7 +397,7 @@ { printf(".%d", KERNEL_VERSION_PATCH_LEVEL); } - printf("-%S (Build %s)\n\n", KERNEL_VERSION_BUILD_TYPE, buildstr); + printf("-%s (Build %s)\n\n", kernel_version_build_type, buildstr); } /* * (Over)write the include file, unless
18 years, 3 months
1
0
0
0
[hyperion] 24258: Cosmetic changes
by hyperion@svn.reactos.org
Author: hyperion Date: Sun Sep 24 22:07:21 2006 New Revision: 24258 URL:
http://svn.reactos.org/svn/reactos?rev=24258&view=rev
Log: Cosmetic changes Modified: trunk/reactos/include/psdk/intrin.h Modified: trunk/reactos/include/psdk/intrin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/intrin.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/intrin.h (original) +++ trunk/reactos/include/psdk/intrin.h Sun Sep 24 22:07:21 2006 @@ -47,7 +47,7 @@ first, but they're only "as wrong" as they would be on Visual C++. Our priority is compatibility - NOTE: unlike most people who write __inline__ asm for GCC, I didn't pull the + NOTE: unlike most people who write inline asm for GCC, I didn't pull the constraints and the uses of __volatile__ out of my... hat. Do not touch them. I hate cargo cult programming @@ -274,155 +274,155 @@ static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask) { - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x & mask, x); - } + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x & mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask) { - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x & mask, x); - } + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x & mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask) { - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x & mask, x); - } + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x & mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask) { - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x | mask, x); - } + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x | mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask) { - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x | mask, x); - } + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x | mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask) { - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x | mask, x); - } + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x | mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask) { - char x; - char y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange8(value, x ^ mask, x); - } + char x; + char y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange8(value, x ^ mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask) { - short x; - short y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange16(value, x ^ mask, x); - } + short x; + short y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange16(value, x ^ mask, x); + } while(y != x); - return y; + return y; } static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask) { - long x; - long y; - - y = *value; - - do - { - x = y; - y = _InterlockedCompareExchange(value, x ^ mask, x); - } + long x; + long y; + + y = *value; + + do + { + x = y; + y = _InterlockedCompareExchange(value, x ^ mask, x); + } while(y != x); - return y; + return y; } #endif
18 years, 3 months
1
0
0
0
[tretiakov] 24257: memcpy -> RtlCopyMemory assert -> ASSERT
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Sep 24 21:10:58 2006 New Revision: 24257 URL:
http://svn.reactos.org/svn/reactos?rev=24257&view=rev
Log: memcpy -> RtlCopyMemory assert -> ASSERT Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/path.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/path.c Sun Sep 24 21:10:58 2006 @@ -467,7 +467,7 @@ FASTCALL PATH_InitGdiPath ( GdiPath *pPath ) { - assert(pPath!=NULL); + ASSERT(pPath!=NULL); pPath->state=PATH_Null; pPath->pPoints=NULL; @@ -484,7 +484,7 @@ FASTCALL PATH_DestroyGdiPath ( GdiPath *pPath ) { - assert(pPath!=NULL); + ASSERT(pPath!=NULL); ExFreePool(pPath->pPoints); ExFreePool(pPath->pFlags); @@ -504,16 +504,16 @@ FASTCALL PATH_AssignGdiPath ( GdiPath *pPathDest, const GdiPath *pPathSrc ) { - assert(pPathDest!=NULL && pPathSrc!=NULL); + ASSERT(pPathDest!=NULL && pPathSrc!=NULL); /* Make sure destination arrays are big enough */ if ( !PATH_ReserveEntries(pPathDest, pPathSrc->numEntriesUsed) ) return FALSE; /* Perform the copy operation */ - memcpy(pPathDest->pPoints, pPathSrc->pPoints, + RtlCopyMemory(pPathDest->pPoints, pPathSrc->pPoints, sizeof(POINT)*pPathSrc->numEntriesUsed); - memcpy(pPathDest->pFlags, pPathSrc->pFlags, + RtlCopyMemory(pPathDest->pFlags, pPathSrc->pFlags, sizeof(BYTE)*pPathSrc->numEntriesUsed); pPathDest->state=pPathSrc->state; @@ -748,7 +748,7 @@ if ( angleEnd <= angleStart ) { angleEnd+=2*M_PI; - assert(angleEnd>=angleStart); + ASSERT(angleEnd>=angleStart); } } else @@ -756,7 +756,7 @@ if(angleEnd>=angleStart) { angleEnd-=2*M_PI; - assert(angleEnd<=angleStart); + ASSERT(angleEnd<=angleStart); } } @@ -1087,8 +1087,8 @@ INT *pNumPointsInStroke; HRGN hrgn = 0; - assert ( pPath!=NULL ); - assert ( pHrgn!=NULL ); + ASSERT(pPath!=NULL); + ASSERT(pHrgn!=NULL); PATH_FlattenPath ( pPath ); @@ -1148,7 +1148,7 @@ FASTCALL PATH_EmptyPath ( GdiPath *pPath ) { - assert(pPath!=NULL); + ASSERT(pPath!=NULL); pPath->state=PATH_Null; pPath->numEntriesUsed=0; @@ -1164,7 +1164,7 @@ FASTCALL PATH_AddEntry ( GdiPath *pPath, const POINT *pPoint, BYTE flags ) { - assert(pPath!=NULL); + ASSERT(pPath!=NULL); /* FIXME: If newStroke is true, perhaps we want to check that we're * getting a PT_MOVETO @@ -1206,8 +1206,8 @@ POINT *pPointsNew; BYTE *pFlagsNew; - assert(pPath!=NULL); - assert(numEntries>=0); + ASSERT(pPath!=NULL); + ASSERT(numEntries>=0); /* Do we have to allocate more memory? */ if(numEntries > pPath->numEntriesAllocated) @@ -1237,10 +1237,10 @@ /* Copy old arrays to new arrays and discard old arrays */ if(pPath->pPoints) { - assert(pPath->pFlags); - - memcpy(pPointsNew, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed); - memcpy(pFlagsNew, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed); + ASSERT(pPath->pFlags); + + RtlCopyMemory(pPointsNew, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed); + RtlCopyMemory(pFlagsNew, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed); ExFreePool(pPath->pPoints); ExFreePool(pPath->pFlags); @@ -1272,7 +1272,7 @@ POINT point; int i; - assert(fabs(angleEnd-angleStart)<=M_PI_2); + ASSERT(fabs(angleEnd-angleStart)<=M_PI_2); /* FIXME: Is there an easier way of computing this? */
18 years, 3 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
15
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Results per page:
10
25
50
100
200