ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2009
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
21 participants
654 discussions
Start a n
N
ew thread
[cgutman] 42404: - Fix a bug in TDI_TRANSPORT_ADDRESS_FILE handling - Remove some dead code
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 5 09:52:15 2009 New Revision: 42404 URL:
http://svn.reactos.org/svn/reactos?rev=42404&view=rev
Log: - Fix a bug in TDI_TRANSPORT_ADDRESS_FILE handling - Remove some dead code Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Wed Aug 5 09:52:15 2009 @@ -716,15 +716,6 @@ TcpipRecursiveMutexLeave(&TCPLock); return STATUS_INVALID_PARAMETER; } - - if (!AddrFile) { - TI_DbgPrint(MID_TRACE, ("No address file object.\n")); - TcpipRecursiveMutexLeave(&TCPLock); - return STATUS_INVALID_PARAMETER; - } - - TcpipRecursiveMutexLeave(&TCPLock); - return STATUS_SUCCESS; } case TDI_QUERY_CONNECTION_INFO: @@ -747,6 +738,7 @@ switch ((ULONG)IrpSp->FileObject->FsContext2) { case TDI_TRANSPORT_ADDRESS_FILE: AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; + Endpoint = AddrFile ? AddrFile->Connection : NULL; break; case TDI_CONNECTION_FILE:
15 years, 4 months
1
0
0
0
[cgutman] 42403: - Correct the loopback adapter's address mask and broadcast address
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 5 05:25:27 2009 New Revision: 42403 URL:
http://svn.reactos.org/svn/reactos?rev=42403&view=rev
Log: - Correct the loopback adapter's address mask and broadcast address Modified: trunk/reactos/drivers/network/tcpip/include/ip.h Modified: trunk/reactos/drivers/network/tcpip/include/ip.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/ip.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/ip.h [iso-8859-1] Wed Aug 5 05:25:27 2009 @@ -187,8 +187,8 @@ /* Loopback adapter address information (network byte order) */ #define LOOPBACK_ADDRESS_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0x7F000001)) -#define LOOPBACK_BCASTADDR_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0x7F0000FF)) -#define LOOPBACK_ADDRMASK_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0xFFFFFF00)) +#define LOOPBACK_BCASTADDR_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0x7FFFFFFF)) +#define LOOPBACK_ADDRMASK_IPv4 ((IPv4_RAW_ADDRESS)DH2N(0xFF000000)) /* Protocol definitions */ #ifndef IPPROTO_RAW
15 years, 4 months
1
0
0
0
[gschneider] 42402: asctime/ctime: Check for too low input time, fixes one msvcrt time winetest
by gschneider@svn.reactos.org
Author: gschneider Date: Wed Aug 5 04:06:25 2009 New Revision: 42402 URL:
http://svn.reactos.org/svn/reactos?rev=42402&view=rev
Log: asctime/ctime: Check for too low input time, fixes one msvcrt time winetest Modified: trunk/reactos/lib/sdk/crt/time/ctime.c Modified: trunk/reactos/lib/sdk/crt/time/ctime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/time/ctime.c?r…
============================================================================== --- trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] Wed Aug 5 04:06:25 2009 @@ -1200,14 +1200,23 @@ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static char result[26]; - - (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n", - wday_name[timeptr->tm_wday], - mon_name[timeptr->tm_mon], - timeptr->tm_mday, timeptr->tm_hour, - timeptr->tm_min, timeptr->tm_sec, - TM_YEAR_BASE + timeptr->tm_year); - return result; + char* res = result; + + /* Check for invalid input time */ + if (timeptr->tm_year <= 69) + { + res = NULL; + } + else + { + sprintf(res, "%.3s %.3s%3d %02d:%02d:%02d %d\n", + wday_name[timeptr->tm_wday], + mon_name[timeptr->tm_mon], + timeptr->tm_mday, timeptr->tm_hour, + timeptr->tm_min, timeptr->tm_sec, + TM_YEAR_BASE + timeptr->tm_year); + } + return res; } /*
15 years, 4 months
1
0
0
0
[gschneider] 42401: -_ecvt really uses a static buffer for return values -Handle memory allocation failure
by gschneider@svn.reactos.org
Author: gschneider Date: Wed Aug 5 04:02:25 2009 New Revision: 42401 URL:
http://svn.reactos.org/svn/reactos?rev=42401&view=rev
Log: -_ecvt really uses a static buffer for return values -Handle memory allocation failure Modified: trunk/reactos/lib/sdk/crt/stdlib/ecvt.c Modified: trunk/reactos/lib/sdk/crt/stdlib/ecvt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/ecvt.c?…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/ecvt.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/ecvt.c [iso-8859-1] Wed Aug 5 04:02:25 2009 @@ -14,16 +14,16 @@ char * _ecvt (double value, int ndigits, int *decpt, int *sign) { - char *ecvtbuf, *cvtbuf; - char *s, *d; + static char ecvtbuf[DBL_MAX_10_EXP + 10]; + char *cvtbuf, *s, *d; s = cvtbuf = (char*)malloc(ndigits + 18); /* sign, dot, null, 15 for alignment */ - d = ecvtbuf = (char*)malloc(DBL_MAX_10_EXP + 10); + d = ecvtbuf; *sign = 0; *decpt = 0; - if (cvtbuf == NULL || ecvtbuf == NULL) + if (cvtbuf == NULL) { return NULL; } @@ -91,6 +91,11 @@ { /* Need enhanced precision*/ char* tbuf = (char*)malloc(ndigits + 18); + if (tbuf == NULL) + { + free(cvtbuf); + return NULL; + } sprintf(tbuf, "%-+.*E", ndigits + 2, value); if (tbuf[1] >= '5') {
15 years, 4 months
1
0
0
0
[cgutman] 42400: - Partial rewrite of recursive mutex code - Makes the recursive mutex faster and smaller - Fixes several unprotected accesses to recursive mutex
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 5 01:51:39 2009 New Revision: 42400 URL:
http://svn.reactos.org/svn/reactos?rev=42400&view=rev
Log: - Partial rewrite of recursive mutex code - Makes the recursive mutex faster and smaller - Fixes several unprotected accesses to recursive mutex Modified: trunk/reactos/drivers/network/tcpip/include/lock.h trunk/reactos/drivers/network/tcpip/recmutex/recmutex.c trunk/reactos/drivers/network/tcpip/recmutex/recmutex.h trunk/reactos/drivers/network/tcpip/tcpip/lock.c Modified: trunk/reactos/drivers/network/tcpip/include/lock.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/lock.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/lock.h [iso-8859-1] Wed Aug 5 01:51:39 2009 @@ -13,7 +13,7 @@ extern VOID TcpipAcquireFastMutex( PFAST_MUTEX Mutex ); extern VOID TcpipReleaseFastMutex( PFAST_MUTEX Mutex ); extern VOID TcpipRecursiveMutexInit( PRECURSIVE_MUTEX RecMutex ); -extern UINT TcpipRecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, +extern VOID TcpipRecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ); extern VOID TcpipRecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ); Modified: trunk/reactos/drivers/network/tcpip/recmutex/recmutex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/recm…
============================================================================== --- trunk/reactos/drivers/network/tcpip/recmutex/recmutex.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/recmutex/recmutex.c [iso-8859-1] Wed Aug 5 01:51:39 2009 @@ -3,7 +3,6 @@ VOID RecursiveMutexInit( PRECURSIVE_MUTEX RecMutex ) { RtlZeroMemory( RecMutex, sizeof(*RecMutex) ); - KeInitializeSpinLock( &RecMutex->SpinLock ); ExInitializeFastMutex( &RecMutex->Mutex ); KeInitializeEvent( &RecMutex->StateLockedEvent, NotificationEvent, FALSE ); @@ -11,76 +10,53 @@ /* NOTE: When we leave, the FAST_MUTEX must have been released. The result * is that we always exit in the same irql as entering */ -SIZE_T RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) { +VOID RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex ) { NTSTATUS Status = STATUS_SUCCESS; PVOID CurrentThread = KeGetCurrentThread(); - KIRQL CurrentIrql; + KIRQL CurrentIrql = KeGetCurrentIrql(); + + ASSERT(RecMutex); + ASSERT(CurrentIrql <= APC_LEVEL); /* Wait for the previous user to unlock the RecMutex state. There might be * multiple waiters waiting to change the state. We need to check each * time we get the event whether somebody still has the state locked */ - if( !RecMutex ) return FALSE; + ExAcquireFastMutex( &RecMutex->Mutex ); - if( CurrentThread == RecMutex->CurrentThread || - (!ToWrite && !RecMutex->Writer) ) { + if( CurrentThread == RecMutex->CurrentThread ) { RecMutex->LockCount++; - return TRUE; + ExReleaseFastMutex( &RecMutex->Mutex ); + return; } - CurrentIrql = KeGetCurrentIrql(); - - ASSERT(CurrentIrql <= DISPATCH_LEVEL); - - if( CurrentIrql <= APC_LEVEL ) { - ExAcquireFastMutex( &RecMutex->Mutex ); - while( RecMutex->Locked ) { - ExReleaseFastMutex( &RecMutex->Mutex ); - Status = KeWaitForSingleObject( &RecMutex->StateLockedEvent, - UserRequest, - KernelMode, - FALSE, - NULL ); - ExAcquireFastMutex( &RecMutex->Mutex ); - } - RecMutex->OldIrql = CurrentIrql; - RecMutex->Locked = TRUE; - RecMutex->Writer = ToWrite; - RecMutex->CurrentThread = CurrentThread; - RecMutex->LockCount++; - ExReleaseFastMutex( &RecMutex->Mutex ); - } else { - KeAcquireSpinLockAtDpcLevel( &RecMutex->SpinLock ); - RecMutex->OldIrql = DISPATCH_LEVEL; - RecMutex->Locked = TRUE; - RecMutex->Writer = ToWrite; - RecMutex->CurrentThread = CurrentThread; - RecMutex->LockCount++; + while( RecMutex->LockCount != 0 ) { + ExReleaseFastMutex( &RecMutex->Mutex ); + Status = KeWaitForSingleObject( &RecMutex->StateLockedEvent, + UserRequest, + KernelMode, + FALSE, + NULL ); + ExAcquireFastMutex( &RecMutex->Mutex ); } - - return TRUE; + RecMutex->CurrentThread = CurrentThread; + RecMutex->LockCount++; + ExReleaseFastMutex( &RecMutex->Mutex ); } VOID RecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ) { + ASSERT(RecMutex); + + ExAcquireFastMutex( &RecMutex->Mutex ); ASSERT(RecMutex->LockCount > 0); RecMutex->LockCount--; if( !RecMutex->LockCount ) { - RecMutex->CurrentThread = NULL; - if( RecMutex->OldIrql <= APC_LEVEL ) { - ExAcquireFastMutex( &RecMutex->Mutex ); - RecMutex->Locked = FALSE; - RecMutex->Writer = FALSE; - ExReleaseFastMutex( &RecMutex->Mutex ); - } else { - RecMutex->Locked = FALSE; - RecMutex->Writer = FALSE; - KeReleaseSpinLockFromDpcLevel( &RecMutex->SpinLock ); - } - KePulseEvent( &RecMutex->StateLockedEvent, IO_NETWORK_INCREMENT, FALSE ); } + + ExReleaseFastMutex( &RecMutex->Mutex ); } Modified: trunk/reactos/drivers/network/tcpip/recmutex/recmutex.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/recm…
============================================================================== --- trunk/reactos/drivers/network/tcpip/recmutex/recmutex.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/recmutex/recmutex.h [iso-8859-1] Wed Aug 5 01:51:39 2009 @@ -10,20 +10,12 @@ PVOID CurrentThread; /* Notification event which signals that another thread can take over */ KEVENT StateLockedEvent; - /* IRQL from spin lock */ - KIRQL OldIrql; - /* Is Locked */ - BOOLEAN Locked; - /* Is reader or writer phase */ - BOOLEAN Writer; - /* Spin lock needed for */ - KSPIN_LOCK SpinLock; } RECURSIVE_MUTEX, *PRECURSIVE_MUTEX; extern VOID RecursiveMutexInit( PRECURSIVE_MUTEX RecMutex ); -extern SIZE_T RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToRead ); +extern VOID RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex ); extern VOID RecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ); -#define ASSERT_LOCKED(x) ASSERT((x)->Locked) +#define ASSERT_LOCKED(x) #endif/*_ROSRTL_RECMUTEX_H*/ Modified: trunk/reactos/drivers/network/tcpip/tcpip/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/lock.c [iso-8859-1] Wed Aug 5 01:51:39 2009 @@ -48,11 +48,9 @@ RecursiveMutexInit( RecMutex ); } -UINT TcpipRecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) { - UINT Ret; +VOID TcpipRecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) { //TI_DbgPrint(DEBUG_LOCK,("Locking\n")); - Ret = RecursiveMutexEnter( RecMutex, ToWrite ); - return Ret; + RecursiveMutexEnter( RecMutex ); } VOID TcpipRecursiveMutexLeave( PRECURSIVE_MUTEX RecMutex ) {
15 years, 4 months
1
0
0
0
[cgutman] 42399: - Add missing locking to DeallocatePort
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Aug 5 01:35:50 2009 New Revision: 42399 URL:
http://svn.reactos.org/svn/reactos?rev=42399&view=rev
Log: - Add missing locking to DeallocatePort Modified: trunk/reactos/lib/drivers/ip/network/ports.c Modified: trunk/reactos/lib/drivers/ip/network/ports.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/network/por…
============================================================================== --- trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/ip/network/ports.c [iso-8859-1] Wed Aug 5 01:35:50 2009 @@ -35,7 +35,10 @@ Port = htons(Port); ASSERT(Port >= PortSet->StartingPort); ASSERT(Port < PortSet->StartingPort + PortSet->PortsToOversee); + + ExAcquireFastMutex( &PortSet->Mutex ); RtlClearBits( &PortSet->ProtoBitmap, Port - PortSet->StartingPort, 1 ); + ExReleaseFastMutex( &PortSet->Mutex ); } BOOLEAN AllocatePort( PPORT_SET PortSet, ULONG Port ) {
15 years, 4 months
1
0
0
0
[gschneider] 42398: Fix formatting
by gschneider@svn.reactos.org
Author: gschneider Date: Wed Aug 5 01:32:38 2009 New Revision: 42398 URL:
http://svn.reactos.org/svn/reactos?rev=42398&view=rev
Log: Fix formatting Modified: trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c Modified: trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/lnx_spri…
============================================================================== --- trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdio/lnx_sprintf.c [iso-8859-1] Wed Aug 5 01:32:38 2009 @@ -20,512 +20,511 @@ #include <wchar.h> #include <tchar.h> -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed */ -#define PLUS 4 /* show plus */ -#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -#define SPECIAL 32 /* 0x */ -#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -#define ZEROTRUNC 128 /* truncate zero's */ -#define REMOVEHEX 256 /* remove 0x from BASE 16 */ +#define ZEROPAD 1 /* pad with zero */ +#define SIGN 2 /* unsigned/signed */ +#define PLUS 4 /* show plus */ +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ +#define ZEROTRUNC 128 /* truncate zero's */ +#define REMOVEHEX 256 /* remove 0x from BASE 16 */ static __inline int do_div(long long *n, int base) { - int a; - a = ((unsigned long long) *n) % (unsigned) base; - *n = ((unsigned long long) *n) / (unsigned) base; - return a; + int a; + a = ((unsigned long long) *n) % (unsigned) base; + *n = ((unsigned long long) *n) / (unsigned) base; + return a; } static int skip_atoi(const char **s) { - int i=0; - - while (isdigit(**s)) - i = i*10 + *((*s)++) - '0'; - return i; + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + return i; } static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type) { - char c,sign,tmp[66]; - const char *digits; - const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; - const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - int i; - - digits = (type & LARGE) ? large_digits : small_digits; - if (type & LEFT) - type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } - } - - if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { - if (base == 16) - size -= 2; - - } - i = 0; - if ((num == 0) && (precision !=0)) - tmp[i++] = '0'; - else while (num != 0) - tmp[i++] = digits[do_div(&num,base)]; - if (i > precision) - precision = i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) { - while(size-->0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - } - if (sign) { - if (buf <= end) - *buf = sign; - ++buf; - } - - if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { - if (base==16) { - if (buf <= end) - *buf = '0'; - ++buf; - if (buf <= end) - *buf = digits[33]; - ++buf; - } - } - - if (!(type & LEFT)) { - while (size-- > 0) { - if (buf <= end) - *buf = c; - ++buf; - } - } - while (i < precision--) { - if (buf <= end) - *buf = '0'; - ++buf; - } - while (i-- > 0) { - if (buf <= end) - *buf = tmp[i]; - ++buf; - } - while (size-- > 0) { - if (buf <= end) - *buf = ' '; - ++buf; - } - - return buf; + char c,sign,tmp[66]; + const char *digits; + const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; + const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + + digits = (type & LARGE) ? large_digits : small_digits; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return 0; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { + if (base == 16) + size -= 2; + } + i = 0; + if ((num == 0) && (precision !=0)) + tmp[i++] = '0'; + else while (num != 0) + tmp[i++] = digits[do_div(&num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) { + while(size-->0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) { + if (buf <= end) + *buf = sign; + ++buf; + } + + if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { + if (base==16) { + if (buf <= end) + *buf = '0'; + ++buf; + if (buf <= end) + *buf = digits[33]; + ++buf; + } + } + + if (!(type & LEFT)) { + while (size-- > 0) { + if (buf <= end) + *buf = c; + ++buf; + } + } + while (i < precision--) { + if (buf <= end) + *buf = '0'; + ++buf; + } + while (i-- > 0) { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) { + if (buf <= end) + *buf = ' '; + ++buf; + } + + return buf; } typedef struct { - unsigned int mantissal:32; - unsigned int mantissah:20; - unsigned int exponent:11; - unsigned int sign:1; + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; } ieee_double_t; static __inline void fracrnd(double *number, int prec) { - /* Shifts fractional digits to decimal places and compares to round table */ - /* Only suitable to determine the exponent with more precision, not for normal rounding */ - /* Incoming numbers are expected to range from approx -10.0 to 10.0 */ - int lpos = 1, ubound, sign = 1; - long decimal = abs((long)*number); - double frac = (*number - decimal) * 10; - long rt[] = - { - 0, - 9, - 99, - 999, - 9999, - 99999, - 999999, - 9999999, - 99999999, - 999999999 - }; - - if (*number < 0) - { - sign = -1; - } - ubound = min(prec, sizeof(rt)/sizeof(*rt) - 1); - while ((long)frac % 10 != 0 && lpos < ubound) - { - frac *= 10; - lpos++; - } - if (abs((long)frac) == rt[lpos]) - { - *number = sign * (decimal + 1); - } + /* Shifts fractional digits to decimal places and compares to round table */ + /* Only suitable to determine the exponent with more precision, not for normal rounding */ + /* Incoming numbers are expected to range from approx -10.0 to 10.0 */ + int lpos = 1, ubound, sign = 1; + long decimal = abs((long)*number); + double frac = (*number - decimal) * 10; + long rt[] = + { + 0, + 9, + 99, + 999, + 9999, + 99999, + 999999, + 9999999, + 99999999, + 999999999 + }; + + if (*number < 0) + { + sign = -1; + } + ubound = min(prec, sizeof(rt)/sizeof(*rt) - 1); + while ((long)frac % 10 != 0 && lpos < ubound) + { + frac *= 10; + lpos++; + } + if (abs((long)frac) == rt[lpos]) + { + *number = sign * (decimal + 1); + } } static char * numberf(char * buf, char * end, double num, char exp_sign, int size, int precision, int type) { - double exponent = 0.0; - double e = 0.0; - long ie; - - int i = 0; - int j = 0; - int ro = 0; - int isize; - - double num2, frac, intr; - double p; - - char c, sign, digits[66]; - char *tmp; - - union - { - double* __n; - ieee_double_t* n; - } n; - - n.__n = # - - if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) - { - ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff); - if (num != 0.0) - { - exponent = ie/3.321928; - } - } - - if ( exp_sign == 'g' || exp_sign == 'G' ) - { - type |= ZEROTRUNC; - if ( exponent < -4 || fabs(exponent) >= precision ) - exp_sign -= 2; // g -> e and G -> E - else - exp_sign = 'f'; - if (type & SPECIAL) precision--; - } - - if ( exp_sign == 'e' || exp_sign == 'E' ) - { - if (num != 0.0) - { - /* Find a suitable exponent */ - frac = modf(exponent, &e); - num2 = num/pow(10.0L, (long double)e); - /* Check if rounding is possible */ - fracrnd(&num2, precision); - if (num2 < 1.0 && num2 > -1.0) - { - e--; - } - else if (num2 <= -10.0 || num2 >= 10.0) - { - e++; - } - } - - /* size-5 because "e+abc" is going to follow */ - buf = numberf(buf, end, num/pow(10.0L,(long double)e), 'f', size-5, precision, type); - isize = 4; - while(*(buf-1) == ' ') - { - isize++; - --buf; - } - - if (buf <= end) - *buf = exp_sign; - ++buf; - size--; - - ie = (long)e; - type = LEFT | SIGN | PLUS; - buf = number(buf, end, ie, 10, isize, 3, type); - return buf; - } - - if ( exp_sign == 'f' ) - { - if (type & LEFT) - type &= ~ZEROPAD; - - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - - if (num < 0) - { - sign = '-'; - num = fabs(num); - size--; - } - else if (type & PLUS) - { - sign = '+'; - size--; - } - else if (type & SPACE) - { - sign = ' '; - size--; - } - - frac = modf(num,&intr); - - // # flags forces a . and prevents truncation of trailing zero's - if ( precision > 0 ) - { - i = precision-1; - while ( i >= 0 ) - { - frac*=10.0L; - frac = modf(frac, &p); - digits[i] = (int)p + '0'; - i--; - } - - i = precision; - size -= precision; - } - - if ( precision >= 1 || type & SPECIAL) - { - digits[i++] = '.'; - size--; - } - - ro = 0; - if ( frac > 0.5 ) - { - ro = 1; - } - - if ( intr == 0.0 ) - { - digits[i++] = '0'; - size--; - } - else - { - while ( intr > 0.0 ) - { - p = intr; - intr/=10.0L; - modf(intr, &intr); - - p -= 10.0*intr; - - digits[i++] = (int)p + '0'; - size--; - } - } - - j = 0; - while ( j < i && ro == 1) - { - if ( digits[j] >= '0' && digits[j] <= '8' ) - { - digits[j]++; - ro = 0; - } - else if ( digits[j] == '9' ) - { - digits[j] = '0'; - } - j++; - } - if ( ro == 1 ) - digits[i++] = '1'; - - digits[i] = 0; - - if (!(type & (ZEROPAD+LEFT))) - { - while(size-->0) - { - if (buf <= end) - *buf = ' '; - ++buf; - } - } - if (sign) - { - if (buf <= end) - *buf = sign; - ++buf; - } - - if (!(type & (ZEROPAD+LEFT))) - { - while(size-->0) - { - if (buf <= end) - *buf = ' '; - ++buf; - } - } - - if (!(type & LEFT)) - { - while (size-- > 0) - { - if (buf <= end) - *buf = c; - ++buf; - } - } - - tmp = digits; - if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) - { - j = 0; - while ( j < i && ( *tmp == '0' || *tmp == '.' )) - { - tmp++; - i--; - } - } - while (i-- > 0) - { - if (buf <= end) - *buf = tmp[i]; - ++buf; - } - while (size-- > 0) - { - if (buf <= end) - *buf = ' '; - buf++; - } - } - return buf; + double exponent = 0.0; + double e = 0.0; + long ie; + + int i = 0; + int j = 0; + int ro = 0; + int isize; + + double num2, frac, intr; + double p; + + char c, sign, digits[66]; + char *tmp; + + union + { + double* __n; + ieee_double_t* n; + } n; + + n.__n = # + + if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) + { + ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff); + if (num != 0.0) + { + exponent = ie/3.321928; + } + } + + if ( exp_sign == 'g' || exp_sign == 'G' ) + { + type |= ZEROTRUNC; + if ( exponent < -4 || fabs(exponent) >= precision ) + exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; + if (type & SPECIAL) precision--; + } + + if ( exp_sign == 'e' || exp_sign == 'E' ) + { + if (num != 0.0) + { + /* Find a suitable exponent */ + frac = modf(exponent, &e); + num2 = num/pow(10.0L, (long double)e); + /* Check if rounding is possible */ + fracrnd(&num2, precision); + if (num2 < 1.0 && num2 > -1.0) + { + e--; + } + else if (num2 <= -10.0 || num2 >= 10.0) + { + e++; + } + } + + /* size-5 because "e+abc" is going to follow */ + buf = numberf(buf, end, num/pow(10.0L,(long double)e), 'f', size-5, precision, type); + isize = 4; + while(*(buf-1) == ' ') + { + isize++; + --buf; + } + + if (buf <= end) + *buf = exp_sign; + ++buf; + size--; + + ie = (long)e; + type = LEFT | SIGN | PLUS; + buf = number(buf, end, ie, 10, isize, 3, type); + return buf; + } + + if ( exp_sign == 'f' ) + { + if (type & LEFT) + type &= ~ZEROPAD; + + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + + if (num < 0) + { + sign = '-'; + num = fabs(num); + size--; + } + else if (type & PLUS) + { + sign = '+'; + size--; + } + else if (type & SPACE) + { + sign = ' '; + size--; + } + + frac = modf(num,&intr); + + // # flags forces a . and prevents truncation of trailing zero's + if ( precision > 0 ) + { + i = precision-1; + while ( i >= 0 ) + { + frac*=10.0L; + frac = modf(frac, &p); + digits[i] = (int)p + '0'; + i--; + } + + i = precision; + size -= precision; + } + + if ( precision >= 1 || type & SPECIAL) + { + digits[i++] = '.'; + size--; + } + + ro = 0; + if ( frac > 0.5 ) + { + ro = 1; + } + + if ( intr == 0.0 ) + { + digits[i++] = '0'; + size--; + } + else + { + while ( intr > 0.0 ) + { + p = intr; + intr/=10.0L; + modf(intr, &intr); + + p -= 10.0*intr; + + digits[i++] = (int)p + '0'; + size--; + } + } + + j = 0; + while ( j < i && ro == 1) + { + if ( digits[j] >= '0' && digits[j] <= '8' ) + { + digits[j]++; + ro = 0; + } + else if ( digits[j] == '9' ) + { + digits[j] = '0'; + } + j++; + } + if ( ro == 1 ) + digits[i++] = '1'; + + digits[i] = 0; + + if (!(type & (ZEROPAD+LEFT))) + { + while(size-->0) + { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + if (sign) + { + if (buf <= end) + *buf = sign; + ++buf; + } + + if (!(type & (ZEROPAD+LEFT))) + { + while(size-->0) + { + if (buf <= end) + *buf = ' '; + ++buf; + } + } + + if (!(type & LEFT)) + { + while (size-- > 0) + { + if (buf <= end) + *buf = c; + ++buf; + } + } + + tmp = digits; + if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) + { + j = 0; + while ( j < i && ( *tmp == '0' || *tmp == '.' )) + { + tmp++; + i--; + } + } + while (i-- > 0) + { + if (buf <= end) + *buf = tmp[i]; + ++buf; + } + while (size-- > 0) + { + if (buf <= end) + *buf = ' '; + buf++; + } + } + return buf; } static char* string(char* buf, char* end, const char* s, int len, int field_width, int precision, int flags) { - int i; - char c; - - c = (flags & ZEROPAD) ? '0' : ' '; - - if (s == NULL) - { - s = "<NULL>"; - len = 6; - } - else - { - if (len == -1) - { - len = 0; - while ((unsigned int)len < (unsigned int)precision && s[len]) - len++; - } - else - { - if ((unsigned int)len > (unsigned int)precision) - len = precision; - } - } - if (!(flags & LEFT)) - while (len < field_width--) - { - if (buf <= end) - *buf = c; - ++buf; - } - for (i = 0; i < len; ++i) - { - if (buf <= end) - *buf = *s++; - ++buf; - } - while (len < field_width--) - { - if (buf <= end) - *buf = ' '; - ++buf; - } - return buf; + int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + + if (s == NULL) + { + s = "<NULL>"; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && s[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + if (buf <= end) + *buf = c; + ++buf; + } + for (i = 0; i < len; ++i) + { + if (buf <= end) + *buf = *s++; + ++buf; + } + while (len < field_width--) + { + if (buf <= end) + *buf = ' '; + ++buf; + } + return buf; } static char* stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int precision, int flags) { - int i; - char c; - - c = (flags & ZEROPAD) ? '0' : ' '; - - if (sw == NULL) - { - sw = L"<NULL>"; - len = 6; - } - else - { - if (len == -1) - { - len = 0; - while ((unsigned int)len < (unsigned int)precision && sw[len]) - len++; - } - else - { - if ((unsigned int)len > (unsigned int)precision) - len = precision; - } - } - if (!(flags & LEFT)) - while (len < field_width--) - { - if (buf <= end) - *buf = c; - buf++; - } - for (i = 0; i < len; ++i) - { - if (buf <= end) - *buf = (unsigned char)(*sw++); - buf++; - } - while (len < field_width--) - { - if (buf <= end) - *buf = ' '; - buf++; - } - return buf; + int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + + if (sw == NULL) + { + sw = L"<NULL>"; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && sw[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + if (buf <= end) + *buf = c; + buf++; + } + for (i = 0; i < len; ++i) + { + if (buf <= end) + *buf = (unsigned char)(*sw++); + buf++; + } + while (len < field_width--) + { + if (buf <= end) + *buf = ' '; + buf++; + } + return buf; } /* @@ -533,313 +532,311 @@ */ int __cdecl lnx_vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) { - int len; - unsigned long long num; - double _double; - - int base; - char *str, *end; - const char *s; - const wchar_t *sw; - - int flags; /* flags to number() */ - - int field_width; /* width of output field */ - int precision; /* min. # of digits for integers; max - number of chars for from string */ - int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */ - - str = buf; - end = buf + cnt - 1; - if (end < buf - 1) { - end = ((char *) -1); - cnt = end - buf + 1; - } - - for ( ; *fmt ; ++fmt) { - if (*fmt != '%') { - if (str <= end) - *str = *fmt; - ++str; - continue; - } - - /* process flags */ - flags = 0; - repeat: - ++fmt; /* this also skips first '%' */ - switch (*fmt) { - case '-': flags |= LEFT; goto repeat; - case '+': flags |= PLUS; goto repeat; - case ' ': flags |= SPACE; goto repeat; - case '#': flags |= SPECIAL; goto repeat; - case '0': flags |= ZEROPAD; goto repeat; - } - - /* get field width */ - field_width = -1; - if (isdigit(*fmt)) - field_width = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - field_width = va_arg(args, int); - if (field_width < 0) { - field_width = -field_width; - flags |= LEFT; - } - } - - /* get the precision */ - precision = -1; - if (*fmt == '.') { - ++fmt; - if (isdigit(*fmt)) - precision = skip_atoi(&fmt); - else if (*fmt == '*') { - ++fmt; - /* it's the next argument */ - precision = va_arg(args, int); - } - if (precision < 0) - precision = 0; - } - - /* get the conversion qualifier */ - qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') { - qualifier = *fmt; - ++fmt; - } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') { - qualifier = *fmt; - fmt += 3; - } else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2) == '2') { - qualifier = 'l'; - fmt += 3; - } else if (*fmt == 'F' && *(fmt+1) == 'p') { - fmt += 1; - flags |= REMOVEHEX; + int len; + unsigned long long num; + double _double; + + int base; + char *str, *end; + const char *s; + const wchar_t *sw; + + int flags; /* flags to number() */ + + int field_width; /* width of output field */ + int precision; /* min. # of digits for integers; max + number of chars for from string */ + int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */ + + str = buf; + end = buf + cnt - 1; + if (end < buf - 1) { + end = ((char *) -1); + cnt = end - buf + 1; + } + + for ( ; *fmt ; ++fmt) { + if (*fmt != '%') { + if (str <= end) + *str = *fmt; + ++str; + continue; + } + + /* process flags */ + flags = 0; +repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = -1; + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') { + qualifier = *fmt; + ++fmt; + } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') { + qualifier = *fmt; + fmt += 3; + } else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2) == '2') { + qualifier = 'l'; + fmt += 3; + } else if (*fmt == 'F' && *(fmt+1) == 'p') { + fmt += 1; + flags |= REMOVEHEX; + } + + /* default base */ + base = 10; + + switch (*fmt) { + case 'c': /* finished */ + if (qualifier == 'l' || qualifier == 'w') { + wchar_t sw1[2]; + /* print unicode string */ + sw1[0] = (wchar_t) va_arg(args, int); + sw1[1] = 0; + str = stringw(str, end, (wchar_t *)&sw1, -1, field_width, precision, flags); + } else { + char s1[2]; + /* print ascii string */ + s1[0] = ( unsigned char) va_arg(args, int); + s1[1] = 0; + str = string(str, end, (char *)&s1, -1, field_width, precision, flags); } - - /* default base */ - base = 10; - - switch (*fmt) { - case 'c': /* finished */ - if (qualifier == 'l' || qualifier == 'w') { - wchar_t sw1[2]; - /* print unicode string */ - sw1[0] = (wchar_t) va_arg(args, int); - sw1[1] = 0; - str = stringw(str, end, (wchar_t *)&sw1, -1, field_width, precision, flags); - } else { - char s1[2]; - /* print ascii string */ - s1[0] = ( unsigned char) va_arg(args, int); - s1[1] = 0; - str = string(str, end, (char *)&s1, -1, field_width, precision, flags); - } - continue; - - case 'C': /* finished */ - if (!(flags & LEFT)) - while (--field_width > 0) { - if (str <= end) - *str = ' '; - ++str; - } - if (qualifier == 'h') { - if (str <= end) - *str = (unsigned char) va_arg(args, int); - ++str; - } else { - if (str <= end) - *str = (unsigned char)(wchar_t) va_arg(args, int); - ++str; - } - while (--field_width > 0) { - if (str <= end) - *str = ' '; - ++str; - } - continue; - - case 's': /* finished */ - if (qualifier == 'l' || qualifier == 'w') { - /* print unicode string */ - sw = va_arg(args, wchar_t *); - str = stringw(str, end, sw, -1, field_width, precision, flags); - } else { - /* print ascii string */ - s = va_arg(args, char *); - str = string(str, end, s, -1, field_width, precision, flags); - } - continue; - - case 'S': - if (qualifier == 'h') { - /* print ascii string */ - s = va_arg(args, char *); - str = string(str, end, s, -1, field_width, precision, flags); - } else { - /* print unicode string */ - sw = va_arg(args, wchar_t *); - str = stringw(str, end, sw, -1, field_width, precision, flags); - } - continue; - - case 'Z': - if (qualifier == 'w') { - /* print counted unicode string */ - PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING); - if ((pus == NULL) || (pus->Buffer == NULL)) { - sw = NULL; - len = -1; - } else { - sw = pus->Buffer; - len = pus->Length / sizeof(WCHAR); - } - str = stringw(str, end, sw, len, field_width, precision, flags); - } else { - /* print counted ascii string */ - PANSI_STRING pus = va_arg(args, PANSI_STRING); - if ((pus == NULL) || (pus->Buffer == NULL)) { - s = NULL; - len = -1; - } else { - s = pus->Buffer; - len = pus->Length; - } - str = string(str, end, s, len, field_width, precision, flags); - } - continue; - - case 'p': - if ((flags & LARGE) == 0) - flags |= LARGE; - - if (field_width == -1) { - field_width = 2 * sizeof(void *); - flags |= ZEROPAD; - } - str = number(str, end, - (uintptr_t) va_arg(args, void *), 16, - field_width, precision, flags); - continue; - - case 'n': - /* FIXME: What does C99 say about the overflow case here? */ - if (qualifier == 'l') { - long * ip = va_arg(args, long *); - *ip = (str - buf); - } else { - int * ip = va_arg(args, int *); - *ip = (str - buf); - } - continue; - - /* float number formats - set up the flags and "break" */ - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - _double = (double)va_arg(args, double); - if ( _isnan(_double) ) { - s = "Nan"; - len = 3; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else if ( _isinf(_double) < 0 ) { - s = "-Inf"; - len = 4; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else if ( _isinf(_double) > 0 ) { - s = "+Inf"; - len = 4; - while ( len > 0 ) { - if (str <= end) - *str = *s++; - ++str; - len --; - } - } else { - if ( precision == -1 ) - precision = 6; - str = numberf(str, end, _double, *fmt, field_width, precision, flags); - } - + continue; + + case 'C': /* finished */ + if (!(flags & LEFT)) + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } + if (qualifier == 'h') { + if (str <= end) + *str = (unsigned char) va_arg(args, int); + ++str; + } else { + if (str <= end) + *str = (unsigned char)(wchar_t) va_arg(args, int); + ++str; + } + while (--field_width > 0) { + if (str <= end) + *str = ' '; + ++str; + } continue; - - /* integer number formats - set up the flags and "break" */ - case 'o': - base = 8; - break; - - case 'b': - base = 2; - break; - - case 'X': - flags |= LARGE; - case 'x': - base = 16; - break; - - case 'd': - case 'i': - flags |= SIGN; - case 'u': - break; - - default: - if (*fmt) { - if (str <= end) - *str = *fmt; - ++str; - } else - --fmt; - continue; - } - - if (qualifier == 'I') - num = va_arg(args, unsigned long long); - else if (qualifier == 'l') { - if (flags & SIGN) - num = va_arg(args, long); - else - num = va_arg(args, unsigned long); - } - else if (qualifier == 'h') { - if (flags & SIGN) - num = va_arg(args, int); - else - num = va_arg(args, unsigned int); - } - else { - if (flags & SIGN) - num = va_arg(args, int); - else - num = va_arg(args, unsigned int); - } - str = number(str, end, num, base, field_width, precision, flags); - } - if (str <= end) - *str = '\0'; - else if (cnt > 0) - /* don't write out a null byte if the buf size is zero */ - *end = '\0'; - return str-buf; + case 's': /* finished */ + if (qualifier == 'l' || qualifier == 'w') { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + str = stringw(str, end, sw, -1, field_width, precision, flags); + } else { + /* print ascii string */ + s = va_arg(args, char *); + str = string(str, end, s, -1, field_width, precision, flags); + } + continue; + + case 'S': + if (qualifier == 'h') { + /* print ascii string */ + s = va_arg(args, char *); + str = string(str, end, s, -1, field_width, precision, flags); + } else { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + str = stringw(str, end, sw, -1, field_width, precision, flags); + } + continue; + + case 'Z': + if (qualifier == 'w') { + /* print counted unicode string */ + PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING); + if ((pus == NULL) || (pus->Buffer == NULL)) { + sw = NULL; + len = -1; + } else { + sw = pus->Buffer; + len = pus->Length / sizeof(WCHAR); + } + str = stringw(str, end, sw, len, field_width, precision, flags); + } else { + /* print counted ascii string */ + PANSI_STRING pus = va_arg(args, PANSI_STRING); + if ((pus == NULL) || (pus->Buffer == NULL)) { + s = NULL; + len = -1; + } else { + s = pus->Buffer; + len = pus->Length; + } + str = string(str, end, s, len, field_width, precision, flags); + } + continue; + + case 'p': + if ((flags & LARGE) == 0) + flags |= LARGE; + + if (field_width == -1) { + field_width = 2 * sizeof(void *); + flags |= ZEROPAD; + } + str = number(str, end, + (uintptr_t) va_arg(args, void *), 16, + field_width, precision, flags); + continue; + + case 'n': + /* FIXME: What does C99 say about the overflow case here? */ + if (qualifier == 'l') { + long * ip = va_arg(args, long *); + *ip = (str - buf); + } else { + int * ip = va_arg(args, int *); + *ip = (str - buf); + } + continue; + + /* float number formats - set up the flags and "break" */ + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + _double = (double)va_arg(args, double); + if ( _isnan(_double) ) { + s = "Nan"; + len = 3; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else if ( _isinf(_double) < 0 ) { + s = "-Inf"; + len = 4; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else if ( _isinf(_double) > 0 ) { + s = "+Inf"; + len = 4; + while ( len > 0 ) { + if (str <= end) + *str = *s++; + ++str; + len --; + } + } else { + if ( precision == -1 ) + precision = 6; + str = numberf(str, end, _double, *fmt, field_width, precision, flags); + } + continue; + + /* integer number formats - set up the flags and "break" */ + case 'o': + base = 8; + break; + + case 'b': + base = 2; + break; + + case 'X': + flags |= LARGE; + case 'x': + base = 16; + break; + + case 'd': + case 'i': + flags |= SIGN; + case 'u': + break; + + default: + if (*fmt) { + if (str <= end) + *str = *fmt; + ++str; + } else + --fmt; + continue; + } + + if (qualifier == 'I') + num = va_arg(args, unsigned long long); + else if (qualifier == 'l') { + if (flags & SIGN) + num = va_arg(args, long); + else + num = va_arg(args, unsigned long); + } + else if (qualifier == 'h') { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + else { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + str = number(str, end, num, base, field_width, precision, flags); + } + if (str <= end) + *str = '\0'; + else if (cnt > 0) + /* don't write out a null byte if the buf size is zero */ + *end = '\0'; + return str-buf; } @@ -848,13 +845,13 @@ */ int lnx_sprintf(char * buf, const char *fmt, ...) { - va_list args; - int i; - - va_start(args, fmt); - i=lnx_vsnprintf(buf,MAXLONG,fmt,args); - va_end(args); - return i; + va_list args; + int i; + + va_start(args, fmt); + i=lnx_vsnprintf(buf,MAXLONG,fmt,args); + va_end(args); + return i; } #if 0 @@ -863,13 +860,13 @@ */ int _snprintf(char * buf, size_t cnt, const char *fmt, ...) { - va_list args; - int i; - - va_start(args, fmt); - i=_vsnprintf(buf,cnt,fmt,args); - va_end(args); - return i; + va_list args; + int i; + + va_start(args, fmt); + i=_vsnprintf(buf,cnt,fmt,args); + va_end(args); + return i; } @@ -878,7 +875,7 @@ */ int __cdecl vsprintf(char *buf, const char *fmt, va_list args) { - return _vsnprintf(buf,MAXLONG,fmt,args); + return _vsnprintf(buf,MAXLONG,fmt,args); } #endif /* EOF */
15 years, 4 months
1
0
0
0
[janderwald] 42397: - Implement KsMergeAutomationTables
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Aug 5 01:30:39 2009 New Revision: 42397 URL:
http://svn.reactos.org/svn/reactos?rev=42397&view=rev
Log: - Implement KsMergeAutomationTables Modified: trunk/reactos/drivers/ksfilter/ks/api.c Modified: trunk/reactos/drivers/ksfilter/ks/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Wed Aug 5 01:30:39 2009 @@ -1936,8 +1936,299 @@ return STATUS_UNSUCCESSFUL; } -/* - @unimplemented +ULONG +KspCountMethodSets( + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + return AutomationTableB->MethodSetsCount; + + if (!AutomationTableB) + return AutomationTableA->MethodSetsCount; + + /* sanity check */ + ASSERT(AutomationTableA->MethodItemSize == AutomationTableB->MethodItemSize); + + /* now iterate all property sets and compare their guids */ + Count = AutomationTableA->MethodSetsCount; + + for(Index = 0; Index < AutomationTableB->MethodSetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->MethodSetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->MethodSets[Index].Set, AutomationTableA->MethodSets[SubIndex].Set)) + { + /* same property set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + Count++; + } + + return Count; +} + +ULONG +KspCountEventSets( + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + return AutomationTableB->EventSetsCount; + + if (!AutomationTableB) + return AutomationTableA->EventSetsCount; + + /* sanity check */ + ASSERT(AutomationTableA->EventItemSize == AutomationTableB->EventItemSize); + + /* now iterate all Event sets and compare their guids */ + Count = AutomationTableA->EventSetsCount; + + for(Index = 0; Index < AutomationTableB->EventSetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->EventSetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->EventSets[Index].Set, AutomationTableA->EventSets[SubIndex].Set)) + { + /* same Event set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + Count++; + } + + return Count; +} + + +ULONG +KspCountPropertySets( + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + return AutomationTableB->PropertySetsCount; + + if (!AutomationTableB) + return AutomationTableA->PropertySetsCount; + + /* sanity check */ + ASSERT(AutomationTableA->PropertyItemSize == AutomationTableB->PropertyItemSize); + + /* now iterate all property sets and compare their guids */ + Count = AutomationTableA->PropertySetsCount; + + for(Index = 0; Index < AutomationTableB->PropertySetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->PropertySetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->PropertySets[Index].Set, AutomationTableA->PropertySets[SubIndex].Set)) + { + /* same property set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + Count++; + } + + return Count; +} + +NTSTATUS +KspCopyMethodSets( + OUT PKSAUTOMATION_TABLE Table, + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + { + /* copy of property set */ + RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableB->MethodSets, Table->MethodItemSize * AutomationTableB->MethodSetsCount); + return STATUS_SUCCESS; + } + else if (!AutomationTableB) + { + /* copy of property set */ + RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, Table->MethodItemSize * AutomationTableA->MethodSetsCount); + return STATUS_SUCCESS; + } + + /* first copy all property items from dominant table */ + RtlMoveMemory((PVOID)Table->MethodSets, AutomationTableA->MethodSets, Table->MethodItemSize * AutomationTableA->MethodSetsCount); + /* set counter */ + Count = AutomationTableA->MethodSetsCount; + + /* now copy entries which arent available in the dominant table */ + for(Index = 0; Index < AutomationTableB->MethodSetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->MethodSetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->MethodSets[Index].Set, AutomationTableA->MethodSets[SubIndex].Set)) + { + /* same property set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + { + /* copy new property item set */ + RtlMoveMemory((PVOID)&Table->MethodSets[Count], &AutomationTableB->MethodSets[Index], Table->MethodItemSize); + Count++; + } + } + + return STATUS_SUCCESS; +} + + +NTSTATUS +KspCopyPropertySets( + OUT PKSAUTOMATION_TABLE Table, + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + { + /* copy of property set */ + RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableB->PropertySets, Table->PropertyItemSize * AutomationTableB->PropertySetsCount); + return STATUS_SUCCESS; + } + else if (!AutomationTableB) + { + /* copy of property set */ + RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, Table->PropertyItemSize * AutomationTableA->PropertySetsCount); + return STATUS_SUCCESS; + } + + /* first copy all property items from dominant table */ + RtlMoveMemory((PVOID)Table->PropertySets, AutomationTableA->PropertySets, Table->PropertyItemSize * AutomationTableA->PropertySetsCount); + /* set counter */ + Count = AutomationTableA->PropertySetsCount; + + /* now copy entries which arent available in the dominant table */ + for(Index = 0; Index < AutomationTableB->PropertySetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->PropertySetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->PropertySets[Index].Set, AutomationTableA->PropertySets[SubIndex].Set)) + { + /* same property set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + { + /* copy new property item set */ + RtlMoveMemory((PVOID)&Table->PropertySets[Count], &AutomationTableB->PropertySets[Index], Table->PropertyItemSize); + Count++; + } + } + + return STATUS_SUCCESS; +} + +NTSTATUS +KspCopyEventSets( + OUT PKSAUTOMATION_TABLE Table, + IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, + IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL) +{ + ULONG Index, SubIndex, Count; + BOOL bFound; + + if (!AutomationTableA) + { + /* copy of Event set */ + RtlMoveMemory((PVOID)Table->EventSets, AutomationTableB->EventSets, Table->EventItemSize * AutomationTableB->EventSetsCount); + return STATUS_SUCCESS; + } + else if (!AutomationTableB) + { + /* copy of Event set */ + RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, Table->EventItemSize * AutomationTableA->EventSetsCount); + return STATUS_SUCCESS; + } + + /* first copy all Event items from dominant table */ + RtlMoveMemory((PVOID)Table->EventSets, AutomationTableA->EventSets, Table->EventItemSize * AutomationTableA->EventSetsCount); + /* set counter */ + Count = AutomationTableA->EventSetsCount; + + /* now copy entries which arent available in the dominant table */ + for(Index = 0; Index < AutomationTableB->EventSetsCount; Index++) + { + /* set found to false */ + bFound = FALSE; + + for(SubIndex = 0; SubIndex < AutomationTableA->EventSetsCount; SubIndex++) + { + if (IsEqualGUIDAligned(AutomationTableB->EventSets[Index].Set, AutomationTableA->EventSets[SubIndex].Set)) + { + /* same Event set found */ + bFound = TRUE; + break; + } + } + + if (!bFound) + { + /* copy new Event item set */ + RtlMoveMemory((PVOID)&Table->EventSets[Count], &AutomationTableB->EventSets[Index], Table->EventItemSize); + Count++; + } + } + + return STATUS_SUCCESS; +} + + +/* + @implemented */ NTSTATUS NTAPI @@ -1947,8 +2238,197 @@ IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL, IN KSOBJECT_BAG Bag OPTIONAL) { - UNIMPLEMENTED - return STATUS_UNSUCCESSFUL; + PKSAUTOMATION_TABLE Table; + NTSTATUS Status = STATUS_SUCCESS; + + if (!AutomationTableA && !AutomationTableB) + { + /* nothing to merge */ + return STATUS_SUCCESS; + } + + /* allocate an automation table */ + Table = AllocateItem(NonPagedPool, sizeof(KSAUTOMATION_TABLE)); + if (!Table) + return STATUS_INSUFFICIENT_RESOURCES; + + if (Bag) + { + /* add table to object bag */ + Status = KsAddItemToObjectBag(Bag, Table, NULL); + /* check for success */ + if (!NT_SUCCESS(Status)) + { + /* free table */ + FreeItem(Table); + return Status; + } + } + + /* count property sets */ + Table->PropertySetsCount = KspCountPropertySets(AutomationTableA, AutomationTableB); + + if (Table->PropertySetsCount) + { + if (AutomationTableA) + { + /* use item size from dominant automation table */ + Table->PropertyItemSize = AutomationTableA->PropertyItemSize; + } + else + { + /* use item size from 2nd automation table */ + Table->PropertyItemSize = AutomationTableB->PropertyItemSize; + } + + /* now allocate the property sets */ + Table->PropertySets = AllocateItem(NonPagedPool, Table->PropertyItemSize * Table->PropertySetsCount); + + if (!Table->PropertySets) + { + /* not enough memory */ + goto cleanup; + } + + if (Bag) + { + /* add set to property bag */ + Status = KsAddItemToObjectBag(Bag, (PVOID)Table->PropertySets, NULL); + /* check for success */ + if (!NT_SUCCESS(Status)) + { + /* cleanup table */ + goto cleanup; + } + } + /* now copy the property sets */ + Status = KspCopyPropertySets(Table, AutomationTableA, AutomationTableB); + if(!NT_SUCCESS(Status)) + goto cleanup; + + } + + /* now count the method sets */ + Table->MethodSetsCount = KspCountMethodSets(AutomationTableA, AutomationTableB); + + if (Table->MethodSetsCount) + { + if (AutomationTableA) + { + /* use item size from dominant automation table */ + Table->MethodItemSize = AutomationTableA->MethodItemSize; + } + else + { + /* use item size from 2nd automation table */ + Table->MethodItemSize = AutomationTableB->MethodItemSize; + } + + /* now allocate the property sets */ + Table->MethodSets = AllocateItem(NonPagedPool, Table->MethodItemSize * Table->MethodSetsCount); + + if (!Table->MethodSets) + { + /* not enough memory */ + goto cleanup; + } + + if (Bag) + { + /* add set to property bag */ + Status = KsAddItemToObjectBag(Bag, (PVOID)Table->MethodSets, NULL); + /* check for success */ + if (!NT_SUCCESS(Status)) + { + /* cleanup table */ + goto cleanup; + } + } + /* now copy the property sets */ + Status = KspCopyMethodSets(Table, AutomationTableA, AutomationTableB); + if(!NT_SUCCESS(Status)) + goto cleanup; + } + + + /* now count the event sets */ + Table->EventSetsCount = KspCountEventSets(AutomationTableA, AutomationTableB); + + if (Table->EventSetsCount) + { + if (AutomationTableA) + { + /* use item size from dominant automation table */ + Table->EventItemSize = AutomationTableA->EventItemSize; + } + else + { + /* use item size from 2nd automation table */ + Table->EventItemSize = AutomationTableB->EventItemSize; + } + + /* now allocate the property sets */ + Table->EventSets = AllocateItem(NonPagedPool, Table->EventItemSize * Table->EventSetsCount); + + if (!Table->EventSets) + { + /* not enough memory */ + goto cleanup; + } + + if (Bag) + { + /* add set to property bag */ + Status = KsAddItemToObjectBag(Bag, (PVOID)Table->EventSets, NULL); + /* check for success */ + if (!NT_SUCCESS(Status)) + { + /* cleanup table */ + goto cleanup; + } + } + /* now copy the property sets */ + Status = KspCopyEventSets(Table, AutomationTableA, AutomationTableB); + if(!NT_SUCCESS(Status)) + goto cleanup; + } + + /* store result */ + *AutomationTableAB = Table; + + return Status; + + +cleanup: + + if (Table) + { + if (Table->PropertySets) + { + /* clean property sets */ + if (!Bag || !NT_SUCCESS(KsRemoveItemFromObjectBag(Bag, (PVOID)Table->PropertySets, TRUE))) + FreeItem((PVOID)Table->PropertySets); + } + + if (Table->MethodSets) + { + /* clean property sets */ + if (!Bag || !NT_SUCCESS(KsRemoveItemFromObjectBag(Bag, (PVOID)Table->MethodSets, TRUE))) + FreeItem((PVOID)Table->MethodSets); + } + + if (Table->EventSets) + { + /* clean property sets */ + if (!Bag || !NT_SUCCESS(KsRemoveItemFromObjectBag(Bag, (PVOID)Table->EventSets, TRUE))) + FreeItem((PVOID)Table->EventSets); + } + + if (!Bag || !NT_SUCCESS(KsRemoveItemFromObjectBag(Bag, Table, TRUE))) + FreeItem(Table); + } + + return STATUS_INSUFFICIENT_RESOURCES; } /*
15 years, 4 months
1
0
0
0
[janderwald] 42396: - Add KsRemoveItemFromObjectBag prototype
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Aug 5 01:30:09 2009 New Revision: 42396 URL:
http://svn.reactos.org/svn/reactos?rev=42396&view=rev
Log: - Add KsRemoveItemFromObjectBag prototype Modified: trunk/reactos/include/psdk/ks.h Modified: trunk/reactos/include/psdk/ks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ks.h?rev=4239…
============================================================================== --- trunk/reactos/include/psdk/ks.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ks.h [iso-8859-1] Wed Aug 5 01:30:09 2009 @@ -3642,6 +3642,14 @@ IN PFNKSFREE Free OPTIONAL); KSDDKAPI +ULONG +NTAPI +KsRemoveItemFromObjectBag( + IN KSOBJECT_BAG ObjectBag, + IN PVOID Item, + IN BOOLEAN Free); + +KSDDKAPI NTSTATUS NTAPI KsAllocateObjectBag(
15 years, 4 months
1
0
0
0
[tkreuzer] 42395: Leftover from r42394, gendib, too
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Aug 5 00:51:55 2009 New Revision: 42395 URL:
http://svn.reactos.org/svn/reactos?rev=42395&view=rev
Log: Leftover from r42394, gendib, too Modified: trunk/reactos/tools/gendib/gendib.c Modified: trunk/reactos/tools/gendib/gendib.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/gendib/gendib.c?rev=…
============================================================================== --- trunk/reactos/tools/gendib/gendib.c [iso-8859-1] (original) +++ trunk/reactos/tools/gendib/gendib.c [iso-8859-1] Wed Aug 5 00:51:55 2009 @@ -489,7 +489,7 @@ } if (RopInfo->UsesPattern && 0 != (Flags & FLAG_PATTERNSURFACE)) { - Output(Out, "Pattern = DIB_GetSource(BltInfo->PatternSurface, PatternX, PatternY, BltInfo->XlatePatternToDest);\n"); + Output(Out, "Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, PatternX, PatternY);\n"); Output(Out, "if (BltInfo->PatternSurface->sizlBitmap.cx <= ++PatternX)\n"); Output(Out, "{\n"); Output(Out, "PatternX -= BltInfo->PatternSurface->sizlBitmap.cx;\n"); @@ -618,11 +618,11 @@ { if (0 == Partial) { - Output(Out, "Pattern = DIB_GetSource(BltInfo->PatternSurface, PatternX, PatternY, BltInfo->XlatePatternToDest);\n"); + Output(Out, "Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, PatternX, PatternY);\n"); } else { - Output(Out, "Pattern |= DIB_GetSource(BltInfo->PatternSurface, PatternX, PatternY, BltInfo->XlatePatternToDest) << %u;\n", Partial * Bpp); + Output(Out, "Pattern |= DIB_GetSourceIndex(BltInfo->PatternSurface, PatternX, PatternY) << %u;\n", Partial * Bpp); } Output(Out, "if (BltInfo->PatternSurface->sizlBitmap.cx <= ++PatternX)\n"); Output(Out, "{\n");
15 years, 4 months
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
66
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
Results per page:
10
25
50
100
200