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
May 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
234 discussions
Start a n
N
ew thread
[hbelusca] 58970: [KDROSDBG-NTOS] Put the 3 helper COM functions into KDBG directly.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed May 8 15:36:38 2013 New Revision: 58970 URL:
http://svn.reactos.org/svn/reactos?rev=58970&view=rev
Log: [KDROSDBG-NTOS] Put the 3 helper COM functions into KDBG directly. Added: branches/kd++/ntoskrnl/kd/arm/ branches/kd++/ntoskrnl/kd/arm/kdbg.c - copied, changed from r58964, branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c branches/kd++/ntoskrnl/kd/i386/kdbg.c - copied, changed from r58964, branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c Removed: branches/kd++/drivers/base/kdrosdbg/arm/ branches/kd++/drivers/base/kdrosdbg/i386/ Modified: branches/kd++/drivers/base/kdrosdbg/CMakeLists.txt branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec branches/kd++/ntoskrnl/CMakeLists.txt Modified: branches/kd++/drivers/base/kdrosdbg/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdrosdbg/…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/CMakeLists.txt [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdrosdbg/CMakeLists.txt [iso-8859-1] Wed May 8 15:36:38 2013 @@ -1,13 +1,6 @@ spec2def(kdcom.dll kdrosdbg.spec ADD_IMPORTLIB) -if(ARCH STREQUAL "i386") - list(APPEND SOURCE i386/kdbg.c) -elseif(ARCH STREQUAL "amd64") - list(APPEND SOURCE i386/kdbg.c) -elseif(ARCH STREQUAL "arm") - list(APPEND SOURCE arm/kdbg.c) -endif(ARCH STREQUAL "i386") list(APPEND SOURCE kdrosdbg.c kdrosdbg.rc Modified: branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdrosdbg/…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec [iso-8859-1] Wed May 8 15:36:38 2013 @@ -1,13 +1,8 @@ -1 stdcall KdD0Transition() -2 stdcall KdD3Transition() -3 stdcall KdDebuggerInitialize0(ptr) -4 stdcall KdDebuggerInitialize1(ptr) -5 stdcall KdReceivePacket(long ptr ptr ptr ptr) -6 stdcall KdRestore(long) -7 stdcall KdSave(long) -8 stdcall KdSendPacket(long ptr ptr ptr) - -; Legacy KD -@ stdcall KdPortInitializeEx(ptr long) -@ stdcall KdPortGetByteEx(ptr ptr) -@ stdcall KdPortPutByteEx(ptr long) +@ stdcall KdD0Transition() +@ stdcall KdD3Transition() +@ stdcall KdDebuggerInitialize0(ptr) +@ stdcall KdDebuggerInitialize1(ptr) +@ stdcall KdReceivePacket(long ptr ptr ptr ptr) +@ stdcall KdRestore(long) +@ stdcall KdSave(long) +@ stdcall KdSendPacket(long ptr ptr ptr) Modified: branches/kd++/ntoskrnl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/CMakeLists.tx…
============================================================================== --- branches/kd++/ntoskrnl/CMakeLists.txt [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/CMakeLists.txt [iso-8859-1] Wed May 8 15:36:38 2013 @@ -363,6 +363,7 @@ if(NOT _WINKD_) if(ARCH STREQUAL "i386") list(APPEND SOURCE + kd/i386/kdbg.c kd/i386/kdmemsup.c kd/wrappers/gdbstub.c) if(KDBG) @@ -372,6 +373,7 @@ elseif(ARCH STREQUAL "amd64") list(APPEND SOURCE kd/amd64/kd.c + kd/i386/kdbg.c # Use the x86 file kd/amd64/kdmemsup.c) if(KDBG) list(APPEND ASM_SOURCE kdbg/amd64/kdb_help.S) @@ -379,6 +381,8 @@ kdbg/amd64/i386-dis.c kdbg/amd64/kdb.c) endif() + elseif(ARCH STREQUAL "arm") + list(APPEND SOURCE kd/arm/kdbg.c) elseif(ARCH STREQUAL "powerpc") list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c) endif() Copied: branches/kd++/ntoskrnl/kd/arm/kdbg.c (from r58964, branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c) URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/arm/kdbg.c…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/arm/kdbg.c [iso-8859-1] Wed May 8 15:36:38 2013 @@ -8,16 +8,8 @@ /* INCLUDES *******************************************************************/ -#define NOEXTAPI -#include <ntifs.h> -#include <arc/arc.h> -#include <halfuncs.h> -#include <windbgkd.h> -#include <ioaccess.h> /* port intrinsics */ -#include <cportlib/cportlib.h> +#include <ntoskrnl.h> #include <arm/peripherals/pl011.h> -#include <stdio.h> - #define NDEBUG #include <debug.h> @@ -32,6 +24,13 @@ #define HACK 24000000 /* REACTOS FUNCTIONS **********************************************************/ + +NTSTATUS +NTAPI +KdDebuggerInitialize1(IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + return STATUS_NOT_IMPLEMENTED; +} BOOLEAN NTAPI Copied: branches/kd++/ntoskrnl/kd/i386/kdbg.c (from r58964, branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c) URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/i386/kdbg.…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/i386/kdbg.c [iso-8859-1] Wed May 8 15:36:38 2013 @@ -9,15 +9,7 @@ /* INCLUDES *****************************************************************/ -#define NOEXTAPI -#include <ntifs.h> -#include <arc/arc.h> -#include <halfuncs.h> -#include <windbgkd.h> -#include <ioaccess.h> /* port intrinsics */ -#include <cportlib/cportlib.h> -#include <stdio.h> - +#include <ntoskrnl.h> #define NDEBUG #include <debug.h> @@ -45,6 +37,14 @@ /* REACTOS FUNCTIONS **********************************************************/ + +NTSTATUS +NTAPI +KdDebuggerInitialize1( + IN PLOADER_PARAMETER_BLOCK LoaderBlock OPTIONAL) +{ + return STATUS_NOT_IMPLEMENTED; +} BOOLEAN NTAPI
11 years, 7 months
1
0
0
0
[akhaldi] 58969: [AFD] * Mark SelectTimeout as a KDEFERRED_ROUTINE and fix its calling convention. This fixes a potential stack corruption. * Brought to you by Nikolay Borisov and the MSVC static a...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed May 8 12:12:15 2013 New Revision: 58969 URL:
http://svn.reactos.org/svn/reactos?rev=58969&view=rev
Log: [AFD] * Mark SelectTimeout as a KDEFERRED_ROUTINE and fix its calling convention. This fixes a potential stack corruption. * Brought to you by Nikolay Borisov and the MSVC static analyzer ;) CORE-7171 #resolve Modified: trunk/reactos/drivers/network/afd/afd/select.c Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Wed May 8 12:12:15 2013 @@ -91,7 +91,8 @@ AFD_DbgPrint(MID_TRACE,("Done\n")); } -static VOID SelectTimeout( PKDPC Dpc, +static KDEFERRED_ROUTINE SelectTimeout; +static VOID NTAPI SelectTimeout( PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVOID SystemArgument2 ) { @@ -235,9 +236,7 @@ KeInitializeTimerEx( &Poll->Timer, NotificationTimer ); - KeInitializeDpc( (PRKDPC)&Poll->TimeoutDpc, - (PKDEFERRED_ROUTINE)SelectTimeout, - Poll ); + KeInitializeDpc( (PRKDPC)&Poll->TimeoutDpc, SelectTimeout, Poll ); InsertTailList( &DeviceExt->Polls, &Poll->ListEntry );
11 years, 7 months
1
0
0
0
[akhaldi] 58968: [BEEP] * Properly mark some unreferenced parameters as such. [AFD] * Properly fix a debug print specifier.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed May 8 11:55:37 2013 New Revision: 58968 URL:
http://svn.reactos.org/svn/reactos?rev=58968&view=rev
Log: [BEEP] * Properly mark some unreferenced parameters as such. [AFD] * Properly fix a debug print specifier. Modified: trunk/reactos/drivers/base/beep/beep.c trunk/reactos/drivers/network/afd/afd/info.c Modified: trunk/reactos/drivers/base/beep/beep.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/beep/beep.c?r…
============================================================================== --- trunk/reactos/drivers/base/beep/beep.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/beep/beep.c [iso-8859-1] Wed May 8 11:55:37 2013 @@ -38,6 +38,10 @@ { PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; + UNREFERENCED_PARAMETER(Dpc); + UNREFERENCED_PARAMETER(SystemArgument1); + UNREFERENCED_PARAMETER(SystemArgument2); + /* Stop the beep */ HalMakeBeep(0); @@ -367,6 +371,8 @@ PDEVICE_OBJECT DeviceObject; UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\Beep"); NTSTATUS Status; + + UNREFERENCED_PARAMETER(RegistryPath); /* Create the device */ Status = IoCreateDevice(DriverObject, Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Wed May 8 11:55:37 2013 @@ -116,7 +116,7 @@ _SEH2_TRY { switch (InfoReq->InformationClass) { case AFD_INFO_BLOCKING_MODE: - AFD_DbgPrint(MID_TRACE,("Blocking mode set to %c\n", InfoReq->Information.Boolean)); + AFD_DbgPrint(MID_TRACE,("Blocking mode set to %u\n", InfoReq->Information.Boolean)); FCB->NonBlocking = InfoReq->Information.Boolean; break; case AFD_INFO_INLINING_MODE:
11 years, 7 months
1
0
0
0
[akhaldi] 58967: [AFD] * Fix more debug print specifiers.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed May 8 11:33:13 2013 New Revision: 58967 URL:
http://svn.reactos.org/svn/reactos?rev=58967&view=rev
Log: [AFD] * Fix more debug print specifiers. Modified: trunk/reactos/drivers/network/afd/afd/info.c trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/select.c Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Wed May 8 11:33:13 2013 @@ -116,7 +116,7 @@ _SEH2_TRY { switch (InfoReq->InformationClass) { case AFD_INFO_BLOCKING_MODE: - AFD_DbgPrint(MID_TRACE,("Blocking mode set to %d\n", InfoReq->Information.Boolean)); + AFD_DbgPrint(MID_TRACE,("Blocking mode set to %c\n", InfoReq->Information.Boolean)); FCB->NonBlocking = InfoReq->Information.Boolean; break; case AFD_INFO_INLINING_MODE: Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Wed May 8 11:33:13 2013 @@ -274,7 +274,7 @@ } } - AFD_DbgPrint(MID_TRACE,("Leaving %x\n", NewBuf)); + AFD_DbgPrint(MID_TRACE,("Leaving %p\n", NewBuf)); return NewBuf; } Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Wed May 8 11:33:13 2013 @@ -144,7 +144,7 @@ HandleArray = AFD_HANDLES(PollReq); for( i = 0; i < PollReq->HandleCount; i++ ) { - AFD_DbgPrint(MAX_TRACE,("Req: %p, This %p\n", + AFD_DbgPrint(MAX_TRACE,("Req: %u, This %p\n", HandleArray[i].Handle, FileObject)); if( (PVOID)HandleArray[i].Handle == FileObject && (!OnlyExclusive || (OnlyExclusive && Poll->Exclusive)) ) { @@ -278,7 +278,7 @@ return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); } - AFD_DbgPrint(MID_TRACE,("Called (Event %p Triggers %d)\n", + AFD_DbgPrint(MID_TRACE,("Called (Event %p Triggers %u)\n", EventSelectInfo->EventObject, EventSelectInfo->Events));
11 years, 7 months
1
0
0
0
[akhaldi] 58966: [AFD] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. * This fixes several warnings emitted by the MSVC...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed May 8 10:55:46 2013 New Revision: 58966 URL:
http://svn.reactos.org/svn/reactos?rev=58966&view=rev
Log: [AFD] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. * This fixes several warnings emitted by the MSVC static analyzer. * Brought to you by Nikolay Borisov, with minor consistency styling changes by me. CORE-7171 Modified: trunk/reactos/drivers/network/afd/afd/bind.c trunk/reactos/drivers/network/afd/afd/connect.c trunk/reactos/drivers/network/afd/afd/context.c trunk/reactos/drivers/network/afd/afd/info.c trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/main.c trunk/reactos/drivers/network/afd/afd/read.c trunk/reactos/drivers/network/afd/afd/select.c trunk/reactos/drivers/network/afd/afd/tdi.c trunk/reactos/drivers/network/afd/afd/write.c trunk/reactos/drivers/network/afd/include/afd.h Modified: trunk/reactos/drivers/network/afd/afd/bind.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/bi…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -13,7 +13,7 @@ NTSTATUS WarmSocketForBind( PAFD_FCB FCB, ULONG ShareType ) { NTSTATUS Status; - AFD_DbgPrint(MID_TRACE,("Called (AF %d)\n", + AFD_DbgPrint(MID_TRACE,("Called (AF %u)\n", FCB->LocalAddress->Address[0].AddressType)); if( !FCB->TdiDeviceName.Length || !FCB->TdiDeviceName.Buffer ) { @@ -78,6 +78,8 @@ PAFD_FCB FCB = FileObject->FsContext; PAFD_BIND_DATA BindReq; + UNREFERENCED_PARAMETER(DeviceObject); + AFD_DbgPrint(MID_TRACE,("Called\n")); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); Modified: trunk/reactos/drivers/network/afd/afd/connect.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -18,6 +18,8 @@ PAFD_FCB FCB = FileObject->FsContext; UINT BufferSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (FCB->ConnectOptionsSize == 0) @@ -46,6 +48,8 @@ PAFD_FCB FCB = FileObject->FsContext; PVOID ConnectOptions = LockRequest(Irp, IrpSp, FALSE, NULL); UINT ConnectOptionsSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -83,6 +87,8 @@ PUINT ConnectOptionsSize = LockRequest(Irp, IrpSp, FALSE, NULL); UINT BufferSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!ConnectOptionsSize) @@ -118,6 +124,8 @@ PAFD_FCB FCB = FileObject->FsContext; UINT BufferSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (FCB->ConnectDataSize == 0) @@ -146,6 +154,8 @@ PAFD_FCB FCB = FileObject->FsContext; PVOID ConnectData = LockRequest(Irp, IrpSp, FALSE, NULL); UINT ConnectDataSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -181,6 +191,8 @@ PAFD_FCB FCB = FileObject->FsContext; PUINT ConnectDataSize = LockRequest(Irp, IrpSp, FALSE, NULL); UINT BufferSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -287,6 +299,7 @@ return Status; } +static IO_COMPLETION_ROUTINE StreamSocketConnectComplete; static NTSTATUS NTAPI @@ -297,7 +310,7 @@ PLIST_ENTRY NextIrpEntry; PIRP NextIrp; - AFD_DbgPrint(MID_TRACE,("Called: FCB %x, FO %x\n", + AFD_DbgPrint(MID_TRACE,("Called: FCB %p, FO %p\n", Context, FCB->FileObject)); /* I was wrong about this before as we can have pending writes to a not @@ -338,7 +351,7 @@ while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_CONNECT] ) ) { NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_CONNECT]); NextIrp = CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry); - AFD_DbgPrint(MID_TRACE,("Completing connect %x\n", NextIrp)); + AFD_DbgPrint(MID_TRACE,("Completing connect %p\n", NextIrp)); NextIrp->IoStatus.Status = Status; NextIrp->IoStatus.Information = NT_SUCCESS(Status) ? ((ULONG_PTR)FCB->Connection.Handle) : 0; if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) ); @@ -374,7 +387,7 @@ NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]); NextIrp = CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry); - AFD_DbgPrint(MID_TRACE,("Launching send request %x\n", NextIrp)); + AFD_DbgPrint(MID_TRACE,("Launching send request %p\n", NextIrp)); Status = AfdConnectedSocketWriteData ( DeviceObject, NextIrp, @@ -403,7 +416,9 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; PAFD_CONNECT_INFO ConnectReq; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); + + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if( !(ConnectReq = LockRequest( Irp, IrpSp, FALSE, NULL )) ) @@ -494,7 +509,7 @@ FCB->State = SOCKET_STATE_CONNECTING; - AFD_DbgPrint(MID_TRACE,("Queueing IRP %x\n", Irp)); + AFD_DbgPrint(MID_TRACE,("Queueing IRP %p\n", Irp)); Status = QueueUserModeIrp( FCB, Irp, FUNCTION_CONNECT ); if (Status == STATUS_PENDING) { @@ -517,7 +532,7 @@ break; default: - AFD_DbgPrint(MIN_TRACE,("Inappropriate socket state %d for connect\n", + AFD_DbgPrint(MIN_TRACE,("Inappropriate socket state %u for connect\n", FCB->State)); break; } Modified: trunk/reactos/drivers/network/afd/afd/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -16,6 +16,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; UINT ContextSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -40,6 +42,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; + UNREFERENCED_PARAMETER(DeviceObject); + if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) @@ -61,6 +65,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; PVOID Context = LockRequest(Irp, IrpSp, FALSE, NULL); + + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); Modified: trunk/reactos/drivers/network/afd/afd/info.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -18,7 +18,9 @@ PAFD_FCB FCB = FileObject->FsContext; PLIST_ENTRY CurrentEntry; - AFD_DbgPrint(MID_TRACE,("Called %x %x\n", InfoReq, + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called %p %x\n", InfoReq, InfoReq ? InfoReq->InformationClass : 0)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -34,13 +36,13 @@ case AFD_INFO_SEND_WINDOW_SIZE: InfoReq->Information.Ulong = FCB->Send.Size; - AFD_DbgPrint(MID_TRACE,("Send window size %d\n", FCB->Send.Size)); + AFD_DbgPrint(MID_TRACE,("Send window size %u\n", FCB->Send.Size)); break; case AFD_INFO_GROUP_ID_TYPE: InfoReq->Information.LargeInteger.u.HighPart = FCB->GroupType; InfoReq->Information.LargeInteger.u.LowPart = FCB->GroupID; - AFD_DbgPrint(MID_TRACE, ("Group ID: %d Group Type: %d\n", FCB->GroupID, FCB->GroupType)); + AFD_DbgPrint(MID_TRACE, ("Group ID: %u Group Type: %u\n", FCB->GroupID, FCB->GroupType)); break; case AFD_INFO_BLOCKING_MODE: @@ -104,6 +106,8 @@ PAFD_FCB FCB = FileObject->FsContext; PCHAR NewBuffer; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!InfoReq) @@ -171,7 +175,7 @@ } break; default: - AFD_DbgPrint(MIN_TRACE,("Unknown request %d\n", InfoReq->InformationClass)); + AFD_DbgPrint(MIN_TRACE,("Unknown request %u\n", InfoReq->InformationClass)); break; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -191,6 +195,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; PMDL Mdl = NULL; + + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -232,6 +238,7 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -16,11 +16,13 @@ PAFD_FCB FCB = NewFileObject->FsContext; NTSTATUS Status; + UNREFERENCED_PARAMETER(DeviceExt); + if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); /* Transfer the connection to the new socket, launch the opening read */ - AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB)); + AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %p)\n", FCB)); FCB->Connection = Qelt->Object; @@ -49,8 +51,8 @@ ListenReceive->SequenceNumber = Qelt->Seq; - AFD_DbgPrint(MID_TRACE,("Giving SEQ %d to userland\n", Qelt->Seq)); - AFD_DbgPrint(MID_TRACE,("Socket Address (K) %x (U) %x\n", + AFD_DbgPrint(MID_TRACE,("Giving SEQ %u to userland\n", Qelt->Seq)); + AFD_DbgPrint(MID_TRACE,("Socket Address (K) %p (U) %p\n", &ListenReceive->Address, Qelt->ConnInfo->RemoteAddress)); @@ -61,9 +63,9 @@ AFD_DbgPrint(MID_TRACE,("IPAddr->TAAddressCount %d\n", IPAddr->TAAddressCount)); - AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].AddressType %d\n", + AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].AddressType %u\n", IPAddr->Address[0].AddressType)); - AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].AddressLength %d\n", + AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].AddressLength %u\n", IPAddr->Address[0].AddressLength)); AFD_DbgPrint(MID_TRACE,("IPAddr->Address[0].Address[0].sin_port %x\n", IPAddr->Address[0].Address[0].sin_port)); @@ -79,6 +81,7 @@ return STATUS_SUCCESS; } +static IO_COMPLETION_ROUTINE ListenComplete; static NTSTATUS NTAPI ListenComplete( PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context ) { @@ -87,6 +90,8 @@ PAFD_TDI_OBJECT_QELT Qelt; PLIST_ENTRY NextIrpEntry; PIRP NextIrp; + + UNREFERENCED_PARAMETER(DeviceObject); if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; @@ -141,7 +146,7 @@ Qelt->Object = FCB->Connection; Qelt->Seq = FCB->ConnSeq++; - AFD_DbgPrint(MID_TRACE,("Address Type: %d (RA %x)\n", + AFD_DbgPrint(MID_TRACE,("Address Type: %u (RA %p)\n", AddressType, FCB->ListenIrp. ConnectionReturnInfo->RemoteAddress)); @@ -213,7 +218,9 @@ PAFD_FCB FCB = FileObject->FsContext; PAFD_LISTEN_DATA ListenReq; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -229,7 +236,7 @@ FCB->DelayedAccept = ListenReq->UseDelayedAcceptance; - AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %x\n", FCB->AddressFile.Handle)); + AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %p\n", FCB->AddressFile.Handle)); Status = WarmSocketForConnection( FCB ); @@ -276,6 +283,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; NTSTATUS Status; + + UNREFERENCED_PARAMETER(DeviceObject); AFD_DbgPrint(MID_TRACE,("Called\n")); @@ -335,7 +344,7 @@ PAFD_TDI_OBJECT_QELT PendingConnObj = CONTAINING_RECORD( PendingConn, AFD_TDI_OBJECT_QELT, ListEntry ); - AFD_DbgPrint(MID_TRACE,("Comparing Seq %d to Q %d\n", + AFD_DbgPrint(MID_TRACE,("Comparing Seq %u to Q %u\n", AcceptData->SequenceNumber, PendingConnObj->Seq)); Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -13,6 +13,8 @@ { ASSERT(Irp->MdlAddress); ASSERT(Irp->Tail.Overlay.DriverContext[0]); + + UNREFERENCED_PARAMETER(IrpSp); return Irp->Tail.Overlay.DriverContext[0]; } @@ -173,6 +175,8 @@ ASSERT(Irp->MdlAddress); ASSERT(Irp->Tail.Overlay.DriverContext[0]); + UNREFERENCED_PARAMETER(IrpSp); + /* Check if we need to copy stuff back */ if (Irp->Tail.Overlay.DriverContext[1] != NULL) { @@ -203,7 +207,7 @@ BOOLEAN LockFailed = FALSE; PAFD_MAPBUF MapBuf; - AFD_DbgPrint(MID_TRACE,("Called(%08x)\n", NewBuf)); + AFD_DbgPrint(MID_TRACE,("Called(%p)\n", NewBuf)); if( NewBuf ) { RtlZeroMemory(NewBuf, Size); @@ -223,14 +227,14 @@ } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { AFD_DbgPrint(MIN_TRACE,("Access violation copying buffer info " - "from userland (%x %x)\n", + "from userland (%p %p)\n", Buf, AddressLen)); ExFreePool( NewBuf ); _SEH2_YIELD(return NULL); } _SEH2_END; for( i = 0; i < Count; i++ ) { - AFD_DbgPrint(MID_TRACE,("Locking buffer %d (%x:%d)\n", + AFD_DbgPrint(MID_TRACE,("Locking buffer %u (%p:%u)\n", i, NewBuf[i].buf, NewBuf[i].len)); if( NewBuf[i].buf && NewBuf[i].len ) { @@ -244,7 +248,7 @@ continue; } - AFD_DbgPrint(MID_TRACE,("NewMdl @ %x\n", MapBuf[i].Mdl)); + AFD_DbgPrint(MID_TRACE,("NewMdl @ %p\n", MapBuf[i].Mdl)); if( MapBuf[i].Mdl ) { AFD_DbgPrint(MID_TRACE,("Probe and lock pages\n")); Modified: trunk/reactos/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -46,6 +46,8 @@ PAFD_FCB FCB = FileObject->FsContext; UINT BufferSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (FCB->DisconnectOptionsSize == 0) @@ -75,6 +77,8 @@ PVOID DisconnectOptions = LockRequest(Irp, IrpSp, FALSE, NULL); UINT DisconnectOptionsSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!DisconnectOptions) @@ -111,6 +115,8 @@ PUINT DisconnectOptionsSize = LockRequest(Irp, IrpSp, FALSE, NULL); UINT BufferSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!DisconnectOptionsSize) @@ -144,6 +150,8 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; PAFD_FCB FCB = FileObject->FsContext; UINT BufferSize = IrpSp->Parameters.DeviceIoControl.OutputBufferLength; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -175,6 +183,8 @@ PVOID DisconnectData = LockRequest(Irp, IrpSp, FALSE, NULL); UINT DisconnectDataSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!DisconnectData) @@ -211,6 +221,8 @@ PUINT DisconnectDataSize = LockRequest(Irp, IrpSp, FALSE, NULL); UINT BufferSize = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + UNREFERENCED_PARAMETER(DeviceObject); + if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); if (!DisconnectDataSize) @@ -246,6 +258,8 @@ PAFD_FCB FCB = FileObject->FsContext; PULONG HandleFlags = LockRequest(Irp, IrpSp, TRUE, NULL); PAFD_TDI_HANDLE_DATA HandleData = Irp->UserBuffer; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -299,7 +313,7 @@ //EaLength = sizeof(FILE_FULL_EA_INFORMATION) + EaInfo->EaNameLength + EaInfo->EaValueLength; - AFD_DbgPrint(MID_TRACE,("EaInfo: %x, EaInfoValue: %x\n", + AFD_DbgPrint(MID_TRACE,("EaInfo: %p, EaInfoValue: %p\n", EaInfo, EaInfoValue)); } @@ -312,7 +326,7 @@ return STATUS_NO_MEMORY; } - AFD_DbgPrint(MID_TRACE,("Initializing the new FCB @ %x (FileObject %x Flags %x)\n", + AFD_DbgPrint(MID_TRACE,("Initializing the new FCB @ %p (FileObject %p Flags %x)\n", FCB, FileObject, ConnectInfo ? ConnectInfo->EndpointFlags : 0)); RtlZeroMemory( FCB, sizeof( *FCB ) ); @@ -335,7 +349,7 @@ InitializeListHead( &FCB->DatagramList ); InitializeListHead( &FCB->PendingConnections ); - AFD_DbgPrint(MID_TRACE,("%x: Checking command channel\n", FCB)); + AFD_DbgPrint(MID_TRACE,("%p: Checking command channel\n", FCB)); if( ConnectInfo ) { FCB->TdiDeviceName.Length = ConnectInfo->SizeOfTransportName; @@ -395,6 +409,8 @@ UINT Function; PIRP CurrentIrp; + UNREFERENCED_PARAMETER(DeviceObject); + if( !SocketAcquireStateLock( FCB ) ) return LostSocket(Irp); for (Function = 0; Function < MAX_FUNCTIONS; Function++) @@ -445,7 +461,7 @@ /* Cancel our pending requests */ for( i = 0; i < IN_FLIGHT_REQUESTS; i++ ) { if( InFlightRequest[i]->InFlightRequest ) { - AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %d (%x)\n", + AFD_DbgPrint(MID_TRACE,("Cancelling in flight irp %u (%p)\n", i, InFlightRequest[i]->InFlightRequest)); IoCancelIrp(InFlightRequest[i]->InFlightRequest); } @@ -526,7 +542,7 @@ { if (ZwClose(FCB->AddressFile.Handle) == STATUS_INVALID_HANDLE) { - DbgPrint("INVALID ADDRESS FILE HANDLE VALUE: %x %x\n", FCB->AddressFile.Handle, FCB->AddressFile.Object); + DbgPrint("INVALID ADDRESS FILE HANDLE VALUE: %p %p\n", FCB->AddressFile.Handle, FCB->AddressFile.Object); } } @@ -534,7 +550,7 @@ { if (ZwClose(FCB->Connection.Handle) == STATUS_INVALID_HANDLE) { - DbgPrint("INVALID CONNECTION HANDLE VALUE: %x %x\n", FCB->Connection.Handle, FCB->Connection.Object); + DbgPrint("INVALID CONNECTION HANDLE VALUE: %p %p\n", FCB->Connection.Handle, FCB->Connection.Object); } } @@ -552,6 +568,7 @@ return STATUS_SUCCESS; } +static IO_COMPLETION_ROUTINE DisconnectComplete; static NTSTATUS NTAPI @@ -562,6 +579,8 @@ PAFD_FCB FCB = Context; PIRP CurrentIrp; PLIST_ENTRY CurrentEntry; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return STATUS_FILE_CLOSED; @@ -678,6 +697,8 @@ USHORT Flags; PLIST_ENTRY CurrentEntry; PIRP CurrentIrp; + + UNREFERENCED_PARAMETER(DeviceObject); if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp); @@ -809,6 +830,7 @@ return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); } +static DRIVER_DISPATCH AfdDispatch; static NTSTATUS NTAPI AfdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) { @@ -818,9 +840,9 @@ PFILE_OBJECT FileObject = IrpSp->FileObject; #endif - AFD_DbgPrint(MID_TRACE,("AfdDispatch: %d\n", IrpSp->MajorFunction)); + AFD_DbgPrint(MID_TRACE,("AfdDispatch: %u\n", IrpSp->MajorFunction)); if( IrpSp->MajorFunction != IRP_MJ_CREATE) { - AFD_DbgPrint(MID_TRACE,("FO %x, IrpSp->FO %x\n", + AFD_DbgPrint(MID_TRACE,("FO %p, IrpSp->FO %p\n", FileObject, IrpSp->FileObject)); ASSERT(FileObject == IrpSp->FileObject); } @@ -1082,7 +1104,8 @@ } } -VOID NTAPI +VOID +NTAPI AfdCancelHandler(PDEVICE_OBJECT DeviceObject, PIRP Irp) { @@ -1199,12 +1222,14 @@ SocketStateUnlock(FCB); - DbgPrint("WARNING!!! IRP cancellation race could lead to a process hang! (Function: %d)\n", Function); -} - + DbgPrint("WARNING!!! IRP cancellation race could lead to a process hang! (Function: %u)\n", Function); +} + +static DRIVER_UNLOAD AfdUnload; static VOID NTAPI AfdUnload(PDRIVER_OBJECT DriverObject) { + UNREFERENCED_PARAMETER(DriverObject); } NTSTATUS NTAPI @@ -1215,6 +1240,7 @@ PAFD_DEVICE_EXTENSION DeviceExt; NTSTATUS Status; + UNREFERENCED_PARAMETER(RegistryPath); /* register driver routines */ DriverObject->MajorFunction[IRP_MJ_CLOSE] = AfdDispatch; DriverObject->MajorFunction[IRP_MJ_CREATE] = AfdDispatch; @@ -1242,7 +1268,7 @@ KeInitializeSpinLock( &DeviceExt->Lock ); InitializeListHead( &DeviceExt->Polls ); - AFD_DbgPrint(MID_TRACE,("Device created: object %x ext %x\n", + AFD_DbgPrint(MID_TRACE,("Device created: object %p ext %p\n", DeviceObject, DeviceExt)); return Status; Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -101,15 +101,14 @@ *TotalBytesCopied = 0; - AFD_DbgPrint(MID_TRACE,("Called, BytesAvailable = %d\n", - BytesAvailable)); + AFD_DbgPrint(MID_TRACE,("Called, BytesAvailable = %u\n", BytesAvailable)); if( CantReadMore(FCB) ) return STATUS_SUCCESS; if( !BytesAvailable ) return STATUS_PENDING; Map = (PAFD_MAPBUF)(RecvReq->BufferArray + RecvReq->BufferCount); - AFD_DbgPrint(MID_TRACE,("Buffer Count: %d @ %x\n", + AFD_DbgPrint(MID_TRACE,("Buffer Count: %u @ %p\n", RecvReq->BufferCount, RecvReq->BufferArray)); for( i = 0; @@ -123,7 +122,7 @@ if( Map[i].Mdl ) { Map[i].BufferAddress = MmMapLockedPages( Map[i].Mdl, KernelMode ); - AFD_DbgPrint(MID_TRACE,("Buffer %d: %x:%d\n", + AFD_DbgPrint(MID_TRACE,("Buffer %u: %p:%u\n", i, Map[i].BufferAddress, BytesToCopy)); @@ -157,9 +156,9 @@ UINT TotalBytesCopied = 0, RetBytesCopied = 0; NTSTATUS Status = STATUS_SUCCESS, RetStatus = STATUS_PENDING; - AFD_DbgPrint(MID_TRACE,("%x %x\n", FCB, Irp)); - - AFD_DbgPrint(MID_TRACE,("FCB %x Receive data waiting %d\n", + AFD_DbgPrint(MID_TRACE,("%p %p\n", FCB, Irp)); + + AFD_DbgPrint(MID_TRACE,("FCB %p Receive data waiting %u\n", FCB, FCB->Recv.Content)); if( CantReadMore( FCB ) ) { @@ -172,7 +171,7 @@ NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp ); RecvReq = GetLockedData(NextIrp, NextIrpSp); - AFD_DbgPrint(MID_TRACE,("Completing recv %x (%d)\n", NextIrp, + AFD_DbgPrint(MID_TRACE,("Completing recv %p (%u)\n", NextIrp, TotalBytesCopied)); UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, FALSE ); @@ -198,7 +197,7 @@ /* Kick the user that receive would be possible now */ /* XXX Not implemented yet */ - AFD_DbgPrint(MID_TRACE,("FCB %x Receive data waiting %d\n", + AFD_DbgPrint(MID_TRACE,("FCB %p Receive data waiting %u\n", FCB, FCB->Recv.Content)); /*OskitDumpBuffer( FCB->Recv.Window, FCB->Recv.Content );*/ @@ -209,18 +208,18 @@ NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp ); RecvReq = GetLockedData(NextIrp, NextIrpSp); - AFD_DbgPrint(MID_TRACE,("RecvReq @ %x\n", RecvReq)); + AFD_DbgPrint(MID_TRACE,("RecvReq @ %p\n", RecvReq)); Status = TryToSatisfyRecvRequestFromBuffer ( FCB, RecvReq, &TotalBytesCopied ); if( Status == STATUS_PENDING ) { - AFD_DbgPrint(MID_TRACE,("Ran out of data for %x\n", NextIrp)); + AFD_DbgPrint(MID_TRACE,("Ran out of data for %p\n", NextIrp)); InsertHeadList(&FCB->PendingIrpList[FUNCTION_RECV], &NextIrp->Tail.Overlay.ListEntry); break; } else { - AFD_DbgPrint(MID_TRACE,("Completing recv %x (%d)\n", NextIrp, + AFD_DbgPrint(MID_TRACE,("Completing recv %p (%u)\n", NextIrp, TotalBytesCopied)); UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, FALSE ); @@ -263,7 +262,7 @@ PollReeval(FCB->DeviceExt, FCB->FileObject); } - AFD_DbgPrint(MID_TRACE,("RetStatus for irp %x is %x\n", Irp, RetStatus)); + AFD_DbgPrint(MID_TRACE,("RetStatus for irp %p is %x\n", Irp, RetStatus)); /* Sometimes we're called with a NULL Irp */ if( Irp ) { @@ -283,6 +282,8 @@ PIRP NextIrp; PAFD_RECV_INFO RecvReq; PIO_STACK_LOCATION NextIrpSp; + + UNREFERENCED_PARAMETER(DeviceObject); AFD_DbgPrint(MID_TRACE,("Called\n")); @@ -341,7 +342,7 @@ BytesToCopy = MIN( RecvReq->BufferArray[0].len, BytesAvailable ); - AFD_DbgPrint(MID_TRACE,("BytesToCopy: %d len %d\n", BytesToCopy, + AFD_DbgPrint(MID_TRACE,("BytesToCopy: %u len %u\n", BytesToCopy, RecvReq->BufferArray[0].len)); if( Map[0].Mdl ) { @@ -362,7 +363,7 @@ sizeof(USHORT), RecvReq->BufferArray[1].len); - AFD_DbgPrint(MID_TRACE,("Copying %d bytes of address\n", AddrLen)); + AFD_DbgPrint(MID_TRACE,("Copying %u bytes of address\n", AddrLen)); Map[1].BufferAddress = MmMapLockedPages( Map[1].Mdl, KernelMode ); @@ -385,7 +386,7 @@ Map[0].BufferAddress = MmMapLockedPages( Map[0].Mdl, KernelMode ); - AFD_DbgPrint(MID_TRACE,("Buffer %d: %x:%d\n", + AFD_DbgPrint(MID_TRACE,("Buffer %d: %p:%u\n", 0, Map[0].BufferAddress, BytesToCopy)); @@ -436,7 +437,10 @@ PLIST_ENTRY ListEntry; KPROCESSOR_MODE LockMode; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + UNREFERENCED_PARAMETER(Short); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -558,7 +562,9 @@ UINT DGSize = Irp->IoStatus.Information + sizeof( AFD_STORED_DATAGRAM ); PLIST_ENTRY NextIrpEntry, DatagramRecvEntry; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; @@ -611,7 +617,7 @@ DatagramRecv->Len = Irp->IoStatus.Information; RtlCopyMemory( DatagramRecv->Buffer, FCB->Recv.Window, DatagramRecv->Len ); - AFD_DbgPrint(MID_TRACE,("Received (A %x)\n", + AFD_DbgPrint(MID_TRACE,("Received (A %p)\n", FCB->AddressFrom->RemoteAddress)); DatagramRecv->Address = TaCopyTransportAddress( FCB->AddressFrom->RemoteAddress ); @@ -642,7 +648,7 @@ NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp ); RecvReq = GetLockedData(NextIrp, NextIrpSp); - AFD_DbgPrint(MID_TRACE,("RecvReq: %x, DatagramRecv: %x\n", + AFD_DbgPrint(MID_TRACE,("RecvReq: %p, DatagramRecv: %p\n", RecvReq, DatagramRecv)); AFD_DbgPrint(MID_TRACE,("Satisfying\n")); @@ -705,7 +711,9 @@ PAFD_STORED_DATAGRAM DatagramRecv; KPROCESSOR_MODE LockMode; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -101,6 +101,10 @@ KIRQL OldIrql; PAFD_DEVICE_EXTENSION DeviceExt; + UNREFERENCED_PARAMETER(Dpc); + UNREFERENCED_PARAMETER(SystemArgument1); + UNREFERENCED_PARAMETER(SystemArgument2); + AFD_DbgPrint(MID_TRACE,("Called\n")); Irp = Poll->Irp; @@ -127,7 +131,7 @@ PAFD_HANDLE HandleArray; UINT i; - AFD_DbgPrint(MID_TRACE,("Killing selects that refer to %x\n", FileObject)); + AFD_DbgPrint(MID_TRACE,("Killing selects that refer to %p\n", FileObject)); KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql ); @@ -140,7 +144,7 @@ HandleArray = AFD_HANDLES(PollReq); for( i = 0; i < PollReq->HandleCount; i++ ) { - AFD_DbgPrint(MAX_TRACE,("Req: %x, This %x\n", + AFD_DbgPrint(MAX_TRACE,("Req: %p, This %p\n", HandleArray[i].Handle, FileObject)); if( (PVOID)HandleArray[i].Handle == FileObject && (!OnlyExclusive || (OnlyExclusive && Poll->Exclusive)) ) { @@ -167,7 +171,9 @@ UINT i, Signalled = 0; ULONG Exclusive = PollReq->Exclusive; - AFD_DbgPrint(MID_TRACE,("Called (HandleCount %d Timeout %d)\n", + UNREFERENCED_PARAMETER(IrpSp); + + AFD_DbgPrint(MID_TRACE,("Called (HandleCount %u Timeout %d)\n", PollReq->HandleCount, (INT)(PollReq->Timeout.QuadPart))); @@ -206,7 +212,7 @@ PollReq->Handles[i].Status = PollReq->Handles[i].Events & FCB->PollState; if( PollReq->Handles[i].Status ) { - AFD_DbgPrint(MID_TRACE,("Signalling %x with %x\n", + AFD_DbgPrint(MID_TRACE,("Signalling %p with %x\n", FCB, FCB->PollState)); Signalled++; } @@ -262,6 +268,8 @@ (PAFD_EVENT_SELECT_INFO)LockRequest( Irp, IrpSp, FALSE, NULL ); PAFD_FCB FCB = FileObject->FsContext; + UNREFERENCED_PARAMETER(DeviceObject); + if( !SocketAcquireStateLock( FCB ) ) { return LostSocket( Irp ); } @@ -270,7 +278,7 @@ return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); } - AFD_DbgPrint(MID_TRACE,("Called (Event %x Triggers %x)\n", + AFD_DbgPrint(MID_TRACE,("Called (Event %p Triggers %d)\n", EventSelectInfo->EventObject, EventSelectInfo->Events)); @@ -302,7 +310,7 @@ if((FCB->EventSelect) && (FCB->PollState & (FCB->EventSelectTriggers & ~FCB->EventSelectDisabled))) { - AFD_DbgPrint(MID_TRACE,("Setting event %x\n", FCB->EventSelect)); + AFD_DbgPrint(MID_TRACE,("Setting event %p\n", FCB->EventSelect)); /* Set the application's event */ KeSetEvent( FCB->EventSelect, IO_NETWORK_INCREMENT, FALSE ); @@ -324,7 +332,9 @@ PKEVENT UserEvent; NTSTATUS Status; - AFD_DbgPrint(MID_TRACE,("Called (FCB %x)\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called (FCB %p)\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) { return LostSocket( Irp ); @@ -379,7 +389,7 @@ PollReq->Handles[i].Status = PollReq->Handles[i].Events & FCB->PollState; if( PollReq->Handles[i].Status ) { - AFD_DbgPrint(MID_TRACE,("Signalling %x with %x\n", + AFD_DbgPrint(MID_TRACE,("Signalling %p with %x\n", FCB, FCB->PollState)); Signalled++; } @@ -395,7 +405,7 @@ KIRQL OldIrql; PAFD_POLL_INFO PollReq; - AFD_DbgPrint(MID_TRACE,("Called: DeviceExt %x FileObject %x\n", + AFD_DbgPrint(MID_TRACE,("Called: DeviceExt %p FileObject %p\n", DeviceExt, FileObject)); KeAcquireSpinLock( &DeviceExt->Lock, &OldIrql ); @@ -414,7 +424,7 @@ while( ThePollEnt != &DeviceExt->Polls ) { Poll = CONTAINING_RECORD( ThePollEnt, AFD_ACTIVE_POLL, ListEntry ); PollReq = Poll->Irp->AssociatedIrp.SystemBuffer; - AFD_DbgPrint(MID_TRACE,("Checking poll %x\n", Poll)); + AFD_DbgPrint(MID_TRACE,("Checking poll %p\n", Poll)); if( UpdatePollWithFCB( Poll, FileObject ) ) { ThePollEnt = ThePollEnt->Flink; @@ -429,7 +439,7 @@ if((FCB->EventSelect) && (FCB->PollState & (FCB->EventSelectTriggers & ~FCB->EventSelectDisabled))) { - AFD_DbgPrint(MID_TRACE,("Setting event %x\n", FCB->EventSelect)); + AFD_DbgPrint(MID_TRACE,("Setting event %p\n", FCB->EventSelect)); /* Set the application's event */ KeSetEvent( FCB->EventSelect, IO_NETWORK_INCREMENT, FALSE ); Modified: trunk/reactos/drivers/network/afd/afd/tdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -64,7 +64,7 @@ AFD_DbgPrint(MID_TRACE, ("Called\n")); - AFD_DbgPrint(MID_TRACE, ("Irp->UserEvent = %x\n", Irp->UserEvent)); + AFD_DbgPrint(MID_TRACE, ("Irp->UserEvent = %p\n", Irp->UserEvent)); Status = IoCallDriver(DeviceObject, Irp); AFD_DbgPrint(MID_TRACE, ("IoCallDriver: %08x\n", Status)); @@ -109,7 +109,7 @@ NTSTATUS Status; ULONG ShareAccess; - AFD_DbgPrint(MAX_TRACE, ("Called. DeviceName (%wZ, %d)\n", DeviceName, ShareType)); + AFD_DbgPrint(MAX_TRACE, ("Called. DeviceName (%wZ, %u)\n", DeviceName, ShareType)); /* Determine the share access */ if (ShareType != AFD_SHARE_REUSE) @@ -152,7 +152,7 @@ AFD_DbgPrint(MIN_TRACE, ("ObReferenceObjectByHandle() failed with status (0x%X).\n", Status)); ZwClose(*Handle); } else { - AFD_DbgPrint(MAX_TRACE, ("Got handle (0x%X) Object (0x%X)\n", + AFD_DbgPrint(MAX_TRACE, ("Got handle (%p) Object (%p)\n", *Handle, *Object)); } } else { @@ -189,7 +189,7 @@ ULONG EaLength; PTRANSPORT_ADDRESS Address; - AFD_DbgPrint(MAX_TRACE, ("Called. DeviceName (%wZ) Name (0x%X)\n", + AFD_DbgPrint(MAX_TRACE, ("Called. DeviceName (%wZ) Name (%p)\n", DeviceName, Name)); /* EaName must be 0-terminated, even though TDI_TRANSPORT_ADDRESS_LENGTH does *not* include the 0 */ @@ -399,7 +399,7 @@ KEVENT Event; PIRP Irp; - AFD_DbgPrint(MAX_TRACE, ("Called. AddressHandle (0x%X) ConnectionObject (0x%X)\n", + AFD_DbgPrint(MAX_TRACE, ("Called. AddressHandle (%p) ConnectionObject (%p)\n", AddressHandle, ConnectionObject)); if (!ConnectionObject) { @@ -448,7 +448,7 @@ KEVENT Event; PIRP Irp; - AFD_DbgPrint(MAX_TRACE, ("Called. ConnectionObject (0x%X)\n", ConnectionObject)); + AFD_DbgPrint(MAX_TRACE, ("Called. ConnectionObject (%p)\n", ConnectionObject)); if (!ConnectionObject) { AFD_DbgPrint(MIN_TRACE, ("Bad connection object.\n")); @@ -803,7 +803,7 @@ /* Locate an IP entity */ EntityCount = BufferSize / sizeof(TDIEntityID); - AFD_DbgPrint(MAX_TRACE, ("EntityCount = %d\n", EntityCount)); + AFD_DbgPrint(MAX_TRACE, ("EntityCount = %u\n", EntityCount)); for (i = 0; i < EntityCount; i++) { if (Entities[i].tei_entity == CL_NL_ENTITY) { @@ -923,7 +923,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - AFD_DbgPrint(MID_TRACE, ("Allocating irp for %x:%d\n", Buffer,BufferLength)); + AFD_DbgPrint(MID_TRACE, ("Allocating irp for %p:%u\n", Buffer,BufferLength)); Mdl = IoAllocateMdl(Buffer, /* Virtual address */ BufferLength, /* Length of buffer */ @@ -947,7 +947,7 @@ _SEH2_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH2_END; - AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); + AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %p\n", Mdl)); TdiBuildSend(*Irp, /* I/O Request Packet */ DeviceObject, /* Device object */ @@ -1002,7 +1002,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - AFD_DbgPrint(MID_TRACE, ("Allocating irp for %x:%d\n", Buffer,BufferLength)); + AFD_DbgPrint(MID_TRACE, ("Allocating irp for %p:%u\n", Buffer,BufferLength)); Mdl = IoAllocateMdl(Buffer, /* Virtual address */ BufferLength, /* Length of buffer */ @@ -1028,7 +1028,7 @@ _SEH2_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH2_END; - AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); + AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %p\n", Mdl)); TdiBuildReceive(*Irp, /* I/O Request Packet */ DeviceObject, /* Device object */ @@ -1097,7 +1097,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - AFD_DbgPrint(MID_TRACE, ("Allocating irp for %x:%d\n", Buffer,BufferLength)); + AFD_DbgPrint(MID_TRACE, ("Allocating irp for %p:%u\n", Buffer,BufferLength)); Mdl = IoAllocateMdl(Buffer, /* Virtual address */ BufferLength, /* Length of buffer */ @@ -1121,7 +1121,7 @@ _SEH2_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH2_END; - AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); + AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %p\n", Mdl)); TdiBuildReceiveDatagram(*Irp, /* I/O Request Packet */ DeviceObject, /* Device object */ @@ -1173,7 +1173,7 @@ return STATUS_INVALID_PARAMETER; } - AFD_DbgPrint(MID_TRACE,("Called(TransportObject %x)\n", TransportObject)); + AFD_DbgPrint(MID_TRACE,("Called(TransportObject %p)\n", TransportObject)); DeviceObject = IoGetRelatedDeviceObject(TransportObject); if (!DeviceObject) { @@ -1192,7 +1192,7 @@ return STATUS_INSUFFICIENT_RESOURCES; } - AFD_DbgPrint(MID_TRACE, ("Allocating irp for %x:%d\n", Buffer,BufferLength)); + AFD_DbgPrint(MID_TRACE, ("Allocating irp for %p:%u\n", Buffer,BufferLength)); Mdl = IoAllocateMdl(Buffer, /* Virtual address */ BufferLength, /* Length of buffer */ @@ -1217,7 +1217,7 @@ _SEH2_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH2_END; - AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); + AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %p\n", Mdl)); TdiBuildSendDatagram(*Irp, /* I/O Request Packet */ DeviceObject, /* Device object */ @@ -1252,7 +1252,7 @@ return STATUS_INVALID_PARAMETER; } - AFD_DbgPrint(MID_TRACE,("Called(TransportObject %x)\n", TransportObject)); + AFD_DbgPrint(MID_TRACE,("Called(TransportObject %p)\n", TransportObject)); DeviceObject = IoGetRelatedDeviceObject(TransportObject); if (!DeviceObject) { Modified: trunk/reactos/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Wed May 8 10:55:46 2013 @@ -9,6 +9,7 @@ */ #include "afd.h" +static IO_COMPLETION_ROUTINE SendComplete; static NTSTATUS NTAPI SendComplete ( PDEVICE_OBJECT DeviceObject, PIRP Irp, @@ -24,6 +25,8 @@ UINT SendLength, BytesCopied; BOOLEAN HaltSendQueue; + UNREFERENCED_PARAMETER(DeviceObject); + /* * The Irp parameter passed in is the IRP of the stream between AFD and * TDI driver. It's not very usefull to us. We need the IRPs of the stream @@ -33,7 +36,7 @@ * processed). */ - AFD_DbgPrint(MID_TRACE,("Called, status %x, %d bytes used\n", + AFD_DbgPrint(MID_TRACE,("Called, status %x, %u bytes used\n", Irp->IoStatus.Status, Irp->IoStatus.Information)); @@ -159,7 +162,7 @@ SendReq = GetLockedData(NextIrp, NextIrpSp); Map = (PAFD_MAPBUF)(SendReq->BufferArray + SendReq->BufferCount); - AFD_DbgPrint(MID_TRACE,("SendReq @ %x\n", SendReq)); + AFD_DbgPrint(MID_TRACE,("SendReq @ %p\n", SendReq)); SpaceAvail = FCB->Send.Size - FCB->Send.BytesUsed; TotalBytesCopied = 0; @@ -254,6 +257,7 @@ return STATUS_SUCCESS; } +static IO_COMPLETION_ROUTINE PacketSocketSendComplete; static NTSTATUS NTAPI PacketSocketSendComplete ( PDEVICE_OBJECT DeviceObject, PIRP Irp, @@ -263,7 +267,9 @@ PIRP NextIrp; PAFD_SEND_INFO SendReq; - AFD_DbgPrint(MID_TRACE,("Called, status %x, %d bytes used\n", + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called, status %x, %u bytes used\n", Irp->IoStatus.Status, Irp->IoStatus.Information)); @@ -329,7 +335,10 @@ UINT TotalBytesCopied = 0, i, SpaceAvail = 0, BytesCopied, SendLength; KPROCESSOR_MODE LockMode; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + UNREFERENCED_PARAMETER(Short); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -431,7 +440,7 @@ Irp, 0 ); } - AFD_DbgPrint(MID_TRACE,("Socket state %d\n", FCB->State)); + AFD_DbgPrint(MID_TRACE,("Socket state %u\n", FCB->State)); if( FCB->State != SOCKET_STATE_CONNECTED ) { if (!(SendReq->AfdFlags & AFD_OVERLAPPED) && @@ -445,12 +454,12 @@ } } - AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %d\n", + AFD_DbgPrint(MID_TRACE,("FCB->Send.BytesUsed = %u\n", FCB->Send.BytesUsed)); SpaceAvail = FCB->Send.Size - FCB->Send.BytesUsed; - AFD_DbgPrint(MID_TRACE,("We can accept %d bytes\n", + AFD_DbgPrint(MID_TRACE,("We can accept %u bytes\n", SpaceAvail)); /* Count the total transfer size */ @@ -493,7 +502,7 @@ { BytesCopied = MIN(SendReq->BufferArray[i].len, SpaceAvail); - AFD_DbgPrint(MID_TRACE,("Copying Buffer %d, %x:%d to %x\n", + AFD_DbgPrint(MID_TRACE,("Copying Buffer %u, %p:%u to %p\n", i, SendReq->BufferArray[i].buf, BytesCopied, @@ -559,7 +568,9 @@ PAFD_SEND_INFO_UDP SendReq; KPROCESSOR_MODE LockMode; - AFD_DbgPrint(MID_TRACE,("Called on %x\n", FCB)); + UNREFERENCED_PARAMETER(DeviceObject); + + AFD_DbgPrint(MID_TRACE,("Called on %p\n", FCB)); if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); @@ -611,7 +622,7 @@ Irp, 0 ); AFD_DbgPrint - (MID_TRACE,("RemoteAddress #%d Type %d\n", + (MID_TRACE,("RemoteAddress #%d Type %u\n", ((PTRANSPORT_ADDRESS)SendReq->TdiConnection.RemoteAddress)-> TAAddressCount, ((PTRANSPORT_ADDRESS)SendReq->TdiConnection.RemoteAddress)-> Modified: trunk/reactos/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
============================================================================== --- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Wed May 8 10:55:46 2013 @@ -319,26 +319,18 @@ VOID OskitDumpBuffer( PCHAR Buffer, UINT Len ); VOID DestroySocket( PAFD_FCB FCB ); -VOID NTAPI AfdCancelHandler(PDEVICE_OBJECT DeviceObject, - PIRP Irp); +DRIVER_CANCEL AfdCancelHandler; VOID RetryDisconnectCompletion(PAFD_FCB FCB); BOOLEAN CheckUnlockExtraBuffers(PAFD_FCB FCB, PIO_STACK_LOCATION IrpSp); /* read.c */ -NTSTATUS NTAPI ReceiveComplete -( PDEVICE_OBJECT DeviceObject, - PIRP Irp, - PVOID Context ); - -NTSTATUS NTAPI PacketSocketRecvComplete -( PDEVICE_OBJECT DeviceObject, - PIRP Irp, - PVOID Context ); - -NTSTATUS NTAPI -AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, - PIO_STACK_LOCATION IrpSp, BOOLEAN Short); +IO_COMPLETION_ROUTINE ReceiveComplete; + +IO_COMPLETION_ROUTINE PacketSocketRecvComplete; + +NTSTATUS NTAPI +AfdConnectedSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp, BOOLEAN Short); NTSTATUS NTAPI AfdPacketSocketReadData(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpSp );
11 years, 7 months
1
0
0
0
[akhaldi] 58965: [XDK/DDK] * The event parameter in IoBuildDeviceIoControlRequest is optional. Spotted by Nikolay Borisov. CORE-7172 #resolve
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed May 8 10:26:24 2013 New Revision: 58965 URL:
http://svn.reactos.org/svn/reactos?rev=58965&view=rev
Log: [XDK/DDK] * The event parameter in IoBuildDeviceIoControlRequest is optional. Spotted by Nikolay Borisov. CORE-7172 #resolve Modified: trunk/reactos/include/ddk/wdm.h trunk/reactos/include/xdk/iofuncs.h Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=5896…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Wed May 8 10:26:24 2013 @@ -12603,7 +12603,7 @@ _Out_opt_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _In_ BOOLEAN InternalDeviceIoControl, - _In_ PKEVENT Event, + _In_opt_ PKEVENT Event, _Out_ PIO_STATUS_BLOCK IoStatusBlock); _IRQL_requires_max_(DISPATCH_LEVEL) Modified: trunk/reactos/include/xdk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iofuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] Wed May 8 10:26:24 2013 @@ -716,7 +716,7 @@ _Out_opt_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _In_ BOOLEAN InternalDeviceIoControl, - _In_ PKEVENT Event, + _In_opt_ PKEVENT Event, _Out_ PIO_STATUS_BLOCK IoStatusBlock); _IRQL_requires_max_(DISPATCH_LEVEL)
11 years, 7 months
1
0
0
0
[hbelusca] 58964: [KDROSDBG] In fact, the kdcom used for KDBG (in GCC builds) is really a thin layer atop of CPORTLIB. Remove extra code (remove also the KD_PORT_INFORMATION type) and replace it wi...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue May 7 00:14:36 2013 New Revision: 58964 URL:
http://svn.reactos.org/svn/reactos?rev=58964&view=rev
Log: [KDROSDBG] In fact, the kdcom used for KDBG (in GCC builds) is really a thin layer atop of CPORTLIB. Remove extra code (remove also the KD_PORT_INFORMATION type) and replace it with calls to CPORTLIB functions. Next step is to put all that thing into KDBG directly, as helper functions. Then, if one wants to make a really kdcom (as we have for MSVC builds), one has to refactor all KDBG. Modified: branches/kd++/drivers/base/kdcom/kdcom.c branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec branches/kd++/ntoskrnl/include/internal/kd.h branches/kd++/ntoskrnl/kd/kdinit.c branches/kd++/ntoskrnl/kd/kdio.c branches/kd++/ntoskrnl/kd/wrappers/gdbstub.c branches/kd++/ntoskrnl/kd/wrappers/gdbstub_powerpc.c Modified: branches/kd++/drivers/base/kdcom/kdcom.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdcom/kdc…
============================================================================== --- branches/kd++/drivers/base/kdcom/kdcom.c [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdcom/kdcom.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -17,8 +17,7 @@ #define DEFAULT_DEBUG_COM2_IRQ 3 /* COM2 IRQ */ #define DEFAULT_DEBUG_BAUD_RATE 115200 /* 115200 Baud */ -#define DEFAULT_BAUD_RATE 19200 - +#define DEFAULT_BAUD_RATE 19200 #if defined(_M_IX86) || defined(_M_AMD64) const ULONG BaseArray[] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; Modified: branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdrosdbg/…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdrosdbg/arm/kdbg.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -10,27 +10,20 @@ #define NOEXTAPI #include <ntifs.h> +#include <arc/arc.h> #include <halfuncs.h> +#include <windbgkd.h> +#include <ioaccess.h> /* port intrinsics */ +#include <cportlib/cportlib.h> +#include <arm/peripherals/pl011.h> #include <stdio.h> -#include <arc/arc.h> -#include <windbgkd.h> -#include <kddll.h> -#include <ioaccess.h> -#include <arm/peripherals/pl011.h> #define NDEBUG #include <debug.h> /* GLOBALS ********************************************************************/ -typedef struct _KD_PORT_INFORMATION -{ - ULONG ComPort; - ULONG BaudRate; - ULONG BaseAddress; -} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; - -KD_PORT_INFORMATION DefaultPort = {0, 0, 0}; +CPPORT DefaultPort = {0, 0, 0}; // // We need to build this in the configuration root and use KeFindConfigurationEntry @@ -42,42 +35,41 @@ BOOLEAN NTAPI -KdPortInitializeEx(IN PKD_PORT_INFORMATION PortInformation, - IN ULONG Unknown1, - IN ULONG Unknown2) +KdPortInitializeEx(IN PCPPORT PortInformation, + IN ULONG ComPortNumber) { ULONG Divider, Remainder, Fraction; ULONG Baudrate = PortInformation->BaudRate; - + // // Calculate baudrate clock divider and remainder // Divider = HACK / (16 * Baudrate); Remainder = HACK % (16 * Baudrate); - + // // Calculate the fractional part // Fraction = (8 * Remainder / Baudrate) >> 1; Fraction += (8 * Remainder / Baudrate) & 1; - + // // Disable interrupts // WRITE_REGISTER_ULONG(UART_PL011_CR, 0); - + // // Set the baud rate // WRITE_REGISTER_ULONG(UART_PL011_IBRD, Divider); WRITE_REGISTER_ULONG(UART_PL011_FBRD, Fraction); - + // // Set 8 bits for data, 1 stop bit, no parity, FIFO enabled // WRITE_REGISTER_ULONG(UART_PL011_LCRH, UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN); - + // // Clear and enable FIFO // @@ -85,7 +77,7 @@ UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | UART_PL011_CR_RXE); - + // // Done // @@ -94,7 +86,7 @@ BOOLEAN NTAPI -KdPortGetByteEx(IN PKD_PORT_INFORMATION PortInformation, +KdPortGetByteEx(IN PCPPORT PortInformation, OUT PUCHAR ByteReceived) { UNIMPLEMENTED; @@ -104,7 +96,7 @@ VOID NTAPI -KdPortPutByteEx(IN PKD_PORT_INFORMATION PortInformation, +KdPortPutByteEx(IN PCPPORT PortInformation, IN UCHAR ByteToSend) { // Modified: branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdrosdbg/…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdrosdbg/i386/kdbg.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -11,26 +11,18 @@ #define NOEXTAPI #include <ntifs.h> +#include <arc/arc.h> #include <halfuncs.h> -#include <stdio.h> -#include <arc/arc.h> #include <windbgkd.h> -#include <kddll.h> #include <ioaccess.h> /* port intrinsics */ #include <cportlib/cportlib.h> +#include <stdio.h> #define NDEBUG #include <debug.h> -typedef struct _KD_PORT_INFORMATION -{ - ULONG ComPort; - ULONG BaudRate; - ULONG BaseAddress; -} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; - -#define DEFAULT_BAUD_RATE 19200 +#define DEFAULT_BAUD_RATE 19200 #if defined(_M_IX86) || defined(_M_AMD64) const ULONG BaseArray[] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8}; @@ -44,57 +36,11 @@ #error Unknown architecture #endif -/* MACROS *******************************************************************/ +/* STATIC VARIABLES ***********************************************************/ -#define SER_RBR(x) ((PUCHAR)(x)+0) -#define SER_THR(x) ((PUCHAR)(x)+0) -#define SER_DLL(x) ((PUCHAR)(x)+0) -#define SER_IER(x) ((PUCHAR)(x)+1) -#define SR_IER_ERDA 0x01 -#define SR_IER_ETHRE 0x02 -#define SR_IER_ERLSI 0x04 -#define SR_IER_EMS 0x08 -#define SR_IER_ALL 0x0F -#define SER_DLM(x) ((PUCHAR)(x)+1) -#define SER_IIR(x) ((PUCHAR)(x)+2) -#define SER_FCR(x) ((PUCHAR)(x)+2) -#define SR_FCR_ENABLE_FIFO 0x01 -#define SR_FCR_CLEAR_RCVR 0x02 -#define SR_FCR_CLEAR_XMIT 0x04 -#define SER_LCR(x) ((PUCHAR)(x)+3) -#define SR_LCR_CS5 0x00 -#define SR_LCR_CS6 0x01 -#define SR_LCR_CS7 0x02 -#define SR_LCR_CS8 0x03 -#define SR_LCR_ST1 0x00 -#define SR_LCR_ST2 0x04 -#define SR_LCR_PNO 0x00 -#define SR_LCR_POD 0x08 -#define SR_LCR_PEV 0x18 -#define SR_LCR_PMK 0x28 -#define SR_LCR_PSP 0x38 -#define SR_LCR_BRK 0x40 -#define SR_LCR_DLAB 0x80 -#define SER_MCR(x) ((PUCHAR)(x)+4) -#define SR_MCR_DTR 0x01 -#define SR_MCR_RTS 0x02 -#define SR_MCR_OUT1 0x04 -#define SR_MCR_OUT2 0x08 -#define SR_MCR_LOOP 0x10 -#define SER_LSR(x) ((PUCHAR)(x)+5) -#define SR_LSR_DR 0x01 -#define SR_LSR_TBE 0x20 -#define SER_MSR(x) ((PUCHAR)(x)+6) -#define SR_MSR_CTS 0x10 -#define SR_MSR_DSR 0x20 -#define SER_SCR(x) ((PUCHAR)(x)+7) +// static CPPORT DefaultPort = {0, 0, 0}; - -/* STATIC VARIABLES *********************************************************/ - -// static KD_PORT_INFORMATION DefaultPort = { 0, 0, 0 }; - -/* The com port must only be initialized once! */ +/* The COM port must only be initialized once! */ // static BOOLEAN PortInitialized = FALSE; @@ -103,14 +49,11 @@ BOOLEAN NTAPI KdPortInitializeEx( - IN PKD_PORT_INFORMATION PortInformation, - IN ULONG Unknown1, - IN ULONG Unknown2) + IN PCPPORT PortInformation, + IN ULONG ComPortNumber) { - ULONG ComPortBase; + NTSTATUS Status; CHAR buffer[80]; - ULONG divisor; - UCHAR lcr; #if 0 // Deactivated because never used in fact (was in KdPortInitialize but we use KdPortInitializeEx) /* @@ -122,7 +65,7 @@ { DefaultPort.BaudRate = PortInformation->BaudRate; - if (PortInformation->ComPort == 0) + if (ComPortNumber == 0) { /* * Start enumerating COM ports from the last one to the first one, @@ -134,12 +77,12 @@ { if (CpDoesPortExist(UlongToPtr(BaseArray[i]))) { - PortInformation->BaseAddress = DefaultPort.BaseAddress = BaseArray[i]; - PortInformation->ComPort = DefaultPort.ComPort = i; + PortInformation->Address = DefaultPort.Address = BaseArray[i]; + ComPortNumber = (ULONG)i; break; } } - if (i == 0) + if (ComPortNumber == 0) { sprintf(buffer, "\nKernel Debugger: No COM port found!\n\n"); @@ -155,108 +98,54 @@ /* * Initialize the port */ - - if (PortInformation->BaudRate == 0) - PortInformation->BaudRate = DEFAULT_BAUD_RATE; - - if (PortInformation->ComPort != 0) + Status = CpInitialize(PortInformation, + (ComPortNumber == 0 ? PortInformation->Address + : UlongToPtr(BaseArray[ComPortNumber])), + (PortInformation->BaudRate == 0 ? DEFAULT_BAUD_RATE + : PortInformation->BaudRate)); + if (!NT_SUCCESS(Status)) { - if (!CpDoesPortExist(UlongToPtr(BaseArray[PortInformation->ComPort]))) - { - sprintf(buffer, - "\nKernel Debugger: Serial port not found!\n\n"); - HalDisplayString(buffer); - return FALSE; - } - - ComPortBase = BaseArray[PortInformation->ComPort]; - PortInformation->BaseAddress = ComPortBase; + sprintf(buffer, + "\nKernel Debugger: Serial port not found!\n\n"); + HalDisplayString(buffer); + return FALSE; } else { - ComPortBase = PortInformation->BaseAddress; - } - - if (ComPortBase == 0) - return FALSE; - #ifndef NDEBUG - sprintf(buffer, - "\nSerial port COM%ld found at 0x%lx\n", - PortInformation->ComPort, - ComPortBase); - HalDisplayString(buffer); -#endif /* NDEBUG */ - - /* set baud rate and data format (8N1) */ - - /* turn on DTR and RTS */ - WRITE_PORT_UCHAR(SER_MCR(ComPortBase), SR_MCR_DTR | SR_MCR_RTS); - - /* set DLAB */ - lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase)) | SR_LCR_DLAB; - WRITE_PORT_UCHAR(SER_LCR(ComPortBase), lcr); - - /* set baud rate */ - divisor = 115200 / PortInformation->BaudRate; - WRITE_PORT_UCHAR(SER_DLL(ComPortBase), (UCHAR)(divisor & 0xff)); - WRITE_PORT_UCHAR(SER_DLM(ComPortBase), (UCHAR)((divisor >> 8) & 0xff)); - - /* reset DLAB and set 8N1 format */ - WRITE_PORT_UCHAR(SER_LCR(ComPortBase), - SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO); - - /* read junk out of the RBR */ - lcr = READ_PORT_UCHAR(SER_RBR(ComPortBase)); - -#ifndef NDEBUG - /* print message to blue screen */ - sprintf(buffer, - "\nKernel Debugger: COM%ld (Port 0x%lx) BaudRate %ld\n\n", - PortInformation->ComPort, - ComPortBase, - PortInformation->BaudRate); - - HalDisplayString(buffer); + /* Print message to blue screen */ + sprintf(buffer, + "\nKernel Debugger: Serial port found: COM%ld (Port 0x%lx) BaudRate %ld\n\n", + ComPortNumber, + PortInformation->Address, + PortInformation->BaudRate); + HalDisplayString(buffer); #endif /* NDEBUG */ #if 0 - /* set global info */ - KdComPortInUse = (PUCHAR)DefaultPort.BaseAddress; + /* Set global info */ + KdComPortInUse = DefaultPort.Address; #endif - - return TRUE; + return TRUE; + } } BOOLEAN NTAPI KdPortGetByteEx( - IN PKD_PORT_INFORMATION PortInformation, + IN PCPPORT PortInformation, OUT PUCHAR ByteReceived) { - PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress; - - if ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DR)) - { - *ByteReceived = READ_PORT_UCHAR(SER_RBR(ComPortBase)); - return TRUE; - } - - return FALSE; + return (CpGetByte(PortInformation, ByteReceived, FALSE) == CP_GET_SUCCESS); } VOID NTAPI KdPortPutByteEx( - IN PKD_PORT_INFORMATION PortInformation, + IN PCPPORT PortInformation, IN UCHAR ByteToSend) { - PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress; - - while ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_TBE) == 0) - ; - - WRITE_PORT_UCHAR(SER_THR(ComPortBase), ByteToSend); + CpPutByte(PortInformation, ByteToSend); } /* EOF */ Modified: branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/drivers/base/kdrosdbg/…
============================================================================== --- branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec [iso-8859-1] (original) +++ branches/kd++/drivers/base/kdrosdbg/kdrosdbg.spec [iso-8859-1] Tue May 7 00:14:36 2013 @@ -8,6 +8,6 @@ 8 stdcall KdSendPacket(long ptr ptr ptr) ; Legacy KD -@ stdcall KdPortInitializeEx(ptr long long) +@ stdcall KdPortInitializeEx(ptr long) @ stdcall KdPortGetByteEx(ptr ptr) @ stdcall KdPortPutByteEx(ptr long) Modified: branches/kd++/ntoskrnl/include/internal/kd.h URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/include/inter…
============================================================================== --- branches/kd++/ntoskrnl/include/internal/kd.h [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/include/internal/kd.h [iso-8859-1] Tue May 7 00:14:36 2013 @@ -1,4 +1,6 @@ #pragma once + +#include <cportlib/cportlib.h> #ifdef _M_PPC #define KdDebuggerEnabled _KdDebuggerEnabled @@ -8,15 +10,8 @@ // // Kernel Debugger Port Definition // -typedef struct _KD_PORT_INFORMATION -{ - ULONG ComPort; - ULONG BaudRate; - ULONG BaseAddress; -} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION; - struct _KD_DISPATCH_TABLE; -extern KD_PORT_INFORMATION GdbPortInfo; +extern CPPORT GdbPortInfo; extern BOOLEAN _KdDebuggerEnabled; extern BOOLEAN _KdDebuggerNotPresent; extern BOOLEAN KdBreakAfterSymbolLoad; @@ -26,21 +21,20 @@ BOOLEAN NTAPI KdPortInitializeEx( - PKD_PORT_INFORMATION PortInformation, - ULONG Unknown1, - ULONG Unknown2 + PCPPORT PortInformation, + ULONG ComPortNumber ); BOOLEAN NTAPI KdPortGetByteEx( - PKD_PORT_INFORMATION PortInformation, + PCPPORT PortInformation, PUCHAR ByteReceived); VOID NTAPI KdPortPutByteEx( - PKD_PORT_INFORMATION PortInformation, + PCPPORT PortInformation, UCHAR ByteToSend ); @@ -340,7 +334,8 @@ extern ULONG KdpPort; /* Port Information for the Serial Native Mode */ -extern KD_PORT_INFORMATION SerialPortInfo; +extern ULONG SerialPortNumber; +extern CPPORT SerialPortInfo; /* Init Functions for Native Providers */ extern PKDP_INIT_ROUTINE InitRoutines[KdMax]; Modified: branches/kd++/ntoskrnl/kd/kdinit.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/kdinit.c?r…
============================================================================== --- branches/kd++/ntoskrnl/kd/kdinit.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/kdinit.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -16,7 +16,8 @@ /* VARIABLES ***************************************************************/ -KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0}; +ULONG PortNumber = DEFAULT_DEBUG_PORT; +CPPORT PortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}; ULONG KdpPortIrq; #ifdef AUTO_ENABLE_BOCHS KDP_DEBUG_MODE KdpDebugMode = {{{.Bochs=TRUE}}}; @@ -68,7 +69,7 @@ KdpDebugMode.Serial = TRUE; /* Set the port to use */ - SerialPortInfo.ComPort = Value; + SerialPortNumber = Value; KdpPort = Value; } } @@ -78,8 +79,8 @@ if (Value) { KdpDebugMode.Serial = TRUE; - SerialPortInfo.BaseAddress = Value; - SerialPortInfo.ComPort = 0; + SerialPortInfo.Address = UlongToPtr(Value); + SerialPortNumber = 0; KdpPort = 0; } } Modified: branches/kd++/ntoskrnl/kd/kdio.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/kdio.c?rev…
============================================================================== --- branches/kd++/ntoskrnl/kd/kdio.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/kdio.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -26,7 +26,8 @@ ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log"); KSPIN_LOCK KdpSerialSpinLock; -KD_PORT_INFORMATION SerialPortInfo = { DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0 }; +ULONG SerialPortNumber = DEFAULT_DEBUG_PORT; +CPPORT SerialPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}; /* Current Port in use. FIXME: Do we support more then one? */ ULONG KdpPort; @@ -358,12 +359,12 @@ DispatchTable->KdpPrintRoutine = KdpSerialDebugPrint; /* Initialize the Port */ - if (!KdPortInitializeEx(&SerialPortInfo, 0, 0)) + if (!KdPortInitializeEx(&SerialPortInfo, SerialPortNumber)) { KdpDebugMode.Serial = FALSE; return; } - KdComPortInUse = (PUCHAR)(ULONG_PTR)SerialPortInfo.BaseAddress; + KdComPortInUse = SerialPortInfo.Address; /* Initialize spinlock */ KeInitializeSpinLock(&KdpSerialSpinLock); Modified: branches/kd++/ntoskrnl/kd/wrappers/gdbstub.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/wrappers/g…
============================================================================== --- branches/kd++/ntoskrnl/kd/wrappers/gdbstub.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/wrappers/gdbstub.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -44,7 +44,8 @@ extern LIST_ENTRY PsActiveProcessHead; /* FIXME hardcoded for COM2, 115200 baud */ -KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 }; +ULONG GdbPortNumber = DEFAULT_DEBUG_PORT; +CPPORT GdbPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}; static CHAR GspInBuffer[1000]; static CHAR GspOutBuffer[1000]; @@ -126,9 +127,7 @@ { UCHAR Value; - while (!KdPortGetByteEx(&GdbPortInfo, &Value)) - ; - + while (!KdPortGetByteEx(&GdbPortInfo, &Value)) ; return Value; } @@ -145,8 +144,7 @@ while (TRUE) { /* wait around for the start character, ignore all other characters */ - while ((ch = GdbGetChar()) != '$') - ; + while ((ch = GdbGetChar()) != '$') ; retry: Checksum = 0; @@ -784,7 +782,6 @@ } else if (strncmp(Request, "Rcmd,", 5) == 0) { - ; } } @@ -943,12 +940,14 @@ ULONG Index; for (Index = 0; Index < GspSwBreakpointCount; Index++) + { if (GspSwBreakpoints[Index].Address == Address) { if (PIndex) *PIndex = Index; return TRUE; } + } return FALSE; } @@ -1569,7 +1568,7 @@ WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException; /* Initialize the Port */ - KdPortInitializeEx(&GdbPortInfo, 0, 0); + KdPortInitializeEx(&GdbPortInfo, GdbPortNumber); } else if (BootPhase == 1) { Modified: branches/kd++/ntoskrnl/kd/wrappers/gdbstub_powerpc.c URL:
http://svn.reactos.org/svn/reactos/branches/kd%2B%2B/ntoskrnl/kd/wrappers/g…
============================================================================== --- branches/kd++/ntoskrnl/kd/wrappers/gdbstub_powerpc.c [iso-8859-1] (original) +++ branches/kd++/ntoskrnl/kd/wrappers/gdbstub_powerpc.c [iso-8859-1] Tue May 7 00:14:36 2013 @@ -88,44 +88,47 @@ #include <debug.h> /************************************************************************/ + +static BOOLEAN GspInitialized; +static BOOLEAN GspRemoteDebug; + +static CONST CHAR HexChars[]="0123456789abcdef"; + +static PETHREAD GspRunThread; /* NULL means run all threads */ +static PETHREAD GspDbgThread; +static PETHREAD GspEnumThread; + +static FAST_MUTEX GspLock; + +extern LIST_ENTRY PsActiveProcessHead; + +/* FIXME hardcoded for COM2, 115200 baud */ +ULONG GdbPortNumber = DEFAULT_DEBUG_PORT; +CPPORT GdbPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}; + /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ /* at least NUMREGBYTES*2 are needed for register packets */ #define BUFMAX 1000 - -static BOOLEAN GspInitialized; - -static BOOLEAN GspRemoteDebug; - -static CONST CHAR HexChars[]="0123456789abcdef"; - -static PETHREAD GspRunThread; /* NULL means run all threads */ -static PETHREAD GspDbgThread; -static PETHREAD GspEnumThread; - -static FAST_MUTEX GspLock; - -extern LIST_ENTRY PsActiveProcessHead; - -/* FIXME hardcoded for COM2, 115200 baud */ -KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 }; +static CHAR GspInBuffer[BUFMAX]; +static CHAR GspOutBuffer[BUFMAX]; /* Number of Registers. */ #define NUMREGS 16 enum REGISTER_NAMES { - EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, - PC /* also known as eip */, - PS /* also known as eflags */, - CS, SS, DS, ES, FS, GS + EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI, + PC /* also known as eip */, + PS /* also known as eflags */, + CS, SS, DS, ES, FS, GS }; typedef struct _CPU_REGISTER { - ULONG Size; - ULONG OffsetInTF; - ULONG OffsetInContext; - BOOLEAN SetInContext; + ULONG Size; + ULONG OffsetInTF; + ULONG OffsetInContext; + BOOLEAN SetInContext; } CPU_REGISTER, *PCPU_REGISTER; static CPU_REGISTER GspRegisters[NUMREGS] = @@ -134,54 +137,45 @@ static PCHAR GspThreadStates[DeferredReady+1] = { - "Initialized", - "Ready", - "Running", - "Standby", - "Terminated", - "Waiting", - "Transition", - "DeferredReady" + "Initialized", + "Ready", + "Running", + "Standby", + "Terminated", + "Waiting", + "Transition", + "DeferredReady" }; LONG HexValue(CHAR ch) { - if ((ch >= '0') && (ch <= '9')) - { - return (ch - '0'); - } - if ((ch >= 'a') && (ch <= 'f')) - { - return (ch - 'a' + 10); - } - if ((ch >= 'A') && (ch <= 'F')) - { - return (ch - 'A' + 10); - } - - return -1; -} - -static CHAR GspInBuffer[BUFMAX]; -static CHAR GspOutBuffer[BUFMAX]; + if ((ch >= '0') && (ch <= '9')) + return (ch - '0'); + + if ((ch >= 'a') && (ch <= 'f')) + return (ch - 'a' + 10); + + if ((ch >= 'A') && (ch <= 'F')) + return (ch - 'A' + 10); + + return -1; +} VOID GdbPutChar(UCHAR Value) { - KdPortPutByteEx(&GdbPortInfo, Value); + KdPortPutByteEx(&GdbPortInfo, Value); } UCHAR GdbGetChar(VOID) { - UCHAR Value; - - while (!KdPortGetByteEx(&GdbPortInfo, &Value)) - ; - - return Value; + UCHAR Value; + + while (!KdPortGetByteEx(&GdbPortInfo, &Value)) ; + return Value; } /* scan for the sequence $<data>#<Checksum> */ @@ -189,57 +183,53 @@ PCHAR GspGetPacket() { - PCHAR Buffer = &GspInBuffer[0]; - CHAR Checksum; - CHAR XmitChecksum; - ULONG Count; - CHAR ch; - - while (TRUE) - { - /* wait around for the start character, ignore all other characters */ - while ((ch = GdbGetChar ()) != '$') - ; - - retry: - Checksum = 0; - XmitChecksum = -1; - Count = 0; - - /* now, read until a # or end of Buffer is found */ - while (Count < BUFMAX) - { - ch = GdbGetChar(); - if (ch == '$') - { - goto retry; - } - if (ch == '#') - { - break; - } - Checksum = Checksum + ch; - Buffer[Count] = ch; - Count = Count + 1; - } - Buffer[Count] = 0; - - if (ch == '#') - { - ch = GdbGetChar(); - XmitChecksum = (CHAR)(HexValue(ch) << 4); - ch = GdbGetChar(); - XmitChecksum += (CHAR)(HexValue(ch)); - - if (Checksum != XmitChecksum) - { - GdbPutChar('-'); /* failed checksum */ - } - else - { - GdbPutChar('+'); /* successful transfer */ - - return &Buffer[0]; + PCHAR Buffer = &GspInBuffer[0]; + CHAR Checksum; + CHAR XmitChecksum; + ULONG Count; + CHAR ch; + + while (TRUE) + { + /* wait around for the start character, ignore all other characters */ + while ((ch = GdbGetChar ()) != '$') ; + +retry: + Checksum = 0; + XmitChecksum = -1; + Count = 0; + + /* now, read until a # or end of Buffer is found */ + while (Count < BUFMAX) + { + ch = GdbGetChar(); + if (ch == '$') + goto retry; + + if (ch == '#') + break; + + Checksum = Checksum + ch; + Buffer[Count] = ch; + Count = Count + 1; + } + Buffer[Count] = 0; + + if (ch == '#') + { + ch = GdbGetChar(); + XmitChecksum = (CHAR)(HexValue(ch) << 4); + ch = GdbGetChar(); + XmitChecksum += (CHAR)(HexValue(ch)); + + if (Checksum != XmitChecksum) + { + GdbPutChar('-'); /* failed checksum */ + } + else + { + GdbPutChar('+'); /* successful transfer */ + return &Buffer[0]; } } } @@ -250,54 +240,54 @@ VOID GspPutPacket(PCHAR Buffer) { - CHAR Checksum; - LONG Count; - CHAR ch; - - /* $<packet info>#<Checksum>. */ - do - { - GdbPutChar('$'); - Checksum = 0; - Count = 0; - - while ((ch = Buffer[Count])) - { - GdbPutChar(ch); - Checksum += ch; - Count += 1; - } - - GdbPutChar('#'); - GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); - GdbPutChar(HexChars[Checksum & 0xf]); - } - while (GdbGetChar() != '+'); + CHAR Checksum; + LONG Count; + CHAR ch; + + /* $<packet info>#<Checksum>. */ + do + { + GdbPutChar('$'); + Checksum = 0; + Count = 0; + + while ((ch = Buffer[Count])) + { + GdbPutChar(ch); + Checksum += ch; + Count += 1; + } + + GdbPutChar('#'); + GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); + GdbPutChar(HexChars[Checksum & 0xf]); + } + while (GdbGetChar() != '+'); } VOID GspPutPacketNoWait(PCHAR Buffer) { - CHAR Checksum; - LONG Count; - CHAR ch; - - /* $<packet info>#<Checksum>. */ - GdbPutChar('$'); - Checksum = 0; - Count = 0; - - while ((ch = Buffer[Count])) - { - GdbPutChar(ch); - Checksum += ch; - Count += 1; - } - - GdbPutChar('#'); - GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); - GdbPutChar(HexChars[Checksum & 0xf]); + CHAR Checksum; + LONG Count; + CHAR ch; + + /* $<packet info>#<Checksum>. */ + GdbPutChar('$'); + Checksum = 0; + Count = 0; + + while ((ch = Buffer[Count])) + { + GdbPutChar(ch); + Checksum += ch; + Count += 1; + } + + GdbPutChar('#'); + GdbPutChar(HexChars[(Checksum >> 4) & 0xf]); + GdbPutChar(HexChars[Checksum & 0xf]); } /* Indicate to caller of GspMem2Hex or GspHex2Mem that there has been an @@ -308,19 +298,33 @@ static CHAR GspReadMemSafe(PCHAR Address) { - CHAR ch; - - if (NULL == Address) - { - GspMemoryError = TRUE; - return '\0'; - } - - GspAccessLocation = Address; - ch = *Address; - GspAccessLocation = NULL; - - return ch; + CHAR ch; + + if (NULL == Address) + { + GspMemoryError = TRUE; + return '\0'; + } + + GspAccessLocation = Address; + ch = *Address; + GspAccessLocation = NULL; + + return ch; +} + +static CHAR +GspWriteMemSafeGetContent(PVOID Context, ULONG Offset) +{ + ASSERT(0 == Offset); + return *((PCHAR) Context); +} + +static void +GspWriteMemSafe(PCHAR Address, + CHAR Ch) +{ + GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch); } /* Convert the memory pointed to by Address into hex, placing result in Buffer */ @@ -329,131 +333,110 @@ a fault; if FALSE treat a fault like any other fault in the stub. */ static PCHAR GspMem2Hex(PCHAR Address, - PCHAR Buffer, - LONG Count, - BOOLEAN MayFault) -{ - ULONG i; - CHAR ch; - - for (i = 0; i < (ULONG) Count; i++) - { - if (MayFault) - { - ch = GspReadMemSafe(Address); - if (GspMemoryError) - { - return Buffer; - } - } - else - { - ch = *Address; - } - *Buffer++ = HexChars[(ch >> 4) & 0xf]; - *Buffer++ = HexChars[ch & 0xf]; - Address++; - } - - *Buffer = 0; - return Buffer; + PCHAR Buffer, + LONG Count, + BOOLEAN MayFault) +{ + ULONG i; + CHAR ch; + + for (i = 0; i < (ULONG) Count; i++) + { + if (MayFault) + { + ch = GspReadMemSafe(Address); + if (GspMemoryError) + return Buffer; + } + else + { + ch = *Address; + } + *Buffer++ = HexChars[(ch >> 4) & 0xf]; + *Buffer++ = HexChars[ch & 0xf]; + Address++; + } + + *Buffer = 0; + return Buffer; } static ULONG GspWriteMem(PCHAR Address, - ULONG Count, - BOOLEAN MayFault, - CHAR (*GetContent)(PVOID Context, ULONG Offset), - PVOID Context) -{ - PCHAR Current; - PCHAR Page; - ULONG CountInPage; - ULONG i; - CHAR ch; - ULONG OldProt = 0; - - Current = Address; - while (Current < Address + Count) - { - Page = (PCHAR)PAGE_ROUND_DOWN(Current); - if (Address + Count <= Page + PAGE_SIZE) - { - /* Fits in this page */ - CountInPage = Count; - } - else - { - /* Flows into next page, handle only current page in this iteration */ - CountInPage = PAGE_SIZE - (Address - Page); - } - if (MayFault) - { - OldProt = MmGetPageProtect(NULL, Address); - MmSetPageProtect(NULL, Address, PAGE_EXECUTE_READWRITE); - } - - for (i = 0; i < CountInPage && ! GspMemoryError; i++) - { - ch = (*GetContent)(Context, Current - Address); - - if (MayFault) - { - GspAccessLocation = Current; - } - *Current = ch; - if (MayFault) - { - GspAccessLocation = NULL; - } - Current++; - } - if (MayFault) - { - MmSetPageProtect(NULL, Page, OldProt); - if (GspMemoryError) - { - return Current - Address; - } - } - } - - return Current - Address; + ULONG Count, + BOOLEAN MayFault, + CHAR (*GetContent)(PVOID Context, ULONG Offset), + PVOID Context) +{ + PCHAR Current; + PCHAR Page; + ULONG CountInPage; + ULONG i; + CHAR ch; + ULONG OldProt = 0; + + Current = Address; + while (Current < Address + Count) + { + Page = (PCHAR)PAGE_ROUND_DOWN(Current); + if (Address + Count <= Page + PAGE_SIZE) + { + /* Fits in this page */ + CountInPage = Count; + } + else + { + /* Flows into next page, handle only current page in this iteration */ + CountInPage = PAGE_SIZE - (Address - Page); + } + if (MayFault) + { + OldProt = MmGetPageProtect(NULL, Address); + MmSetPageProtect(NULL, Address, PAGE_EXECUTE_READWRITE); + } + + for (i = 0; i < CountInPage && ! GspMemoryError; i++) + { + ch = (*GetContent)(Context, Current - Address); + + if (MayFault) + GspAccessLocation = Current; + + *Current = ch; + + if (MayFault) + GspAccessLocation = NULL; + + Current++; + } + if (MayFault) + { + MmSetPageProtect(NULL, Page, OldProt); + if (GspMemoryError) + return Current - Address; + } + } + + return Current - Address; } static CHAR GspHex2MemGetContent(PVOID Context, ULONG Offset) { - return (CHAR)((HexValue(*((PCHAR) Context + 2 * Offset)) << 4) + - HexValue(*((PCHAR) Context + 2 * Offset + 1))); + return (CHAR)((HexValue(*((PCHAR) Context + 2 * Offset)) << 4) + + HexValue(*((PCHAR) Context + 2 * Offset + 1))); } /* Convert the hex array pointed to by Buffer into binary to be placed at Address */ /* Return a pointer to the character AFTER the last byte read from Buffer */ static PCHAR GspHex2Mem(PCHAR Buffer, - PCHAR Address, - ULONG Count, - BOOLEAN MayFault) -{ - Count = GspWriteMem(Address, Count, MayFault, GspHex2MemGetContent, Buffer); - - return Buffer + 2 * Count; -} - -static CHAR -GspWriteMemSafeGetContent(PVOID Context, ULONG Offset) -{ - ASSERT(0 == Offset); - - return *((PCHAR) Context); -} - -static void -GspWriteMemSafe(PCHAR Address, - CHAR Ch) -{ - GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch); + PCHAR Address, + ULONG Count, + BOOLEAN MayFault) +{ + Count = GspWriteMem(Address, Count, MayFault, GspHex2MemGetContent, Buffer); + return Buffer + 2 * Count; } @@ -462,33 +445,38 @@ ULONG GspComputeSignal(NTSTATUS ExceptionCode) { - ULONG SigVal; - - switch (ExceptionCode) - { - case STATUS_INTEGER_DIVIDE_BY_ZERO: - SigVal = 8; /* divide by zero */ - break; - case STATUS_SINGLE_STEP: - case STATUS_BREAKPOINT: - SigVal = 5; /* breakpoint */ - break; - case STATUS_INTEGER_OVERFLOW: - case STATUS_ARRAY_BOUNDS_EXCEEDED: - SigVal = 16; /* bound instruction */ - break; - case STATUS_ILLEGAL_INSTRUCTION: - SigVal = 4; /* Invalid opcode */ - break; - case STATUS_STACK_OVERFLOW: - case STATUS_DATATYPE_MISALIGNMENT: - case STATUS_ACCESS_VIOLATION: - SigVal = 11; /* access violation */ - break; - default: - SigVal = 7; /* "software generated" */ - } - return SigVal; + ULONG SigVal; + + switch (ExceptionCode) + { + case STATUS_INTEGER_DIVIDE_BY_ZERO: + SigVal = 8; /* divide by zero */ + break; + + case STATUS_SINGLE_STEP: + case STATUS_BREAKPOINT: + SigVal = 5; /* breakpoint */ + break; + + case STATUS_INTEGER_OVERFLOW: + case STATUS_ARRAY_BOUNDS_EXCEEDED: + SigVal = 16; /* bound instruction */ + break; + + case STATUS_ILLEGAL_INSTRUCTION: + SigVal = 4; /* Invalid opcode */ + break; + + case STATUS_STACK_OVERFLOW: + case STATUS_DATATYPE_MISALIGNMENT: + case STATUS_ACCESS_VIOLATION: + SigVal = 11; /* access violation */ + break; + + default: + SigVal = 7; /* "software generated" */ + } + return SigVal; } @@ -1626,43 +1614,39 @@ BOOLEAN NTAPI GspBreakIn(PKINTERRUPT Interrupt, - PVOID ServiceContext) -{ - PKTRAP_FRAME TrapFrame; - BOOLEAN DoBreakIn; - CONTEXT Context; - KIRQL OldIrql; - UCHAR Value; - - DPRINT("Break In\n"); - - DoBreakIn = FALSE; - while (KdPortGetByteEx(&GdbPortInfo, &Value)) - { - if (Value == 0x03) - { - DoBreakIn = TRUE; - } - } - - if (!DoBreakIn) - { - return TRUE; - } - - KeRaiseIrql(HIGH_LEVEL, &OldIrql); - - TrapFrame = PsGetCurrentThread()->Tcb.TrapFrame; - - KeTrapFrameToContext(TrapFrame, NULL, &Context); - - KdpGdbEnterDebuggerException(NULL, &Context, TrapFrame); - - KeContextToTrapFrame(&Context, NULL, TrapFrame, Context.ContextFlags, KernelMode); - - KeLowerIrql(OldIrql); - - return TRUE; + PVOID ServiceContext) +{ + PKTRAP_FRAME TrapFrame; + BOOLEAN DoBreakIn; + CONTEXT Context; + KIRQL OldIrql; + UCHAR Value; + + DPRINT("Break In\n"); + + DoBreakIn = FALSE; + while (KdPortGetByteEx(&GdbPortInfo, &Value)) + { + if (Value == 0x03) + DoBreakIn = TRUE; + } + + if (!DoBreakIn) + return TRUE; + + KeRaiseIrql(HIGH_LEVEL, &OldIrql); + + TrapFrame = PsGetCurrentThread()->Tcb.TrapFrame; + + KeTrapFrameToContext(TrapFrame, NULL, &Context); + + KdpGdbEnterDebuggerException(NULL, &Context, TrapFrame); + + KeContextToTrapFrame(&Context, NULL, TrapFrame, Context.ContextFlags, KernelMode); + + KeLowerIrql(OldIrql); + + return TRUE; } VOID @@ -1677,39 +1661,36 @@ KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable, ULONG BootPhase) { - if (!KdDebuggerEnabled || !KdpDebugMode.Gdb) - { - return; - } - - if (BootPhase == 0) - { - ExInitializeFastMutex(&GspLock); - - /* Write out the functions that we support for now */ - WrapperTable->KdpInitRoutine = KdpGdbStubInit; - WrapperTable->KdpPrintRoutine = KdpGdbDebugPrint; - WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException; - - /* Initialize the Port */ - KdPortInitializeEx(&GdbPortInfo, 0, 0); - - KdpPort = GdbPortInfo.ComPort; - } - else if (BootPhase == 1) - { - GspInitialized = TRUE; - - GspRunThread = NULL; - GspDbgThread = NULL; - GspEnumThread = NULL; - - HalDisplayString("Waiting for GDB to attach\n"); - DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); - } - else if (BootPhase == 2) - { - HalDisplayString("\n GDB debugging enabled\n\n"); + if (!KdDebuggerEnabled || !KdpDebugMode.Gdb) + return; + + if (BootPhase == 0) + { + ExInitializeFastMutex(&GspLock); + + /* Write out the functions that we support for now */ + WrapperTable->KdpInitRoutine = KdpGdbStubInit; + WrapperTable->KdpPrintRoutine = KdpGdbDebugPrint; + WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException; + + /* Initialize the Port */ + KdPortInitializeEx(&GdbPortInfo, GdbPortNumber); + // KdpPort = GdbPortInfo.ComPort; + } + else if (BootPhase == 1) + { + GspInitialized = TRUE; + + GspRunThread = NULL; + GspDbgThread = NULL; + GspEnumThread = NULL; + + HalDisplayString("Waiting for GDB to attach\n"); + DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); + } + else if (BootPhase == 2) + { + HalDisplayString("\n GDB debugging enabled\n\n"); } }
11 years, 7 months
1
0
0
0
[ekohl] 58963: [MSGINA] Convert tabs to spaces. No code changes!
by ekohl@svn.reactos.org
Author: ekohl Date: Mon May 6 21:43:03 2013 New Revision: 58963 URL:
http://svn.reactos.org/svn/reactos?rev=58963&view=rev
Log: [MSGINA] Convert tabs to spaces. No code changes! Modified: trunk/reactos/dll/win32/msgina/gui.c trunk/reactos/dll/win32/msgina/msgina.c trunk/reactos/dll/win32/msgina/msgina.h trunk/reactos/dll/win32/msgina/stubs.c trunk/reactos/dll/win32/msgina/tui.c Modified: trunk/reactos/dll/win32/msgina/gui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/gui.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] Mon May 6 21:43:03 2013 @@ -11,222 +11,222 @@ typedef struct _DISPLAYSTATUSMSG { - PGINA_CONTEXT Context; - HDESK hDesktop; - DWORD dwOptions; - PWSTR pTitle; - PWSTR pMessage; - HANDLE StartupEvent; + PGINA_CONTEXT Context; + HDESK hDesktop; + DWORD dwOptions; + PWSTR pTitle; + PWSTR pMessage; + HANDLE StartupEvent; } DISPLAYSTATUSMSG, *PDISPLAYSTATUSMSG; static BOOL GUIInitialize( - IN OUT PGINA_CONTEXT pgContext) -{ - TRACE("GUIInitialize(%p)\n", pgContext); - return TRUE; + IN OUT PGINA_CONTEXT pgContext) +{ + TRACE("GUIInitialize(%p)\n", pgContext); + return TRUE; } static INT_PTR CALLBACK StatusMessageWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - UNREFERENCED_PARAMETER(wParam); - - switch (uMsg) - { - case WM_INITDIALOG: - { - PDISPLAYSTATUSMSG msg = (PDISPLAYSTATUSMSG)lParam; - if (!msg) - return FALSE; - - msg->Context->hStatusWindow = hwndDlg; - - if (msg->pTitle) - SetWindowTextW(hwndDlg, msg->pTitle); - SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, msg->pMessage); - SetEvent(msg->StartupEvent); - return TRUE; - } - } - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + UNREFERENCED_PARAMETER(wParam); + + switch (uMsg) + { + case WM_INITDIALOG: + { + PDISPLAYSTATUSMSG msg = (PDISPLAYSTATUSMSG)lParam; + if (!msg) + return FALSE; + + msg->Context->hStatusWindow = hwndDlg; + + if (msg->pTitle) + SetWindowTextW(hwndDlg, msg->pTitle); + SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, msg->pMessage); + SetEvent(msg->StartupEvent); + return TRUE; + } + } + return FALSE; } static DWORD WINAPI StartupWindowThread(LPVOID lpParam) { - HDESK hDesk; - PDISPLAYSTATUSMSG msg = (PDISPLAYSTATUSMSG)lpParam; - - /* When SetThreadDesktop is called the system closes the desktop handle when needed - so we have to create a new handle because this handle may still be in use by winlogon */ - if (!DuplicateHandle ( GetCurrentProcess(), - msg->hDesktop, - GetCurrentProcess(), - (HANDLE*)&hDesk, - 0, - FALSE, - DUPLICATE_SAME_ACCESS)) - { - HeapFree(GetProcessHeap(), 0, lpParam); - return FALSE; - } - - if(!SetThreadDesktop(hDesk)) - { - HeapFree(GetProcessHeap(), 0, lpParam); - return FALSE; - } - - DialogBoxParam( - hDllInstance, - MAKEINTRESOURCE(IDD_STATUSWINDOW_DLG), - GetDesktopWindow(), - StatusMessageWindowProc, - (LPARAM)lpParam); - - HeapFree(GetProcessHeap(), 0, lpParam); - return TRUE; + HDESK hDesk; + PDISPLAYSTATUSMSG msg = (PDISPLAYSTATUSMSG)lpParam; + + /* When SetThreadDesktop is called the system closes the desktop handle when needed + so we have to create a new handle because this handle may still be in use by winlogon */ + if (!DuplicateHandle ( GetCurrentProcess(), + msg->hDesktop, + GetCurrentProcess(), + (HANDLE*)&hDesk, + 0, + FALSE, + DUPLICATE_SAME_ACCESS)) + { + HeapFree(GetProcessHeap(), 0, lpParam); + return FALSE; + } + + if(!SetThreadDesktop(hDesk)) + { + HeapFree(GetProcessHeap(), 0, lpParam); + return FALSE; + } + + DialogBoxParam( + hDllInstance, + MAKEINTRESOURCE(IDD_STATUSWINDOW_DLG), + GetDesktopWindow(), + StatusMessageWindowProc, + (LPARAM)lpParam); + + HeapFree(GetProcessHeap(), 0, lpParam); + return TRUE; } static BOOL GUIDisplayStatusMessage( - IN PGINA_CONTEXT pgContext, - IN HDESK hDesktop, - IN DWORD dwOptions, - IN PWSTR pTitle, - IN PWSTR pMessage) -{ - PDISPLAYSTATUSMSG msg; - HANDLE Thread; - DWORD ThreadId; - - TRACE("GUIDisplayStatusMessage(%ws)\n", pMessage); - - if (!pgContext->hStatusWindow) - { - msg = (PDISPLAYSTATUSMSG)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DISPLAYSTATUSMSG)); - if(!msg) - return FALSE; - - msg->Context = pgContext; - msg->dwOptions = dwOptions; - msg->pTitle = pTitle; - msg->pMessage = pMessage; - msg->hDesktop = hDesktop; - - msg->StartupEvent = CreateEventW( - NULL, - TRUE, - FALSE, - NULL); - - if (!msg->StartupEvent) - return FALSE; - - Thread = CreateThread( - NULL, - 0, - StartupWindowThread, - (PVOID)msg, - 0, - &ThreadId); - if (Thread) - { - CloseHandle(Thread); - WaitForSingleObject(msg->StartupEvent, INFINITE); - CloseHandle(msg->StartupEvent); - return TRUE; - } - - return FALSE; - } - - if (pTitle) - SetWindowTextW(pgContext->hStatusWindow, pTitle); - - SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUSLABEL, pMessage); - - return TRUE; + IN PGINA_CONTEXT pgContext, + IN HDESK hDesktop, + IN DWORD dwOptions, + IN PWSTR pTitle, + IN PWSTR pMessage) +{ + PDISPLAYSTATUSMSG msg; + HANDLE Thread; + DWORD ThreadId; + + TRACE("GUIDisplayStatusMessage(%ws)\n", pMessage); + + if (!pgContext->hStatusWindow) + { + msg = (PDISPLAYSTATUSMSG)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DISPLAYSTATUSMSG)); + if(!msg) + return FALSE; + + msg->Context = pgContext; + msg->dwOptions = dwOptions; + msg->pTitle = pTitle; + msg->pMessage = pMessage; + msg->hDesktop = hDesktop; + + msg->StartupEvent = CreateEventW( + NULL, + TRUE, + FALSE, + NULL); + + if (!msg->StartupEvent) + return FALSE; + + Thread = CreateThread( + NULL, + 0, + StartupWindowThread, + (PVOID)msg, + 0, + &ThreadId); + if (Thread) + { + CloseHandle(Thread); + WaitForSingleObject(msg->StartupEvent, INFINITE); + CloseHandle(msg->StartupEvent); + return TRUE; + } + + return FALSE; + } + + if (pTitle) + SetWindowTextW(pgContext->hStatusWindow, pTitle); + + SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUSLABEL, pMessage); + + return TRUE; } static BOOL GUIRemoveStatusMessage( - IN PGINA_CONTEXT pgContext) -{ - if (pgContext->hStatusWindow) - { - EndDialog(pgContext->hStatusWindow, 0); - pgContext->hStatusWindow = NULL; - } - - return TRUE; + IN PGINA_CONTEXT pgContext) +{ + if (pgContext->hStatusWindow) + { + EndDialog(pgContext->hStatusWindow, 0); + pgContext->hStatusWindow = NULL; + } + + return TRUE; } static INT_PTR CALLBACK EmptyWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - UNREFERENCED_PARAMETER(hwndDlg); - UNREFERENCED_PARAMETER(uMsg); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + UNREFERENCED_PARAMETER(hwndDlg); + UNREFERENCED_PARAMETER(uMsg); + UNREFERENCED_PARAMETER(wParam); + UNREFERENCED_PARAMETER(lParam); + + return FALSE; } static VOID GUIDisplaySASNotice( - IN OUT PGINA_CONTEXT pgContext) -{ - INT result; - - TRACE("GUIDisplaySASNotice()\n"); - - /* Display the notice window */ - result = DialogBoxParam( - pgContext->hDllInstance, - MAKEINTRESOURCE(IDD_NOTICE_DLG), - GetDesktopWindow(), - EmptyWindowProc, - (LPARAM)NULL); - if (result == -1) - { - /* Failed to display the window. Do as if the user - * already has pressed CTRL+ALT+DELETE */ - pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); - } + IN OUT PGINA_CONTEXT pgContext) +{ + INT result; + + TRACE("GUIDisplaySASNotice()\n"); + + /* Display the notice window */ + result = DialogBoxParam( + pgContext->hDllInstance, + MAKEINTRESOURCE(IDD_NOTICE_DLG), + GetDesktopWindow(), + EmptyWindowProc, + (LPARAM)NULL); + if (result == -1) + { + /* Failed to display the window. Do as if the user + * already has pressed CTRL+ALT+DELETE */ + pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); + } } /* Get the text contained in a textbox. Allocates memory in pText * to contain the text. Returns TRUE in case of success */ static BOOL GetTextboxText( - IN HWND hwndDlg, - IN INT TextboxId, - OUT LPWSTR *pText) -{ - LPWSTR Text; - int Count; - - Count = GetWindowTextLength(GetDlgItem(hwndDlg, TextboxId)); - Text = HeapAlloc(GetProcessHeap(), 0, (Count + 1) * sizeof(WCHAR)); - if (!Text) - return FALSE; - if (Count != GetWindowTextW(GetDlgItem(hwndDlg, TextboxId), Text, Count + 1)) - { - HeapFree(GetProcessHeap(), 0, Text); - return FALSE; - } - *pText = Text; - return TRUE; + IN HWND hwndDlg, + IN INT TextboxId, + OUT LPWSTR *pText) +{ + LPWSTR Text; + int Count; + + Count = GetWindowTextLength(GetDlgItem(hwndDlg, TextboxId)); + Text = HeapAlloc(GetProcessHeap(), 0, (Count + 1) * sizeof(WCHAR)); + if (!Text) + return FALSE; + if (Count != GetWindowTextW(GetDlgItem(hwndDlg, TextboxId), Text, Count + 1)) + { + HeapFree(GetProcessHeap(), 0, Text); + return FALSE; + } + *pText = Text; + return TRUE; } static VOID @@ -260,209 +260,209 @@ static INT_PTR CALLBACK LoggedOnWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - { - OnInitSecurityDlg(hwndDlg, (PGINA_CONTEXT)lParam); - SetFocus(GetDlgItem(hwndDlg, IDNO)); - return TRUE; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDC_LOCK: - EndDialog(hwndDlg, WLX_SAS_ACTION_LOCK_WKSTA); - return TRUE; - case IDC_LOGOFF: - EndDialog(hwndDlg, WLX_SAS_ACTION_LOGOFF); - return TRUE; - case IDC_SHUTDOWN: - EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN_POWER_OFF); - return TRUE; - case IDC_TASKMGR: - EndDialog(hwndDlg, WLX_SAS_ACTION_TASKLIST); - return TRUE; - case IDCANCEL: - EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); - return TRUE; - } - break; - } - case WM_CLOSE: - { - EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); - return TRUE; - } - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + { + OnInitSecurityDlg(hwndDlg, (PGINA_CONTEXT)lParam); + SetFocus(GetDlgItem(hwndDlg, IDNO)); + return TRUE; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_LOCK: + EndDialog(hwndDlg, WLX_SAS_ACTION_LOCK_WKSTA); + return TRUE; + case IDC_LOGOFF: + EndDialog(hwndDlg, WLX_SAS_ACTION_LOGOFF); + return TRUE; + case IDC_SHUTDOWN: + EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN_POWER_OFF); + return TRUE; + case IDC_TASKMGR: + EndDialog(hwndDlg, WLX_SAS_ACTION_TASKLIST); + return TRUE; + case IDCANCEL: + EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); + return TRUE; + } + break; + } + case WM_CLOSE: + { + EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); + return TRUE; + } + } + + return FALSE; } static INT GUILoggedOnSAS( - IN OUT PGINA_CONTEXT pgContext, - IN DWORD dwSasType) -{ - INT result; - - TRACE("GUILoggedOnSAS()\n"); - - if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL) - { - /* Nothing to do for WLX_SAS_TYPE_TIMEOUT ; the dialog will - * close itself thanks to the use of WlxDialogBoxParam */ - return WLX_SAS_ACTION_NONE; - } - - result = pgContext->pWlxFuncs->WlxSwitchDesktopToWinlogon( - pgContext->hWlx); - - result = pgContext->pWlxFuncs->WlxDialogBoxParam( - pgContext->hWlx, - pgContext->hDllInstance, - MAKEINTRESOURCEW(IDD_LOGGEDON_DLG), - GetDesktopWindow(), - LoggedOnWindowProc, - (LPARAM)pgContext); - - if (result < WLX_SAS_ACTION_LOGON || - result > WLX_SAS_ACTION_SWITCH_CONSOLE) - { - result = WLX_SAS_ACTION_NONE; - } - - if (result == WLX_SAS_ACTION_NONE) - { - result = pgContext->pWlxFuncs->WlxSwitchDesktopToUser( - pgContext->hWlx); - } - - return result; + IN OUT PGINA_CONTEXT pgContext, + IN DWORD dwSasType) +{ + INT result; + + TRACE("GUILoggedOnSAS()\n"); + + if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL) + { + /* Nothing to do for WLX_SAS_TYPE_TIMEOUT ; the dialog will + * close itself thanks to the use of WlxDialogBoxParam */ + return WLX_SAS_ACTION_NONE; + } + + result = pgContext->pWlxFuncs->WlxSwitchDesktopToWinlogon( + pgContext->hWlx); + + result = pgContext->pWlxFuncs->WlxDialogBoxParam( + pgContext->hWlx, + pgContext->hDllInstance, + MAKEINTRESOURCEW(IDD_LOGGEDON_DLG), + GetDesktopWindow(), + LoggedOnWindowProc, + (LPARAM)pgContext); + + if (result < WLX_SAS_ACTION_LOGON || + result > WLX_SAS_ACTION_SWITCH_CONSOLE) + { + result = WLX_SAS_ACTION_NONE; + } + + if (result == WLX_SAS_ACTION_NONE) + { + result = pgContext->pWlxFuncs->WlxSwitchDesktopToUser( + pgContext->hWlx); + } + + return result; } static INT_PTR CALLBACK LoggedOutWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - PGINA_CONTEXT pgContext; - - pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - /* FIXME: take care of DontDisplayLastUserName, NoDomainUI, ShutdownWithoutLogon */ - pgContext = (PGINA_CONTEXT)lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); - SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); - - pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - return TRUE; - } - case WM_PAINT: - { - PAINTSTRUCT ps; - HDC hdc; - if (pgContext->hBitmap) - { - hdc = BeginPaint(hwndDlg, &ps); - DrawStateW(hdc, NULL, NULL, (LPARAM)pgContext->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP); - EndPaint(hwndDlg, &ps); - } - return TRUE; - } - case WM_DESTROY: - { - DeleteObject(pgContext->hBitmap); - return TRUE; - } - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDOK: - { - LPWSTR UserName = NULL, Password = NULL; - INT result = WLX_SAS_ACTION_NONE; - - if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0') - break; - if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password) && - DoLoginTasks(pgContext, UserName, NULL, Password)) - { - result = WLX_SAS_ACTION_LOGON; - } - HeapFree(GetProcessHeap(), 0, UserName); - HeapFree(GetProcessHeap(), 0, Password); - EndDialog(hwndDlg, result); - return TRUE; - } - case IDCANCEL: - { - EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); - return TRUE; - } - case IDC_SHUTDOWN: - { - EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN); - return TRUE; - } - } - break; - } - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PGINA_CONTEXT pgContext; + + pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + /* FIXME: take care of DontDisplayLastUserName, NoDomainUI, ShutdownWithoutLogon */ + pgContext = (PGINA_CONTEXT)lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); + SetFocus(GetDlgItem(hwndDlg, IDC_USERNAME)); + + pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + return TRUE; + } + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc; + if (pgContext->hBitmap) + { + hdc = BeginPaint(hwndDlg, &ps); + DrawStateW(hdc, NULL, NULL, (LPARAM)pgContext->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP); + EndPaint(hwndDlg, &ps); + } + return TRUE; + } + case WM_DESTROY: + { + DeleteObject(pgContext->hBitmap); + return TRUE; + } + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + { + LPWSTR UserName = NULL, Password = NULL; + INT result = WLX_SAS_ACTION_NONE; + + if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0') + break; + if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password) && + DoLoginTasks(pgContext, UserName, NULL, Password)) + { + result = WLX_SAS_ACTION_LOGON; + } + HeapFree(GetProcessHeap(), 0, UserName); + HeapFree(GetProcessHeap(), 0, Password); + EndDialog(hwndDlg, result); + return TRUE; + } + case IDCANCEL: + { + EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); + return TRUE; + } + case IDC_SHUTDOWN: + { + EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN); + return TRUE; + } + } + break; + } + } + + return FALSE; } static INT GUILoggedOutSAS( - IN OUT PGINA_CONTEXT pgContext) -{ - int result; - - TRACE("GUILoggedOutSAS()\n"); - - result = pgContext->pWlxFuncs->WlxDialogBoxParam( - pgContext->hWlx, - pgContext->hDllInstance, - MAKEINTRESOURCEW(IDD_LOGGEDOUT_DLG), - GetDesktopWindow(), - LoggedOutWindowProc, - (LPARAM)pgContext); - if (result >= WLX_SAS_ACTION_LOGON && - result <= WLX_SAS_ACTION_SWITCH_CONSOLE) - { - WARN("WlxLoggedOutSAS() returns 0x%x\n", result); - return result; - } - - WARN("WlxDialogBoxParam() failed (0x%x)\n", result); - return WLX_SAS_ACTION_NONE; + IN OUT PGINA_CONTEXT pgContext) +{ + int result; + + TRACE("GUILoggedOutSAS()\n"); + + result = pgContext->pWlxFuncs->WlxDialogBoxParam( + pgContext->hWlx, + pgContext->hDllInstance, + MAKEINTRESOURCEW(IDD_LOGGEDOUT_DLG), + GetDesktopWindow(), + LoggedOutWindowProc, + (LPARAM)pgContext); + if (result >= WLX_SAS_ACTION_LOGON && + result <= WLX_SAS_ACTION_SWITCH_CONSOLE) + { + WARN("WlxLoggedOutSAS() returns 0x%x\n", result); + return result; + } + + WARN("WlxDialogBoxParam() failed (0x%x)\n", result); + return WLX_SAS_ACTION_NONE; } static INT GUILockedSAS( - IN OUT PGINA_CONTEXT pgContext) -{ - TRACE("GUILockedSAS()\n"); - - UNREFERENCED_PARAMETER(pgContext); - - UNIMPLEMENTED; - return WLX_SAS_ACTION_UNLOCK_WKSTA; + IN OUT PGINA_CONTEXT pgContext) +{ + TRACE("GUILockedSAS()\n"); + + UNREFERENCED_PARAMETER(pgContext); + + UNIMPLEMENTED; + return WLX_SAS_ACTION_UNLOCK_WKSTA; } @@ -485,71 +485,71 @@ static INT_PTR CALLBACK LockedWindowProc( - IN HWND hwndDlg, - IN UINT uMsg, - IN WPARAM wParam, - IN LPARAM lParam) -{ - PGINA_CONTEXT pgContext; - - pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA); - - switch (uMsg) - { - case WM_INITDIALOG: - { - pgContext = (PGINA_CONTEXT)lParam; - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); - - pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - OnInitLockedDlg(hwndDlg, pgContext); - return TRUE; - } - case WM_PAINT: - { - PAINTSTRUCT ps; - HDC hdc; - if (pgContext->hBitmap) - { - hdc = BeginPaint(hwndDlg, &ps); - DrawStateW(hdc, NULL, NULL, (LPARAM)pgContext->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP); - EndPaint(hwndDlg, &ps); - } - return TRUE; - } - case WM_DESTROY: - { - DeleteObject(pgContext->hBitmap); - return TRUE; - } - } - - return FALSE; + IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + PGINA_CONTEXT pgContext; + + pgContext = (PGINA_CONTEXT)GetWindowLongPtr(hwndDlg, GWL_USERDATA); + + switch (uMsg) + { + case WM_INITDIALOG: + { + pgContext = (PGINA_CONTEXT)lParam; + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); + + pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); + OnInitLockedDlg(hwndDlg, pgContext); + return TRUE; + } + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc; + if (pgContext->hBitmap) + { + hdc = BeginPaint(hwndDlg, &ps); + DrawStateW(hdc, NULL, NULL, (LPARAM)pgContext->hBitmap, (WPARAM)0, 0, 0, 0, 0, DST_BITMAP); + EndPaint(hwndDlg, &ps); + } + return TRUE; + } + case WM_DESTROY: + { + DeleteObject(pgContext->hBitmap); + return TRUE; + } + } + + return FALSE; } static VOID GUIDisplayLockedNotice( - IN OUT PGINA_CONTEXT pgContext) -{ - TRACE("GUIdisplayLockedNotice()\n"); - - pgContext->pWlxFuncs->WlxDialogBoxParam( - pgContext->hWlx, - pgContext->hDllInstance, - MAKEINTRESOURCEW(IDD_LOCKED_DLG), - GetDesktopWindow(), - LockedWindowProc, - (LPARAM)pgContext); + IN OUT PGINA_CONTEXT pgContext) +{ + TRACE("GUIdisplayLockedNotice()\n"); + + pgContext->pWlxFuncs->WlxDialogBoxParam( + pgContext->hWlx, + pgContext->hDllInstance, + MAKEINTRESOURCEW(IDD_LOCKED_DLG), + GetDesktopWindow(), + LockedWindowProc, + (LPARAM)pgContext); } GINA_UI GinaGraphicalUI = { - GUIInitialize, - GUIDisplayStatusMessage, - GUIRemoveStatusMessage, - GUIDisplaySASNotice, - GUILoggedOnSAS, - GUILoggedOutSAS, - GUILockedSAS, - GUIDisplayLockedNotice, + GUIInitialize, + GUIDisplayStatusMessage, + GUIRemoveStatusMessage, + GUIDisplaySASNotice, + GUILoggedOnSAS, + GUILoggedOutSAS, + GUILockedSAS, + GUIDisplayLockedNotice, }; Modified: trunk/reactos/dll/win32/msgina/msgina.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?…
============================================================================== --- trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] Mon May 6 21:43:03 2013 @@ -39,100 +39,100 @@ */ BOOL WINAPI WlxNegotiate( - IN DWORD dwWinlogonVersion, - OUT PDWORD pdwDllVersion) -{ - TRACE("WlxNegotiate(%lx, %p)\n", dwWinlogonVersion, pdwDllVersion); - - if(!pdwDllVersion || (dwWinlogonVersion < WLX_VERSION_1_3)) - return FALSE; - - *pdwDllVersion = WLX_VERSION_1_3; - - return TRUE; + IN DWORD dwWinlogonVersion, + OUT PDWORD pdwDllVersion) +{ + TRACE("WlxNegotiate(%lx, %p)\n", dwWinlogonVersion, pdwDllVersion); + + if(!pdwDllVersion || (dwWinlogonVersion < WLX_VERSION_1_3)) + return FALSE; + + *pdwDllVersion = WLX_VERSION_1_3; + + return TRUE; } static LONG ReadRegSzKey( - IN HKEY hKey, - IN LPCWSTR pszKey, - OUT LPWSTR* pValue) -{ - LONG rc; - DWORD dwType; - DWORD cbData = 0; - LPWSTR Value; - - if (!pValue) - return ERROR_INVALID_PARAMETER; - - *pValue = NULL; - rc = RegQueryValueExW(hKey, pszKey, NULL, &dwType, NULL, &cbData); - if (rc != ERROR_SUCCESS) - return rc; - if (dwType != REG_SZ) - return ERROR_FILE_NOT_FOUND; - Value = HeapAlloc(GetProcessHeap(), 0, cbData + sizeof(WCHAR)); - if (!Value) - return ERROR_NOT_ENOUGH_MEMORY; - rc = RegQueryValueExW(hKey, pszKey, NULL, NULL, (LPBYTE)Value, &cbData); - if (rc != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, Value); - return rc; - } - /* NULL-terminate the string */ - Value[cbData / sizeof(WCHAR)] = '\0'; - - *pValue = Value; - return ERROR_SUCCESS; + IN HKEY hKey, + IN LPCWSTR pszKey, + OUT LPWSTR* pValue) +{ + LONG rc; + DWORD dwType; + DWORD cbData = 0; + LPWSTR Value; + + if (!pValue) + return ERROR_INVALID_PARAMETER; + + *pValue = NULL; + rc = RegQueryValueExW(hKey, pszKey, NULL, &dwType, NULL, &cbData); + if (rc != ERROR_SUCCESS) + return rc; + if (dwType != REG_SZ) + return ERROR_FILE_NOT_FOUND; + Value = HeapAlloc(GetProcessHeap(), 0, cbData + sizeof(WCHAR)); + if (!Value) + return ERROR_NOT_ENOUGH_MEMORY; + rc = RegQueryValueExW(hKey, pszKey, NULL, NULL, (LPBYTE)Value, &cbData); + if (rc != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, Value); + return rc; + } + /* NULL-terminate the string */ + Value[cbData / sizeof(WCHAR)] = '\0'; + + *pValue = Value; + return ERROR_SUCCESS; } static VOID ChooseGinaUI(VOID) { - HKEY ControlKey = NULL; - LPWSTR SystemStartOptions = NULL; - LPWSTR CurrentOption, NextOption; /* Pointers into SystemStartOptions */ - BOOL ConsoleBoot = FALSE; - LONG rc; - - rc = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SYSTEM\\CurrentControlSet\\Control", - 0, - KEY_QUERY_VALUE, - &ControlKey); - - rc = ReadRegSzKey(ControlKey, L"SystemStartOptions", &SystemStartOptions); - if (rc != ERROR_SUCCESS) - goto cleanup; - - /* Check for CONSOLE switch in SystemStartOptions */ - CurrentOption = SystemStartOptions; - while (CurrentOption) - { - NextOption = wcschr(CurrentOption, L' '); - if (NextOption) - *NextOption = L'\0'; - if (wcsicmp(CurrentOption, L"CONSOLE") == 0) - { - TRACE("Found %S. Switching to console boot\n", CurrentOption); - ConsoleBoot = TRUE; - goto cleanup; - } - CurrentOption = NextOption ? NextOption + 1 : NULL; - } + HKEY ControlKey = NULL; + LPWSTR SystemStartOptions = NULL; + LPWSTR CurrentOption, NextOption; /* Pointers into SystemStartOptions */ + BOOL ConsoleBoot = FALSE; + LONG rc; + + rc = RegOpenKeyExW( + HKEY_LOCAL_MACHINE, + L"SYSTEM\\CurrentControlSet\\Control", + 0, + KEY_QUERY_VALUE, + &ControlKey); + + rc = ReadRegSzKey(ControlKey, L"SystemStartOptions", &SystemStartOptions); + if (rc != ERROR_SUCCESS) + goto cleanup; + + /* Check for CONSOLE switch in SystemStartOptions */ + CurrentOption = SystemStartOptions; + while (CurrentOption) + { + NextOption = wcschr(CurrentOption, L' '); + if (NextOption) + *NextOption = L'\0'; + if (wcsicmp(CurrentOption, L"CONSOLE") == 0) + { + TRACE("Found %S. Switching to console boot\n", CurrentOption); + ConsoleBoot = TRUE; + goto cleanup; + } + CurrentOption = NextOption ? NextOption + 1 : NULL; + } cleanup: - if (ConsoleBoot) - pGinaUI = &GinaTextUI; - else - pGinaUI = &GinaGraphicalUI; - - if (ControlKey != NULL) - RegCloseKey(ControlKey); - HeapFree(GetProcessHeap(), 0, SystemStartOptions); + if (ConsoleBoot) + pGinaUI = &GinaTextUI; + else + pGinaUI = &GinaGraphicalUI; + + if (ControlKey != NULL) + RegCloseKey(ControlKey); + HeapFree(GetProcessHeap(), 0, SystemStartOptions); } /* @@ -140,50 +140,50 @@ */ BOOL WINAPI WlxInitialize( - LPWSTR lpWinsta, - HANDLE hWlx, - PVOID pvReserved, - PVOID pWinlogonFunctions, - PVOID *pWlxContext) -{ - PGINA_CONTEXT pgContext; - - UNREFERENCED_PARAMETER(pvReserved); - - pgContext = (PGINA_CONTEXT)LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, sizeof(GINA_CONTEXT)); - if(!pgContext) - { - WARN("LocalAlloc() failed\n"); - return FALSE; - } - - /* Return the context to winlogon */ - *pWlxContext = (PVOID)pgContext; - pgContext->hDllInstance = hDllInstance; - - /* Save pointer to dispatch table */ - pgContext->pWlxFuncs = (PWLX_DISPATCH_VERSION_1_3)pWinlogonFunctions; - - /* Save the winlogon handle used to call the dispatch functions */ - pgContext->hWlx = hWlx; - - /* Save window station */ - pgContext->station = lpWinsta; - - /* Clear status window handle */ - pgContext->hStatusWindow = 0; - - /* Notify winlogon that we will use the default SAS */ - pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx); - - /* Locates the authentification package */ - //LsaRegisterLogonProcess(...); - - /* Check autologon settings the first time */ - pgContext->AutoLogonState = AUTOLOGON_CHECK_REGISTRY; - - ChooseGinaUI(); - return pGinaUI->Initialize(pgContext); + LPWSTR lpWinsta, + HANDLE hWlx, + PVOID pvReserved, + PVOID pWinlogonFunctions, + PVOID *pWlxContext) +{ + PGINA_CONTEXT pgContext; + + UNREFERENCED_PARAMETER(pvReserved); + + pgContext = (PGINA_CONTEXT)LocalAlloc(LMEM_FIXED | LMEM_ZEROINIT, sizeof(GINA_CONTEXT)); + if(!pgContext) + { + WARN("LocalAlloc() failed\n"); + return FALSE; + } + + /* Return the context to winlogon */ + *pWlxContext = (PVOID)pgContext; + pgContext->hDllInstance = hDllInstance; + + /* Save pointer to dispatch table */ + pgContext->pWlxFuncs = (PWLX_DISPATCH_VERSION_1_3)pWinlogonFunctions; + + /* Save the winlogon handle used to call the dispatch functions */ + pgContext->hWlx = hWlx; + + /* Save window station */ + pgContext->station = lpWinsta; + + /* Clear status window handle */ + pgContext->hStatusWindow = 0; + + /* Notify winlogon that we will use the default SAS */ + pgContext->pWlxFuncs->WlxUseCtrlAltDel(hWlx); + + /* Locates the authentification package */ + //LsaRegisterLogonProcess(...); + + /* Check autologon settings the first time */ + pgContext->AutoLogonState = AUTOLOGON_CHECK_REGISTRY; + + ChooseGinaUI(); + return pGinaUI->Initialize(pgContext); } /* @@ -252,65 +252,65 @@ */ BOOL WINAPI WlxStartApplication( - PVOID pWlxContext, - PWSTR pszDesktopName, - PVOID pEnvironment, - PWSTR pszCmdLine) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInformation; - WCHAR CurrentDirectory[MAX_PATH]; - HANDLE hAppToken; - UINT len; - BOOL ret; - - len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH); - if (len == 0 || len > MAX_PATH) - { - ERR("GetWindowsDirectoryW() failed\n"); - return FALSE; - } - - ret = DuplicateTokenEx(pgContext->UserToken, MAXIMUM_ALLOWED, NULL, SecurityImpersonation, TokenPrimary, &hAppToken); - if (!ret) - { - ERR("DuplicateTokenEx() failed with error %lu\n", GetLastError()); - return FALSE; - } - - ZeroMemory(&StartupInfo, sizeof(StartupInfo)); - ZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpTitle = pszCmdLine; - StartupInfo.dwFlags = STARTF_USESHOWWINDOW; - StartupInfo.wShowWindow = SW_SHOW; - StartupInfo.lpDesktop = pszDesktopName; - - len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH); - if (len == 0 || len > MAX_PATH) - { - ERR("GetWindowsDirectoryW() failed\n"); - return FALSE; - } - ret = CreateProcessAsUserW( - hAppToken, - pszCmdLine, - NULL, - NULL, - NULL, - FALSE, - CREATE_UNICODE_ENVIRONMENT, - pEnvironment, - CurrentDirectory, - &StartupInfo, - &ProcessInformation); - CloseHandle(ProcessInformation.hProcess); - CloseHandle(ProcessInformation.hThread); - CloseHandle(hAppToken); - if (!ret) - ERR("CreateProcessAsUserW() failed with error %lu\n", GetLastError()); - return ret; + PVOID pWlxContext, + PWSTR pszDesktopName, + PVOID pEnvironment, + PWSTR pszCmdLine) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + STARTUPINFOW StartupInfo; + PROCESS_INFORMATION ProcessInformation; + WCHAR CurrentDirectory[MAX_PATH]; + HANDLE hAppToken; + UINT len; + BOOL ret; + + len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH); + if (len == 0 || len > MAX_PATH) + { + ERR("GetWindowsDirectoryW() failed\n"); + return FALSE; + } + + ret = DuplicateTokenEx(pgContext->UserToken, MAXIMUM_ALLOWED, NULL, SecurityImpersonation, TokenPrimary, &hAppToken); + if (!ret) + { + ERR("DuplicateTokenEx() failed with error %lu\n", GetLastError()); + return FALSE; + } + + ZeroMemory(&StartupInfo, sizeof(StartupInfo)); + ZeroMemory(&ProcessInformation, sizeof(ProcessInformation)); + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpTitle = pszCmdLine; + StartupInfo.dwFlags = STARTF_USESHOWWINDOW; + StartupInfo.wShowWindow = SW_SHOW; + StartupInfo.lpDesktop = pszDesktopName; + + len = GetWindowsDirectoryW(CurrentDirectory, MAX_PATH); + if (len == 0 || len > MAX_PATH) + { + ERR("GetWindowsDirectoryW() failed\n"); + return FALSE; + } + ret = CreateProcessAsUserW( + hAppToken, + pszCmdLine, + NULL, + NULL, + NULL, + FALSE, + CREATE_UNICODE_ENVIRONMENT, + pEnvironment, + CurrentDirectory, + &StartupInfo, + &ProcessInformation); + CloseHandle(ProcessInformation.hProcess); + CloseHandle(ProcessInformation.hThread); + CloseHandle(hAppToken); + if (!ret) + ERR("CreateProcessAsUserW() failed with error %lu\n", GetLastError()); + return ret; } /* @@ -318,61 +318,61 @@ */ BOOL WINAPI WlxActivateUserShell( - PVOID pWlxContext, - PWSTR pszDesktopName, - PWSTR pszMprLogonScript, - PVOID pEnvironment) -{ - HKEY hKey; - DWORD BufSize, ValueType; - WCHAR pszUserInitApp[MAX_PATH + 1]; - WCHAR pszExpUserInitApp[MAX_PATH]; - DWORD len; - LONG rc; - - TRACE("WlxActivateUserShell()\n"); - - UNREFERENCED_PARAMETER(pszMprLogonScript); - - /* Get the path of userinit */ - rc = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", - 0, - KEY_QUERY_VALUE, - &hKey); - if (rc != ERROR_SUCCESS) - { - WARN("RegOpenKeyExW() failed with error %lu\n", rc); - return FALSE; - } - - /* Query userinit application */ - BufSize = sizeof(pszUserInitApp) - sizeof(UNICODE_NULL); - rc = RegQueryValueExW( - hKey, - L"Userinit", - NULL, - &ValueType, - (LPBYTE)pszUserInitApp, - &BufSize); - RegCloseKey(hKey); - if (rc != ERROR_SUCCESS || (ValueType != REG_SZ && ValueType != REG_EXPAND_SZ)) - { - WARN("RegQueryValueExW() failed with error %lu\n", rc); - return FALSE; - } - pszUserInitApp[MAX_PATH] = UNICODE_NULL; - - len = ExpandEnvironmentStringsW(pszUserInitApp, pszExpUserInitApp, MAX_PATH); - if (len > MAX_PATH) - { - WARN("ExpandEnvironmentStringsW() failed. Required size %lu\n", len); - return FALSE; - } - - /* Start userinit app */ - return WlxStartApplication(pWlxContext, pszDesktopName, pEnvironment, pszExpUserInitApp); + PVOID pWlxContext, + PWSTR pszDesktopName, + PWSTR pszMprLogonScript, + PVOID pEnvironment) +{ + HKEY hKey; + DWORD BufSize, ValueType; + WCHAR pszUserInitApp[MAX_PATH + 1]; + WCHAR pszExpUserInitApp[MAX_PATH]; + DWORD len; + LONG rc; + + TRACE("WlxActivateUserShell()\n"); + + UNREFERENCED_PARAMETER(pszMprLogonScript); + + /* Get the path of userinit */ + rc = RegOpenKeyExW( + HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + 0, + KEY_QUERY_VALUE, + &hKey); + if (rc != ERROR_SUCCESS) + { + WARN("RegOpenKeyExW() failed with error %lu\n", rc); + return FALSE; + } + + /* Query userinit application */ + BufSize = sizeof(pszUserInitApp) - sizeof(UNICODE_NULL); + rc = RegQueryValueExW( + hKey, + L"Userinit", + NULL, + &ValueType, + (LPBYTE)pszUserInitApp, + &BufSize); + RegCloseKey(hKey); + if (rc != ERROR_SUCCESS || (ValueType != REG_SZ && ValueType != REG_EXPAND_SZ)) + { + WARN("RegQueryValueExW() failed with error %lu\n", rc); + return FALSE; + } + pszUserInitApp[MAX_PATH] = UNICODE_NULL; + + len = ExpandEnvironmentStringsW(pszUserInitApp, pszExpUserInitApp, MAX_PATH); + if (len > MAX_PATH) + { + WARN("ExpandEnvironmentStringsW() failed. Required size %lu\n", len); + return FALSE; + } + + /* Start userinit app */ + return WlxStartApplication(pWlxContext, pszDesktopName, pEnvironment, pszExpUserInitApp); } /* @@ -380,43 +380,43 @@ */ int WINAPI WlxLoggedOnSAS( - PVOID pWlxContext, - DWORD dwSasType, - PVOID pReserved) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - INT SasAction = WLX_SAS_ACTION_NONE; - - TRACE("WlxLoggedOnSAS(0x%lx)\n", dwSasType); - - UNREFERENCED_PARAMETER(pReserved); - - switch (dwSasType) - { - case WLX_SAS_TYPE_CTRL_ALT_DEL: - case WLX_SAS_TYPE_TIMEOUT: - { - SasAction = pGinaUI->LoggedOnSAS(pgContext, dwSasType); - break; - } - case WLX_SAS_TYPE_SC_INSERT: - { - FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_INSERT not supported!\n"); - break; - } - case WLX_SAS_TYPE_SC_REMOVE: - { - FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_REMOVE not supported!\n"); - break; - } - default: - { - WARN("WlxLoggedOnSAS: Unknown SasType: 0x%x\n", dwSasType); - break; - } - } - - return SasAction; + PVOID pWlxContext, + DWORD dwSasType, + PVOID pReserved) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + INT SasAction = WLX_SAS_ACTION_NONE; + + TRACE("WlxLoggedOnSAS(0x%lx)\n", dwSasType); + + UNREFERENCED_PARAMETER(pReserved); + + switch (dwSasType) + { + case WLX_SAS_TYPE_CTRL_ALT_DEL: + case WLX_SAS_TYPE_TIMEOUT: + { + SasAction = pGinaUI->LoggedOnSAS(pgContext, dwSasType); + break; + } + case WLX_SAS_TYPE_SC_INSERT: + { + FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_INSERT not supported!\n"); + break; + } + case WLX_SAS_TYPE_SC_REMOVE: + { + FIXME("WlxLoggedOnSAS: SasType WLX_SAS_TYPE_SC_REMOVE not supported!\n"); + break; + } + default: + { + WARN("WlxLoggedOnSAS: Unknown SasType: 0x%x\n", dwSasType); + break; + } + } + + return SasAction; } /* @@ -424,17 +424,17 @@ */ BOOL WINAPI WlxDisplayStatusMessage( - IN PVOID pWlxContext, - IN HDESK hDesktop, - IN DWORD dwOptions, - IN PWSTR pTitle, - IN PWSTR pMessage) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - - TRACE("WlxDisplayStatusMessage(\"%S\")\n", pMessage); - - return pGinaUI->DisplayStatusMessage(pgContext, hDesktop, dwOptions, pTitle, pMessage); + IN PVOID pWlxContext, + IN HDESK hDesktop, + IN DWORD dwOptions, + IN PWSTR pTitle, + IN PWSTR pMessage) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + + TRACE("WlxDisplayStatusMessage(\"%S\")\n", pMessage); + + return pGinaUI->DisplayStatusMessage(pgContext, hDesktop, dwOptions, pTitle, pMessage); } /* @@ -442,231 +442,231 @@ */ BOOL WINAPI WlxRemoveStatusMessage( - IN PVOID pWlxContext) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - - TRACE("WlxRemoveStatusMessage()\n"); - - return pGinaUI->RemoveStatusMessage(pgContext); + IN PVOID pWlxContext) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + + TRACE("WlxRemoveStatusMessage()\n"); + + return pGinaUI->RemoveStatusMessage(pgContext); } static PWSTR DuplicationString(PWSTR Str) { - DWORD cb; - PWSTR NewStr; - - if (Str == NULL) return NULL; - - cb = (wcslen(Str) + 1) * sizeof(WCHAR); - if ((NewStr = LocalAlloc(LMEM_FIXED, cb))) - memcpy(NewStr, Str, cb); - return NewStr; + DWORD cb; + PWSTR NewStr; + + if (Str == NULL) return NULL; + + cb = (wcslen(Str) + 1) * sizeof(WCHAR); + if ((NewStr = LocalAlloc(LMEM_FIXED, cb))) + memcpy(NewStr, Str, cb); + return NewStr; } BOOL DoLoginTasks( - IN OUT PGINA_CONTEXT pgContext, - IN PWSTR UserName, - IN PWSTR Domain, - IN PWSTR Password) -{ - LPWSTR ProfilePath = NULL; - LPWSTR lpEnvironment = NULL; - TOKEN_STATISTICS Stats; - PWLX_PROFILE_V2_0 pProfile = NULL; - DWORD cbStats, cbSize; - DWORD dwLength; - BOOL bResult; - - if (!LogonUserW(UserName, Domain, Password, - LOGON32_LOGON_INTERACTIVE, - LOGON32_PROVIDER_DEFAULT, - &pgContext->UserToken)) - { - WARN("LogonUserW() failed\n"); - goto cleanup; - } - - /* Store the logon time in the context */ - GetLocalTime(&pgContext->LogonTime); - - /* Store user and domain in the context */ - wcscpy(pgContext->UserName, UserName); - if (Domain == NULL || wcslen(Domain) == 0) - { - dwLength = 256; - GetComputerNameW(pgContext->Domain, &dwLength); - } - else - { - wcscpy(pgContext->Domain, Domain); - } - - /* Get profile path */ - cbSize = 0; - bResult = GetProfilesDirectoryW(NULL, &cbSize); - if (!bResult && GetLastError() == ERROR_INSUFFICIENT_BUFFER) - { - ProfilePath = HeapAlloc(GetProcessHeap(), 0, cbSize * sizeof(WCHAR)); - if (!ProfilePath) - { - WARN("HeapAlloc() failed\n"); - goto cleanup; - } - bResult = GetProfilesDirectoryW(ProfilePath, &cbSize); - } - if (!bResult) - { - WARN("GetUserProfileDirectoryW() failed\n"); - goto cleanup; - } - - /* Allocate memory for profile */ - pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V2_0)); - if (!pProfile) - { - WARN("HeapAlloc() failed\n"); - goto cleanup; - } - pProfile->dwType = WLX_PROFILE_TYPE_V2_0; - pProfile->pszProfile = ProfilePath; - - lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - (wcslen(pgContext->Domain)+ 14 + 1) * sizeof(WCHAR)); - if (!lpEnvironment) - { - WARN("HeapAlloc() failed\n"); - goto cleanup; - } - - wsprintfW(lpEnvironment, L"LOGONSERVER=\\\\%s", pgContext->Domain); - - pProfile->pszEnvironment = lpEnvironment; - - if (!GetTokenInformation(pgContext->UserToken, - TokenStatistics, - (PVOID)&Stats, - sizeof(TOKEN_STATISTICS), - &cbStats)) - { - WARN("Couldn't get Authentication id from user token!\n"); - goto cleanup; - } - - *pgContext->pAuthenticationId = Stats.AuthenticationId; - pgContext->pMprNotifyInfo->pszUserName = DuplicationString(UserName); - pgContext->pMprNotifyInfo->pszDomain = DuplicationString(Domain); - pgContext->pMprNotifyInfo->pszPassword = DuplicationString(Password); - pgContext->pMprNotifyInfo->pszOldPassword = NULL; - *pgContext->pdwOptions = 0; - *pgContext->pProfile = pProfile; - return TRUE; + IN OUT PGINA_CONTEXT pgContext, + IN PWSTR UserName, + IN PWSTR Domain, + IN PWSTR Password) +{ + LPWSTR ProfilePath = NULL; + LPWSTR lpEnvironment = NULL; + TOKEN_STATISTICS Stats; + PWLX_PROFILE_V2_0 pProfile = NULL; + DWORD cbStats, cbSize; + DWORD dwLength; + BOOL bResult; + + if (!LogonUserW(UserName, Domain, Password, + LOGON32_LOGON_INTERACTIVE, + LOGON32_PROVIDER_DEFAULT, + &pgContext->UserToken)) + { + WARN("LogonUserW() failed\n"); + goto cleanup; + } + + /* Store the logon time in the context */ + GetLocalTime(&pgContext->LogonTime); + + /* Store user and domain in the context */ + wcscpy(pgContext->UserName, UserName); + if (Domain == NULL || wcslen(Domain) == 0) + { + dwLength = 256; + GetComputerNameW(pgContext->Domain, &dwLength); + } + else + { + wcscpy(pgContext->Domain, Domain); + } + + /* Get profile path */ + cbSize = 0; + bResult = GetProfilesDirectoryW(NULL, &cbSize); + if (!bResult && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + ProfilePath = HeapAlloc(GetProcessHeap(), 0, cbSize * sizeof(WCHAR)); + if (!ProfilePath) + { + WARN("HeapAlloc() failed\n"); + goto cleanup; + } + bResult = GetProfilesDirectoryW(ProfilePath, &cbSize); + } + if (!bResult) + { + WARN("GetUserProfileDirectoryW() failed\n"); + goto cleanup; + } + + /* Allocate memory for profile */ + pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V2_0)); + if (!pProfile) + { + WARN("HeapAlloc() failed\n"); + goto cleanup; + } + pProfile->dwType = WLX_PROFILE_TYPE_V2_0; + pProfile->pszProfile = ProfilePath; + + lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + (wcslen(pgContext->Domain)+ 14 + 1) * sizeof(WCHAR)); + if (!lpEnvironment) + { + WARN("HeapAlloc() failed\n"); + goto cleanup; + } + + wsprintfW(lpEnvironment, L"LOGONSERVER=\\\\%s", pgContext->Domain); + + pProfile->pszEnvironment = lpEnvironment; + + if (!GetTokenInformation(pgContext->UserToken, + TokenStatistics, + (PVOID)&Stats, + sizeof(TOKEN_STATISTICS), + &cbStats)) + { + WARN("Couldn't get Authentication id from user token!\n"); + goto cleanup; + } + + *pgContext->pAuthenticationId = Stats.AuthenticationId; + pgContext->pMprNotifyInfo->pszUserName = DuplicationString(UserName); + pgContext->pMprNotifyInfo->pszDomain = DuplicationString(Domain); + pgContext->pMprNotifyInfo->pszPassword = DuplicationString(Password); + pgContext->pMprNotifyInfo->pszOldPassword = NULL; + *pgContext->pdwOptions = 0; + *pgContext->pProfile = pProfile; + return TRUE; cleanup: - if (pProfile) - { - HeapFree(GetProcessHeap(), 0, pProfile->pszEnvironment); - } - HeapFree(GetProcessHeap(), 0, pProfile); - HeapFree(GetProcessHeap(), 0, ProfilePath); - return FALSE; + if (pProfile) + { + HeapFree(GetProcessHeap(), 0, pProfile->pszEnvironment); + } + HeapFree(GetProcessHeap(), 0, pProfile); + HeapFree(GetProcessHeap(), 0, ProfilePath); + return FALSE; } static BOOL DoAutoLogon( - IN PGINA_CONTEXT pgContext) -{ - HKEY WinLogonKey = NULL; - LPWSTR AutoLogon = NULL; - LPWSTR AutoCount = NULL; - LPWSTR IgnoreShiftOverride = NULL; - LPWSTR UserName = NULL; - LPWSTR DomainName = NULL; - LPWSTR Password = NULL; - BOOL result = FALSE; - LONG rc; - - TRACE("DoAutoLogon(): AutoLogonState = %lu\n", - pgContext->AutoLogonState); - - if (pgContext->AutoLogonState == AUTOLOGON_DISABLED) - return FALSE; - - rc = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", - 0, - KEY_QUERY_VALUE, - &WinLogonKey); - if (rc != ERROR_SUCCESS) - goto cleanup; - - if (pgContext->AutoLogonState == AUTOLOGON_CHECK_REGISTRY) - { - /* Set it by default to disabled, we might reenable it again later */ - pgContext->AutoLogonState = AUTOLOGON_DISABLED; - - rc = ReadRegSzKey(WinLogonKey, L"AutoAdminLogon", &AutoLogon); - if (rc != ERROR_SUCCESS) - goto cleanup; - if (wcscmp(AutoLogon, L"1") != 0) - goto cleanup; - - rc = ReadRegSzKey(WinLogonKey, L"AutoLogonCount", &AutoCount); - if (rc == ERROR_SUCCESS && wcscmp(AutoCount, L"0") == 0) - goto cleanup; - else if (rc != ERROR_FILE_NOT_FOUND) - goto cleanup; - - rc = ReadRegSzKey(WinLogonKey, L"IgnoreShiftOverride", &UserName); - if (rc == ERROR_SUCCESS) - { - if (wcscmp(AutoLogon, L"1") != 0 && GetKeyState(VK_SHIFT) < 0) - goto cleanup; - } - else if (GetKeyState(VK_SHIFT) < 0) - { - /* User pressed SHIFT */ - goto cleanup; - } - - pgContext->AutoLogonState = AUTOLOGON_ONCE; - result = TRUE; - } - else /* pgContext->AutoLogonState == AUTOLOGON_ONCE */ - { - pgContext->AutoLogonState = AUTOLOGON_DISABLED; - - rc = ReadRegSzKey(WinLogonKey, L"DefaultUserName", &UserName); - if (rc != ERROR_SUCCESS) - goto cleanup; - rc = ReadRegSzKey(WinLogonKey, L"DefaultDomainName", &DomainName); - if (rc != ERROR_SUCCESS && rc != ERROR_FILE_NOT_FOUND) - goto cleanup; - rc = ReadRegSzKey(WinLogonKey, L"DefaultPassword", &Password); - if (rc != ERROR_SUCCESS) - goto cleanup; - - result = DoLoginTasks(pgContext, UserName, DomainName, Password); - - if (result == TRUE) - NotifyBootConfigStatus(TRUE); - } + IN PGINA_CONTEXT pgContext) +{ + HKEY WinLogonKey = NULL; + LPWSTR AutoLogon = NULL; + LPWSTR AutoCount = NULL; + LPWSTR IgnoreShiftOverride = NULL; + LPWSTR UserName = NULL; + LPWSTR DomainName = NULL; + LPWSTR Password = NULL; + BOOL result = FALSE; + LONG rc; + + TRACE("DoAutoLogon(): AutoLogonState = %lu\n", + pgContext->AutoLogonState); + + if (pgContext->AutoLogonState == AUTOLOGON_DISABLED) + return FALSE; + + rc = RegOpenKeyExW( + HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\WinLogon", + 0, + KEY_QUERY_VALUE, + &WinLogonKey); + if (rc != ERROR_SUCCESS) + goto cleanup; + + if (pgContext->AutoLogonState == AUTOLOGON_CHECK_REGISTRY) + { + /* Set it by default to disabled, we might reenable it again later */ + pgContext->AutoLogonState = AUTOLOGON_DISABLED; + + rc = ReadRegSzKey(WinLogonKey, L"AutoAdminLogon", &AutoLogon); + if (rc != ERROR_SUCCESS) + goto cleanup; + if (wcscmp(AutoLogon, L"1") != 0) + goto cleanup; + + rc = ReadRegSzKey(WinLogonKey, L"AutoLogonCount", &AutoCount); + if (rc == ERROR_SUCCESS && wcscmp(AutoCount, L"0") == 0) + goto cleanup; + else if (rc != ERROR_FILE_NOT_FOUND) + goto cleanup; + + rc = ReadRegSzKey(WinLogonKey, L"IgnoreShiftOverride", &UserName); + if (rc == ERROR_SUCCESS) + { + if (wcscmp(AutoLogon, L"1") != 0 && GetKeyState(VK_SHIFT) < 0) + goto cleanup; + } + else if (GetKeyState(VK_SHIFT) < 0) + { + /* User pressed SHIFT */ + goto cleanup; + } + + pgContext->AutoLogonState = AUTOLOGON_ONCE; + result = TRUE; + } + else /* pgContext->AutoLogonState == AUTOLOGON_ONCE */ + { + pgContext->AutoLogonState = AUTOLOGON_DISABLED; + + rc = ReadRegSzKey(WinLogonKey, L"DefaultUserName", &UserName); + if (rc != ERROR_SUCCESS) + goto cleanup; + rc = ReadRegSzKey(WinLogonKey, L"DefaultDomainName", &DomainName); + if (rc != ERROR_SUCCESS && rc != ERROR_FILE_NOT_FOUND) + goto cleanup; + rc = ReadRegSzKey(WinLogonKey, L"DefaultPassword", &Password); + if (rc != ERROR_SUCCESS) + goto cleanup; + + result = DoLoginTasks(pgContext, UserName, DomainName, Password); + + if (result == TRUE) + NotifyBootConfigStatus(TRUE); + } cleanup: - if (WinLogonKey != NULL) - RegCloseKey(WinLogonKey); - HeapFree(GetProcessHeap(), 0, AutoLogon); - HeapFree(GetProcessHeap(), 0, AutoCount); - HeapFree(GetProcessHeap(), 0, IgnoreShiftOverride); - HeapFree(GetProcessHeap(), 0, UserName); - HeapFree(GetProcessHeap(), 0, DomainName); - HeapFree(GetProcessHeap(), 0, Password); - TRACE("DoAutoLogon(): AutoLogonState = %lu, returning %d\n", - pgContext->AutoLogonState, result); - return result; + if (WinLogonKey != NULL) + RegCloseKey(WinLogonKey); + HeapFree(GetProcessHeap(), 0, AutoLogon); + HeapFree(GetProcessHeap(), 0, AutoCount); + HeapFree(GetProcessHeap(), 0, IgnoreShiftOverride); + HeapFree(GetProcessHeap(), 0, UserName); + HeapFree(GetProcessHeap(), 0, DomainName); + HeapFree(GetProcessHeap(), 0, Password); + TRACE("DoAutoLogon(): AutoLogonState = %lu, returning %d\n", + pgContext->AutoLogonState, result); + return result; } /* @@ -674,32 +674,32 @@ */ VOID WINAPI WlxDisplaySASNotice( - IN PVOID pWlxContext) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - - TRACE("WlxDisplaySASNotice(%p)\n", pWlxContext); - - if (GetSystemMetrics(SM_REMOTESESSION)) - { - /* User is remotely logged on. Don't display a notice */ - pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); - return; - } - - if (DoAutoLogon(pgContext)) - { - /* Don't display the window, we want to do an automatic logon */ - pgContext->AutoLogonState = AUTOLOGON_ONCE; - pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); - return; - } - else - pgContext->AutoLogonState = AUTOLOGON_DISABLED; - - pGinaUI->DisplaySASNotice(pgContext); - - TRACE("WlxDisplaySASNotice() done\n"); + IN PVOID pWlxContext) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + + TRACE("WlxDisplaySASNotice(%p)\n", pWlxContext); + + if (GetSystemMetrics(SM_REMOTESESSION)) + { + /* User is remotely logged on. Don't display a notice */ + pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); + return; + } + + if (DoAutoLogon(pgContext)) + { + /* Don't display the window, we want to do an automatic logon */ + pgContext->AutoLogonState = AUTOLOGON_ONCE; + pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL); + return; + } + else + pgContext->AutoLogonState = AUTOLOGON_DISABLED; + + pGinaUI->DisplaySASNotice(pgContext); + + TRACE("WlxDisplaySASNotice() done\n"); } /* @@ -707,40 +707,40 @@ */ INT WINAPI WlxLoggedOutSAS( - IN PVOID pWlxContext, - IN DWORD dwSasType, - OUT PLUID pAuthenticationId, - IN OUT PSID pLogonSid, - OUT PDWORD pdwOptions, - OUT PHANDLE phToken, - OUT PWLX_MPR_NOTIFY_INFO pMprNotifyInfo, - OUT PVOID *pProfile) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - INT res; - - TRACE("WlxLoggedOutSAS()\n"); - - UNREFERENCED_PARAMETER(dwSasType); - UNREFERENCED_PARAMETER(pLogonSid); - - pgContext->pAuthenticationId = pAuthenticationId; - pgContext->pdwOptions = pdwOptions; - pgContext->pMprNotifyInfo = pMprNotifyInfo; - pgContext->pProfile = pProfile; - - if (0 == GetSystemMetrics(SM_REMOTESESSION) && - DoAutoLogon(pgContext)) - { - /* User is local and registry contains information - * to log on him automatically */ - *phToken = pgContext->UserToken; - return WLX_SAS_ACTION_LOGON; - } - - res = pGinaUI->LoggedOutSAS(pgContext); - *phToken = pgContext->UserToken; - return res; + IN PVOID pWlxContext, + IN DWORD dwSasType, + OUT PLUID pAuthenticationId, + IN OUT PSID pLogonSid, + OUT PDWORD pdwOptions, + OUT PHANDLE phToken, + OUT PWLX_MPR_NOTIFY_INFO pMprNotifyInfo, + OUT PVOID *pProfile) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + INT res; + + TRACE("WlxLoggedOutSAS()\n"); + + UNREFERENCED_PARAMETER(dwSasType); + UNREFERENCED_PARAMETER(pLogonSid); + + pgContext->pAuthenticationId = pAuthenticationId; + pgContext->pdwOptions = pdwOptions; + pgContext->pMprNotifyInfo = pMprNotifyInfo; + pgContext->pProfile = pProfile; + + if (0 == GetSystemMetrics(SM_REMOTESESSION) && + DoAutoLogon(pgContext)) + { + /* User is local and registry contains information + * to log on him automatically */ + *phToken = pgContext->UserToken; + return WLX_SAS_ACTION_LOGON; + } + + res = pGinaUI->LoggedOutSAS(pgContext); + *phToken = pgContext->UserToken; + return res; } /* @@ -748,16 +748,16 @@ */ int WINAPI WlxWkstaLockedSAS( - PVOID pWlxContext, - DWORD dwSasType) -{ - PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; - - TRACE("WlxWkstaLockedSAS()\n"); - - UNREFERENCED_PARAMETER(dwSasType); - - return pGinaUI->LockedSAS(pgContext); + PVOID pWlxContext, + DWORD dwSasType) +{ + PGINA_CONTEXT pgContext = (PGINA_CONTEXT)pWlxContext; + + TRACE("WlxWkstaLockedSAS()\n"); + + UNREFERENCED_PARAMETER(dwSasType); + + return pGinaUI->LockedSAS(pgContext); } @@ -781,7 +781,7 @@ */ BOOL WINAPI WlxIsLogoffOk( - PVOID pWlxContext) + PVOID pWlxContext) { TRACE("WlxIsLogoffOk()\n"); UNREFERENCED_PARAMETER(pWlxContext); @@ -790,14 +790,14 @@ BOOL WINAPI DllMain( - IN HINSTANCE hinstDLL, - IN DWORD dwReason, - IN LPVOID lpvReserved) -{ - UNREFERENCED_PARAMETER(lpvReserved); - - if (dwReason == DLL_PROCESS_ATTACH) - hDllInstance = hinstDLL; - - return TRUE; -} + IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + UNREFERENCED_PARAMETER(lpvReserved); + + if (dwReason == DLL_PROCESS_ATTACH) + hDllInstance = hinstDLL; + + return TRUE; +} Modified: trunk/reactos/dll/win32/msgina/msgina.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.h?…
============================================================================== --- trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/msgina.h [iso-8859-1] Mon May 6 21:43:03 2013 @@ -23,25 +23,25 @@ typedef struct { - HANDLE hWlx; - LPWSTR station; - PWLX_DISPATCH_VERSION_1_3 pWlxFuncs; - HANDLE hDllInstance; - HWND hStatusWindow; - DWORD AutoLogonState; + HANDLE hWlx; + LPWSTR station; + PWLX_DISPATCH_VERSION_1_3 pWlxFuncs; + HANDLE hDllInstance; + HWND hStatusWindow; + DWORD AutoLogonState; - /* Informations to be filled during logon */ - WCHAR UserName[256]; - WCHAR Domain[256]; - SYSTEMTIME LogonTime; - HANDLE UserToken; - PLUID pAuthenticationId; - PDWORD pdwOptions; - PWLX_MPR_NOTIFY_INFO pMprNotifyInfo; - PVOID *pProfile; + /* Informations to be filled during logon */ + WCHAR UserName[256]; + WCHAR Domain[256]; + SYSTEMTIME LogonTime; + HANDLE UserToken; + PLUID pAuthenticationId; + PDWORD pdwOptions; + PWLX_MPR_NOTIFY_INFO pMprNotifyInfo; + PVOID *pProfile; - /* Current logo to display */ - HBITMAP hBitmap; + /* Current logo to display */ + HBITMAP hBitmap; } GINA_CONTEXT, *PGINA_CONTEXT; extern HINSTANCE hDllInstance; @@ -57,23 +57,23 @@ typedef struct _GINA_UI { - PFGINA_INITIALIZE Initialize; - PFGINA_DISPLAYSTATUSMESSAGE DisplayStatusMessage; - PFGINA_REMOVESTATUSMESSAGE RemoveStatusMessage; - PFGINA_DISPLAYSASNOTICE DisplaySASNotice; - PFGINA_LOGGEDONSAS LoggedOnSAS; - PFGINA_LOGGEDOUTSAS LoggedOutSAS; - PFGINA_LOCKEDSAS LockedSAS; - PFGINA_DISPLAYLOCKEDNOTICE DisplayLockedNotice; + PFGINA_INITIALIZE Initialize; + PFGINA_DISPLAYSTATUSMESSAGE DisplayStatusMessage; + PFGINA_REMOVESTATUSMESSAGE RemoveStatusMessage; + PFGINA_DISPLAYSASNOTICE DisplaySASNotice; + PFGINA_LOGGEDONSAS LoggedOnSAS; + PFGINA_LOGGEDOUTSAS LoggedOutSAS; + PFGINA_LOCKEDSAS LockedSAS; + PFGINA_DISPLAYLOCKEDNOTICE DisplayLockedNotice; } GINA_UI, *PGINA_UI; /* msgina.c */ BOOL DoLoginTasks( - IN OUT PGINA_CONTEXT pgContext, - IN PWSTR UserName, - IN PWSTR Domain, - IN PWSTR Password); + IN OUT PGINA_CONTEXT pgContext, + IN PWSTR UserName, + IN PWSTR Domain, + IN PWSTR Password); /* EOF */ Modified: trunk/reactos/dll/win32/msgina/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/stubs.c?r…
============================================================================== --- trunk/reactos/dll/win32/msgina/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/stubs.c [iso-8859-1] Mon May 6 21:43:03 2013 @@ -22,20 +22,20 @@ DWORD Unknown, BOOL bHideLogoff) { - UNREFERENCED_PARAMETER(hParent); - UNREFERENCED_PARAMETER(Unknown); - UNREFERENCED_PARAMETER(bHideLogoff); + UNREFERENCED_PARAMETER(hParent); + UNREFERENCED_PARAMETER(Unknown); + UNREFERENCED_PARAMETER(bHideLogoff); - /* Return values: - * 0x00: Cancelled/Help - * 0x01: Log off user - * 0x02: Shutdown - * 0x04: Reboot - * 0x10: Standby - * 0x40: Hibernate - */ - UNIMPLEMENTED; - return FALSE; + /* Return values: + * 0x00: Cancelled/Help + * 0x01: Log off user + * 0x02: Shutdown + * 0x04: Reboot + * 0x10: Standby + * 0x40: Hibernate + */ + UNIMPLEMENTED; + return FALSE; } @@ -44,12 +44,12 @@ */ BOOL WINAPI WlxIsLockOk( - PVOID pWlxContext) + PVOID pWlxContext) { - UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pWlxContext); - UNIMPLEMENTED; - return TRUE; + UNIMPLEMENTED; + return TRUE; } @@ -58,11 +58,11 @@ */ VOID WINAPI WlxLogoff( - PVOID pWlxContext) + PVOID pWlxContext) { - UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pWlxContext); - UNIMPLEMENTED; + UNIMPLEMENTED; } @@ -71,13 +71,13 @@ */ VOID WINAPI WlxShutdown( - PVOID pWlxContext, - DWORD ShutdownType) + PVOID pWlxContext, + DWORD ShutdownType) { - UNREFERENCED_PARAMETER(pWlxContext); - UNREFERENCED_PARAMETER(ShutdownType); + UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(ShutdownType); - UNIMPLEMENTED; + UNIMPLEMENTED; } @@ -86,18 +86,18 @@ */ BOOL WINAPI WlxGetStatusMessage( - PVOID pWlxContext, - DWORD *pdwOptions, - PWSTR pMessage, - DWORD dwBufferSize) + PVOID pWlxContext, + DWORD *pdwOptions, + PWSTR pMessage, + DWORD dwBufferSize) { - UNREFERENCED_PARAMETER(pWlxContext); - UNREFERENCED_PARAMETER(pdwOptions); - UNREFERENCED_PARAMETER(pMessage); - UNREFERENCED_PARAMETER(dwBufferSize); + UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pdwOptions); + UNREFERENCED_PARAMETER(pMessage); + UNREFERENCED_PARAMETER(dwBufferSize); - UNIMPLEMENTED; - return FALSE; + UNIMPLEMENTED; + return FALSE; } @@ -106,14 +106,14 @@ */ BOOL WINAPI WlxNetworkProviderLoad( - PVOID pWlxContext, - PWLX_MPR_NOTIFY_INFO pNprNotifyInfo) + PVOID pWlxContext, + PWLX_MPR_NOTIFY_INFO pNprNotifyInfo) { - UNREFERENCED_PARAMETER(pWlxContext); - UNREFERENCED_PARAMETER(pNprNotifyInfo); + UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pNprNotifyInfo); - UNIMPLEMENTED; - return FALSE; + UNIMPLEMENTED; + return FALSE; } @@ -122,11 +122,11 @@ */ VOID WINAPI WlxDisconnectNotify( - PVOID pWlxContext) + PVOID pWlxContext) { - UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pWlxContext); - UNIMPLEMENTED; + UNIMPLEMENTED; } @@ -135,13 +135,13 @@ */ BOOL WINAPI WlxGetConsoleSwitchCredentials( - PVOID pWlxContext, - PVOID pCredInfo) + PVOID pWlxContext, + PVOID pCredInfo) { - UNREFERENCED_PARAMETER(pWlxContext); - UNREFERENCED_PARAMETER(pCredInfo); + UNREFERENCED_PARAMETER(pWlxContext); + UNREFERENCED_PARAMETER(pCredInfo); - UNIMPLEMENTED; - return FALSE; + UNIMPLEMENTED; + return FALSE; } Modified: trunk/reactos/dll/win32/msgina/tui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/tui.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msgina/tui.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msgina/tui.c [iso-8859-1] Mon May 6 21:43:03 2013 @@ -11,255 +11,255 @@ static BOOL TUIInitialize( - IN OUT PGINA_CONTEXT pgContext) -{ - TRACE("TUIInitialize(%p)\n", pgContext); - - return AllocConsole(); + IN OUT PGINA_CONTEXT pgContext) +{ + TRACE("TUIInitialize(%p)\n", pgContext); + + return AllocConsole(); } static BOOL TUIDisplayStatusMessage( - IN PGINA_CONTEXT pgContext, - IN HDESK hDesktop, - IN DWORD dwOptions, - IN PWSTR pTitle, - IN PWSTR pMessage) -{ - static LPCWSTR newLine = L"\n"; - DWORD result; - - TRACE("TUIDisplayStatusMessage(%ws)\n", pMessage); - - UNREFERENCED_PARAMETER(pgContext); - UNREFERENCED_PARAMETER(hDesktop); - UNREFERENCED_PARAMETER(dwOptions); - UNREFERENCED_PARAMETER(pTitle); - - return - WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - pMessage, - wcslen(pMessage), - &result, - NULL) && - WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - newLine, - wcslen(newLine), - &result, - NULL); + IN PGINA_CONTEXT pgContext, + IN HDESK hDesktop, + IN DWORD dwOptions, + IN PWSTR pTitle, + IN PWSTR pMessage) +{ + static LPCWSTR newLine = L"\n"; + DWORD result; + + TRACE("TUIDisplayStatusMessage(%ws)\n", pMessage); + + UNREFERENCED_PARAMETER(pgContext); + UNREFERENCED_PARAMETER(hDesktop); + UNREFERENCED_PARAMETER(dwOptions); + UNREFERENCED_PARAMETER(pTitle); + + return + WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + pMessage, + wcslen(pMessage), + &result, + NULL) && + WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + newLine, + wcslen(newLine), + &result, + NULL); } static BOOL TUIRemoveStatusMessage( - IN PGINA_CONTEXT pgContext) -{ - UNREFERENCED_PARAMETER(pgContext); - - /* Nothing to do */ - return TRUE; + IN PGINA_CONTEXT pgContext) +{ + UNREFERENCED_PARAMETER(pgContext); + + /* Nothing to do */ + return TRUE; } static BOOL DisplayResourceText( - IN UINT uIdResourceText, - IN BOOL AddNewLine) -{ - WCHAR Prompt[256]; - static LPCWSTR newLine = L"\n"; - DWORD count; - - if (0 == LoadStringW(hDllInstance, uIdResourceText, Prompt, 256)) - return FALSE; - if (!WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - Prompt, wcslen(Prompt), - &count, NULL)) - { - return FALSE; - } - if (AddNewLine) - { - if (!WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - newLine, wcslen(newLine), - &count, NULL)) - { - return FALSE; - } - } - return TRUE; + IN UINT uIdResourceText, + IN BOOL AddNewLine) +{ + WCHAR Prompt[256]; + static LPCWSTR newLine = L"\n"; + DWORD count; + + if (0 == LoadStringW(hDllInstance, uIdResourceText, Prompt, 256)) + return FALSE; + if (!WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + Prompt, wcslen(Prompt), + &count, NULL)) + { + return FALSE; + } + if (AddNewLine) + { + if (!WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + newLine, wcslen(newLine), + &count, NULL)) + { + return FALSE; + } + } + return TRUE; } static VOID TUIDisplaySASNotice( - IN OUT PGINA_CONTEXT pgContext) -{ - TRACE("TUIDisplaySASNotice()\n"); - - UNREFERENCED_PARAMETER(pgContext); - - DisplayResourceText(IDS_LOGGEDOUTSAS, TRUE); - DisplayResourceText(IDS_PRESSCTRLALTDELETE, TRUE); + IN OUT PGINA_CONTEXT pgContext) +{ + TRACE("TUIDisplaySASNotice()\n"); + + UNREFERENCED_PARAMETER(pgContext); + + DisplayResourceText(IDS_LOGGEDOUTSAS, TRUE); + DisplayResourceText(IDS_PRESSCTRLALTDELETE, TRUE); } static INT TUILoggedOnSAS( - IN OUT PGINA_CONTEXT pgContext, - IN DWORD dwSasType) -{ - TRACE("TUILoggedOnSAS()\n"); - - UNREFERENCED_PARAMETER(pgContext); - - if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL) - { - /* Nothing to do for WLX_SAS_TYPE_TIMEOUT */ - return WLX_SAS_ACTION_NONE; - } - - FIXME("FIXME: TUILoggedOnSAS(): Let's suppose the user wants to log off...\n"); - return WLX_SAS_ACTION_LOGOFF; + IN OUT PGINA_CONTEXT pgContext, + IN DWORD dwSasType) +{ + TRACE("TUILoggedOnSAS()\n"); + + UNREFERENCED_PARAMETER(pgContext); + + if (dwSasType != WLX_SAS_TYPE_CTRL_ALT_DEL) + { + /* Nothing to do for WLX_SAS_TYPE_TIMEOUT */ + return WLX_SAS_ACTION_NONE; + } + + FIXME("FIXME: TUILoggedOnSAS(): Let's suppose the user wants to log off...\n"); + return WLX_SAS_ACTION_LOGOFF; } static BOOL ReadString( - IN UINT uIdResourcePrompt, - IN OUT PWSTR Buffer, - IN DWORD BufferLength, - IN BOOL ShowString) -{ - DWORD count, i; - WCHAR charToDisplay[] = { 0, UNICODE_NULL }; - - if (!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), 0)) - return FALSE; - - if (!FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE))) - return FALSE; - - if (!DisplayResourceText(uIdResourcePrompt, FALSE)) - return FALSE; - - i = 0; - for (;;) - { - WCHAR readChar; - if (!ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), &readChar, 1, &count, NULL)) - return FALSE; - if (readChar == '\r' || readChar == '\n') - { - /* End of string */ - charToDisplay[0] = L'\n'; - WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - charToDisplay, - wcslen(charToDisplay), - &count, - NULL); - break; - } - if (ShowString) - { - /* Display the char */ - charToDisplay[0] = readChar; - WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - charToDisplay, - wcslen(charToDisplay), - &count, - NULL); - } - Buffer[i++] = readChar; - /* FIXME: buffer overflow if the user writes too many chars! */ - UNREFERENCED_PARAMETER(BufferLength); - /* FIXME: handle backspace */ - } - Buffer[i] = UNICODE_NULL; - - if (!ShowString) - { - /* Still display the \n */ - static LPCWSTR newLine = L"\n"; - DWORD result; - WriteConsoleW( - GetStdHandle(STD_OUTPUT_HANDLE), - newLine, - wcslen(newLine), - &result, - NULL); - } - return TRUE; + IN UINT uIdResourcePrompt, + IN OUT PWSTR Buffer, + IN DWORD BufferLength, + IN BOOL ShowString) +{ + DWORD count, i; + WCHAR charToDisplay[] = { 0, UNICODE_NULL }; + + if (!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), 0)) + return FALSE; + + if (!FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE))) + return FALSE; + + if (!DisplayResourceText(uIdResourcePrompt, FALSE)) + return FALSE; + + i = 0; + for (;;) + { + WCHAR readChar; + if (!ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), &readChar, 1, &count, NULL)) + return FALSE; + if (readChar == '\r' || readChar == '\n') + { + /* End of string */ + charToDisplay[0] = L'\n'; + WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + charToDisplay, + wcslen(charToDisplay), + &count, + NULL); + break; + } + if (ShowString) + { + /* Display the char */ + charToDisplay[0] = readChar; + WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + charToDisplay, + wcslen(charToDisplay), + &count, + NULL); + } + Buffer[i++] = readChar; + /* FIXME: buffer overflow if the user writes too many chars! */ + UNREFERENCED_PARAMETER(BufferLength); + /* FIXME: handle backspace */ + } + Buffer[i] = UNICODE_NULL; + + if (!ShowString) + { + /* Still display the \n */ + static LPCWSTR newLine = L"\n"; + DWORD result; + WriteConsoleW( + GetStdHandle(STD_OUTPUT_HANDLE), + newLine, + wcslen(newLine), + &result, + NULL); + } + return TRUE; } static INT TUILoggedOutSAS( - IN OUT PGINA_CONTEXT pgContext) -{ - WCHAR UserName[256]; - WCHAR Password[256]; - - TRACE("TUILoggedOutSAS()\n"); - - /* Ask the user for credentials */ - if (!ReadString(IDS_ASKFORUSER, UserName, 256, TRUE)) - return WLX_SAS_ACTION_NONE; - if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) - return WLX_SAS_ACTION_NONE; - - if (DoLoginTasks(pgContext, UserName, NULL, Password)) - return WLX_SAS_ACTION_LOGON; - else - return WLX_SAS_ACTION_NONE; + IN OUT PGINA_CONTEXT pgContext) +{ + WCHAR UserName[256]; + WCHAR Password[256]; + + TRACE("TUILoggedOutSAS()\n"); + + /* Ask the user for credentials */ + if (!ReadString(IDS_ASKFORUSER, UserName, 256, TRUE)) + return WLX_SAS_ACTION_NONE; + if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) + return WLX_SAS_ACTION_NONE; + + if (DoLoginTasks(pgContext, UserName, NULL, Password)) + return WLX_SAS_ACTION_LOGON; + else + return WLX_SAS_ACTION_NONE; } static INT TUILockedSAS( - IN OUT PGINA_CONTEXT pgContext) -{ - HANDLE hToken; - WCHAR UserName[256]; - WCHAR Password[256]; - - TRACE("TUILockedSAS()\n"); - - UNREFERENCED_PARAMETER(pgContext); - - if (!DisplayResourceText(IDS_LOGGEDOUTSAS, TRUE)) - return WLX_SAS_ACTION_UNLOCK_WKSTA; - - /* Ask the user for credentials */ - if (!ReadString(IDS_ASKFORUSER, UserName, 256, TRUE)) - return WLX_SAS_ACTION_NONE; - if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) - return WLX_SAS_ACTION_NONE; - - if (!LogonUserW(UserName, NULL, Password, - LOGON32_LOGON_UNLOCK, - LOGON32_PROVIDER_DEFAULT, - &hToken)) - { - TRACE("LogonUserW() failed\n"); - return WLX_SAS_ACTION_NONE; - } - CloseHandle(hToken); - return WLX_SAS_ACTION_UNLOCK_WKSTA; + IN OUT PGINA_CONTEXT pgContext) +{ + HANDLE hToken; + WCHAR UserName[256]; + WCHAR Password[256]; + + TRACE("TUILockedSAS()\n"); + + UNREFERENCED_PARAMETER(pgContext); + + if (!DisplayResourceText(IDS_LOGGEDOUTSAS, TRUE)) + return WLX_SAS_ACTION_UNLOCK_WKSTA; + + /* Ask the user for credentials */ + if (!ReadString(IDS_ASKFORUSER, UserName, 256, TRUE)) + return WLX_SAS_ACTION_NONE; + if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) + return WLX_SAS_ACTION_NONE; + + if (!LogonUserW(UserName, NULL, Password, + LOGON32_LOGON_UNLOCK, + LOGON32_PROVIDER_DEFAULT, + &hToken)) + { + TRACE("LogonUserW() failed\n"); + return WLX_SAS_ACTION_NONE; + } + CloseHandle(hToken); + return WLX_SAS_ACTION_UNLOCK_WKSTA; } static VOID TUIDisplayLockedNotice( - IN OUT PGINA_CONTEXT pgContext) + IN OUT PGINA_CONTEXT pgContext) { } GINA_UI GinaTextUI = { - TUIInitialize, - TUIDisplayStatusMessage, - TUIRemoveStatusMessage, - TUIDisplaySASNotice, - TUILoggedOnSAS, - TUILoggedOutSAS, - TUILockedSAS, - TUIDisplayLockedNotice, + TUIInitialize, + TUIDisplayStatusMessage, + TUIRemoveStatusMessage, + TUIDisplaySASNotice, + TUILoggedOnSAS, + TUILoggedOutSAS, + TUILockedSAS, + TUIDisplayLockedNotice, };
11 years, 7 months
1
0
0
0
[pschweitzer] 58962: [KMTESTS:FSRTL] Add comments
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon May 6 11:24:55 2013 New Revision: 58962 URL:
http://svn.reactos.org/svn/reactos?rev=58962&view=rev
Log: [KMTESTS:FSRTL] Add comments Modified: trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c Modified: trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_fsrtl/FsRtlM…
============================================================================== --- trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c [iso-8859-1] Mon May 6 11:24:55 2013 @@ -146,6 +146,10 @@ NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); ok(NbRuns == 0, "Expected 0 runs, got: %lu\n", NbRuns); + /* Create a mapping with three holes between each mapping + * It looks like that: + * ----//////-----/////-----/////// + */ ok(FsRtlAddLargeMcbEntry(&LargeMcb, 1024, 1024, 1024) == TRUE, "expected TRUE, got FALSE\n"); ok(FsRtlAddLargeMcbEntry(&LargeMcb, 3072, 3072, 1024) == TRUE, "expected TRUE, got FALSE\n"); ok(FsRtlAddLargeMcbEntry(&LargeMcb, 5120, 5120, 1024) == TRUE, "expected TRUE, got FALSE\n"); @@ -183,6 +187,7 @@ ok(Lbn == 5120, "Expected Lbn 5120, got: %I64d\n", Lbn); ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + /* Fill first hole */ ok(FsRtlAddLargeMcbEntry(&LargeMcb, 0, 0, 1024) == TRUE, "expected TRUE, got FALSE\n"); NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); @@ -208,6 +213,7 @@ ok(Lbn == 5120, "Expected Lbn 5120, got: %I64d\n", Lbn); ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + /* Fill half of the last hole and overlap */ ok(FsRtlAddLargeMcbEntry(&LargeMcb, 4608, 4608, 1024) == TRUE, "expected TRUE, got FALSE\n"); NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb);
11 years, 7 months
1
0
0
0
[pschweitzer] 58961: [KMTESTS:FSRTL] Add more tests for MCBs
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon May 6 08:10:53 2013 New Revision: 58961 URL:
http://svn.reactos.org/svn/reactos?rev=58961&view=rev
Log: [KMTESTS:FSRTL] Add more tests for MCBs Modified: trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c Modified: trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_fsrtl/FsRtlM…
============================================================================== --- trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c [iso-8859-1] (original) +++ trunk/rostests/kmtests/ntos_fsrtl/FsRtlMcb.c [iso-8859-1] Mon May 6 08:10:53 2013 @@ -141,6 +141,99 @@ ok(Index == 1, "Expected Index 1, got: %lu\n", Index); FsRtlUninitializeLargeMcb(&LargeMcb); + + FsRtlInitializeLargeMcb(&LargeMcb, PagedPool); + NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); + ok(NbRuns == 0, "Expected 0 runs, got: %lu\n", NbRuns); + + ok(FsRtlAddLargeMcbEntry(&LargeMcb, 1024, 1024, 1024) == TRUE, "expected TRUE, got FALSE\n"); + ok(FsRtlAddLargeMcbEntry(&LargeMcb, 3072, 3072, 1024) == TRUE, "expected TRUE, got FALSE\n"); + ok(FsRtlAddLargeMcbEntry(&LargeMcb, 5120, 5120, 1024) == TRUE, "expected TRUE, got FALSE\n"); + + NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); + ok(NbRuns == 6, "Expected 6 runs, got: %lu\n", NbRuns); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 0, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 0, "Expected Vbn 0, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 1, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 1024, "Expected Vbn 1024, got: %I64d\n", Vbn); + ok(Lbn == 1024, "Expected Lbn 1024, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 2, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 2048, "Expected Vbn 2048, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 3, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 3072, "Expected Vbn 3072, got: %I64d\n", Vbn); + ok(Lbn == 3072, "Expected Lbn 3072, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 4, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 4096, "Expected Vbn 4096, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 5, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 5120, "Expected Vbn 5120, got: %I64d\n", Vbn); + ok(Lbn == 5120, "Expected Lbn 5120, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlAddLargeMcbEntry(&LargeMcb, 0, 0, 1024) == TRUE, "expected TRUE, got FALSE\n"); + + NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); + ok(NbRuns == 4, "Expected 4 runs, got: %lu\n", NbRuns); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 0, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 0, "Expected Vbn 0, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 3072, "Expected SectorCount 3072, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 1, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 3072, "Expected Vbn 3072, got: %I64d\n", Vbn); + ok(Lbn == 3072, "Expected Lbn 3072, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 2, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 4096, "Expected Vbn 4096, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 3, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 5120, "Expected Vbn 5120, got: %I64d\n", Vbn); + ok(Lbn == 5120, "Expected Lbn 5120, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlAddLargeMcbEntry(&LargeMcb, 4608, 4608, 1024) == TRUE, "expected TRUE, got FALSE\n"); + + NbRuns = FsRtlNumberOfRunsInLargeMcb(&LargeMcb); + ok(NbRuns == 4, "Expected 4 runs, got: %lu\n", NbRuns); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 0, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 0, "Expected Vbn 0, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 3072, "Expected SectorCount 3072, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 1, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 3072, "Expected Vbn 3072, got: %I64d\n", Vbn); + ok(Lbn == 3072, "Expected Lbn 3072, got: %I64d\n", Lbn); + ok(SectorCount == 1024, "Expected SectorCount 1024, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 2, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 4096, "Expected Vbn 4096, got: %I64d\n", Vbn); + ok(Lbn == -1, "Expected Lbn -1, got: %I64d\n", Lbn); + ok(SectorCount == 512, "Expected SectorCount 512, got: %I64d\n", SectorCount); + + ok(FsRtlGetNextLargeMcbEntry(&LargeMcb, 3, &Vbn, &Lbn, &SectorCount) == TRUE, "expected TRUE, got FALSE\n"); + ok(Vbn == 4608, "Expected Vbn 4608, got: %I64d\n", Vbn); + ok(Lbn == 4608, "Expected Lbn 4608, got: %I64d\n", Lbn); + ok(SectorCount == 1536, "Expected SectorCount 1536, got: %I64d\n", SectorCount); + + FsRtlUninitializeLargeMcb(&LargeMcb); } START_TEST(FsRtlMcb)
11 years, 7 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
24
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
Results per page:
10
25
50
100
200