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
March 2010
----- 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
19 participants
896 discussions
Start a n
N
ew thread
[akhaldi] 45787: - Move more stuff to wdm.h - Improve PAGED_CODE, ProbeFor{Read, Write} and Cm(UN)RegisterCallback - Group some related definitions.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 14:33:58 2010 New Revision: 45787 URL:
http://svn.reactos.org/svn/reactos?rev=45787&view=rev
Log: - Move more stuff to wdm.h - Improve PAGED_CODE, ProbeFor{Read,Write} and Cm(UN)RegisterCallback - Group some related definitions. Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 14:33:58 2010 @@ -1561,6 +1561,56 @@ KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); return; } + +#if DBG + +#if (NTDDI_VERSION >= NTDDI_VISTA) +#define PAGED_ASSERT( exp ) NT_ASSERT( exp ) +#else +#define PAGED_ASSERT( exp ) ASSERT( exp ) +#endif + +#define PAGED_CODE() { \ + if (KeGetCurrentIrql() > APC_LEVEL) { \ + KdPrint( ("NTDDK: Pageable code called at IRQL > APC_LEVEL (%d)\n", KeGetCurrentIrql() )); \ + PAGED_ASSERT(FALSE); \ + } \ +} + +#else + +#define PAGED_CODE() + +#endif + +#if defined(_NTDDK_) || defined(_NTIFS_) + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTKERNELAPI +VOID +NTAPI +ProbeForRead( + IN CONST VOID *Address, + IN SIZE_T Length, + IN ULONG Alignment); + +#endif + +#endif + +#if (NTDDI_VERSION >= NTDDI_WIN2K) + +NTKERNELAPI +VOID +NTAPI +ProbeForWrite( + IN PVOID Address, + IN SIZE_T Length, + IN ULONG Alignment); + +#endif + /* ** Utillity functions @@ -2737,103 +2787,31 @@ } REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION; /****************************************************************************** - * I/O Manager Functions * + * Configuration Manager Functions * ******************************************************************************/ -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && \ - (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) - -#define DMA_MACROS_DEFINED - -FORCEINLINE + #if (NTDDI_VERSION >= NTDDI_WINXP) + +NTKERNELAPI NTSTATUS -IoAllocateAdapterChannel( - IN PADAPTER_OBJECT AdapterObject, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context) -{ - PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel; - AllocateAdapterChannel = - *(DmaAdapter)->DmaOperations->AllocateAdapterChannel; - ASSERT(AllocateAdapterChannel); - return AllocateAdapterChannel(DmaAdapter, - DeviceObject, - NumberOfMapRegisters, - ExecutionRoutine, - Context ); -} - -FORCEINLINE -BOOLEAN -IoFlushAdapterBuffers( - IN PADAPTER_OBJECT AdapterObject, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN ULONG Length, - IN BOOLEAN WriteToDevice) -{ - PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers; - FlushAdapterBuffers = *(DmaAdapter)->DmaOperations->FlushAdapterBuffers; - ASSERT(FlushAdapterBuffers); - return FlushAdapterBuffers(DmaAdapter, - Mdl, - MapRegisterBase, - CurrentVa, - Length, - WriteToDevice ); -} - -FORCEINLINE -VOID -IoFreeAdapterChannel( - IN PADAPTER_OBJECT AdapterObject) -{ - PFREE_ADAPTER_CHANNEL FreeAdapterChannel; - FreeAdapterChannel = *(DmaAdapter)->DmaOperations->FreeAdapterChannel; - ASSERT(FreeAdapterChannel); - FreeAdapterChannel(DmaAdapter); -} - -FORCEINLINE -VOID -IoFreeMapRegisters( - IN PADAPTER_OBJECT AdapterObject, - IN PVOID MapRegisterBase, - IN ULONG NumberOfMapRegisters) -{ - PFREE_MAP_REGISTERS FreeMapRegisters; - FreeMapRegisters = *(DmaAdapter)->DmaOperations->FreeMapRegisters; - ASSERT(FreeMapRegisters); - FreeMapRegisters(DmaAdapter, MapRegisterBase, NumberOfMapRegisters); -} - -FORCEINLINE -PHYSICAL_ADDRESS -IoMapTransfer( - IN PDMA_ADAPTER DmaAdapter, - IN PMDL Mdl, - IN PVOID MapRegisterBase, - IN PVOID CurrentVa, - IN OUT PULONG Length, - IN BOOLEAN WriteToDevice) -{ - PMAP_TRANSFER MapTransfer; - - MapTransfer = *(DmaAdapter)->DmaOperations->MapTransfer; - ASSERT(MapTransfer); - return MapTransfer(DmaAdapter, - Mdl, - MapRegisterBase, - CurrentVa, - Length, - WriteToDevice); -} -#endif - -/* PCI_COMMON_CONFIG.Command */ +CmRegisterCallback( + IN PEX_CALLBACK_FUNCTION Function, + IN PVOID Context OPTIONAL, + OUT PLARGE_INTEGER Cookie); + +NTKERNELAPI +NTSTATUS +NTAPI +CmUnRegisterCallback( + IN LARGE_INTEGER Cookie); + +#endif + +/****************************************************************************** + * I/O Manager Types * + ******************************************************************************/ + + /* PCI_COMMON_CONFIG.Command */ #define PCI_ENABLE_IO_SPACE 0x0001 #define PCI_ENABLE_MEMORY_SPACE 0x0002 @@ -5178,6 +5156,516 @@ #define PCI_WHICHSPACE_ROM 0x52696350 /* 'PciR' */ /****************************************************************************** + * I/O Manager Functions * + ******************************************************************************/ + +#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && \ + (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) + +#define DMA_MACROS_DEFINED + +FORCEINLINE +NTSTATUS +IoAllocateAdapterChannel( + IN PADAPTER_OBJECT AdapterObject, + IN PDEVICE_OBJECT DeviceObject, + IN ULONG NumberOfMapRegisters, + IN PDRIVER_CONTROL ExecutionRoutine, + IN PVOID Context) +{ + PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel; + AllocateAdapterChannel = + *(DmaAdapter)->DmaOperations->AllocateAdapterChannel; + ASSERT(AllocateAdapterChannel); + return AllocateAdapterChannel(DmaAdapter, + DeviceObject, + NumberOfMapRegisters, + ExecutionRoutine, + Context ); +} + +FORCEINLINE +BOOLEAN +IoFlushAdapterBuffers( + IN PADAPTER_OBJECT AdapterObject, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN ULONG Length, + IN BOOLEAN WriteToDevice) +{ + PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers; + FlushAdapterBuffers = *(DmaAdapter)->DmaOperations->FlushAdapterBuffers; + ASSERT(FlushAdapterBuffers); + return FlushAdapterBuffers(DmaAdapter, + Mdl, + MapRegisterBase, + CurrentVa, + Length, + WriteToDevice ); +} + +FORCEINLINE +VOID +IoFreeAdapterChannel( + IN PADAPTER_OBJECT AdapterObject) +{ + PFREE_ADAPTER_CHANNEL FreeAdapterChannel; + FreeAdapterChannel = *(DmaAdapter)->DmaOperations->FreeAdapterChannel; + ASSERT(FreeAdapterChannel); + FreeAdapterChannel(DmaAdapter); +} + +FORCEINLINE +VOID +IoFreeMapRegisters( + IN PADAPTER_OBJECT AdapterObject, + IN PVOID MapRegisterBase, + IN ULONG NumberOfMapRegisters) +{ + PFREE_MAP_REGISTERS FreeMapRegisters; + FreeMapRegisters = *(DmaAdapter)->DmaOperations->FreeMapRegisters; + ASSERT(FreeMapRegisters); + FreeMapRegisters(DmaAdapter, MapRegisterBase, NumberOfMapRegisters); +} + +FORCEINLINE +PHYSICAL_ADDRESS +IoMapTransfer( + IN PDMA_ADAPTER DmaAdapter, + IN PMDL Mdl, + IN PVOID MapRegisterBase, + IN PVOID CurrentVa, + IN OUT PULONG Length, + IN BOOLEAN WriteToDevice) +{ + PMAP_TRANSFER MapTransfer; + + MapTransfer = *(DmaAdapter)->DmaOperations->MapTransfer; + ASSERT(MapTransfer); + return MapTransfer(DmaAdapter, + Mdl, + MapRegisterBase, + CurrentVa, + Length, + WriteToDevice); +} +#endif + +#if !defined(_M_AMD64) +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +READ_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +UCHAR +NTAPI +READ_PORT_UCHAR( + IN PUCHAR Port); + +NTHALAPI +ULONG +NTAPI +READ_PORT_ULONG( + IN PULONG Port); + +NTHALAPI +USHORT +NTAPI +READ_PORT_USHORT( + IN PUSHORT Port); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +READ_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTKERNELAPI +UCHAR +NTAPI +READ_REGISTER_UCHAR( + IN PUCHAR Register); + +NTKERNELAPI +ULONG +NTAPI +READ_REGISTER_ULONG( + IN PULONG Register); + +NTKERNELAPI +USHORT +NTAPI +READ_REGISTER_USHORT( + IN PUSHORT Register); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_UCHAR( + IN PUCHAR Port, + IN UCHAR Value); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_ULONG( + IN PULONG Port, + IN ULONG Value); + +NTHALAPI +VOID +NTAPI +WRITE_PORT_USHORT( + IN PUSHORT Port, + IN USHORT Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_UCHAR( + IN PUCHAR Register, + IN UCHAR Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_ULONG( + IN PULONG Register, + IN ULONG Value); + +NTKERNELAPI +VOID +NTAPI +WRITE_REGISTER_USHORT( + IN PUSHORT Register, + IN USHORT Value); + +#else + +FORCEINLINE +VOID +READ_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __inbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +READ_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + __indwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +READ_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __inwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +UCHAR +READ_PORT_UCHAR( + IN PUCHAR Port) +{ + return __inbyte((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +ULONG +READ_PORT_ULONG( + IN PULONG Port) +{ + return __indword((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +USHORT +READ_PORT_USHORT( + IN PUSHORT Port) +{ + return __inword((USHORT)(ULONG_PTR)Port); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __movsb(Register, Buffer, Count); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + __movsd(Register, Buffer, Count); +} + +FORCEINLINE +VOID +READ_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __movsw(Register, Buffer, Count); +} + +FORCEINLINE +UCHAR +READ_REGISTER_UCHAR( + IN PUCHAR Register) +{ + return *Register; +} + +FORCEINLINE +ULONG +READ_REGISTER_ULONG( + IN PULONG Register) +{ + return *Register; +} + +FORCEINLINE +USHORT +READ_REGISTER_USHORT( + IN PUSHORT Register) +{ + return *Register; +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_UCHAR( + IN PUCHAR Port, + IN PUCHAR Buffer, + IN ULONG Count) +{ + __outbytestring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_ULONG( + IN PULONG Port, + IN PULONG Buffer, + IN ULONG Count) +{ + __outdwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_BUFFER_USHORT( + IN PUSHORT Port, + IN PUSHORT Buffer, + IN ULONG Count) +{ + __outwordstring((USHORT)(ULONG_PTR)Port, Buffer, Count); +} + +FORCEINLINE +VOID +WRITE_PORT_UCHAR( + IN PUCHAR Port, + IN UCHAR Value) +{ + __outbyte((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_PORT_ULONG( + IN PULONG Port, + IN ULONG Value) +{ + __outdword((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_PORT_USHORT( + IN PUSHORT Port, + IN USHORT Value) +{ + __outword((USHORT)(ULONG_PTR)Port, Value); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_UCHAR( + IN PUCHAR Register, + IN PUCHAR Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsb(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_ULONG( + IN PULONG Register, + IN PULONG Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsd(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_BUFFER_USHORT( + IN PUSHORT Register, + IN PUSHORT Buffer, + IN ULONG Count) +{ + LONG Synch; + __movsw(Register, Buffer, Count); + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_UCHAR( + IN PUCHAR Register, + IN UCHAR Value) +{ + LONG Synch; + *Register = Value; + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_ULONG( + IN PULONG Register, + IN ULONG Value) +{ + LONG Synch; + *Register = Value; + InterlockedOr(&Synch, 1); +} + +FORCEINLINE +VOID +WRITE_REGISTER_USHORT( + IN PUSHORT Register, + IN USHORT Value) +{ + LONG Sync; + *Register = Value; + InterlockedOr(&Sync, 1); +} + +#endif + +/****************************************************************************** * RTL Types * ******************************************************************************/ Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 14:33:58 2010 @@ -2529,58 +2529,6 @@ #define ExIsResourceAcquired ExIsResourceAcquiredSharedLite #define ExReleaseResourceForThread ExReleaseResourceForThreadLite - -#if DBG - -#define PAGED_CODE() { \ - if (KeGetCurrentIrql() > APC_LEVEL) { \ - KdPrint( ("NTDDK: Pageable code called at IRQL > APC_LEVEL (%d)\n", KeGetCurrentIrql() )); \ - ASSERT(FALSE); \ - } \ -} - -#else - -#define PAGED_CODE() - -#endif - -NTKERNELAPI -VOID -NTAPI -ProbeForRead( - IN CONST VOID *Address, - IN SIZE_T Length, - IN ULONG Alignment); - -NTKERNELAPI -VOID -NTAPI -ProbeForWrite( - IN PVOID Address, - IN SIZE_T Length, - IN ULONG Alignment); - - - -/** Configuration manager routines **/ - -NTKERNELAPI -NTSTATUS -NTAPI -CmRegisterCallback( - IN PEX_CALLBACK_FUNCTION Function, - IN PVOID Context, - IN OUT PLARGE_INTEGER Cookie); - -NTKERNELAPI -NTSTATUS -NTAPI -CmUnRegisterCallback( - IN LARGE_INTEGER Cookie); - - - /** Filesystem runtime library routines **/ NTKERNELAPI @@ -2588,8 +2536,6 @@ NTAPI FsRtlIsTotalDeviceFailure( IN NTSTATUS Status); - - /** Hardware abstraction layer routines **/ @@ -2613,7 +2559,6 @@ HalPutDmaAdapter( PADAPTER_OBJECT AdapterObject ); - /** Io access routines **/
14 years, 9 months
1
0
0
0
[akhaldi] 45786: - Move more stuff to wdm.h - Fix/Improve InitializeSListHead - Convert some macros into inline functions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 14:02:26 2010 New Revision: 45786 URL:
http://svn.reactos.org/svn/reactos?rev=45786&view=rev
Log: - Move more stuff to wdm.h - Fix/Improve InitializeSListHead - Convert some macros into inline functions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 14:02:26 2010 @@ -1540,6 +1540,27 @@ ); #endif + +/* Fast Mutex */ + +NTKERNELAPI +VOID +KeInitializeEvent( + OUT PRKEVENT Event, + IN EVENT_TYPE Type, + IN BOOLEAN State); + +FORCEINLINE +VOID +ExInitializeFastMutex( + OUT PFAST_MUTEX FastMutex) +{ + FastMutex->Count = FM_LOCK_BIT; + FastMutex->Owner = NULL; + FastMutex->Contention = 0; + KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); + return; +} /* ** Utillity functions @@ -5264,37 +5285,35 @@ ListHead->Blink = Entry; } -/* - * BOOLEAN - * IsListEmpty( - * IN PLIST_ENTRY ListHead) - */ -#define IsListEmpty(_ListHead) \ - ((_ListHead)->Flink == (_ListHead)) - -/* - * PSINGLE_LIST_ENTRY - * PopEntryList( - * IN PSINGLE_LIST_ENTRY ListHead) - */ -#define PopEntryList(ListHead) \ -{ \ - PSINGLE_LIST_ENTRY _FirstEntry; \ - _FirstEntry = (ListHead)->Next; \ - if (_FirstEntry != NULL) \ - (ListHead)->Next = _FirstEntry->Next; \ +BOOLEAN +FORCEINLINE +IsListEmpty( + IN CONST LIST_ENTRY * ListHead) +{ + return (BOOLEAN)(ListHead->Flink == ListHead); } -/* - * VOID - * PushEntryList( - * IN PSINGLE_LIST_ENTRY ListHead, - * IN PSINGLE_LIST_ENTRY Entry) - */ -#define PushEntryList(_ListHead, _Entry) \ +FORCEINLINE +PSINGLE_LIST_ENTRY +PopEntryList( + IN OUT PSINGLE_LIST_ENTRY ListHead) { - (_Entry)->Next = (_ListHead)->Next; \ - (_ListHead)->Next = (_Entry); \ + PSINGLE_LIST_ENTRY FirstEntry; + FirstEntry = ListHead->Next; + if (FirstEntry != NULL) { + ListHead->Next = FirstEntry->Next; + } + return FirstEntry; +} + +FORCEINLINE +VOID +PushEntryList( + IN OUT PSINGLE_LIST_ENTRY ListHead, + IN OUT PSINGLE_LIST_ENTRY Entry) +{ + Entry->Next = ListHead->Next; + ListHead->Next = Entry; } FORCEINLINE @@ -5341,8 +5360,6 @@ Blink->Flink = ListHead; return Entry; } - - NTSYSAPI VOID @@ -6657,6 +6674,58 @@ * Executive Functions * ******************************************************************************/ +#if !defined(_WINBASE_) + +#if defined(_WIN64) && (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_NTOSP_)) + +NTKERNELAPI +VOID +InitializeSListHead ( + OUT PSLIST_HEADER SListHead); + +#else + +__inline +VOID +InitializeSListHead ( + OUT PSLIST_HEADER SListHead) +{ + +#if defined(_IA64_) + + ULONG64 FeatureBits; + +#endif + +#if defined(_WIN64) + + if (((ULONG_PTR)SListHead & 0xf) != 0) { + RtlRaiseStatus(STATUS_DATATYPE_MISALIGNMENT); + } + +#endif + + RtlZeroMemory(SListHead, sizeof(SLIST_HEADER)); + +#if defined(_IA64_) + + FeatureBits = __getReg(CV_IA64_CPUID4); + if ((FeatureBits & KF_16BYTE_INSTR) != 0) { + SListHead->Header16.HeaderType = 1; + SListHead->Header16.Init = 1; + } + +#endif + + return; +} + +#endif + +#endif // !defined(_WINBASE_) + +#define ExInitializeSListHead InitializeSListHead + #if defined(_X86_) #if defined(_NTHAL_) #define ExAcquireFastMutex ExiAcquireFastMutex Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 14:02:26 2010 @@ -2396,23 +2396,6 @@ IN ULONG Count, IN ULONG Flags); -/* Fast Mutex */ -#define ExInitializeFastMutex(_FastMutex) \ -{ \ - (_FastMutex)->Count = FM_LOCK_BIT; \ - (_FastMutex)->Owner = NULL; \ - (_FastMutex)->Contention = 0; \ - KeInitializeEvent(&(_FastMutex)->Gate, SynchronizationEvent, FALSE); \ -} - -NTKERNELAPI -VOID -NTAPI -KeInitializeEvent( - IN PRKEVENT Event, - IN EVENT_TYPE Type, - IN BOOLEAN State); - /****************************************************************************** * Executive Types * ******************************************************************************/ @@ -2497,16 +2480,6 @@ */ #define ExInterlockedFreeToZone(Zone, Block, Lock) \ ExInterlockedPushEntryList(&(Zone)->FreeList, (PSINGLE_LIST_ENTRY)(Block), Lock) - -/* - * VOID - * InitializeSListHead( - * IN PSLIST_HEADER SListHead) - */ -#define InitializeSListHead(_SListHead) \ - (_SListHead)->Alignment = 0 - -#define ExInitializeSListHead InitializeSListHead /* * BOOLEAN
14 years, 9 months
1
0
0
0
[akhaldi] 45785: - Move more stuff to wdm.h - Fix RTL_VERIFYMSG - Improve NLS_MB_CODE_PAGE_TAG and NLS_MB_OEM_CODE_PAGE_TAG - Fix/Improve some RTL and Guarded Mutex routines
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 13:39:52 2010 New Revision: 45785 URL:
http://svn.reactos.org/svn/reactos?rev=45785&view=rev
Log: - Move more stuff to wdm.h - Fix RTL_VERIFYMSG - Improve NLS_MB_CODE_PAGE_TAG and NLS_MB_OEM_CODE_PAGE_TAG - Fix/Improve some RTL and Guarded Mutex routines Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 13:39:52 2010 @@ -1476,6 +1476,71 @@ ); #endif +#if (NTDDI_VERSION >= NTDDI_WS03SP1) +NTKERNELAPI +BOOLEAN +KeAreAllApcsDisabled( + VOID); + +/* Guarded Mutex routines */ + +NTKERNELAPI +VOID +FASTCALL +KeAcquireGuardedMutex( + IN OUT PKGUARDED_MUTEX GuardedMutex +); + +NTKERNELAPI +VOID +FASTCALL +KeAcquireGuardedMutexUnsafe( + IN OUT PKGUARDED_MUTEX GuardedMutex +); + +NTKERNELAPI +VOID +KeEnterGuardedRegion( + VOID +); + +NTKERNELAPI +VOID +NTAPI +KeLeaveGuardedRegion( + VOID +); + +NTKERNELAPI +VOID +FASTCALL +KeInitializeGuardedMutex( + OUT PKGUARDED_MUTEX GuardedMutex +); + +NTKERNELAPI +VOID +FASTCALL +KeReleaseGuardedMutexUnsafe( + IN OUT PKGUARDED_MUTEX GuardedMutex +); + +NTKERNELAPI +VOID +FASTCALL +KeReleaseGuardedMutex( + IN OUT PKGUARDED_MUTEX GuardedMutex +); + +NTKERNELAPI +BOOLEAN +FASTCALL +KeTryToAcquireGuardedMutex( + IN OUT PKGUARDED_MUTEX GuardedMutex +); + +#endif + /* ** Utillity functions */ @@ -1511,6 +1576,112 @@ */ #define ROUND_TO_PAGES(Size) \ (((ULONG_PTR) (Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + +#if defined(_X86_) || defined(_AMD64_) + +// +// x86 and x64 performs a 0x2C interrupt +// +#define DbgRaiseAssertionFailure __int2c + +#elif defined(_ARM_) + +// +// TODO +// + +#else +#error Unsupported Architecture +#endif + +#if DBG + +#define ASSERT(exp) \ + (VOID)((!(exp)) ? \ + RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE) + +#define ASSERTMSG(msg, exp) \ + (VOID)((!(exp)) ? \ + RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, msg ), FALSE : TRUE) + +#define RTL_SOFT_ASSERT(exp) \ + (VOID)((!(exp)) ? \ + DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE) + +#define RTL_SOFT_ASSERTMSG(msg, exp) \ + (VOID)((!(exp)) ? \ + DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE : TRUE) + +#define RTL_VERIFY(exp) ASSERT(exp) +#define RTL_VERIFYMSG(msg, exp) ASSERTMSG(msg, exp) + +#define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp) +#define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp) + +#if defined(_MSC_VER) + +#define NT_ASSERT(exp) \ + ((!(exp)) ? \ + (__annotation(L"Debug", L"AssertFail", L#exp), \ + DbgRaiseAssertionFailure(), FALSE) : TRUE) + +#define NT_ASSERTMSG(msg, exp) \ + ((!(exp)) ? \ + (__annotation(L"Debug", L"AssertFail", L##msg), \ + DbgRaiseAssertionFailure(), FALSE) : TRUE) + +#define NT_ASSERTMSGW(msg, exp) \ + ((!(exp)) ? \ + (__annotation(L"Debug", L"AssertFail", msg), \ + DbgRaiseAssertionFailure(), FALSE) : TRUE) + +#else + +// +// GCC doesn't support __annotation (nor PDB) +// +#define NT_ASSERT(exp) \ + (VOID)((!(exp)) ? (DbgRaiseAssertionFailure(), FALSE) : TRUE) + +#define NT_ASSERTMSG NT_ASSERT +#define NT_ASSERTMSGW NT_ASSERT + +#endif + +#else /* !DBG */ + +#define ASSERT(exp) ((VOID) 0) +#define ASSERTMSG(msg, exp) ((VOID) 0) + +#define RTL_SOFT_ASSERT(exp) ((VOID) 0) +#define RTL_SOFT_ASSERTMSG(msg, exp) ((VOID) 0) + +#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE) +#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) + +#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE) +#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) + +#define NT_ASSERT(exp) ((VOID)0) +#define NT_ASSERTMSG(exp) ((VOID)0) +#define NT_ASSERTMSGW(exp) ((VOID)0) + +#endif /* DBG */ + +#ifdef _NTSYSTEM_ + +#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag +#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag + +#else + +#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) +#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) + +#endif /* _NTSYSTEM_ */ + +extern BOOLEAN NLS_MB_CODE_PAGE_TAG; +extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; /****************************************************************************** @@ -5057,6 +5228,122 @@ * RTL Functions * ******************************************************************************/ +FORCEINLINE +VOID +InitializeListHead( + OUT PLIST_ENTRY ListHead) +{ + ListHead->Flink = ListHead->Blink = ListHead; +} + +FORCEINLINE +VOID +InsertHeadList( + IN OUT PLIST_ENTRY ListHead, + IN OUT PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldFlink; + OldFlink = ListHead->Flink; + Entry->Flink = OldFlink; + Entry->Blink = ListHead; + OldFlink->Blink = Entry; + ListHead->Flink = Entry; +} + +FORCEINLINE +VOID +InsertTailList( + IN OUT PLIST_ENTRY ListHead, + IN OUT PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldBlink; + OldBlink = ListHead->Blink; + Entry->Flink = ListHead; + Entry->Blink = OldBlink; + OldBlink->Flink = Entry; + ListHead->Blink = Entry; +} + +/* + * BOOLEAN + * IsListEmpty( + * IN PLIST_ENTRY ListHead) + */ +#define IsListEmpty(_ListHead) \ + ((_ListHead)->Flink == (_ListHead)) + +/* + * PSINGLE_LIST_ENTRY + * PopEntryList( + * IN PSINGLE_LIST_ENTRY ListHead) + */ +#define PopEntryList(ListHead) \ +{ \ + PSINGLE_LIST_ENTRY _FirstEntry; \ + _FirstEntry = (ListHead)->Next; \ + if (_FirstEntry != NULL) \ + (ListHead)->Next = _FirstEntry->Next; \ +} + +/* + * VOID + * PushEntryList( + * IN PSINGLE_LIST_ENTRY ListHead, + * IN PSINGLE_LIST_ENTRY Entry) + */ +#define PushEntryList(_ListHead, _Entry) \ +{ + (_Entry)->Next = (_ListHead)->Next; \ + (_ListHead)->Next = (_Entry); \ +} + +FORCEINLINE +BOOLEAN +RemoveEntryList( + IN PLIST_ENTRY Entry) +{ + PLIST_ENTRY OldFlink; + PLIST_ENTRY OldBlink; + + OldFlink = Entry->Flink; + OldBlink = Entry->Blink; + OldFlink->Blink = OldBlink; + OldBlink->Flink = OldFlink; + return (BOOLEAN)(OldFlink == OldBlink); +} + +FORCEINLINE +PLIST_ENTRY +RemoveHeadList( + IN OUT PLIST_ENTRY ListHead) +{ + PLIST_ENTRY Flink; + PLIST_ENTRY Entry; + + Entry = ListHead->Flink; + Flink = Entry->Flink; + ListHead->Flink = Flink; + Flink->Blink = ListHead; + return Entry; +} + +FORCEINLINE +PLIST_ENTRY +RemoveTailList( + IN OUT PLIST_ENTRY ListHead) +{ + PLIST_ENTRY Blink; + PLIST_ENTRY Entry; + + Entry = ListHead->Blink; + Blink = Entry->Blink; + ListHead->Blink = Blink; + Blink->Flink = ListHead; + return Entry; +} + + + NTSYSAPI VOID NTAPI Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 13:39:52 2010 @@ -2242,228 +2242,8 @@ #endif // !defined (_X86_) -/* -** Utillity functions -*/ - #define ARGUMENT_PRESENT(ArgumentPointer) \ ((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL) - -#if defined(_X86_) || defined(_AMD64_) - -// -// x86 and x64 performs a 0x2C interrupt -// -#define DbgRaiseAssertionFailure __int2c - -#elif defined(_ARM_) - -// -// TODO -// - -#else -#error Unsupported Architecture -#endif - -#if DBG - -#define ASSERT(exp) \ - (VOID)((!(exp)) ? \ - RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE) - -#define ASSERTMSG(msg, exp) \ - (VOID)((!(exp)) ? \ - RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, msg ), FALSE : TRUE) - -#define RTL_SOFT_ASSERT(exp) \ - (VOID)((!(exp)) ? \ - DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE) - -#define RTL_SOFT_ASSERTMSG(msg, exp) \ - (VOID)((!(exp)) ? \ - DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE : TRUE) - -#define RTL_VERIFY(exp) ASSERT(exp) -#define RTL_VERIFYMSG(msg, exp) ASSERT(msg, exp) - -#define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp) -#define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp) - -#if defined(_MSC_VER) - -#define NT_ASSERT(exp) \ - ((!(exp)) ? \ - (__annotation(L"Debug", L"AssertFail", L#exp), \ - DbgRaiseAssertionFailure(), FALSE) : TRUE) - -#define NT_ASSERTMSG(msg, exp) \ - ((!(exp)) ? \ - (__annotation(L"Debug", L"AssertFail", L##msg), \ - DbgRaiseAssertionFailure(), FALSE) : TRUE) - -#define NT_ASSERTMSGW(msg, exp) \ - ((!(exp)) ? \ - (__annotation(L"Debug", L"AssertFail", msg), \ - DbgRaiseAssertionFailure(), FALSE) : TRUE) - -#else - -// -// GCC doesn't support __annotation (nor PDB) -// -#define NT_ASSERT(exp) \ - (VOID)((!(exp)) ? (DbgRaiseAssertionFailure(), FALSE) : TRUE) - -#define NT_ASSERTMSG NT_ASSERT -#define NT_ASSERTMSGW NT_ASSERT - -#endif - -#else /* !DBG */ - -#define ASSERT(exp) ((VOID) 0) -#define ASSERTMSG(msg, exp) ((VOID) 0) - -#define RTL_SOFT_ASSERT(exp) ((VOID) 0) -#define RTL_SOFT_ASSERTMSG(msg, exp) ((VOID) 0) - -#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE) -#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) - -#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE) -#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE) - -#define NT_ASSERT(exp) ((VOID)0) -#define NT_ASSERTMSG(exp) ((VOID)0) -#define NT_ASSERTMSGW(exp) ((VOID)0) - -#endif /* DBG */ - -/* HACK HACK HACK - GCC (or perhaps LD) is messing this up */ -#if defined(_NTSYSTEM_) || defined(__GNUC__) -#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag -#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag -#else -#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) -#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) -#endif /* _NT_SYSTEM */ - -extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG; -extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG; - -/* -** Driver support routines -*/ - -/** Runtime library routines **/ - -static __inline VOID -InitializeListHead( - IN PLIST_ENTRY ListHead) -{ - ListHead->Flink = ListHead->Blink = ListHead; -} - -static __inline VOID -InsertHeadList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY Entry) -{ - PLIST_ENTRY OldFlink; - OldFlink = ListHead->Flink; - Entry->Flink = OldFlink; - Entry->Blink = ListHead; - OldFlink->Blink = Entry; - ListHead->Flink = Entry; -} - -static __inline VOID -InsertTailList( - IN PLIST_ENTRY ListHead, - IN PLIST_ENTRY Entry) -{ - PLIST_ENTRY OldBlink; - OldBlink = ListHead->Blink; - Entry->Flink = ListHead; - Entry->Blink = OldBlink; - OldBlink->Flink = Entry; - ListHead->Blink = Entry; -} - -/* - * BOOLEAN - * IsListEmpty( - * IN PLIST_ENTRY ListHead) - */ -#define IsListEmpty(_ListHead) \ - ((_ListHead)->Flink == (_ListHead)) - -/* - * PSINGLE_LIST_ENTRY - * PopEntryList( - * IN PSINGLE_LIST_ENTRY ListHead) - */ -#define PopEntryList(ListHead) \ - (ListHead)->Next; \ - { \ - PSINGLE_LIST_ENTRY _FirstEntry; \ - _FirstEntry = (ListHead)->Next; \ - if (_FirstEntry != NULL) \ - (ListHead)->Next = _FirstEntry->Next; \ - } - -/* - * VOID - * PushEntryList( - * IN PSINGLE_LIST_ENTRY ListHead, - * IN PSINGLE_LIST_ENTRY Entry) - */ -#define PushEntryList(_ListHead, _Entry) \ - (_Entry)->Next = (_ListHead)->Next; \ - (_ListHead)->Next = (_Entry); \ - -static __inline BOOLEAN -RemoveEntryList( - IN PLIST_ENTRY Entry) -{ - PLIST_ENTRY OldFlink; - PLIST_ENTRY OldBlink; - - OldFlink = Entry->Flink; - OldBlink = Entry->Blink; - OldFlink->Blink = OldBlink; - OldBlink->Flink = OldFlink; - return (BOOLEAN)(OldFlink == OldBlink); -} - -static __inline PLIST_ENTRY -RemoveHeadList( - IN PLIST_ENTRY ListHead) -{ - PLIST_ENTRY Flink; - PLIST_ENTRY Entry; - - Entry = ListHead->Flink; - Flink = Entry->Flink; - ListHead->Flink = Flink; - Flink->Blink = ListHead; - return Entry; -} - -static __inline PLIST_ENTRY -RemoveTailList( - IN PLIST_ENTRY ListHead) -{ - PLIST_ENTRY Blink; - PLIST_ENTRY Entry; - - Entry = ListHead->Blink; - Blink = Entry->Blink; - ListHead->Blink = Blink; - Blink->Flink = ListHead; - return Entry; -} NTSYSAPI NTSTATUS @@ -2615,71 +2395,6 @@ OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags); - -NTKERNELAPI -BOOLEAN -NTAPI -KeAreAllApcsDisabled( - VOID -); - -/* Guarded Mutex routines */ - -NTKERNELAPI -VOID -FASTCALL -KeAcquireGuardedMutex( - IN OUT PKGUARDED_MUTEX GuardedMutex -); - -NTKERNELAPI -VOID -FASTCALL -KeAcquireGuardedMutexUnsafe( - IN OUT PKGUARDED_MUTEX GuardedMutex -); - -NTKERNELAPI -VOID -NTAPI -KeEnterGuardedRegion( - VOID -); - -NTKERNELAPI -VOID -NTAPI -KeLeaveGuardedRegion( - VOID -); - -NTKERNELAPI -VOID -FASTCALL -KeInitializeGuardedMutex( - OUT PKGUARDED_MUTEX GuardedMutex -); - -NTKERNELAPI -VOID -FASTCALL -KeReleaseGuardedMutexUnsafe( - IN OUT PKGUARDED_MUTEX GuardedMutex -); - -NTKERNELAPI -VOID -FASTCALL -KeReleaseGuardedMutex( - IN OUT PKGUARDED_MUTEX GuardedMutex -); - -NTKERNELAPI -BOOLEAN -FASTCALL -KeTryToAcquireGuardedMutex( - IN OUT PKGUARDED_MUTEX GuardedMutex -); /* Fast Mutex */ #define ExInitializeFastMutex(_FastMutex) \
14 years, 9 months
1
0
0
0
[dreimer] 45784: sSVN: Make us of the http:// protocol instead of the svn:// one.
by dreimer@svn.reactos.org
Author: dreimer Date: Wed Mar 3 12:47:17 2010 New Revision: 45784 URL:
http://svn.reactos.org/svn/reactos?rev=45784&view=rev
Log: sSVN: Make us of the http:// protocol instead of the svn:// one. Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] Wed Mar 3 12:47:17 2010 @@ -11,9 +11,9 @@ $OFFSVN = $OFFSVN -replace "(.*)Revision: ",'' $OFFSVN = [CONVERT]::ToInt32($OFFSVN,10) if ("$ENV:ROS_ARCH" -eq "amd64") { - $ONSVN = IEX "& svn.exe info
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
" | select-string "Revision:" + $ONSVN = IEX "& svn.exe info
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
" | select-string "Revision:" } else { - $ONSVN = IEX "& svn.exe info
svn://svn.reactos.org/reactos/trunk/reactos
" | select-string "Revision:" + $ONSVN = IEX "& svn.exe info
http://svn.reactos.org/reactos/trunk/reactos
" | select-string "Revision:" } $ONSVN = $ONSVN -replace "(.*)Revision: ",'' $ONSVN = [CONVERT]::ToInt32($ONSVN,10) @@ -102,9 +102,9 @@ $dir = get-childitem if ("$dir" -eq "") { if ("$ENV:ROS_ARCH" -eq "amd64") { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
." } else { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/trunk/reactos
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/trunk/reactos
." } } else { "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" @@ -125,9 +125,9 @@ $dir = get-childitem if ("$dir" -eq "") { if ("$ENV:ROS_ARCH" -eq "amd64") { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/rosapps
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/rosapps
." } else { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/trunk/rosapps
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/trunk/rosapps
." } } else { "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" @@ -149,9 +149,9 @@ $dir = get-childitem if ("$dir" -eq "") { if ("$ENV:ROS_ARCH" -eq "amd64") { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/rostests
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/rostests
." } else { - IEX "& svn.exe checkout
svn://svn.reactos.org/reactos/trunk/rostests
." + IEX "& svn.exe checkout
http://svn.reactos.org/reactos/trunk/rostests
." } } else { "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED" Modified: trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/sSV…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/sSVN.cmd [iso-8859-1] Wed Mar 3 12:47:17 2010 @@ -48,9 +48,9 @@ dir /b 2>nul | findstr "." >nul if errorlevel 1 ( if "%ROS_ARCH%" == "amd64" ( - svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
. + svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
. ) else ( - svn.exe checkout
svn://svn.reactos.org/reactos/trunk/reactos
. + svn.exe checkout
http://svn.reactos.org/reactos/trunk/reactos
. ) ) else ( echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED @@ -72,9 +72,9 @@ dir /b 2>nul | findstr "." >nul if errorlevel 1 ( if "%ROS_ARCH%" == "amd64" ( - svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/rosapps
. + svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/rosapps
. ) else ( - svn.exe checkout
svn://svn.reactos.org/reactos/trunk/rosapps
. + svn.exe checkout
http://svn.reactos.org/reactos/trunk/rosapps
. ) ) else ( echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED @@ -97,9 +97,9 @@ dir /b 2>nul | findstr "." >nul if errorlevel 1 ( if "%ROS_ARCH%" == "amd64" ( - svn.exe checkout
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/rostests
. + svn.exe checkout
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/rostests
. ) else ( - svn.exe checkout
svn://svn.reactos.org/reactos/trunk/rostests
. + svn.exe checkout
http://svn.reactos.org/reactos/trunk/rostests
. ) ) else ( echo ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED @@ -125,9 +125,9 @@ :UP for /f "usebackq tokens=2" %%i in (`"svn.exe info | find "Revision:""`) do set OFFSVN=%%i if "%ROS_ARCH%" == "amd64" ( - for /f "usebackq tokens=2" %%j in (`"svn.exe info
svn://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
| find "Revision:""`) do set ONSVN=%%j + for /f "usebackq tokens=2" %%j in (`"svn.exe info
http://svn.reactos.org/reactos/branches/ros-amd64-bringup/reactos
| find "Revision:""`) do set ONSVN=%%j ) else ( - for /f "usebackq tokens=2" %%j in (`"svn.exe info
svn://svn.reactos.org/reactos/trunk/reactos
| find "Revision:""`) do set ONSVN=%%j + for /f "usebackq tokens=2" %%j in (`"svn.exe info
http://svn.reactos.org/reactos/trunk/reactos
| find "Revision:""`) do set ONSVN=%%j ) echo Local Revision: !OFFSVN!
14 years, 9 months
1
0
0
0
[akhaldi] 45783: Add several missing USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 12:42:20 2010 New Revision: 45783 URL:
http://svn.reactos.org/svn/reactos?rev=45783&view=rev
Log: Add several missing USB related definitions Added: branches/header-work/include/ddk/hubbusif.h (with props) branches/header-work/include/ddk/usbbusif.h (with props) branches/header-work/include/ddk/usbdrivr.h (with props) Added: branches/header-work/include/ddk/hubbusif.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/hubbusi…
============================================================================== --- branches/header-work/include/ddk/hubbusif.h (added) +++ branches/header-work/include/ddk/hubbusif.h [iso-8859-1] Wed Mar 3 12:42:20 2010 @@ -1,0 +1,782 @@ +#pragma once + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +typedef PVOID PUSB_DEVICE_HANDLE; + +typedef struct _ROOTHUB_PDO_EXTENSION { + ULONG Signature; +} ROOTHUB_PDO_EXTENSION, *PROOTHUB_PDO_EXTENSION; + +#define USBD_DEVHACK_SLOW_ENUMERATION 0x00000001 +#define USBD_DEVHACK_DISABLE_SN 0x00000002 +#define USBD_DEVHACK_SET_DIAG_ID 0x00000004 + +#ifndef USB_BUSIFFN +#define USB_BUSIFFN __stdcall +#endif + +#define CD_ERR_V1 0x00000001 + +#define ID_ERR_V1 0x00000001 + +#define USBD_KEEP_DEVICE_DATA 0x00000001 +#define USBD_MARK_DEVICE_BUSY 0x00000002 + +#define USB_IDLE_NOT_READY 0 +#define USB_IDLE_READY 1 + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_CREATE_USB_DEVICE ( + IN PVOID BusContext, + OUT PUSB_DEVICE_HANDLE *NewDeviceHandle, + IN PUSB_DEVICE_HANDLE HubDeviceHandle, + IN USHORT PortStatus, + IN USHORT PortNumber); + +typedef USB_BUSIFFN_CREATE_USB_DEVICE *PUSB_BUSIFFN_CREATE_USB_DEVICE; + +typedef enum _USBPORT_CREATEDEV_ERROR { + CreateDevErrNotSet = 0, + CreateDevBadHubDevHandle, + CreateDevFailedAllocDevHandle, + CreateDevFailedOpenEndpoint, + CreateDevFailedAllocDsBuff, + CreateDevFailedGetDs, + CreateDevTtNotFound, + CreateDevBadDevHandlePtr +} USBPORT_CREATEDEV_ERROR; + +typedef struct _USB_CD_ERROR_INFORMATION { + ULONG Version; + USBPORT_CREATEDEV_ERROR PathError; + ULONG UlongArg1; + ULONG UlongArg2; + NTSTATUS NtStatus; + UCHAR XtraInfo[64]; +} USB_CD_ERROR_INFORMATION, *PUSB_CD_ERROR_INFORMATION; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_CREATE_USB_DEVICE_EX ( + IN PVOID BusContext, + OUT PUSB_DEVICE_HANDLE *NewDeviceHandle, + IN PUSB_DEVICE_HANDLE HsHubDeviceHandle, + IN USHORT PortStatus, + IN USHORT PortNumber, + OUT PUSB_CD_ERROR_INFORMATION CdErrorInfo, + IN USHORT TtPortNumber); + +typedef USB_BUSIFFN_CREATE_USB_DEVICE_EX *PUSB_BUSIFFN_CREATE_USB_DEVICE_EX; + +typedef struct _USB_PORT_PATH { + ULONG PortPathDepth; + ULONG PortPath[6]; +} USB_PORT_PATH, *PUSB_PORT_PATH; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_CREATE_USB_DEVICE_V7 ( + IN PVOID BusContext, + OUT PUSB_DEVICE_HANDLE *NewDeviceHandle, + IN PUSB_DEVICE_HANDLE HsHubDeviceHandle, + IN USHORT PortStatus, + IN PUSB_PORT_PATH PortPath, + OUT PUSB_CD_ERROR_INFORMATION CdErrorInfo, + IN USHORT TtPortNumber, + IN PDEVICE_OBJECT PdoDeviceObject, + IN PUNICODE_STRING PhysicalDeviceObjectName); + +typedef USB_BUSIFFN_CREATE_USB_DEVICE_V7 *PUSB_BUSIFFN_CREATE_USB_DEVICE_V7; + +typedef enum _USBPORT_INITDEV_ERROR { + InitDevErrNotSet = 0, + InitDevFailedSetAddress, + InitDevFailedPokeEndpoint, + InitDevBadDeviceDescriptor +} USBPORT_INITDEV_ERROR; + +typedef struct _USB_ID_ERROR_INFORMATION { + ULONG Version; + USBPORT_INITDEV_ERROR PathError; + ULONG Arg1; + ULONG UsbAddress; + NTSTATUS NtStatus; + USBD_STATUS UsbdStatus; + UCHAR XtraInfo[64]; +} USB_ID_ERROR_INFORMATION, *PUSB_ID_ERROR_INFORMATION; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_INITIALIZE_USB_DEVICE ( + IN PVOID BusContext, + IN OUT PUSB_DEVICE_HANDLE DeviceHandle); + +typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX ( + IN PVOID BusContext, + IN OUT PUSB_DEVICE_HANDLE DeviceHandle, + OUT PUSB_ID_ERROR_INFORMATION IdErrInfo); + +typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_REMOVE_USB_DEVICE ( + IN PVOID BusContext, + IN OUT PUSB_DEVICE_HANDLE DeviceHandle, + IN ULONG Flags); + +typedef USB_BUSIFFN_REMOVE_USB_DEVICE *PUSB_BUSIFFN_REMOVE_USB_DEVICE; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_USB_DESCRIPTORS ( + IN PVOID BusContext, + IN OUT PUSB_DEVICE_HANDLE DeviceHandle, + OUT PUCHAR DeviceDescriptorBuffer, + IN OUT PULONG DeviceDescriptorBufferLength, + OUT PUCHAR ConfigDescriptorBuffer, + IN OUT PULONG ConfigDescriptorBufferLength); + +typedef USB_BUSIFFN_GET_USB_DESCRIPTORS *PUSB_BUSIFFN_GET_USB_DESCRIPTORS; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_RESTORE_DEVICE ( + IN PVOID BusContext, + IN OUT PUSB_DEVICE_HANDLE OldDeviceHandle, + IN OUT PUSB_DEVICE_HANDLE NewDeviceHandle); + +typedef USB_BUSIFFN_RESTORE_DEVICE *PUSB_BUSIFFN_RESTORE_DEVICE; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_POTRTHACK_FLAGS ( + IN PVOID BusContext, + IN OUT PULONG Flags); + +typedef USB_BUSIFFN_GET_POTRTHACK_FLAGS *PUSB_BUSIFFN_GET_POTRTHACK_FLAGS; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_DEVICE_INFORMATION ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + OUT PVOID DeviceInformationBuffer, + IN ULONG DeviceInformationBufferLength, + IN OUT PULONG LengthOfDataCopied); + +typedef USB_BUSIFFN_GET_DEVICE_INFORMATION *PUSB_BUSIFFN_GET_DEVICE_INFORMATION; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_CONTROLLER_INFORMATION ( + IN PVOID BusContext, + IN OUT PVOID ControllerInformationBuffer, + IN ULONG ControllerInformationBufferLength, + IN OUT PULONG LengthOfDataCopied); + +typedef USB_BUSIFFN_GET_CONTROLLER_INFORMATION *PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ( + IN PVOID BusContext, + IN BOOLEAN Enable); + +typedef USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND *PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_EXTENDED_HUB_INFO ( + IN PVOID BusContext, + IN PDEVICE_OBJECT HubPhysicalDeviceObject, + IN PVOID HubInformationBuffer, + IN ULONG HubInformationBufferLength, + OUT PULONG LengthOfDataCopied); + +typedef USB_BUSIFFN_GET_EXTENDED_HUB_INFO *PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_ROOTHUB_SYM_NAME ( + IN PVOID BusContext, + IN PVOID HubSymNameBuffer, + IN ULONG HubSymNameBufferLength, + OUT PULONG HubSymNameActualLength); + +typedef USB_BUSIFFN_GET_ROOTHUB_SYM_NAME *PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME; + +typedef +PVOID +USB_BUSIFFN +USB_BUSIFFN_GET_DEVICE_BUSCONTEXT ( + IN PVOID HubBusContext, + IN PVOID DeviceHandle); + +typedef USB_BUSIFFN_GET_DEVICE_BUSCONTEXT *PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_INITIALIZE_20HUB ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE HubDeviceHandle, + IN ULONG TtCount); + +typedef USB_BUSIFFN_INITIALIZE_20HUB *PUSB_BUSIFFN_INITIALIZE_20HUB; + +typedef +BOOLEAN +USB_BUSIFFN +USB_BUSIFFN_IS_ROOT ( + IN PVOID BusContext, + IN PVOID DeviceObject); + +typedef USB_BUSIFFN_IS_ROOT *PUSB_BUSIFFN_IS_ROOT; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_ACQUIRE_SEMAPHORE ( + IN PVOID BusContext); + +typedef USB_BUSIFFN_ACQUIRE_SEMAPHORE *PUSB_BUSIFFN_ACQUIRE_SEMAPHORE; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_RELEASE_SEMAPHORE ( + IN PVOID BusContext); + +typedef USB_BUSIFFN_RELEASE_SEMAPHORE *PUSB_BUSIFFN_RELEASE_SEMAPHORE; + +typedef +VOID +__stdcall +RH_INIT_CALLBACK ( + IN PVOID CallBackContext); + +typedef RH_INIT_CALLBACK *PRH_INIT_CALLBACK; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_ROOTHUB_INIT_NOTIFY ( + IN PVOID BusContext, + IN PVOID CallbackContext, + IN PRH_INIT_CALLBACK CallbackRoutine); + +typedef USB_BUSIFFN_ROOTHUB_INIT_NOTIFY *PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_FLUSH_TRANSFERS ( + IN PVOID BusContext, + IN PVOID DeviceHandle); + +typedef USB_BUSIFFN_FLUSH_TRANSFERS *PUSB_BUSIFFN_FLUSH_TRANSFERS; + +typedef +ULONG +USB_BUSIFFN +USB_BUSIFFN_CALC_PIPE_BANDWIDTH ( + IN PVOID BusContext, + IN PUSBD_PIPE_INFORMATION PipeInfo, + IN USB_DEVICE_SPEED DeviceSpeed); + +typedef USB_BUSIFFN_CALC_PIPE_BANDWIDTH *PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_SET_BUS_WAKE_MODE ( + IN PVOID BusContext, + IN ULONG Mode); + +typedef USB_BUSIFFN_SET_BUS_WAKE_MODE *PUSB_BUSIFFN_SET_BUS_WAKE_MODE; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_SET_DEVICE_FLAG ( + IN PVOID BusContext, + IN GUID *DeviceFlagGuid, + IN PVOID ValueData, + IN ULONG ValueLength); + +typedef USB_BUSIFFN_SET_DEVICE_FLAG *PUSB_BUSIFFN_SET_DEVICE_FLAG; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_SET_DEVHANDLE_DATA ( + IN PVOID BusContext, + IN PVOID DeviceHandle, + IN PDEVICE_OBJECT UsbDevicePdo); + +typedef USB_BUSIFFN_SET_DEVHANDLE_DATA *PUSB_BUSIFFN_SET_DEVHANDLE_DATA; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_TEST_POINT ( + IN PVOID BusContext, + IN PVOID DeviceHandle, + IN ULONG Opcode, + IN PVOID TestData); + +typedef USB_BUSIFFN_TEST_POINT *PUSB_BUSIFFN_TEST_POINT; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + OUT PVOID DeviceInformationBuffer, + IN ULONG DeviceInformationBufferLength, + IN OUT PULONG LengthOfDataCopied); + +typedef USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO *PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_WAIT_ASYNC_POWERUP ( + IN PVOID BusContext); + +typedef USB_BUSIFFN_WAIT_ASYNC_POWERUP *PUSB_BUSIFFN_WAIT_ASYNC_POWERUP; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_DEVICE_ADDRESS ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + OUT PUSHORT DeviceAddress); + +typedef USB_BUSIFFN_GET_DEVICE_ADDRESS *PUSB_BUSIFFN_GET_DEVICE_ADDRESS; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_DEREF_DEVICE_HANDLE ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + IN PVOID Object, + IN ULONG Tag); + +typedef USB_BUSIFFN_DEREF_DEVICE_HANDLE *PUSB_BUSIFFN_DEREF_DEVICE_HANDLE; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_REF_DEVICE_HANDLE ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + IN PVOID Object, + IN ULONG Tag); + +typedef USB_BUSIFFN_REF_DEVICE_HANDLE *PUSB_BUSIFFN_REF_DEVICE_HANDLE; + +typedef +ULONG +USB_BUSIFFN +USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + IN ULONG NewIdleReadyState); + +typedef USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE *PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT ( + IN PVOID BusContext, + IN USHORT PortNumber, + OUT LPGUID ContainerId); + +typedef USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT; + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT ( + IN PVOID BusContext, + IN USHORT PortNumber, + IN LPGUID ContainerId); + +typedef USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT; + +typedef +NTSTATUS +USB_BUSIFFN +USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle); + +typedef USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES *PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES; + +#define ERRATA_FLAG_RESET_TT_ON_CANCEL 1 +#define ERRATA_FLAG_NO_CLEAR_TT_BUFFER_ON_CANCEL 2 + +#define USB_BUSIF_HUB_VERSION_0 0x0000 +#define USB_BUSIF_HUB_VERSION_1 0x0001 +#define USB_BUSIF_HUB_VERSION_2 0x0002 +#define USB_BUSIF_HUB_VERSION_3 0x0003 +#define USB_BUSIF_HUB_VERSION_4 0x0004 +#define USB_BUSIF_HUB_VERSION_5 0x0005 +#define USB_BUSIF_HUB_VERSION_6 0x0006 +#define USB_BUSIF_HUB_VERSION_7 0x0007 + +#define USB_BUSIF_HUB_MIDUMP_VERSION_0 0x0000 + +#define USB_BUSIF_HUB_SS_VERSION_0 0x0000 + +typedef +VOID +USB_BUSIFFN +USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG ( + IN PVOID BusContext, + IN PUSB_DEVICE_HANDLE DeviceHandle, + IN ULONG DeviceErrataFlag); + +typedef USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG *PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG; + +DEFINE_GUID(USB_BUS_INTERFACE_HUB_GUID, +0xb2bb8c0a, 0x5ab4, 0x11d3, 0xa8, 0xcd, 0x0, 0xc0, 0x4f, 0x68, 0x74, 0x7a); + +typedef struct _USB_BUS_INTERFACE_HUB_V0 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; +} USB_BUS_INTERFACE_HUB_V0, *PUSB_BUS_INTERFACE_HUB_V0; + +typedef struct _USB_BUS_INTERFACE_HUB_V1 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; +} USB_BUS_INTERFACE_HUB_V1, *PUSB_BUS_INTERFACE_HUB_V1; + +typedef struct _USB_BUS_INTERFACE_HUB_V2 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; +} USB_BUS_INTERFACE_HUB_V2, *PUSB_BUS_INTERFACE_HUB_V2; + +typedef struct _USB_BUS_INTERFACE_HUB_V3 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; + PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; +} USB_BUS_INTERFACE_HUB_V3, *PUSB_BUS_INTERFACE_HUB_V3; + +typedef struct _USB_BUS_INTERFACE_HUB_V4 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; + PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; + PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; +} USB_BUS_INTERFACE_HUB_V4, *PUSB_BUS_INTERFACE_HUB_V4; + +typedef struct _USB_BUS_INTERFACE_HUB_V5 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; + PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; + PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; + PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; +} USB_BUS_INTERFACE_HUB_V5, *PUSB_BUS_INTERFACE_HUB_V5; + +typedef struct _USB_BUS_INTERFACE_HUB_V6 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; + PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; + PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; + PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; + PUSB_BUSIFFN_IS_ROOT HubIsRoot; + PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore; + PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore; + PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth; + PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode; + PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag; + PUSB_BUSIFFN_TEST_POINT HubTestPoint; + PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo; + PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp; + PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress; + PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle; + PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle; + PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState; +} USB_BUS_INTERFACE_HUB_V6, *PUSB_BUS_INTERFACE_HUB_V6; + +typedef struct _USB_BUS_INTERFACE_HUB_V7 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice; + PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice; + PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; + PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; + PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; + PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; + PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; + PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; + PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; + PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; + PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; + PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; + PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; + PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; + PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; + PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; + PUSB_BUSIFFN_IS_ROOT HubIsRoot; + PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore; + PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore; + PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth; + PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode; + PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag; + PUSB_BUSIFFN_TEST_POINT HubTestPoint; + PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo; + PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp; + PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress; + PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle; + PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle; + PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState; + PUSB_BUSIFFN_CREATE_USB_DEVICE_V7 CreateUsbDeviceV7; + PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT GetContainerIdForPort; + PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT SetContainerIdForPort; + PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES AbortAllDevicePipes; + PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG SetDeviceErrataFlag; +} USB_BUS_INTERFACE_HUB_V7, *PUSB_BUS_INTERFACE_HUB_V7; + +DEFINE_GUID(USB_BUS_INTERFACE_HUB_MINIDUMP_GUID, +0xc5485f21, 0x4e81, 0x4a23, 0xa8, 0xf9, 0xd8, 0x51, 0x8a, 0xf4, 0x5c, 0x38); + +typedef VOID +(USB_BUSIFFN *PUSB_BUSIFFN_SET_MINIDUMP_FLAGS) ( + IN PVOID); + +typedef struct _USB_BUS_INTERFACE_HUB_MINIDUMP { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_SET_MINIDUMP_FLAGS SetUsbPortMiniDumpFlags; +} USB_BUS_INTERFACE_HUB_MINIDUMP, *PUSB_BUS_INTERFACE_HUB_MINIDUMP; + +DEFINE_GUID(USB_BUS_INTERFACE_HUB_SS_GUID, +0xbfc3f363, 0x8ba1, 0x4c7b, 0x97, 0xba, 0x9b, 0x12, 0xb1, 0xca, 0x13, 0x2f); + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_SUSPEND_HUB) ( + PDEVICE_OBJECT Pdo); + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_RESUME_HUB) ( + PDEVICE_OBJECT Pdo); + +typedef struct _USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_SUSPEND_HUB SuspendHub; + PUSB_BUSIFFN_RESUME_HUB ResumeHub; +} USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND, *PUSB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND; + +#include <pshpack1.h> + +typedef struct _USB_PIPE_INFORMATION_0 { + USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + UCHAR ED_Pad[1]; + ULONG ScheduleOffset; +} USB_PIPE_INFORMATION_0, *PUSB_PIPE_INFORMATION_0; + +typedef struct _USB_LEVEL_INFORMATION { + ULONG InformationLevel; + ULONG ActualLength; +} USB_LEVEL_INFORMATION, *PUSB_LEVEL_INFORMATION; + +typedef struct _USB_DEVICE_INFORMATION_0 { + ULONG InformationLevel; + ULONG ActualLength; + ULONG PortNumber; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR DD_pad[2]; + UCHAR CurrentConfigurationValue; + UCHAR ReservedMBZ; + USHORT DeviceAddress; + ULONG HubAddress; + USB_DEVICE_SPEED DeviceSpeed; + USB_DEVICE_TYPE DeviceType; + ULONG NumberOfOpenPipes; + USB_PIPE_INFORMATION_0 PipeList[1]; +} USB_DEVICE_INFORMATION_0, *PUSB_DEVICE_INFORMATION_0; + +typedef struct _USB_CONTROLLER_INFORMATION_0 { + ULONG InformationLevel; + ULONG ActualLength; + BOOLEAN SelectiveSuspendEnabled; + BOOLEAN IsHighSpeedController; +} USB_CONTROLLER_INFORMATION_0, *PUSB_CONTROLLER_INFORMATION_0; + +typedef struct _USB_CONTROLLER_INFORMATION_1 { + ULONG InformationLevel; + ULONG ActualLength; + BOOLEAN SelectiveSuspendEnabled; + BOOLEAN IsHighSpeedController; + ULONG HcBusNumber; + ULONG HcBusDevice; + ULONG HcBusFunction; +} USB_CONTROLLER_INFORMATION_1, *PUSB_CONTROLLER_INFORMATION_1; + +typedef struct _USB_EXTPORT_INFORMATION_0 { + ULONG PhysicalPortNumber; + ULONG PortLabelNumber; + USHORT VidOverride; + USHORT PidOverride; + ULONG PortAttributes; +} USB_EXTPORT_INFORMATION_0, *PUSB_EXTPORT_INFORMATION; + +typedef struct _USB_EXTHUB_INFORMATION_0 { + ULONG InformationLevel; + ULONG NumberOfPorts; + USB_EXTPORT_INFORMATION_0 Port[255]; +} USB_EXTHUB_INFORMATION_0, *PUSB_EXTHUB_INFORMATION_0; + +typedef struct _USB_DEVICE_PERFORMANCE_INFO_0 { + ULONG InformationLevel; + ULONG ActualLength; + ULONG BulkBytes; + ULONG BulkUrbCount; + ULONG ControlDataBytes; + ULONG ControlUrbCount; + ULONG IsoBytes; + ULONG IsoUrbCount; + ULONG InterruptBytes; + ULONG InterruptUrbCount; + ULONG AllocedInterrupt[6]; + ULONG AllocedIso; + ULONG Total32secBandwidth; + ULONG TotalTtBandwidth; + ULONG TotalIsoLatency; + ULONG DroppedIsoPackets; + ULONG TransferErrors; +} USB_DEVICE_PERFORMANCE_INFO_0, *PUSB_DEVICE_PERFORMANCE_INFO_0; + +#include <poppack.h> + +#endif Propchange: branches/header-work/include/ddk/hubbusif.h ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/header-work/include/ddk/usbbusif.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/usbbusi…
============================================================================== --- branches/header-work/include/ddk/usbbusif.h (added) +++ branches/header-work/include/ddk/usbbusif.h [iso-8859-1] Wed Mar 3 12:42:20 2010 @@ -1,0 +1,193 @@ +#pragma once + +#ifndef USB_BUSIFFN +#define USB_BUSIFFN __stdcall +#endif + +#if (NTDDI_VERSION >= NTDDI_WINXP) + +typedef PVOID PUSB_DEVICE_HANDLE; + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) ( + IN PVOID, + IN PURB); + +#define USB_HCD_CAPS_SUPPORTS_RT_THREADS 0x00000001 + +typedef VOID +(USB_BUSIFFN *PUSB_BUSIFFN_GETUSBDI_VERSION) ( + IN PVOID, + OUT PUSBD_VERSION_INFORMATION, + OUT PULONG); + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME) ( + IN PVOID, + OUT PULONG); + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_ENUM_LOG_ENTRY) ( + IN PVOID, + IN ULONG, + IN ULONG, + IN ULONG, + IN ULONG); + +typedef struct _USB_BUS_INFORMATION_LEVEL_0 { + ULONG TotalBandwidth; + ULONG ConsumedBandwidth; +} USB_BUS_INFORMATION_LEVEL_0, *PUSB_BUS_INFORMATION_LEVEL_0; + +typedef struct _USB_BUS_INFORMATION_LEVEL_1 { + ULONG TotalBandwidth; + ULONG ConsumedBandwidth; + ULONG ControllerNameLength; + WCHAR ControllerNameUnicodeString[1]; +} USB_BUS_INFORMATION_LEVEL_1, *PUSB_BUS_INFORMATION_LEVEL_1; + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_INFORMATION) ( + IN PVOID, + IN ULONG, + INout PVOID, + OUT PULONG, + OUT PULONG); + +typedef BOOLEAN +(USB_BUSIFFN *PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED) ( + IN PVOID); + +#define USB_BUSIF_USBDI_VERSION_0 0x0000 +#define USB_BUSIF_USBDI_VERSION_1 0x0001 +#define USB_BUSIF_USBDI_VERSION_2 0x0002 +#define USB_BUSIF_USBDI_VERSION_3 0x0003 + +DEFINE_GUID(USB_BUS_INTERFACE_USBDI_GUID, +0xb1a96a13, 0x3de0, 0x4574, 0x9b, 0x1, 0xc0, 0x8f, 0xea, 0xb3, 0x18, 0xd6); + +typedef struct _USB_BUS_INTERFACE_USBDI_V0 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; + PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; + PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; + PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; +} USB_BUS_INTERFACE_USBDI_V0, *PUSB_BUS_INTERFACE_USBDI_V0; + +typedef struct _USB_BUS_INTERFACE_USBDI_V1 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; + PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; + PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; + PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; + PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; +} USB_BUS_INTERFACE_USBDI_V1, *PUSB_BUS_INTERFACE_USBDI_V1; + +typedef struct _USB_BUS_INTERFACE_USBDI_V2 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; + PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; + PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; + PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; + PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; + PUSB_BUSIFFN_ENUM_LOG_ENTRY EnumLogEntry; +} USB_BUS_INTERFACE_USBDI_V2, *PUSB_BUS_INTERFACE_USBDI_V2; + +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME_EX) ( + IN PVOID, + OUT PULONG); + +typedef NTSTATUS +(USB_BUSIFFN *PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE) ( + IN PVOID, + OUT PULONG, + OUT PUSHORT, + OUT PUSHORT, + OUT PUCHAR, + OUT PUCHAR, + OUT PUCHAR, + OUT PUCHAR); + +typedef struct _USB_BUS_INTERFACE_USBDI_V3 { + USHORT Size; + USHORT Version; + PVOID BusContext; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; + PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; + PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; + PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; + PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; + PUSB_BUSIFFN_ENUM_LOG_ENTRY EnumLogEntry; + PUSB_BUSIFFN_QUERY_BUS_TIME_EX QueryBusTimeEx; + PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE QueryControllerType; +} USB_BUS_INTERFACE_USBDI_V3, *PUSB_BUS_INTERFACE_USBDI_V3; + +DEFINE_GUID(USB_BUS_INTERFACE_USBC_CONFIGURATION_GUID, +0x893b6a96, 0xb7f, 0x4d4d, 0xbd, 0xb4, 0xbb, 0xd4, 0xce, 0xeb, 0xb3, 0x1c); + +#define USBC_FUNCTION_FLAG_APPEND_ID 0x1 + +typedef struct _USBC_FUNCTION_DESCRIPTOR{ + UCHAR FunctionNumber; + UCHAR NumberOfInterfaces; + PUSB_INTERFACE_DESCRIPTOR *InterfaceDescriptorList; + UNICODE_STRING HardwareId; + UNICODE_STRING CompatibleId; + UNICODE_STRING FunctionDescription; + ULONG FunctionFlags; + PVOID Reserved; +} USBC_FUNCTION_DESCRIPTOR, *PUSBC_FUNCTION_DESCRIPTOR; + +typedef +NTSTATUS +(USB_BUSIFFN *USBC_START_DEVICE_CALLBACK)( + IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor, + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + PUSBC_FUNCTION_DESCRIPTOR *FunctionDescriptorBuffer, + OUT PULONG FunctionDescriptorBufferLength, + IN PDEVICE_OBJECT FdoDeviceObject, + IN PDEVICE_OBJECT PdoDeviceObject); + +typedef +BOOLEAN +(USB_BUSIFFN *USBC_PDO_ENABLE_CALLBACK)( + IN PVOID Context, + IN USHORT FirstInterfaceNumber, + IN USHORT NumberOfInterfaces, + IN UCHAR FunctionClass, + IN UCHAR FunctionSubClass, + IN UCHAR FunctionProtocol); + +#define USBC_DEVICE_CONFIGURATION_INTERFACE_VERSION_1 0x0001 + +typedef struct _USBC_DEVICE_CONFIGURATION_INTERFACE_V1 { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; + USBC_START_DEVICE_CALLBACK StartDeviceCallback; + USBC_PDO_ENABLE_CALLBACK PdoEnableCallback; + PVOID Reserved[7]; +} USBC_DEVICE_CONFIGURATION_INTERFACE_V1, *PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1; + +#endif Propchange: branches/header-work/include/ddk/usbbusif.h ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/header-work/include/ddk/usbdrivr.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/usbdriv…
============================================================================== --- branches/header-work/include/ddk/usbdrivr.h (added) +++ branches/header-work/include/ddk/usbdrivr.h [iso-8859-1] Wed Mar 3 12:42:20 2010 @@ -1,0 +1,9 @@ +#pragma once + +#define USB_KERNEL_IOCTL +#include "usbioctl.h" +#undef USB_KERNEL_IOCTL + +#include "usb.h" +#include "usbdlib.h" +#include "usbbusif.h" Propchange: branches/header-work/include/ddk/usbdrivr.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 9 months
1
0
0
0
[akhaldi] 45782: - Move more stuff to wdm.h - Add missing MM_ALLOCATE_* definitions - Improve KeTryToAcquireSpinLockAtDpcLevel and KeTestSpinLock - Fix a typo in BYTES_TO_PAGES definition - Remove a useless #if block - Add missing ntddk.h include in ntoskrnl.h
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Mar 3 12:38:57 2010 New Revision: 45782 URL:
http://svn.reactos.org/svn/reactos?rev=45782&view=rev
Log: - Move more stuff to wdm.h - Add missing MM_ALLOCATE_* definitions - Improve KeTryToAcquireSpinLockAtDpcLevel and KeTestSpinLock - Fix a typo in BYTES_TO_PAGES definition - Remove a useless #if block - Add missing ntddk.h include in ntoskrnl.h Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h branches/header-work/ntoskrnl/include/ntoskrnl.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 12:38:57 2010 @@ -978,6 +978,14 @@ #define SharedUserData ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA) +#define EFLAG_SIGN 0x8000 +#define EFLAG_ZERO 0x4000 +#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO) + +#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) +#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT) +#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) + typedef enum _TRACE_INFORMATION_CLASS { TraceIdClass, TraceHandleClass, @@ -1445,8 +1453,76 @@ #endif // _AMD64_ /****************************************************************************** + * Kernel Functions * + ******************************************************************************/ + +/* SPINLOCK FUNCTIONS */ + +/* FIXME : #if (NTDDI_VERSION >= NTDDI_WS03SP1) */ +NTKERNELAPI +BOOLEAN +FASTCALL +KeTryToAcquireSpinLockAtDpcLevel( + IN OUT PKSPIN_LOCK SpinLock +); +/* #endif (NTDDI_VERSION >= NTDDI_WS03SP1) */ + +#if (NTDDI_VERSION >= NTDDI_WS03) +NTKERNELAPI +BOOLEAN +FASTCALL +KeTestSpinLock( + IN PKSPIN_LOCK SpinLock +); +#endif + +/* +** Utillity functions +*/ + +/* + * ULONG + * BYTE_OFFSET( + * IN PVOID Va) + */ +#define BYTE_OFFSET(Va) \ + ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1))) + +/* + * ULONG + * BYTES_TO_PAGES( + * IN ULONG Size) + */ +#define BYTES_TO_PAGES(Size) \ + (((Size) >> PAGE_SHIFT) + (((Size) & (PAGE_SIZE - 1)) != 0)) + +/* + * PVOID + * PAGE_ALIGN( + * IN PVOID Va) + */ +#define PAGE_ALIGN(Va) \ + ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1))) + +/* + * ULONG_PTR + * ROUND_TO_PAGES( + * IN ULONG_PTR Size) + */ +#define ROUND_TO_PAGES(Size) \ + (((ULONG_PTR) (Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) + + +/****************************************************************************** * Memory manager Types * ******************************************************************************/ + +#define MM_DONT_ZERO_ALLOCATION 0x00000001 +#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 +#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 +#define MM_ALLOCATE_NO_WAIT 0x00000008 +#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 +#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001 #define MDL_PAGES_LOCKED 0x0002 @@ -6864,10 +6940,6 @@ IN ULONG Count); #endif // (NTDDI_VERSION >= NTDDI_WINXPSP2) -#if (NTDDI_VERSION >= NTDDI_WS03) - -#endif // (NTDDI_VERSION >= NTDDI_WS03) - #if (NTDDI_VERSION >= NTDDI_WS03SP1) NTKERNELAPI PEX_RUNDOWN_REF_CACHE_AWARE Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 12:38:57 2010 @@ -2052,18 +2052,6 @@ #error Unknown architecture #endif -#define MM_DONT_ZERO_ALLOCATION 0x00000001 -#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 - - -#define EFLAG_SIGN 0x8000 -#define EFLAG_ZERO 0x4000 -#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO) - -#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) -#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT) -#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) - typedef enum _INTERLOCKED_RESULT { ResultNegative = RESULT_NEGATIVE, ResultZero = RESULT_ZERO, @@ -2113,20 +2101,6 @@ /** SPINLOCK FUNCTIONS ********************************************************/ - -NTKERNELAPI -BOOLEAN -FASTCALL -KeTryToAcquireSpinLockAtDpcLevel( - IN OUT PKSPIN_LOCK SpinLock -); - -NTKERNELAPI -BOOLEAN -FASTCALL -KeTestSpinLock( - IN PKSPIN_LOCK SpinLock -); #if defined (_X86_) @@ -2275,40 +2249,6 @@ #define ARGUMENT_PRESENT(ArgumentPointer) \ ((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL) -/* - * ULONG - * BYTE_OFFSET( - * IN PVOID Va) - */ -#define BYTE_OFFSET(Va) \ - ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1))) - -/* - * ULONG - * BYTES_TO_PAGES( - * IN ULONG Size) - */ -#define BYTES_TO_PAGES(Size) \ - ((ULONG) ((ULONG_PTR) (Size) >> PAGE_SHIFT) + (((ULONG) (Size) & (PAGE_SIZE - 1)) != 0)) - -/* - * PVOID - * PAGE_ALIGN( - * IN PVOID Va) - */ -#define PAGE_ALIGN(Va) \ - ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1))) - -/* - * ULONG_PTR - * ROUND_TO_PAGES( - * IN ULONG_PTR Size) - */ -#define ROUND_TO_PAGES(Size) \ - ((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) - - - #if defined(_X86_) || defined(_AMD64_) // Modified: branches/header-work/ntoskrnl/include/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/include/nt…
============================================================================== --- branches/header-work/ntoskrnl/include/ntoskrnl.h [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/include/ntoskrnl.h [iso-8859-1] Wed Mar 3 12:38:57 2010 @@ -24,6 +24,7 @@ #undef DECLSPEC_IMPORT #define DECLSPEC_IMPORT #include <ntifs.h> +#include <ntddk.h> #include <wdmguid.h> #include <arc/arc.h> #undef NTHALAPI
14 years, 9 months
1
0
0
0
[evb] 45781: - Fix includes in richard's driver. - Fix wrong calling to VideoPortCreateEvent. He got parameters all mixed up~
by evb@svn.reactos.org
Author: evb Date: Wed Mar 3 09:08:07 2010 New Revision: 45781 URL:
http://svn.reactos.org/svn/reactos?rev=45781&view=rev
Log: - Fix includes in richard's driver. - Fix wrong calling to VideoPortCreateEvent. He got parameters all mixed up~ Modified: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c Modified: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h [iso-8859-1] Wed Mar 3 09:08:07 2010 @@ -5,8 +5,8 @@ * PURPOSE: VMWARE SVGA-II Driver Header * PROGRAMMERS: ReactOS Portable Systems Group */ - -#include <ntddk.h> + +#include <ntdef.h> #include <dderror.h> #include <miniport.h> #include <ntddvdeo.h> Modified: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c [iso-8859-1] Wed Mar 3 09:08:07 2010 @@ -112,8 +112,8 @@ /* Create the sync event */ VideoPortCreateEvent(DeviceExtension, - SynchronizationEvent, - FALSE, + NOTIFICATION_EVENT, + NULL, &DeviceExtension->SyncEvent); /* Check for multi-monitor configuration */
14 years, 9 months
1
0
0
0
[evb] 45780: - Video Miniport driver not use ntddk.h, but miniport.h. But, Reactos miniport.h is empty! Add some definitions to miniport.h to get simple drivers to compile, so now can remove ntddk.h from VGA/VBE/XBOX miniports! - Video Port driver should not use either, but too many changes required. So, define __BROKEN__ to allow ntddk + miniport together. - Add VideoPortIsNoVesa API definition. Not implemented in ReactOS, used to disable VESA in F8 "Standard VGA Mode". Should implement for VGA
by evb@svn.reactos.org
Author: evb Date: Wed Mar 3 08:09:09 2010 New Revision: 45780 URL:
http://svn.reactos.org/svn/reactos?rev=45780&view=rev
Log: - Video Miniport driver not use ntddk.h, but miniport.h. But, Reactos miniport.h is empty! Add some definitions to miniport.h to get simple drivers to compile, so now can remove ntddk.h from VGA/VBE/XBOX miniports! - Video Port driver should not use either, but too many changes required. So, define __BROKEN__ to allow ntddk + miniport together. - Add VideoPortIsNoVesa API definition. Not implemented in ReactOS, used to disable VESA in F8 "Standard VGA Mode". Should implement for VGA-only support on broken VESA machine, and for test. Modified: trunk/reactos/drivers/video/miniport/vbe/vbemp.h trunk/reactos/drivers/video/miniport/vga/vgamp.h trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h trunk/reactos/drivers/video/videoprt/videoprt.h trunk/reactos/include/ddk/miniport.h trunk/reactos/include/ddk/video.h Modified: trunk/reactos/drivers/video/miniport/vbe/vbemp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vbe…
============================================================================== --- trunk/reactos/drivers/video/miniport/vbe/vbemp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vbe/vbemp.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -22,17 +22,9 @@ /* INCLUDES *******************************************************************/ -#ifdef _MSC_VER -#pragma message ("INVESTIGATE ME") -#endif - -#if 0 //#ifdef _MSC_VER +#include "ntdef.h" +#include "dderror.h" #include "devioctl.h" -#else -#include <ntddk.h> -#endif - -#include "dderror.h" #include "miniport.h" #include "ntddvdeo.h" #include "video.h" Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vga…
============================================================================== --- trunk/reactos/drivers/video/miniport/vga/vgamp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vga/vgamp.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -23,17 +23,9 @@ /* INCLUDES *******************************************************************/ -#ifdef _MSC_VER -#pragma message ("INVESTIGATE ME") -#endif - -#if 0 //#ifdef _MSC_VER +#include "ntdef.h" +#include "dderror.h" #include "devioctl.h" -#else -#include <ntddk.h> -#endif - -#include "dderror.h" #include "miniport.h" #include "ntddvdeo.h" #include "video.h" Modified: trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/xbo…
============================================================================== --- trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/xboxvmp/xboxvmp.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -24,18 +24,10 @@ /* INCLUDES *******************************************************************/ -#ifdef _MSC_VER -#pragma message ("INVESTIGATE ME") -#endif - -#if 0 //#ifdef _MSC_VER +#include "ntdef.h" +#define PAGE_SIZE 4096 +#include "dderror.h" #include "devioctl.h" -#define PAGE_SIZE 4096 -#else -#include <ntddk.h> -#endif - -#include "dderror.h" #include "miniport.h" #include "ntddvdeo.h" #include "video.h" Modified: trunk/reactos/drivers/video/videoprt/videoprt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/vid…
============================================================================== --- trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/videoprt/videoprt.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -24,6 +24,7 @@ #include <stdio.h> #include <ntddk.h> +#define __BROKEN__ #include <miniport.h> #include <video.h> #include <ntddvdeo.h> Modified: trunk/reactos/include/ddk/miniport.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/miniport.h?rev…
============================================================================== --- trunk/reactos/include/ddk/miniport.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/miniport.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -63,6 +63,193 @@ IN ULONG ReadBank, IN ULONG WriteBank, IN PVOID Context); + +#ifndef __BROKEN__ + +typedef enum _INTERFACE_TYPE { + InterfaceTypeUndefined = -1, + Internal, + Isa, + Eisa, + MicroChannel, + TurboChannel, + PCIBus, + VMEBus, + NuBus, + PCMCIABus, + CBus, + MPIBus, + MPSABus, + ProcessorInternal, + InternalPowerBus, + PNPISABus, + PNPBus, + Vmcs, + MaximumInterfaceType +}INTERFACE_TYPE, *PINTERFACE_TYPE; + +typedef enum _KINTERRUPT_MODE { + LevelSensitive, + Latched +} KINTERRUPT_MODE; + +typedef VOID (*PINTERFACE_REFERENCE)(PVOID Context); +typedef VOID (*PINTERFACE_DEREFERENCE)(PVOID Context); + +typedef enum _BUS_DATA_TYPE { + ConfigurationSpaceUndefined = -1, + Cmos, + EisaConfiguration, + Pos, + CbusConfiguration, + PCIConfiguration, + VMEConfiguration, + NuBusConfiguration, + PCMCIAConfiguration, + MPIConfiguration, + MPSAConfiguration, + PNPISAConfiguration, + SgiInternalConfiguration, + MaximumBusDataType +} BUS_DATA_TYPE, *PBUS_DATA_TYPE; + +typedef enum _DMA_WIDTH { + Width8Bits, + Width16Bits, + Width32Bits, + MaximumDmaWidth +}DMA_WIDTH, *PDMA_WIDTH; + +typedef enum _DMA_SPEED { + Compatible, + TypeA, + TypeB, + TypeC, + TypeF, + MaximumDmaSpeed +}DMA_SPEED, *PDMA_SPEED; + +typedef struct _INTERFACE { + USHORT Size; + USHORT Version; + PVOID Context; + PINTERFACE_REFERENCE InterfaceReference; + PINTERFACE_DEREFERENCE InterfaceDereference; +} INTERFACE, *PINTERFACE; + +typedef enum _IRQ_DEVICE_POLICY { + IrqPolicyMachineDefault = 0, + IrqPolicyAllCloseProcessors, + IrqPolicyOneCloseProcessor, + IrqPolicyAllProcessorsInMachine, + IrqPolicySpecifiedProcessors, + IrqPolicySpreadMessagesAcrossAllProcessors +} IRQ_DEVICE_POLICY, *PIRQ_DEVICE_POLICY; + +typedef enum _IRQ_PRIORITY { + IrqPriorityUndefined = 0, + IrqPriorityLow, + IrqPriorityNormal, + IrqPriorityHigh +} IRQ_PRIORITY, *PIRQ_PRIORITY; + +typedef struct _IO_RESOURCE_DESCRIPTOR { + UCHAR Option; + UCHAR Type; // use CM_RESOURCE_TYPE + UCHAR ShareDisposition; // use CM_SHARE_DISPOSITION + UCHAR Spare1; + USHORT Flags; // use CM resource flag defines + USHORT Spare2; // align + + union { + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Port; + + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory; + + struct { + ULONG MinimumVector; + ULONG MaximumVector; + IRQ_DEVICE_POLICY AffinityPolicy; + IRQ_PRIORITY PriorityPolicy; + KAFFINITY TargetedProcessors; + } Interrupt; + + struct { + ULONG MinimumChannel; + ULONG MaximumChannel; + } Dma; + + struct { + ULONG Length; + ULONG Alignment; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Generic; + + struct { + ULONG Data[3]; + } DevicePrivate; + + // + // Bus Number information. + // + + struct { + ULONG Length; + ULONG MinBusNumber; + ULONG MaxBusNumber; + ULONG Reserved; + } BusNumber; + + struct { + ULONG Priority; // use LCPRI_Xxx values in cfg.h + ULONG Reserved1; + ULONG Reserved2; + } ConfigData; + + // + // The following structures provide descriptions + // for memory resource requirement greater than MAXULONG + // + + struct { + ULONG Length40; + ULONG Alignment40; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory40; + + struct { + ULONG Length48; + ULONG Alignment48; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory48; + + struct { + ULONG Length64; + ULONG Alignment64; + PHYSICAL_ADDRESS MinimumAddress; + PHYSICAL_ADDRESS MaximumAddress; + } Memory64; + + + } u; + +} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; + +#include <guiddef.h> +#endif #ifdef __cplusplus } Modified: trunk/reactos/include/ddk/video.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/video.h?rev=45…
============================================================================== --- trunk/reactos/include/ddk/video.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/video.h [iso-8859-1] Wed Mar 3 08:09:09 2010 @@ -1139,6 +1139,13 @@ VPAPI BOOLEAN DDKAPI +VideoPortIsNoVesa( + VOID +); + +VPAPI +BOOLEAN +DDKAPI VideoPortQueueDpc( IN PVOID HwDeviceExtension, IN PMINIPORT_DPC_ROUTINE CallbackRoutine,
14 years, 9 months
1
0
0
0
[sir_richard] 45779: [VIDEOPRT]: <Committing on behalf of eVb> - Patch to make VideoPort INT10 Services return VP_STATUS instead of NT_STATUS. It is not the same thing.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Mar 3 06:22:45 2010 New Revision: 45779 URL:
http://svn.reactos.org/svn/reactos?rev=45779&view=rev
Log: [VIDEOPRT]: <Committing on behalf of eVb> - Patch to make VideoPort INT10 Services return VP_STATUS instead of NT_STATUS. It is not the same thing. Modified: trunk/reactos/drivers/video/videoprt/int10.c Modified: trunk/reactos/drivers/video/videoprt/int10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/int…
============================================================================== --- trunk/reactos/drivers/video/videoprt/int10.c [iso-8859-1] (original) +++ trunk/reactos/drivers/video/videoprt/int10.c [iso-8859-1] Wed Mar 3 06:22:45 2010 @@ -187,7 +187,8 @@ /* Detach and return status */ IntDetachFromCSRSS(&CallingProcess, &ApcState); - return Status; + if (NT_SUCCESS(Status)) return NO_ERROR; + return ERROR_INVALID_PARAMETER; } /* PUBLIC FUNCTIONS ***********************************************************/ @@ -240,6 +241,6 @@ /* Detach from CSRSS */ IntDetachFromCSRSS(&CallingProcess, &ApcState); - - return Status; -} + if (NT_SUCCESS(Status)) return NO_ERROR; + return ERROR_INVALID_PARAMETER; +}
14 years, 9 months
1
0
0
0
[sir_richard] 45778: [VMX-SVGA]: Some work in progress from my tree. Abandonning this for now due to work reasons, but will likely have eVb hacking on it as some future time. The point of this driver was to expose Mm/VideoPrt issues AND support Qemu hosts with the VMX-SVGA driver option which do not have a way to obtain the driver itself but would still benefit from the acceleration. It was mostly just an experiment.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Mar 3 06:21:00 2010 New Revision: 45778 URL:
http://svn.reactos.org/svn/reactos?rev=45778&view=rev
Log: [VMX-SVGA]: Some work in progress from my tree. Abandonning this for now due to work reasons, but will likely have eVb hacking on it as some future time. The point of this driver was to expose Mm/VideoPrt issues AND support Qemu hosts with the VMX-SVGA driver option which do not have a way to obtain the driver itself but would still benefit from the acceleration. It was mostly just an experiment. Modified: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c Modified: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h [iso-8859-1] Wed Mar 3 06:21:00 2010 @@ -20,13 +20,13 @@ LARGE_INTEGER VramSize; PHYSICAL_ADDRESS VramBase; ULONG MemSize; - ULONG IndexPort; - ULONG ValuePort; + PULONG IndexPort; + PULONG ValuePort; PVOID FrameBufferBase; PVOID Fifo; ULONG InterruptPort; ULONG InterruptState; - PKEVENT SyncEvent; + PENG_EVENT SyncEvent; VIDEO_MODE_INFORMATION CurrentMode; ULONG VideoModeCount; ULONG Capabilities; Modified: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c [iso-8859-1] Wed Mar 3 06:21:00 2010 @@ -9,12 +9,75 @@ /* INCLUDES *******************************************************************/ #include "precomp.h" +#include "debug.h" /* GLOBALS ********************************************************************/ PHW_DEVICE_EXTENSION VmxDeviceExtensionArray[SVGA_MAX_DISPLAYS]; +static PWCHAR AdapterString = L"VMware SVGA II"; /* FUNCTIONS ******************************************************************/ + +ULONG +NTAPI +VmxReadUlong(IN PHW_DEVICE_EXTENSION DeviceExtension, + IN ULONG Index) +{ + /* Program the index first, then read the value */ + VideoPortWritePortUlong(DeviceExtension->IndexPort, Index); + return VideoPortReadPortUlong(DeviceExtension->ValuePort); +} + +VOID +NTAPI +VmxWriteUlong(IN PHW_DEVICE_EXTENSION DeviceExtension, + IN ULONG Index, + IN ULONG Value) +{ + /* Program the index first, then write the value */ + VideoPortWritePortUlong(DeviceExtension->IndexPort, Index); + VideoPortWritePortUlong(DeviceExtension->ValuePort, Value); +} + +ULONG +NTAPI +VmxInitModes(IN PHW_DEVICE_EXTENSION DeviceExtension) +{ + /* Not here yet */ + UNIMPLEMENTED; + while (TRUE); + return 0; +} + +VP_STATUS +NTAPI +VmxInitDevice(IN PHW_DEVICE_EXTENSION DeviceExtension) +{ + /* Not here yet */ + UNIMPLEMENTED; + while (TRUE); + return NO_ERROR; +} + +BOOLEAN +NTAPI +VmxIsMultiMon(IN PHW_DEVICE_EXTENSION DeviceExtension) +{ + ULONG Capabilities; + + /* Get the caps */ + Capabilities = DeviceExtension->Capabilities; + + /* Check for multi-mon support */ + if ((Capabilities & SVGA_CAP_MULTIMON) && (Capabilities & SVGA_CAP_PITCHLOCK)) + { + /* Query the monitor count */ + if (VmxReadUlong(DeviceExtension, SVGA_REG_NUM_DISPLAYS) > 1) return TRUE; + } + + /* Either no support, or just one screen */ + return FALSE; +} VP_STATUS NTAPI @@ -24,6 +87,82 @@ IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, OUT PUCHAR Again) { + VP_STATUS Status; + PHW_DEVICE_EXTENSION DeviceExtension = HwDeviceExtension; + DPRINT1("VMX searching for adapter\n"); + + /* Zero out the fields */ + VideoPortZeroMemory(DeviceExtension, sizeof(HW_DEVICE_EXTENSION)); + + /* Validate the Config Info */ + if (ConfigInfo->Length < sizeof(VIDEO_PORT_CONFIG_INFO)) + { + /* Incorrect OS version? */ + DPRINT1("Invalid configuration info\n"); + return ERROR_INVALID_PARAMETER; + } + + /* Initialize the device extension and find the adapter */ + Status = VmxInitDevice(DeviceExtension); + DPRINT1("Init status: %lx\n", Status); + if (Status != NO_ERROR) return ERROR_DEV_NOT_EXIST; + + /* Save this adapter extension */ + VmxDeviceExtensionArray[0] = DeviceExtension; + + /* Create the sync event */ + VideoPortCreateEvent(DeviceExtension, + SynchronizationEvent, + FALSE, + &DeviceExtension->SyncEvent); + + /* Check for multi-monitor configuration */ + if (VmxIsMultiMon(DeviceExtension)) + { + /* Let's not go so far */ + UNIMPLEMENTED; + while (TRUE); + } + + /* Zero the frame buffer */ + VideoPortZeroMemory((PVOID)DeviceExtension->FrameBuffer.LowPart, + DeviceExtension->VramSize.LowPart); + + /* Initialize the video modes */ + VmxInitModes(DeviceExtension); + + /* Setup registry keys */ + VideoPortSetRegistryParameters(DeviceExtension, + L"HardwareInformation.ChipType", + AdapterString, + sizeof(AdapterString)); + VideoPortSetRegistryParameters(DeviceExtension, + L"HardwareInformation.DacType", + AdapterString, + sizeof(AdapterString)); + VideoPortSetRegistryParameters(DeviceExtension, + L"HardwareInformation.MemorySize", + &DeviceExtension->VramSize.LowPart, + sizeof(ULONG)); + VideoPortSetRegistryParameters(DeviceExtension, + L"HardwareInformation.AdapterString", + AdapterString, + sizeof(AdapterString)); + VideoPortSetRegistryParameters(DeviceExtension, + L"HardwareInformation.BiosString", + AdapterString, + sizeof(AdapterString)); + + /* No VDM support */ + ConfigInfo->NumEmulatorAccessEntries = 0; + ConfigInfo->EmulatorAccessEntries = 0; + ConfigInfo->EmulatorAccessEntriesContext = 0; + ConfigInfo->HardwareStateSize = 0; + ConfigInfo->VdmPhysicalVideoMemoryAddress.QuadPart = 0; + ConfigInfo->VdmPhysicalVideoMemoryLength = 0; + + /* Write that this is Windows XP or higher */ + VmxWriteUlong(DeviceExtension, SVGA_REG_GUEST_ID, 0x5000 | 0x08); return NO_ERROR; } @@ -31,6 +170,8 @@ NTAPI VmxInitialize(IN PVOID HwDeviceExtension) { + UNIMPLEMENTED; + while (TRUE); return TRUE; } @@ -39,6 +180,8 @@ VmxStartIO(IN PVOID HwDeviceExtension, IN PVIDEO_REQUEST_PACKET RequestPacket) { + UNIMPLEMENTED; + while (TRUE); return TRUE; } @@ -48,6 +191,8 @@ IN ULONG Columns, IN ULONG Rows) { + UNIMPLEMENTED; + while (TRUE); return FALSE; } @@ -57,6 +202,8 @@ IN ULONG HwId, IN PVIDEO_POWER_MANAGEMENT VideoPowerControl) { + UNIMPLEMENTED; + while (TRUE); return NO_ERROR; } @@ -66,14 +213,17 @@ IN ULONG HwId, IN PVIDEO_POWER_MANAGEMENT VideoPowerControl) { - - return NO_ERROR; + UNIMPLEMENTED; + while (TRUE); + return NO_ERROR; } BOOLEAN NTAPI VmxInterrupt(IN PVOID HwDeviceExtension) { + UNIMPLEMENTED; + while (TRUE); return TRUE; } @@ -86,6 +236,8 @@ OUT PULONG UId, OUT PULONG pUnused) { + UNIMPLEMENTED; + while (TRUE); return NO_ERROR; } @@ -97,6 +249,7 @@ VIDEO_HW_INITIALIZATION_DATA InitData; /* Zero initialization structure and array of extensions, one per screen */ + DPRINT1("VMX-SVGAII Loading...\n"); VideoPortZeroMemory(VmxDeviceExtensionArray, sizeof(VmxDeviceExtensionArray)); VideoPortZeroMemory(&InitData, sizeof(InitData));
14 years, 9 months
1
0
0
0
← Newer
1
...
82
83
84
85
86
87
88
89
90
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200