ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2008
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
31 participants
710 discussions
Start a n
N
ew thread
[tkreuzer] 38204: TextOut functions take a character count, not a byte count. Rename cb to cch.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Dec 20 15:19:43 2008 New Revision: 38204 URL:
http://svn.reactos.org/svn/reactos?rev=38204&view=rev
Log: TextOut functions take a character count, not a byte count. Rename cb to cch. Modified: trunk/reactos/dll/win32/gdi32/objects/text.c Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] Sat Dec 20 15:19:43 2008 @@ -12,7 +12,7 @@ int nXStart, int nYStart, LPCSTR lpString, - int cbString) + int cchString) { ANSI_STRING StringA; UNICODE_STRING StringU; @@ -25,7 +25,7 @@ } else StringU.Buffer = NULL; - ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cbString); + ret = TextOutW(hdc, nXStart, nYStart, StringU.Buffer, cchString); RtlFreeUnicodeString(&StringU); return ret; } @@ -41,9 +41,9 @@ int nXStart, int nYStart, LPCWSTR lpString, - int cbString) -{ - return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cbString, NULL, 0); + int cchString) +{ + return NtGdiExtTextOutW(hdc, nXStart, nYStart, 0, NULL, (LPWSTR)lpString, cchString, NULL, 0); } @@ -143,7 +143,7 @@ GetTextExtentPointA( HDC hdc, LPCSTR lpString, - int cbString, + int cchString, LPSIZE lpSize ) { @@ -154,7 +154,7 @@ RtlInitAnsiString(&StringA, (LPSTR)lpString); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); - ret = GetTextExtentPointW(hdc, StringU.Buffer, cbString, lpSize); + ret = GetTextExtentPointW(hdc, StringU.Buffer, cchString, lpSize); RtlFreeUnicodeString(&StringU); @@ -170,11 +170,11 @@ GetTextExtentPointW( HDC hdc, LPCWSTR lpString, - int cbString, + int cchString, LPSIZE lpSize ) { - return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cbString, lpSize, 0); + return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0); } @@ -184,13 +184,13 @@ BOOL APIENTRY GetTextExtentExPointW( - HDC hdc, - LPCWSTR lpszStr, - int cchString, - int nMaxExtent, - LPINT lpnFit, - LPINT alpDx, - LPSIZE lpSize + HDC hdc, + LPCWSTR lpszStr, + int cchString, + int nMaxExtent, + LPINT lpnFit, + LPINT alpDx, + LPSIZE lpSize ) { return NtGdiGetTextExtentExW ( @@ -240,7 +240,7 @@ GetTextExtentPoint32A( HDC hdc, LPCSTR lpString, - int cbString, + int cchString, LPSIZE lpSize ) { @@ -251,7 +251,7 @@ RtlInitAnsiString(&StringA, (LPSTR)lpString); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); - ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cbString, lpSize); + ret = GetTextExtentPoint32W(hdc, StringU.Buffer, cchString, lpSize); RtlFreeUnicodeString(&StringU); @@ -267,11 +267,11 @@ GetTextExtentPoint32W( HDC hdc, LPCWSTR lpString, - int cbString, + int cchString, LPSIZE lpSize ) { - return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cbString, lpSize, 0); + return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cchString, lpSize, 0); } /* @@ -315,7 +315,7 @@ UINT fuOptions, CONST RECT *lprc, LPCSTR lpString, - UINT cbCount, + UINT cchString, CONST INT *lpDx ) { @@ -326,7 +326,7 @@ RtlInitAnsiString(&StringA, (LPSTR)lpString); RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE); - ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cbCount, lpDx); + ret = ExtTextOutW(hdc, X, Y, fuOptions, lprc, StringU.Buffer, cchString, lpDx); RtlFreeUnicodeString(&StringU); @@ -346,11 +346,11 @@ UINT fuOptions, CONST RECT *lprc, LPCWSTR lpString, - UINT cbCount, + UINT cchString, CONST INT *lpDx ) { - return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cbCount, (LPINT)lpDx, 0); + return NtGdiExtTextOutW(hdc, X, Y, fuOptions, (LPRECT)lprc, (LPWSTR)lpString, cchString, (LPINT)lpDx, 0); }
16 years
1
0
0
0
[tkreuzer] 38203: Handle ETO_PDY more correctly (dy values still ignored)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Dec 20 15:01:14 2008 New Revision: 38203 URL:
http://svn.reactos.org/svn/reactos?rev=38203&view=rev
Log: Handle ETO_PDY more correctly (dy values still ignored) Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Sat Dec 20 15:01:14 2008 @@ -3669,7 +3669,14 @@ } else { - TextLeft += Dx[i] << 6; + if (fuOptions & ETO_PDY) + { + TextLeft += Dx[i*2] << 6; + } + else + { + TextLeft += Dx[i] << 6; + } // DbgPrint("new TextLeft2: %d\n", TextLeft); } previous = glyph_index;
16 years
1
0
0
0
[khornicek] 38202: - add check for NULL pointer, "first" is NULL for folders, files without extension etc. see bug 3959 See issue #3959 for more details.
by khornicek@svn.reactos.org
Author: khornicek Date: Sat Dec 20 14:48:08 2008 New Revision: 38202 URL:
http://svn.reactos.org/svn/reactos?rev=38202&view=rev
Log: - add check for NULL pointer, "first" is NULL for folders, files without extension etc. see bug 3959 See issue #3959 for more details. Modified: trunk/reactos/dll/cpl/appwiz/createlink.c Modified: trunk/reactos/dll/cpl/appwiz/createlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/appwiz/createlink.…
============================================================================== --- trunk/reactos/dll/cpl/appwiz/createlink.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/appwiz/createlink.c [iso-8859-1] Sat Dec 20 14:48:08 2008 @@ -155,7 +155,9 @@ first[1] = L'\0'; first = wcsrchr(pContext->szDescription, L'.'); - first[0] = L'\0'; + + if(first) + first[0] = L'\0'; } }
16 years
1
0
0
0
[tkreuzer] 38201: When fuOptions has ETO_PDY specified, the DxBuffer in NtGdiExtTextOutW consists of pairs of INTs, thus the Buffer must be twice as big. (Thanks to aspotashev for locating the problem) MmCopyToCaller -> SEH2. Allocate only one buffer for the string and the Dx values. See issue #3958 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Dec 20 14:38:23 2008 New Revision: 38201 URL:
http://svn.reactos.org/svn/reactos?rev=38201&view=rev
Log: When fuOptions has ETO_PDY specified, the DxBuffer in NtGdiExtTextOutW consists of pairs of INTs, thus the Buffer must be twice as big. (Thanks to aspotashev for locating the problem) MmCopyToCaller -> SEH2. Allocate only one buffer for the string and the Dx values. See issue #3958 for more details. Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Sat Dec 20 14:38:23 2008 @@ -3135,6 +3135,8 @@ BOOL DoBreak = FALSE; LPCWSTR String, SafeString = NULL; HPALETTE hDestPalette; + PVOID TmpBuffer = NULL; + ULONG TmpBufSize, StringSize, DxSize = 0; // TODO: Write test-cases to exactly match real Windows in different // bad parameters (e.g. does Windows check the DC or the RECT first?). @@ -3160,41 +3162,70 @@ SetLastWin32Error(ERROR_INVALID_PARAMETER); goto fail; } + + Status = STATUS_SUCCESS; if (Count > 0) { - SafeString = ExAllocatePoolWithTag(PagedPool, Count * sizeof(WCHAR), TAG_GDITEXT); - if (!SafeString) - { + TmpBufSize = StringSize = Count * sizeof(WCHAR); + if (UnsafeDx) + { + /* If ETO_PDY is specified, we have pairs of INTs */ + DxSize = Count * sizeof(INT) * (fuOptions & ETO_PDY ? 2 : 1); + TmpBufSize += DxSize; + } + + /* Allocate a temp buffer for the string and the Dx values */ + TmpBuffer = ExAllocatePoolWithTag(PagedPool, TmpBufSize, TAG_GDITEXT); + SafeString = TmpBuffer; + if (!TmpBuffer) + { + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); goto fail; } - Status = MmCopyFromCaller(SafeString, UnsafeString, Count * sizeof(WCHAR)); - if (! NT_SUCCESS(Status)) + + /* Probe and copy user mode data to the temp buffer */ + _SEH2_TRY + { + if (UnsafeString) + { + ProbeForRead(UnsafeString, StringSize, 1); + memcpy((PVOID)SafeString, UnsafeString, StringSize); + } + + if (UnsafeDx) + { + ProbeForRead(UnsafeDx, DxSize, 1); + Dx = (INT*)((ULONG_PTR)TmpBuffer + StringSize); + memcpy(Dx, UnsafeString, DxSize); + } + + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + if (!NT_SUCCESS(Status)) { goto fail; } } String = SafeString; - if (NULL != UnsafeDx && Count > 0) - { - Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT); - if (NULL == Dx) - { - goto fail; - } - Status = MmCopyFromCaller(Dx, UnsafeDx, Count * sizeof(INT)); + if (lprc) + { + _SEH2_TRY + { + ProbeForRead(lprc, sizeof(RECT), 1); + memcpy(&SpecifiedDestRect, lprc, sizeof(RECT)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END if (!NT_SUCCESS(Status)) { - goto fail; - } - } - - if (lprc) - { - Status = MmCopyFromCaller(&SpecifiedDestRect, lprc, sizeof(RECT)); - if (!NT_SUCCESS(Status)) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); goto fail; } } @@ -3692,13 +3723,9 @@ BRUSHOBJ_UnlockBrush(BrushFg); NtGdiDeleteObject(hBrushFg); } - if (NULL != SafeString) - { - ExFreePoolWithTag((void*)SafeString, TAG_GDITEXT); - } - if (NULL != Dx) - { - ExFreePoolWithTag(Dx, TAG_GDITEXT); + if (TmpBuffer) + { + ExFreePoolWithTag(TmpBuffer, TAG_GDITEXT); } DC_UnlockDc(dc);
16 years
1
0
0
0
[cgutman] 38200: - Revert r37479
by cgutman@svn.reactos.org
Author: cgutman Date: Sat Dec 20 14:08:53 2008 New Revision: 38200 URL:
http://svn.reactos.org/svn/reactos?rev=38200&view=rev
Log: - Revert r37479 Modified: branches/aicom-network-fixes/lib/drivers/ip/network/loopback.c Modified: branches/aicom-network-fixes/lib/drivers/ip/network/loopback.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
============================================================================== --- branches/aicom-network-fixes/lib/drivers/ip/network/loopback.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/lib/drivers/ip/network/loopback.c [iso-8859-1] Sat Dec 20 14:08:53 2008 @@ -22,6 +22,7 @@ KSPIN_LOCK LoopWorkLock; LIST_ENTRY LoopWorkList; WORK_QUEUE_ITEM LoopWorkItem; +BOOLEAN LoopReceiveWorkerBusy = FALSE; VOID STDCALL LoopReceiveWorker( PVOID Context ) { PLIST_ENTRY ListEntry; @@ -34,43 +35,46 @@ TI_DbgPrint(DEBUG_DATALINK, ("Called.\n")); - ListEntry = ExInterlockedRemoveHeadList( &LoopWorkList, &LoopWorkLock ); - WorkItem = CONTAINING_RECORD(ListEntry, LAN_WQ_ITEM, ListEntry); - - TI_DbgPrint(DEBUG_DATALINK, ("WorkItem: %x\n", WorkItem)); - - Packet = WorkItem->Packet; - Adapter = WorkItem->Adapter; - BytesTransferred = WorkItem->BytesTransferred; - - ExFreePool( WorkItem ); - - IPPacket.NdisPacket = Packet; - - TI_DbgPrint(DEBUG_DATALINK, ("Packet %x Adapter %x Trans %x\n", - Packet, Adapter, BytesTransferred)); - - NdisGetFirstBufferFromPacket(Packet, - &NdisBuffer, - &IPPacket.Header, - &IPPacket.ContigSize, - &IPPacket.TotalSize); - - IPPacket.ContigSize = IPPacket.TotalSize = BytesTransferred; - /* Determine which upper layer protocol that should receive - this packet and pass it to the correct receive handler */ - - TI_DbgPrint(MID_TRACE, - ("ContigSize: %d, TotalSize: %d, BytesTransferred: %d\n", - IPPacket.ContigSize, IPPacket.TotalSize, - BytesTransferred)); - - IPPacket.Position = 0; - - IPReceive(Loopback, &IPPacket); - - FreeNdisPacket( Packet ); + while( (ListEntry = + ExInterlockedRemoveHeadList( &LoopWorkList, &LoopWorkLock )) ) { + WorkItem = CONTAINING_RECORD(ListEntry, LAN_WQ_ITEM, ListEntry); + + TI_DbgPrint(DEBUG_DATALINK, ("WorkItem: %x\n", WorkItem)); + + Packet = WorkItem->Packet; + Adapter = WorkItem->Adapter; + BytesTransferred = WorkItem->BytesTransferred; + + ExFreePool( WorkItem ); + + IPPacket.NdisPacket = Packet; + + TI_DbgPrint(DEBUG_DATALINK, ("Packet %x Adapter %x Trans %x\n", + Packet, Adapter, BytesTransferred)); + + NdisGetFirstBufferFromPacket(Packet, + &NdisBuffer, + &IPPacket.Header, + &IPPacket.ContigSize, + &IPPacket.TotalSize); + + IPPacket.ContigSize = IPPacket.TotalSize = BytesTransferred; + /* Determine which upper layer protocol that should receive + this packet and pass it to the correct receive handler */ + + TI_DbgPrint(MID_TRACE, + ("ContigSize: %d, TotalSize: %d, BytesTransferred: %d\n", + IPPacket.ContigSize, IPPacket.TotalSize, + BytesTransferred)); + + IPPacket.Position = 0; + + IPReceive(Loopback, &IPPacket); + + FreeNdisPacket( Packet ); + } TI_DbgPrint(DEBUG_DATALINK, ("Leaving\n")); + LoopReceiveWorkerBusy = FALSE; } VOID LoopSubmitReceiveWork( @@ -80,19 +84,34 @@ UINT BytesTransferred) { PLAN_WQ_ITEM WQItem; PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext; + KIRQL OldIrql; + + TcpipAcquireSpinLock( &LoopWorkLock, &OldIrql ); WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) ); - if( !WQItem ) return; + if( !WQItem ) { + TcpipReleaseSpinLock( &LoopWorkLock, OldIrql ); + return; + } WQItem->Packet = Packet; WQItem->Adapter = Adapter; WQItem->BytesTransferred = BytesTransferred; - ExInterlockedInsertTailList( &LoopWorkList, &WQItem->ListEntry, &LoopWorkLock ); + InsertTailList( &LoopWorkList, &WQItem->ListEntry ); TI_DbgPrint(DEBUG_DATALINK, ("Packet %x Adapter %x BytesTrans %x\n", Packet, Adapter, BytesTransferred)); - ExQueueWorkItem( &LoopWorkItem, CriticalWorkQueue ); + if( !LoopReceiveWorkerBusy ) { + LoopReceiveWorkerBusy = TRUE; + ExQueueWorkItem( &LoopWorkItem, CriticalWorkQueue ); + TI_DbgPrint(DEBUG_DATALINK, + ("Work item inserted %x %x\n", &LoopWorkItem, WQItem)); + } else { + TI_DbgPrint(DEBUG_DATALINK, + ("LOOP WORKER BUSY %x %x\n", &LoopWorkItem, WQItem)); + } + TcpipReleaseSpinLock( &LoopWorkLock, OldIrql ); } VOID LoopTransmit(
16 years
1
0
0
0
[tkreuzer] 38199: [FORMATTING] Fix indentation. No code change.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Dec 20 13:43:11 2008 New Revision: 38199 URL:
http://svn.reactos.org/svn/reactos?rev=38199&view=rev
Log: [FORMATTING] Fix indentation. No code change. Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
16 years
1
0
0
0
[sginsberg] 38198: - Revert 38116 -- the SEH issues should be gone now
by sginsberg@svn.reactos.org
Author: sginsberg Date: Sat Dec 20 07:48:35 2008 New Revision: 38198 URL:
http://svn.reactos.org/svn/reactos?rev=38198&view=rev
Log: - Revert 38116 -- the SEH issues should be gone now Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c Modified: trunk/reactos/dll/win32/advapi32/sec/lsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/lsa…
============================================================================== --- trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/sec/lsa.c [iso-8859-1] Sat Dec 20 07:48:35 2008 @@ -78,11 +78,10 @@ NTSTATUS WINAPI LsaClose(LSA_HANDLE ObjectHandle) { - //NTSTATUS Status; + NTSTATUS Status; TRACE("LsaClose(0x%p) called\n", ObjectHandle); -#if 0 _SEH2_TRY { Status = LsarClose((PLSAPR_HANDLE)&ObjectHandle); @@ -94,15 +93,6 @@ _SEH2_END; return Status; -#else - - /* This is our fake handle, don't go too much long way */ - if (ObjectHandle == (LSA_HANDLE)0xcafe) - return STATUS_SUCCESS; - - return LsarClose((PLSAPR_HANDLE)&ObjectHandle); - -#endif } @@ -395,13 +385,12 @@ IN ACCESS_MASK DesiredAccess, IN OUT PLSA_HANDLE PolicyHandle) { - //NTSTATUS Status; + NTSTATUS Status; TRACE("LsaOpenPolicy (%s,%p,0x%08x,%p)\n", SystemName?debugstr_w(SystemName->Buffer):"(null)", ObjectAttributes, DesiredAccess, PolicyHandle); -#if 0 _SEH2_TRY { *PolicyHandle = NULL; @@ -420,12 +409,6 @@ TRACE("LsaOpenPolicy() done (Status: 0x%08lx)\n", Status); return Status; -#else - - if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe; - return STATUS_SUCCESS; - -#endif }
16 years
1
0
0
0
[hyperion] 38197: Supersedes r38084. Take three modified include/reactos/libs/pseh/pseh2.h modified lib/pseh/framebased-gcchack.c modified lib/pseh/i386/framebased-gcchack.S Disassemble trampolines in the library, instead of the macros. Results in better, smaller code. As a side effect, PSEH no longer requires a trampoline for nested functions - which results in even better, even smaller code in many common cases where the nested functions don't use any variables from the containing function Sim
by hyperion@svn.reactos.org
Author: hyperion Date: Sat Dec 20 07:05:57 2008 New Revision: 38197 URL:
http://svn.reactos.org/svn/reactos?rev=38197&view=rev
Log: Supersedes r38084. Take three modified include/reactos/libs/pseh/pseh2.h modified lib/pseh/framebased-gcchack.c modified lib/pseh/i386/framebased-gcchack.S Disassemble trampolines in the library, instead of the macros. Results in better, smaller code. As a side effect, PSEH no longer requires a trampoline for nested functions - which results in even better, even smaller code in many common cases where the nested functions don't use any variables from the containing function Simulate a no-op setjmp so that GCC correctly handles variables in registers, instead of surprise-corrupting random variables in random conditions Save EBP and ESP every time a _SEH2_TRY/_SEH2_EXCEPT is entered, instead of only the first time. Probably not entirely correct yet Don't generate a nested function for a _SEH2_EXCEPT() filter expression if the value is a compile-time constant: convert the value to (void *)0, (void *)1 or (void *)-1, and set that as the filter, instead (like Visual C++ does, incidentally) If a _SEH2_EXCEPT() filter expression is a compile-time constant evaluating to EXCEPTION_CONTINUE_EXECUTION or EXCEPTION_CONTINUE_SEARCH, allow GCC to optimize out the body of the _SEH2_EXCEPT (because it'd be unreachable). This should really result in a compile-time warning, but #pragma message is unsupported in GCC 4.1.3 Let _SEH2_EXCEPT() accept a comma expression as filter expression (e.g. _SEH2_EXCEPT(MessageBox(...), EXCEPTION_EXECUTE_HANDLER) instead of _SEH2_EXCEPT((MessageBox(...), EXCEPTION_EXECUTE_HANDLER))) Small optimizations in PSEH library Clean up GCC hacks Remove currently unused PSEH 3 hacks Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h trunk/reactos/lib/pseh/framebased-gcchack.c trunk/reactos/lib/pseh/i386/framebased-gcchack.S Modified: trunk/reactos/include/reactos/libs/pseh/pseh2.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
============================================================================== --- trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/pseh/pseh2.h [iso-8859-1] Sat Dec 20 07:05:57 2008 @@ -46,8 +46,7 @@ { _SEH2Registration_t SF_Registration; volatile struct __SEH2TryLevel * volatile SF_TopTryLevel; - void * volatile SF_FramePointer; - void * volatile SF_StackPointer; + struct _EXCEPTION_POINTERS * volatile SF_ExceptionInformation; volatile unsigned long SF_Code; } _SEH2Frame_t; @@ -55,9 +54,10 @@ typedef struct __SEH2TryLevel { volatile struct __SEH2TryLevel * ST_Next; - void * ST_FramePointer; void * ST_Filter; void * ST_Body; + void * volatile ST_Ebp; + void * volatile ST_Esp; } _SEH2TryLevel_t; @@ -120,32 +120,40 @@ #define __SEH_PRETEND_SIDE_EFFECT (void)0 /* Forces GCC to consider the specified label reachable */ -#define __SEH_USE_LABEL(L_) __asm__ __volatile__("# %0\n" : : "i" (&&L_)) +#define __SEH_USE_LABEL(L_) if(__SEH_VOLATILE_FALSE) goto L_; /* Makes GCC pretend the specified label is reachable, to silence warnings */ #define __SEH_PRETEND_USE_LABEL(L_) (void)(&&L_) -/* Forces GCC to emit the specified nested function as a function */ -#define __SEH_USE_NESTED_FUNCTION(F_) (void)(&F_) /* __attribute__((noinline)) seems to do the trick */ - /* Soft memory barrier */ #define __SEH_BARRIER __asm__ __volatile__("#":::"memory") /* GCC doesn't know that this equals zero */ -#define __SEH_ZERO ({ int zero = 0; __asm__ __volatile__("#" : "+g" (zero)); zero; }) - -#define __SEH_FALSE __builtin_expect(__SEH_ZERO, 0) -#define __SEH_TRUE __builtin_expect(!__SEH_ZERO, 1) +#define __SEH_VOLATILE_ZERO ({ int zero = 0; __asm__ __volatile__("#" : "+g" (zero)); zero; }) + +/* GCC believes this is setjmp */ +#define __SEH_PRETEND_SETJMP() (_SEH2PretendSetjmp(), 0) + +#define __SEH_VOLATILE_FALSE __builtin_expect(__SEH_VOLATILE_ZERO, 0) +#define __SEH_VOLATILE_TRUE __builtin_expect(!__SEH_VOLATILE_ZERO, 1) + +#define ___SEH_STRINGIFY(X_) # X_ +#define __SEH_STRINGIFY(X_) ___SEH_STRINGIFY(X_) + +static +__inline__ +__attribute__((returns_twice)) +__attribute__((always_inline)) +void _SEH2PretendSetjmp(void) +{ +} #define __SEH_FORCE_NEST \ __asm__ __volatile__("#%0" : : "r" (&_SEHFrame)) -#define __SEH_NESTED_PROLOG \ - __SEH_FORCE_NEST; - -#define __SEH_DECLARE_EXCEPT_PFN(NAME_) int (__cdecl * NAME_)(void *) -#define __SEH_DECLARE_EXCEPT(NAME_) int __cdecl NAME_(void *) -#define __SEH_DEFINE_EXCEPT(NAME_) int __cdecl NAME_(void * _SEHExceptionPointers) +#define __SEH_DECLARE_EXCEPT_PFN(NAME_) int (__cdecl * NAME_)(void) +#define __SEH_DECLARE_EXCEPT(NAME_) int __cdecl NAME_(void) +#define __SEH_DEFINE_EXCEPT(NAME_) int __cdecl NAME_(void) #define __SEH_DECLARE_FINALLY_PFN(NAME_) void (__cdecl * NAME_)(void) #define __SEH_DECLARE_FINALLY(NAME_) void __cdecl NAME_(void) @@ -155,21 +163,19 @@ #define __SEH_RETURN_FINALLY() return #define __SEH_BEGIN_TRY \ + if(!__SEH_PRETEND_SETJMP()) \ { \ - __label__ _SEHBeginTry; \ __label__ _SEHEndTry; \ - \ - __SEH_USE_LABEL(_SEHBeginTry); \ - __SEH_USE_LABEL(_SEHEndTry); \ - \ - _SEHBeginTry: __SEH_SIDE_EFFECT; \ + \ + __SEH_PRETEND_USE_LABEL(_SEHEndTry); \ + \ { \ __SEH_BARRIER; #define __SEH_END_TRY \ __SEH_BARRIER; \ } \ - _SEHEndTry: __SEH_SIDE_EFFECT; \ + _SEHEndTry:; \ } #define __SEH_SET_TRYLEVEL(TRYLEVEL_) \ @@ -188,21 +194,14 @@ #define __SEH_BEGIN_SCOPE \ for(;;) \ { \ - __label__ _SEHBeginScope; \ - __label__ _SEHEndScope; \ - \ - _SEHBeginScope: __SEH_SIDE_EFFECT; \ - \ const int _SEHTopTryLevel = (_SEH2ScopeKind != 0); \ _SEH2Frame_t * const _SEHCurFrameP = _SEH2FrameP; \ volatile _SEH2TryLevel_t * const _SEHPrevTryLevelP = _SEH2TryLevelP; \ + __attribute__((unused)) int _SEHAbnormalTermination; \ \ (void)_SEHTopTryLevel; \ (void)_SEHCurFrameP; \ (void)_SEHPrevTryLevelP; \ - \ - __SEH_USE_LABEL(_SEHBeginScope); \ - __SEH_USE_LABEL(_SEHEndScope); \ \ { \ __label__ _SEHBeforeTry; \ @@ -227,15 +226,10 @@ __SEH_ENTER_TRYLEVEL(); \ \ if(_SEHTopTryLevel) \ - { \ - __SEH_BARRIER; __asm__ __volatile__("mov %%ebp, %0\n#%1" : "=m" (_SEHFrame.SF_FramePointer) : "r" (__builtin_frame_address(0))); __SEH_BARRIER; \ _SEH2EnterFrame(&_SEHFrame); \ - } \ #define __SEH_END_SCOPE \ } \ - \ - _SEHEndScope: __SEH_SIDE_EFFECT; \ \ break; \ } @@ -244,14 +238,13 @@ __label__ _SEHBeginExcept; \ __label__ _SEHEndExcept; \ \ - auto __SEH_DECLARE_EXCEPT(_SEHExcept); \ auto __SEH_DECLARE_FINALLY(_SEHFinally); #define _SEH2_TRY \ __SEH_BEGIN_SCOPE \ { \ __SEH_SCOPE_LOCALS; \ -\ + \ __SEH_BEGIN_TRY \ { @@ -265,14 +258,15 @@ __SEH_PRETEND_USE_LABEL(_SEHBeginExcept); \ __SEH_PRETEND_USE_LABEL(_SEHEndExcept); \ \ - __SEH_USE_NESTED_FUNCTION(_SEHFinally); \ - \ - _SEHTryLevel.ST_FramePointer = _SEHClosureFromTrampoline((_SEHTrampoline_t *)&_SEHFinally); \ _SEHTryLevel.ST_Filter = 0; \ - _SEHTryLevel.ST_Body = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)&_SEHFinally); \ + _SEHTryLevel.ST_Body = &_SEHFinally; \ + \ + _SEHAbnormalTermination = 1; \ \ goto _SEHDoTry; \ _SEHAfterTry:; \ + \ + _SEHAbnormalTermination = 0; \ \ if(_SEHTopTryLevel) \ _SEH2LeaveFrame(); \ @@ -284,10 +278,9 @@ _SEHFinally(); \ goto _SEHEndExcept; \ \ - _SEHBeginExcept: __SEH_PRETEND_SIDE_EFFECT; \ - __attribute__((unused)) __SEH_DEFINE_EXCEPT(_SEHExcept) { __SEH_RETURN_EXCEPT(0); } \ - \ - __attribute__((noinline)) __attribute__((used)) __SEH_DEFINE_FINALLY(_SEHFinally) \ + _SEHBeginExcept:; \ + \ + __attribute__((noinline)) __SEH_DEFINE_FINALLY(_SEHFinally) \ { \ __SEH_END_SCOPE_CHAIN; \ \ @@ -295,39 +288,64 @@ (void)_SEH2FrameP; \ (void)_SEH2TryLevelP; \ \ - __SEH_NESTED_PROLOG; \ - \ for(;; ({ __SEH_RETURN_FINALLY(); })) \ { -#define _SEH2_EXCEPT(E_) \ +#define _SEH2_EXCEPT(...) \ } \ __SEH_END_TRY; \ \ goto _SEHAfterTry; \ \ _SEHBeforeTry:; \ -\ - __SEH_USE_LABEL(_SEHBeginExcept); \ - __SEH_USE_LABEL(_SEHEndExcept); \ -\ - __SEH_USE_NESTED_FUNCTION(_SEHExcept); \ - \ - _SEHTryLevel.ST_FramePointer = _SEHClosureFromTrampoline((_SEHTrampoline_t *)&_SEHExcept); \ - _SEHTryLevel.ST_Filter = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)&_SEHExcept); \ - _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \ - __SEH_BARRIER; __asm__ __volatile__("mov %%esp, %0" : "=m" (_SEH2FrameP->SF_StackPointer)); __SEH_BARRIER; \ -\ + \ + if(__builtin_constant_p((__VA_ARGS__))) \ + { \ + if((__VA_ARGS__) > 0) \ + { \ + _SEHTryLevel.ST_Filter = (void *)1; \ + _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \ + __SEH_USE_LABEL(_SEHBeginExcept); \ + } \ + else if((__VA_ARGS__) < 0) \ + { \ + _SEHTryLevel.ST_Filter = (void *)-1; \ + _SEHTryLevel.ST_Body = NULL; \ + } \ + else \ + { \ + _SEHTryLevel.ST_Filter = (void *)0; \ + _SEHTryLevel.ST_Body = NULL; \ + } \ + } \ + else \ + { \ + __SEH_DEFINE_EXCEPT(_SEHExcept) \ + { \ + __SEH_RETURN_EXCEPT((__VA_ARGS__)); \ + } \ + \ + _SEHTryLevel.ST_Filter = &_SEHExcept; \ + _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \ + __SEH_USE_LABEL(_SEHBeginExcept); \ + } \ + \ + __SEH_BARRIER; \ + \ + __asm__ __volatile__ \ + ( \ + "mov %%ebp, %0\n" \ + "mov %%esp, %1" : \ + "=m" (_SEHTryLevel.ST_Ebp), \ + "=m" (_SEHTryLevel.ST_Esp) \ + ); \ + \ + __SEH_BARRIER; \ + \ goto _SEHDoTry; \ -\ - __attribute__((noinline)) __attribute__((used)) __SEH_DEFINE_EXCEPT(_SEHExcept) \ - { \ - __SEH_NESTED_PROLOG; \ - __SEH_RETURN_EXCEPT(E_); \ - } \ -\ + \ __attribute__((unused)) __SEH_DEFINE_FINALLY(_SEHFinally) { __SEH_RETURN_FINALLY(); } \ -\ + \ _SEHAfterTry:; \ if(_SEHTopTryLevel) \ _SEH2LeaveFrame(); \ @@ -336,12 +354,9 @@ __SEH_LEAVE_TRYLEVEL(); \ } \ \ - if(__SEH_FALSE) \ - goto _SEHBeginExcept; \ - else \ - goto _SEHEndExcept; \ -\ - _SEHBeginExcept: __SEH_SIDE_EFFECT; \ + goto _SEHEndExcept; \ + \ + _SEHBeginExcept:; \ { \ { \ _SEH2Frame_t * const _SEH2FrameP = _SEHTopTryLevel ? &_SEHFrame : _SEHCurFrameP; \ @@ -352,13 +367,14 @@ __SEH_BARRIER; \ } \ } \ - _SEHEndExcept: __SEH_SIDE_EFFECT; \ + \ + _SEHEndExcept:; \ } \ __SEH_END_SCOPE; -#define _SEH2_GetExceptionInformation() ((struct _EXCEPTION_POINTERS *)_SEHExceptionPointers) +#define _SEH2_GetExceptionInformation() ((_SEH2FrameP)->SF_ExceptionInformation) #define _SEH2_GetExceptionCode() ((_SEH2FrameP)->SF_Code) -#define _SEH2_AbnormalTermination() (!!_SEH2_GetExceptionCode()) +#define _SEH2_AbnormalTermination() (_SEHAbnormalTermination) #define _SEH2_YIELD(STMT_) \ for(;;) \ @@ -379,7 +395,7 @@ #define _SEH2_TRY __try #define _SEH2_FINALLY __finally -#define _SEH2_EXCEPT(E_) __except((E_)) +#define _SEH2_EXCEPT(...) __except(__VA_ARGS__) #define _SEH2_END #define _SEH2_GetExceptionInformation() (GetExceptionInformation()) Modified: trunk/reactos/lib/pseh/framebased-gcchack.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/framebased-gcchac…
============================================================================== --- trunk/reactos/lib/pseh/framebased-gcchack.c [iso-8859-1] (original) +++ trunk/reactos/lib/pseh/framebased-gcchack.c [iso-8859-1] Sat Dec 20 07:05:57 2008 @@ -40,7 +40,7 @@ extern _SEH2Registration_t * __cdecl _SEH2CurrentRegistration(void); extern void _SEH2GlobalUnwind(void *); -extern int __SEH2Except(void *, void *, void *); +extern int __SEH2Except(void *, void *); extern void __SEH2Finally(void *, void *); extern DECLSPEC_NORETURN int __SEH2Handle(void *, void *, void *); @@ -51,18 +51,45 @@ extern int __cdecl __SEH2NestedHandler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *); FORCEINLINE -int _SEH2Except(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel, EXCEPTION_POINTERS * ep) -{ - return __SEH2Except(trylevel->ST_Filter, trylevel->ST_FramePointer, ep); -} - -static -#if defined(__GNUC__) -__attribute__((noinline)) -#endif +int _SEH2Except(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel) +{ + void * filter = trylevel->ST_Filter; + void * context = NULL; + + if(filter == (void *)0) + return 0; + + if(filter == (void *)1) + return 1; + + if(filter == (void *)-1) + return -1; + + if(_SEHIsTrampoline((_SEHTrampoline_t *)filter)) + { + context = _SEHClosureFromTrampoline((_SEHTrampoline_t *)filter); + filter = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)filter); + } + + return __SEH2Except(filter, context); +} + +FORCEINLINE void _SEH2Finally(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel) { - __SEH2Finally(trylevel->ST_Body, trylevel->ST_FramePointer); + if(trylevel->ST_Filter == NULL && trylevel->ST_Body != NULL) + { + void * body = trylevel->ST_Body; + void * context = NULL; + + if(_SEHIsTrampoline((_SEHTrampoline_t *)body)) + { + context = _SEHClosureFromTrampoline((_SEHTrampoline_t *)body); + body = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)body); + } + + __SEH2Finally(body, context); + } } extern @@ -91,10 +118,7 @@ __SEH2EnterFrame(&nestedframe); for(trylevel = frame->SF_TopTryLevel; trylevel && trylevel != dsttrylevel; trylevel = trylevel->ST_Next) - { - if(!trylevel->ST_Filter) - _SEH2Finally(frame, trylevel); - } + _SEH2Finally(frame, trylevel); frame->SF_TopTryLevel = dsttrylevel; @@ -106,7 +130,7 @@ { _SEH2GlobalUnwind(frame); _SEH2LocalUnwind(frame, trylevel); - __SEH2Handle(trylevel->ST_Body, frame->SF_FramePointer, frame->SF_StackPointer); + __SEH2Handle(trylevel->ST_Body, trylevel->ST_Ebp, trylevel->ST_Esp); } extern @@ -132,25 +156,22 @@ { int ret = 0; volatile _SEH2TryLevel_t * trylevel; + EXCEPTION_POINTERS ep; + + ep.ExceptionRecord = ExceptionRecord; + ep.ContextRecord = ContextRecord; frame->SF_Code = ExceptionRecord->ExceptionCode; + frame->SF_ExceptionInformation = &ep; for(trylevel = frame->SF_TopTryLevel; trylevel != NULL; trylevel = trylevel->ST_Next) { - if(trylevel->ST_Filter) - { - EXCEPTION_POINTERS ep; - - ep.ExceptionRecord = ExceptionRecord; - ep.ContextRecord = ContextRecord; - - ret = _SEH2Except(frame, trylevel, &ep); - - if(ret < 0) - return ExceptionContinueExecution; - else if(ret > 0) - _SEH2Handle(frame, trylevel); - } + ret = _SEH2Except(frame, trylevel); + + if(ret < 0) + return ExceptionContinueExecution; + else if(ret > 0) + _SEH2Handle(frame, trylevel); } } Modified: trunk/reactos/lib/pseh/i386/framebased-gcchack.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/i386/framebased-g…
============================================================================== --- trunk/reactos/lib/pseh/i386/framebased-gcchack.S [iso-8859-1] (original) +++ trunk/reactos/lib/pseh/i386/framebased-gcchack.S [iso-8859-1] Sat Dec 20 07:05:57 2008 @@ -49,18 +49,8 @@ jmp eax .globl ___SEH2Except +.globl ___SEH2Finally ___SEH2Except: - mov eax, [esp+4] - mov ecx, [esp+8] - - push [esp+12] - call eax - - pop ecx - - ret - -.globl ___SEH2Finally ___SEH2Finally: mov eax, [esp+4] mov ecx, [esp+8]
16 years
1
0
0
0
[dgorbachev] 38196: - Do not use pGlobalData after freeing, - do not load color spectrum bitmaps if no adapter found, - do not use HEAP_ZERO_MEMORY, use memset(), - check SelectObject() result, - fix indentation.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Sat Dec 20 05:06:21 2008 New Revision: 38196 URL:
http://svn.reactos.org/svn/reactos?rev=38196&view=rev
Log: - Do not use pGlobalData after freeing, - do not load color spectrum bitmaps if no adapter found, - do not use HEAP_ZERO_MEMORY, use memset(), - check SelectObject() result, - fix indentation. Modified: trunk/reactos/dll/cpl/desk/settings.c Modified: trunk/reactos/dll/cpl/desk/settings.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/settings.c?re…
============================================================================== --- trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] Sat Dec 20 05:06:21 2008 @@ -1,7 +1,7 @@ /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Display Control Panel - * FILE: lib/cpl/desk/settings.c + * FILE: dll/cpl/desk/settings.c * PURPOSE: Settings property page * * PROGRAMMERS: Trevor McCort (lycan359(a)gmail.com) @@ -286,13 +286,14 @@ DISPLAY_DEVICE displayDevice; PGLOBAL_DATA pGlobalData; - pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA)); + pGlobalData = HeapAlloc(GetProcessHeap(), 0, sizeof(GLOBAL_DATA)); if (pGlobalData == NULL) return; SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData); /* Get video cards list */ + pGlobalData->DisplayDeviceList = NULL; displayDevice.cb = (DWORD)sizeof(DISPLAY_DEVICE); while (EnumDisplayDevices(NULL, iDevNum, &displayDevice, 0x1)) { @@ -303,6 +304,7 @@ } iDevNum++; } + if (Result == 0) { /* No adapter found */ @@ -311,6 +313,10 @@ EnableWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_RESOLUTION_TEXT), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_ADVANCED), FALSE); ShowWindow(GetDlgItem(hwndDlg, IDC_SETTINGS_SPECTRUM), SW_HIDE); + + /* Do not initialize the color spectrum bitmaps */ + memset(pGlobalData->hSpectrumBitmaps, 0, sizeof(pGlobalData->hSpectrumBitmaps)); + return; } else if (Result == 1) { @@ -325,10 +331,10 @@ monitors.Size.cy = pGlobalData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight; monitors.Flags = 0; SendDlgItemMessage(hwndDlg, - IDC_SETTINGS_MONSEL, - MSLM_SETMONITORSINFO, - 1, - (LPARAM)&monitors); + IDC_SETTINGS_MONSEL, + MSLM_SETMONITORSINFO, + 1, + (LPARAM)&monitors); } else /* FIXME: incomplete! */ { @@ -352,10 +358,10 @@ } SendDlgItemMessage(hwndDlg, - IDC_SETTINGS_MONSEL, - MSLM_SETMONITORSINFO, - Result, - (LPARAM)pMonitors); + IDC_SETTINGS_MONSEL, + MSLM_SETMONITORSINFO, + Result, + (LPARAM)pMonitors); HeapFree(GetProcessHeap(), 0, pMonitors); } @@ -401,12 +407,17 @@ default: iBitmap = 2; } - SelectObject(hdcMem, pGlobalData->hSpectrumBitmaps[iBitmap]); - StretchBlt(hDC, - client->left, client->top, client->right - client->left, client->bottom - client->top, - hdcMem, 0, 0, - pGlobalData->cxSource[iBitmap], - pGlobalData->cySource[iBitmap], SRCCOPY); + if (SelectObject(hdcMem, pGlobalData->hSpectrumBitmaps[iBitmap])) + { + StretchBlt(hDC, + client->left, client->top, + client->right - client->left, + client->bottom - client->top, + hdcMem, 0, 0, + pGlobalData->cxSource[iBitmap], + pGlobalData->cySource[iBitmap], SRCCOPY); + } + DeleteDC(hdcMem); } @@ -631,7 +642,6 @@ if (lpDrawItem->CtlID == IDC_SETTINGS_SPECTRUM) ShowColorSpectrum(lpDrawItem->hDC, &lpDrawItem->rcItem, pGlobalData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel, pGlobalData); - break; } case WM_COMMAND: @@ -834,13 +844,13 @@ Current = Next; } - HeapFree(GetProcessHeap(), 0, pGlobalData); - for (i = 0; i < NUM_SPECTRUM_BITMAPS; i++) { if (pGlobalData->hSpectrumBitmaps[i]) DeleteObject(pGlobalData->hSpectrumBitmaps[i]); } + + HeapFree(GetProcessHeap(), 0, pGlobalData); } } return FALSE;
16 years
1
0
0
0
[janderwald] 38195: - Fix parameters for CreateService
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Dec 20 04:09:25 2008 New Revision: 38195 URL:
http://svn.reactos.org/svn/reactos?rev=38195&view=rev
Log: - Fix parameters for CreateService Modified: trunk/reactos/base/applications/sc/create.c Modified: trunk/reactos/base/applications/sc/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sc/creat…
============================================================================== --- trunk/reactos/base/applications/sc/create.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/sc/create.c [iso-8859-1] Sat Dec 20 04:09:25 2008 @@ -20,7 +20,7 @@ DWORD dwErrorControl = SERVICE_ERROR_NORMAL; LPCTSTR lpBinaryPathName = NULL; LPCTSTR lpLoadOrderGroup = NULL; - LPDWORD lpdwTagId = NULL; + DWORD dwTagId = 0; LPCTSTR lpDependencies = NULL; LPCTSTR lpServiceStartName = NULL; LPCTSTR lpPassword = NULL; @@ -36,7 +36,7 @@ _tprintf(_T("error control - %lu\n"), dwErrorControl); _tprintf(_T("Binary path - %s\n"), lpBinaryPathName); _tprintf(_T("load order group - %s\n"), lpLoadOrderGroup); - _tprintf(_T("tag - %lu\n"), lpdwTagId); + _tprintf(_T("tag - %lu\n"), dwTagId); _tprintf(_T("dependincies - %s\n"), lpDependencies); _tprintf(_T("account start name - %s\n"), lpServiceStartName); _tprintf(_T("account password - %s\n"), lpPassword); @@ -66,7 +66,7 @@ dwErrorControl, lpBinaryPathName, lpLoadOrderGroup, - lpdwTagId, + &dwTagId, lpDependencies, lpServiceStartName, lpPassword);
16 years
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200