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
[akhaldi] 58990: [FASTFAT] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 11 11:03:12 2013 New Revision: 58990 URL:
http://svn.reactos.org/svn/reactos?rev=58990&view=rev
Log: [FASTFAT] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. Modified: trunk/reactos/drivers/filesystems/fastfat/blockdev.c trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/direntry.c trunk/reactos/drivers/filesystems/fastfat/dirwr.c trunk/reactos/drivers/filesystems/fastfat/fastio.c trunk/reactos/drivers/filesystems/fastfat/fat.c trunk/reactos/drivers/filesystems/fastfat/fcb.c trunk/reactos/drivers/filesystems/fastfat/finfo.c trunk/reactos/drivers/filesystems/fastfat/fsctl.c trunk/reactos/drivers/filesystems/fastfat/iface.c trunk/reactos/drivers/filesystems/fastfat/misc.c trunk/reactos/drivers/filesystems/fastfat/rw.c trunk/reactos/drivers/filesystems/fastfat/volume.c Modified: trunk/reactos/drivers/filesystems/fastfat/blockdev.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/blockdev.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/blockdev.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -74,8 +74,8 @@ again: KeInitializeEvent (&event, NotificationEvent, FALSE); - DPRINT ("VfatReadDisk(pDeviceObject %p, Offset %I64x, Length %d, Buffer %p)\n", - pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); + DPRINT("VfatReadDisk(pDeviceObject %p, Offset %I64x, Length %u, Buffer %p)\n", + pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); DPRINT ("Building synchronous FSD Request...\n"); Irp = IoBuildSynchronousFsdRequest (IRP_MJ_READ, @@ -130,9 +130,9 @@ if (!NT_SUCCESS (Status)) { - DPRINT ("IO failed!!! VfatReadDisk : Error code: %x\n", Status); - DPRINT ("(pDeviceObject %p, Offset %I64x, Size %d, Buffer %p\n", - pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); + DPRINT("IO failed!!! VfatReadDisk : Error code: %x\n", Status); + DPRINT("(pDeviceObject %p, Offset %I64x, Size %u, Buffer %p\n", + pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer); return (Status); } DPRINT ("Block request succeeded for %p\n", Irp); @@ -151,8 +151,8 @@ NTSTATUS Status; PVOID Buffer; - DPRINT ("VfatReadDiskPartial(IrpContext %p, ReadOffset %I64x, ReadLength %d, BufferOffset %x, Wait %d)\n", - IrpContext, ReadOffset->QuadPart, ReadLength, BufferOffset, Wait); + DPRINT("VfatReadDiskPartial(IrpContext %p, ReadOffset %I64x, ReadLength %u, BufferOffset %u, Wait %u)\n", + IrpContext, ReadOffset->QuadPart, ReadLength, BufferOffset, Wait); DPRINT ("Building asynchronous FSD Request...\n"); @@ -251,8 +251,8 @@ NTSTATUS Status; PVOID Buffer; - DPRINT ("VfatWriteDiskPartial(IrpContext %p, WriteOffset %I64x, WriteLength %d, BufferOffset %x, Wait %d)\n", - IrpContext, WriteOffset->QuadPart, WriteLength, BufferOffset, Wait); + DPRINT("VfatWriteDiskPartial(IrpContext %p, WriteOffset %I64x, WriteLength %u, BufferOffset %x, Wait %u)\n", + IrpContext, WriteOffset->QuadPart, WriteLength, BufferOffset, Wait); Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset; Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -196,7 +196,7 @@ UNICODE_STRING FileToFindUpcase; BOOLEAN WildCard; - DPRINT ("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %d)\n", + DPRINT ("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %u)\n", Parent, FileToFindU, DirContext->DirIndex); DPRINT ("FindFile: Path %wZ\n",&Parent->PathNameU); @@ -242,7 +242,7 @@ RtlCopyMemory(&DirContext->DirEntry, &rcFcb->entry, sizeof(DIR_ENTRY)); DirContext->StartIndex = rcFcb->startIndex; DirContext->DirIndex = rcFcb->dirIndex; - DPRINT("FindFile: new Name %wZ, DirIndex %d (%d)\n", + DPRINT("FindFile: new Name %wZ, DirIndex %u (%u)\n", &DirContext->LongNameU, DirContext->DirIndex, DirContext->StartIndex); Status = STATUS_SUCCESS; } @@ -309,8 +309,8 @@ vfatReleaseFCB(DeviceExt, rcFcb); } } - DPRINT("%d\n", DirContext->LongNameU.Length); - DPRINT("FindFile: new Name %wZ, DirIndex %d\n", + DPRINT("%u\n", DirContext->LongNameU.Length); + DPRINT("FindFile: new Name %wZ, DirIndex %u\n", &DirContext->LongNameU, DirContext->DirIndex); if (Context) Modified: trunk/reactos/drivers/filesystems/fastfat/direntry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/direntry.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/direntry.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -294,7 +294,7 @@ { if (dirMap == 0) { - DPRINT (" long name entry found at %d\n", DirContext->DirIndex); + DPRINT (" long name entry found at %u\n", DirContext->DirIndex); RtlZeroMemory(DirContext->LongNameU.Buffer, DirContext->LongNameU.MaximumLength); CheckSum = longNameEntry->alias_checksum; Valid = TRUE; @@ -416,6 +416,8 @@ ULONG DirIndex = DirContext->DirIndex; FileOffset.u.HighPart = 0; + + UNREFERENCED_PARAMETER(First); if (!vfatFCBIsRoot(pDirFcb)) { Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -37,7 +37,7 @@ dirIndex = pFcb->dirIndex; } - DPRINT("updEntry dirIndex %d, PathName \'%wZ\'\n", dirIndex, &pFcb->PathNameU); + DPRINT("updEntry dirIndex %u, PathName \'%wZ\'\n", dirIndex, &pFcb->PathNameU); if (vfatFCBIsRoot(pFcb) || (pFcb->Flags & (FCB_IS_FAT|FCB_IS_VOLUME))) { @@ -184,7 +184,7 @@ CcUnpinData(Context); } } - DPRINT("nbSlots %d nbFree %d, entry number %d\n", nbSlots, nbFree, *start); + DPRINT("nbSlots %u nbFree %u, entry number %u\n", nbSlots, nbFree, *start); return TRUE; } @@ -228,7 +228,7 @@ /* nb of entry needed for long name+normal entry */ nbSlots = (DirContext.LongNameU.Length / sizeof(WCHAR) + 12) / 13 + 1; - DPRINT("NameLen= %d, nbSlots =%d\n", DirContext.LongNameU.Length / sizeof(WCHAR), nbSlots); + DPRINT("NameLen= %u, nbSlots =%u\n", DirContext.LongNameU.Length / sizeof(WCHAR), nbSlots); Buffer = ExAllocatePoolWithTag(NonPagedPool, (nbSlots - 1) * sizeof(FAT_DIR_ENTRY), TAG_VFAT); if (Buffer == NULL) { @@ -326,7 +326,7 @@ needLong = TRUE; } } - DPRINT("'%s', '%wZ', needTilde=%d, needLong=%d\n", + DPRINT("'%s', '%wZ', needTilde=%u, needLong=%u\n", aName, &DirContext.LongNameU, needTilde, needLong); memset(DirContext.DirEntry.Fat.ShortName, ' ', 11); for (i = 0; i < 8 && aName[i] && aName[i] != '.'; i++) @@ -653,7 +653,7 @@ ASSERT(pFcb->parentFcb); DPRINT("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); - DPRINT("delete entry: %d to %d\n", pFcb->startIndex, pFcb->dirIndex); + DPRINT("delete entry: %u to %u\n", pFcb->startIndex, pFcb->dirIndex); Offset.u.HighPart = 0; for (i = pFcb->startIndex; i <= pFcb->dirIndex; i++) { @@ -716,7 +716,7 @@ StartIndex = pFcb->startIndex; DPRINT("delEntry PathName \'%wZ\'\n", &pFcb->PathNameU); - DPRINT("delete entry: %d\n", StartIndex); + DPRINT("delete entry: %u\n", StartIndex); Offset.u.HighPart = 0; Offset.u.LowPart = (StartIndex * sizeof(FATX_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE; if (!CcPinRead(pFcb->parentFcb->FileObject, &Offset, sizeof(FATX_DIR_ENTRY), TRUE, Modified: trunk/reactos/drivers/filesystems/fastfat/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -8,6 +8,8 @@ #define NDEBUG #include "vfat.h" + +static FAST_IO_CHECK_IF_POSSIBLE VfatFastIoCheckIfPossible; static BOOLEAN NTAPI VfatFastIoCheckIfPossible(IN PFILE_OBJECT FileObject, @@ -19,24 +21,48 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - /* Prevent all Fast I/O requests */ - DPRINT("VfatFastIoCheckIfPossible(): returning FALSE.\n"); - return FALSE; -} + /* Prevent all Fast I/O requests */ + DPRINT("VfatFastIoCheckIfPossible(): returning FALSE.\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(CheckForReadOperation); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_READ VfatFastIoRead; static BOOLEAN NTAPI VfatFastIoRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, - IN ULONG Length, + IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus, + OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoRead()\n"); - return FALSE; -} + DPRINT("VfatFastIoRead()\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_WRITE VfatFastIoWrite; static BOOLEAN NTAPI VfatFastIoWrite(IN PFILE_OBJECT FileObject, @@ -48,9 +74,21 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoWrite()\n"); - return FALSE; -} + DPRINT("VfatFastIoWrite()\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_QUERY_BASIC_INFO VfatFastIoQueryBasicInfo; static BOOLEAN NTAPI VfatFastIoQueryBasicInfo(IN PFILE_OBJECT FileObject, @@ -59,9 +97,18 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoQueryBasicInfo()\n"); - return FALSE; -} + DPRINT("VfatFastIoQueryBasicInfo()\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_QUERY_STANDARD_INFO VfatFastIoQueryStandardInfo; static BOOLEAN NTAPI VfatFastIoQueryStandardInfo(IN PFILE_OBJECT FileObject, @@ -70,9 +117,18 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoQueryStandardInfo\n"); - return FALSE; -} + DPRINT("VfatFastIoQueryStandardInfo\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_LOCK VfatFastIoLock; static BOOLEAN NTAPI VfatFastIoLock(IN PFILE_OBJECT FileObject, @@ -85,9 +141,22 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoLock\n"); - return FALSE; -} + DPRINT("VfatFastIoLock\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(ProcessId); + UNREFERENCED_PARAMETER(Key); + UNREFERENCED_PARAMETER(FailImmediately); + UNREFERENCED_PARAMETER(ExclusiveLock); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_UNLOCK_SINGLE VfatFastIoUnlockSingle; static BOOLEAN NTAPI VfatFastIoUnlockSingle(IN PFILE_OBJECT FileObject, @@ -98,9 +167,20 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoUnlockSingle\n"); - return FALSE; -} + DPRINT("VfatFastIoUnlockSingle\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(ProcessId); + UNREFERENCED_PARAMETER(Key); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_UNLOCK_ALL VfatFastIoUnlockAll; static BOOLEAN NTAPI VfatFastIoUnlockAll(IN PFILE_OBJECT FileObject, @@ -108,9 +188,17 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoUnlockAll\n"); - return FALSE; -} + DPRINT("VfatFastIoUnlockAll\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(ProcessId); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_UNLOCK_ALL_BY_KEY VfatFastIoUnlockAllByKey; static BOOLEAN NTAPI VfatFastIoUnlockAllByKey(IN PFILE_OBJECT FileObject, @@ -119,9 +207,18 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoUnlockAllByKey\n"); - return FALSE; -} + DPRINT("VfatFastIoUnlockAllByKey\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(ProcessId); + UNREFERENCED_PARAMETER(Key); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_DEVICE_CONTROL VfatFastIoDeviceControl; static BOOLEAN NTAPI VfatFastIoDeviceControl(IN PFILE_OBJECT FileObject, @@ -134,28 +231,51 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoDeviceControl\n"); - return FALSE; -} + DPRINT("VfatFastIoDeviceControl\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(InputBuffer); + UNREFERENCED_PARAMETER(InputBufferLength); + UNREFERENCED_PARAMETER(OutputBuffer); + UNREFERENCED_PARAMETER(OutputBufferLength); + UNREFERENCED_PARAMETER(IoControlCode); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_ACQUIRE_FILE VfatAcquireFileForNtCreateSection; static VOID NTAPI VfatAcquireFileForNtCreateSection(IN PFILE_OBJECT FileObject) { - DPRINT("VfatAcquireFileForNtCreateSection\n"); -} + DPRINT("VfatAcquireFileForNtCreateSection\n"); + UNREFERENCED_PARAMETER(FileObject); +} + +static FAST_IO_RELEASE_FILE VfatReleaseFileForNtCreateSection; static VOID NTAPI VfatReleaseFileForNtCreateSection(IN PFILE_OBJECT FileObject) { - DPRINT("VfatReleaseFileForNtCreateSection\n"); -} + DPRINT("VfatReleaseFileForNtCreateSection\n"); + UNREFERENCED_PARAMETER(FileObject); +} + +static FAST_IO_DETACH_DEVICE VfatFastIoDetachDevice; static VOID NTAPI VfatFastIoDetachDevice(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice) { - DPRINT("VfatFastIoDetachDevice\n"); -} + DPRINT("VfatFastIoDetachDevice\n"); + UNREFERENCED_PARAMETER(SourceDevice); + UNREFERENCED_PARAMETER(TargetDevice); +} + +static FAST_IO_QUERY_NETWORK_OPEN_INFO VfatFastIoQueryNetworkOpenInfo; static BOOLEAN NTAPI VfatFastIoQueryNetworkOpenInfo(IN PFILE_OBJECT FileObject, @@ -164,9 +284,18 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoQueryNetworkOpenInfo\n"); - return FALSE; -} + DPRINT("VfatFastIoQueryNetworkOpenInfo\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_ACQUIRE_FOR_MOD_WRITE VfatAcquireForModWrite; static NTSTATUS NTAPI VfatAcquireForModWrite(IN PFILE_OBJECT FileObject, @@ -174,9 +303,17 @@ OUT PERESOURCE* ResourceToRelease, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatAcquireForModWrite\n"); - return STATUS_INVALID_DEVICE_REQUEST; -} + DPRINT("VfatAcquireForModWrite\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(EndingOffset); + UNREFERENCED_PARAMETER(ResourceToRelease); + UNREFERENCED_PARAMETER(DeviceObject); + + return STATUS_INVALID_DEVICE_REQUEST; +} + +static FAST_IO_MDL_READ VfatMdlRead; static BOOLEAN NTAPI VfatMdlRead(IN PFILE_OBJECT FileObject, @@ -187,18 +324,36 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatMdlRead\n"); - return FALSE; -} + DPRINT("VfatMdlRead\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_MDL_READ_COMPLETE VfatMdlReadComplete; static BOOLEAN NTAPI VfatMdlReadComplete(IN PFILE_OBJECT FileObject, IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatMdlReadComplete\n"); - return FALSE; -} + DPRINT("VfatMdlReadComplete\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_PREPARE_MDL_WRITE VfatPrepareMdlWrite; static BOOLEAN NTAPI VfatPrepareMdlWrite(IN PFILE_OBJECT FileObject, @@ -209,9 +364,20 @@ OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatPrepareMdlWrite\n"); - return FALSE; -} + DPRINT("VfatPrepareMdlWrite\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_MDL_WRITE_COMPLETE VfatMdlWriteComplete; static BOOLEAN NTAPI VfatMdlWriteComplete(IN PFILE_OBJECT FileObject, @@ -219,9 +385,17 @@ IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatMdlWriteComplete\n"); - return FALSE; -} + DPRINT("VfatMdlWriteComplete\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_READ_COMPRESSED VfatFastIoReadCompressed; static BOOLEAN NTAPI VfatFastIoReadCompressed(IN PFILE_OBJECT FileObject, @@ -235,9 +409,23 @@ IN ULONG CompressedDataInfoLength, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoReadCompressed\n"); - return FALSE; -} + DPRINT("VfatFastIoReadCompressed\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(CompressedDataInfo); + UNREFERENCED_PARAMETER(CompressedDataInfoLength); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_WRITE_COMPRESSED VfatFastIoWriteCompressed; static BOOLEAN NTAPI VfatFastIoWriteCompressed(IN PFILE_OBJECT FileObject, @@ -251,18 +439,39 @@ IN ULONG CompressedDataInfoLength, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatFastIoWriteCompressed\n"); - return FALSE; -} + DPRINT("VfatFastIoWriteCompressed\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(Buffer); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(CompressedDataInfo); + UNREFERENCED_PARAMETER(CompressedDataInfoLength); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_MDL_READ_COMPLETE_COMPRESSED VfatMdlReadCompleteCompressed; static BOOLEAN NTAPI VfatMdlReadCompleteCompressed(IN PFILE_OBJECT FileObject, IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatMdlReadCompleteCompressed\n"); - return FALSE; -} + DPRINT("VfatMdlReadCompleteCompressed\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED VfatMdlWriteCompleteCompressed; static BOOLEAN NTAPI VfatMdlWriteCompleteCompressed(IN PFILE_OBJECT FileObject, @@ -270,9 +479,17 @@ IN PMDL MdlChain, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatMdlWriteCompleteCompressed\n"); - return FALSE; -} + DPRINT("VfatMdlWriteCompleteCompressed\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(MdlChain); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_QUERY_OPEN VfatFastIoQueryOpen; static BOOLEAN NTAPI VfatFastIoQueryOpen(IN PIRP Irp, @@ -280,17 +497,31 @@ IN PDEVICE_OBJECT DeviceObject) { DPRINT("VfatFastIoQueryOpen\n"); - return FALSE; -} + + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(NetworkInformation); + UNREFERENCED_PARAMETER(DeviceObject); + + return FALSE; +} + +static FAST_IO_RELEASE_FOR_MOD_WRITE VfatReleaseForModWrite; static NTSTATUS NTAPI VfatReleaseForModWrite(IN PFILE_OBJECT FileObject, IN PERESOURCE ResourceToRelease, IN PDEVICE_OBJECT DeviceObject) { - DPRINT("VfatReleaseForModWrite\n"); - return STATUS_INVALID_DEVICE_REQUEST; -} + DPRINT("VfatReleaseForModWrite\n"); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(ResourceToRelease); + UNREFERENCED_PARAMETER(DeviceObject); + + return STATUS_INVALID_DEVICE_REQUEST; +} + +static FAST_IO_ACQUIRE_FOR_CCFLUSH VfatAcquireForCcFlush; static NTSTATUS NTAPI VfatAcquireForCcFlush(IN PFILE_OBJECT FileObject, @@ -300,6 +531,8 @@ DPRINT("VfatAcquireForCcFlush\n"); + UNREFERENCED_PARAMETER(DeviceObject); + /* Make sure it is not a volume lock */ ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); @@ -308,6 +541,8 @@ return STATUS_SUCCESS; } + +static FAST_IO_RELEASE_FOR_CCFLUSH VfatReleaseForCcFlush; static NTSTATUS NTAPI VfatReleaseForCcFlush(IN PFILE_OBJECT FileObject, @@ -316,6 +551,8 @@ PVFATFCB Fcb = (PVFATFCB)FileObject->FsContext; DPRINT("VfatReleaseForCcFlush\n"); + + UNREFERENCED_PARAMETER(DeviceObject); /* Make sure it is not a volume lock */ ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); Modified: trunk/reactos/drivers/filesystems/fastfat/fat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fat.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -148,7 +148,7 @@ Offset.QuadPart = ROUND_DOWN(i * 2, ChunkSize); if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) { - DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, ChunkSize); + DPRINT1("CcMapData(Offset %x, Length %u) failed\n", (ULONG)Offset.QuadPart, ChunkSize); return STATUS_UNSUCCESSFUL; } Block = (PUSHORT)((ULONG_PTR)BaseAddress + (i * 2) % ChunkSize); @@ -202,7 +202,7 @@ Offset.QuadPart = 0; if(!CcPinRead(DeviceExt->FATFileObject, &Offset, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context, &BaseAddress)) { - DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector); + DPRINT1("CcMapData(Offset %x, Length %u) failed\n", (ULONG)Offset.QuadPart, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector); return STATUS_UNSUCCESSFUL; } @@ -269,7 +269,7 @@ Offset.QuadPart = ROUND_DOWN(i * 4, ChunkSize); if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) { - DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, ChunkSize); + DPRINT1("CcMapData(Offset %x, Length %u) failed\n", (ULONG)Offset.QuadPart, ChunkSize); return STATUS_UNSUCCESSFUL; } Block = (PULONG)((ULONG_PTR)BaseAddress + (i * 4) % ChunkSize); @@ -420,7 +420,7 @@ Offset.QuadPart = ROUND_DOWN(i * 4, ChunkSize); if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress)) { - DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, ChunkSize); + DPRINT1("CcMapData(Offset %x, Length %u) failed\n", (ULONG)Offset.QuadPart, ChunkSize); return STATUS_UNSUCCESSFUL; } Block = (PULONG)((ULONG_PTR)BaseAddress + (i * 4) % ChunkSize); Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -532,6 +532,8 @@ { PVFATCCB newCCB; + UNREFERENCED_PARAMETER(vcb); + newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); if (newCCB == NULL) { @@ -601,7 +603,7 @@ return status; } - DPRINT (" Index:%d longName:%wZ\n", + DPRINT (" Index:%u longName:%wZ\n", DirContext.DirIndex, &DirContext.LongNameU); Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -105,7 +105,7 @@ DPRINT ("FsdSetPositionInformation()\n"); DPRINT ("PositionInfo %p\n", PositionInfo); - DPRINT ("Setting position %d\n", PositionInfo->CurrentByteOffset.u.LowPart); + DPRINT ("Setting position %u\n", PositionInfo->CurrentByteOffset.u.LowPart); FileObject->CurrentByteOffset.QuadPart = PositionInfo->CurrentByteOffset.QuadPart; @@ -303,7 +303,7 @@ PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension; #endif - DPRINT ("FsdSetDispositionInformation(<%wZ>, Delete %d)\n", &FCB->PathNameU, DispositionInfo->DeleteFile); + DPRINT ("FsdSetDispositionInformation(<%wZ>, Delete %u)\n", &FCB->PathNameU, DispositionInfo->DeleteFile); ASSERT(DeviceExt != NULL); ASSERT(DeviceExt->FatInfo.BytesPerCluster != 0); @@ -605,7 +605,7 @@ ULONG NCluster; BOOLEAN AllocSizeChanged = FALSE; - DPRINT("VfatSetAllocationSizeInformation(File <%wZ>, AllocationSize %d %d)\n", &Fcb->PathNameU, + DPRINT("VfatSetAllocationSizeInformation(File <%wZ>, AllocationSize %d %u)\n", &Fcb->PathNameU, AllocationSize->HighPart, AllocationSize->LowPart); if (Fcb->Flags & FCB_IS_FATX_ENTRY) Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -85,8 +85,8 @@ } PartitionInfoIsValid = TRUE; DPRINT("Partition Information:\n"); - DPRINT("StartingOffset %I64u\n", PartitionInfo.StartingOffset.QuadPart / 512); - DPRINT("PartitionLength %I64u\n", PartitionInfo.PartitionLength.QuadPart / 512); + DPRINT("StartingOffset %I64x\n", PartitionInfo.StartingOffset.QuadPart / 512); + DPRINT("PartitionLength %I64x\n", PartitionInfo.PartitionLength.QuadPart / 512); DPRINT("HiddenSectors %u\n", PartitionInfo.HiddenSectors); DPRINT("PartitionNumber %u\n", PartitionInfo.PartitionNumber); DPRINT("PartitionType %u\n", PartitionInfo.PartitionType); @@ -153,7 +153,7 @@ Boot->BytesPerSector != 2048 && Boot->BytesPerSector != 4096) { - DPRINT1("BytesPerSector %d\n", Boot->BytesPerSector); + DPRINT1("BytesPerSector %u\n", Boot->BytesPerSector); *RecognizedFS = FALSE; } @@ -161,7 +161,7 @@ Boot->FATCount != 1 && Boot->FATCount != 2) { - DPRINT1("FATCount %d\n", Boot->FATCount); + DPRINT1("FATCount %u\n", Boot->FATCount); *RecognizedFS = FALSE; } @@ -349,7 +349,7 @@ { return(Status); } - DPRINT("MountVfatdev %d, PAGE_SIZE = %d\n", DeviceExt->FatInfo.BytesPerCluster, PAGE_SIZE); + DPRINT("MountVfatdev %u, PAGE_SIZE = %d\n", DeviceExt->FatInfo.BytesPerCluster, PAGE_SIZE); return(STATUS_SUCCESS); @@ -448,15 +448,15 @@ goto ByeBye; } - DPRINT("BytesPerSector: %d\n", DeviceExt->FatInfo.BytesPerSector); - DPRINT("SectorsPerCluster: %d\n", DeviceExt->FatInfo.SectorsPerCluster); - DPRINT("FATCount: %d\n", DeviceExt->FatInfo.FATCount); - DPRINT("FATSectors: %d\n", DeviceExt->FatInfo.FATSectors); - DPRINT("RootStart: %d\n", DeviceExt->FatInfo.rootStart); - DPRINT("DataStart: %d\n", DeviceExt->FatInfo.dataStart); + DPRINT("BytesPerSector: %u\n", DeviceExt->FatInfo.BytesPerSector); + DPRINT("SectorsPerCluster: %u\n", DeviceExt->FatInfo.SectorsPerCluster); + DPRINT("FATCount: %u\n", DeviceExt->FatInfo.FATCount); + DPRINT("FATSectors: %u\n", DeviceExt->FatInfo.FATSectors); + DPRINT("RootStart: %u\n", DeviceExt->FatInfo.rootStart); + DPRINT("DataStart: %u\n", DeviceExt->FatInfo.dataStart); if (DeviceExt->FatInfo.FatType == FAT32) { - DPRINT("RootCluster: %d\n", DeviceExt->FatInfo.RootCluster); + DPRINT("RootCluster: %u\n", DeviceExt->FatInfo.RootCluster); } switch (DeviceExt->FatInfo.FatType) @@ -875,7 +875,7 @@ break; default: - DPRINT("VFAT FSC: MinorFunction %d\n", IrpContext->MinorFunction); + DPRINT("VFAT FSC: MinorFunction %u\n", IrpContext->MinorFunction); Status = STATUS_INVALID_DEVICE_REQUEST; break; } Modified: trunk/reactos/drivers/filesystems/fastfat/iface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/iface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/iface.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -48,6 +48,8 @@ PDEVICE_OBJECT DeviceObject; UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Fat"); NTSTATUS Status; + + UNREFERENCED_PARAMETER(RegistryPath); Status = IoCreateDevice(DriverObject, sizeof(VFAT_GLOBAL_DATA), Modified: trunk/reactos/drivers/filesystems/fastfat/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -212,6 +212,8 @@ return IrpContext; } +static WORKER_THREAD_ROUTINE VfatDoRequest; + static VOID NTAPI VfatDoRequest (PVOID IrpContext) { InterlockedDecrement(&QueueCount); @@ -274,4 +276,3 @@ return STATUS_SUCCESS; } - Modified: trunk/reactos/drivers/filesystems/fastfat/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/rw.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -139,7 +139,7 @@ ASSERT(IrpContext->FileObject->FsContext2 != NULL); DPRINT("VfatReadFileData(DeviceExt %p, FileObject %p, " - "Length %d, ReadOffset 0x%I64x)\n", DeviceExt, + "Length %u, ReadOffset 0x%I64x)\n", DeviceExt, IrpContext->FileObject, Length, ReadOffset.QuadPart); *LengthRead = 0; @@ -283,7 +283,7 @@ Status = NextCluster(DeviceExt, FirstCluster, &CurrentCluster, FALSE); } while (StartCluster + ClusterCount == CurrentCluster && NT_SUCCESS(Status) && Length > BytesDone); - DPRINT("start %08x, next %08x, count %d\n", + DPRINT("start %08x, next %08x, count %u\n", StartCluster, CurrentCluster, ClusterCount); ExAcquireFastMutex(&Fcb->LastMutex); @@ -354,7 +354,7 @@ BytesPerSector = DeviceExt->FatInfo.BytesPerSector; DPRINT("VfatWriteFileData(DeviceExt %p, FileObject %p, " - "Length %d, WriteOffset 0x%I64x), '%wZ'\n", DeviceExt, + "Length %u, WriteOffset 0x%I64x), '%wZ'\n", DeviceExt, IrpContext->FileObject, Length, WriteOffset.QuadPart, &Fcb->PathNameU); @@ -491,7 +491,7 @@ Status = NextCluster(DeviceExt, FirstCluster, &CurrentCluster, FALSE); } while (StartCluster + ClusterCount == CurrentCluster && NT_SUCCESS(Status) && Length > BytesDone); - DPRINT("start %08x, next %08x, count %d\n", + DPRINT("start %08x, next %08x, count %u\n", StartCluster, CurrentCluster, ClusterCount); ExAcquireFastMutex(&Fcb->LastMutex); @@ -583,7 +583,7 @@ } - DPRINT("'%wZ', Offset: %d, Length %d\n", &Fcb->PathNameU, ByteOffset.u.LowPart, Length); + DPRINT("'%wZ', Offset: %u, Length %u\n", &Fcb->PathNameU, ByteOffset.u.LowPart, Length); if (ByteOffset.u.HighPart && !(Fcb->Flags & FCB_IS_VOLUME)) { @@ -600,7 +600,7 @@ { if (ByteOffset.u.LowPart % BytesPerSector != 0 || Length % BytesPerSector != 0) { - DPRINT("%d %d\n", ByteOffset.u.LowPart, Length); + DPRINT("%u %u\n", ByteOffset.u.LowPart, Length); // non cached read must be sector aligned Status = STATUS_INVALID_PARAMETER; goto ByeBye; @@ -1043,4 +1043,3 @@ return Status; } - Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] Sat May 11 11:03:12 2013 @@ -411,7 +411,7 @@ SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; DPRINT ("FsInformationClass %d\n", FsInformationClass); - DPRINT ("BufferLength %d\n", BufferLength); + DPRINT ("BufferLength %u\n", BufferLength); DPRINT ("SystemBuffer %p\n", SystemBuffer); switch(FsInformationClass)
11 years, 7 months
1
0
0
0
[tfaber] 58989: [KBDHID][MOUHID] - Use switch instead of nested ifs - Remove some unnecessary casts - Fix some spacing issues
by tfaber@svn.reactos.org
Author: tfaber Date: Sat May 11 10:23:54 2013 New Revision: 58989 URL:
http://svn.reactos.org/svn/reactos?rev=58989&view=rev
Log: [KBDHID][MOUHID] - Use switch instead of nested ifs - Remove some unnecessary casts - Fix some spacing issues Modified: trunk/reactos/drivers/hid/kbdhid/kbdhid.c trunk/reactos/drivers/hid/kbdhid/kbdhid.h trunk/reactos/drivers/hid/mouhid/mouhid.c trunk/reactos/drivers/hid/mouhid/mouhid.h Modified: trunk/reactos/drivers/hid/kbdhid/kbdhid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/kbdhid/kbdhid.…
============================================================================== --- trunk/reactos/drivers/hid/kbdhid/kbdhid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/kbdhid/kbdhid.c [iso-8859-1] Sat May 11 10:23:54 2013 @@ -50,7 +50,7 @@ /* get device extension */ DeviceExtension = (PKBDHID_DEVICE_EXTENSION)Context; - for(Index = 0; Index < Length; Index++) + for (Index = 0; Index < Length; Index++) { DPRINT("[KBDHID] ScanCode Index %lu ScanCode %x\n", Index, NewScanCodes[Index] & 0xFF); @@ -84,7 +84,7 @@ InputData.MakeCode = NewScanCodes[Index] & 0x7F; /* dispatch scan codes */ - KbdHid_DispatchInputData((PKBDHID_DEVICE_EXTENSION)Context, &InputData); + KbdHid_DispatchInputData(Context, &InputData); } /* done */ @@ -136,24 +136,46 @@ /* get current usages */ ButtonLength = DeviceExtension->UsageListLength; - Status = HidP_GetUsagesEx(HidP_Input, HIDP_LINK_COLLECTION_UNSPECIFIED, DeviceExtension->CurrentUsageList, &ButtonLength, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetUsagesEx(HidP_Input, + HIDP_LINK_COLLECTION_UNSPECIFIED, + DeviceExtension->CurrentUsageList, + &ButtonLength, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); ASSERT(Status == HIDP_STATUS_SUCCESS); /* FIXME check if needs mapping */ /* get usage difference */ - Status = HidP_UsageAndPageListDifference(DeviceExtension->PreviousUsageList, DeviceExtension->CurrentUsageList, DeviceExtension->BreakUsageList, DeviceExtension->MakeUsageList, DeviceExtension->UsageListLength); + Status = HidP_UsageAndPageListDifference(DeviceExtension->PreviousUsageList, + DeviceExtension->CurrentUsageList, + DeviceExtension->BreakUsageList, + DeviceExtension->MakeUsageList, + DeviceExtension->UsageListLength); ASSERT(Status == HIDP_STATUS_SUCCESS); /* replace previous usage list with current list */ - RtlMoveMemory(DeviceExtension->PreviousUsageList, DeviceExtension->CurrentUsageList, sizeof(USAGE_AND_PAGE) * DeviceExtension->UsageListLength); + RtlMoveMemory(DeviceExtension->PreviousUsageList, + DeviceExtension->CurrentUsageList, + sizeof(USAGE_AND_PAGE) * DeviceExtension->UsageListLength); /* translate break usage list */ - HidP_TranslateUsageAndPagesToI8042ScanCodes(DeviceExtension->BreakUsageList, DeviceExtension->UsageListLength, HidP_Keyboard_Break, &DeviceExtension->ModifierState, KbdHid_InsertScanCodes, DeviceExtension); + HidP_TranslateUsageAndPagesToI8042ScanCodes(DeviceExtension->BreakUsageList, + DeviceExtension->UsageListLength, + HidP_Keyboard_Break, + &DeviceExtension->ModifierState, + KbdHid_InsertScanCodes, + DeviceExtension); ASSERT(Status == HIDP_STATUS_SUCCESS); /* translate new usage list */ - HidP_TranslateUsageAndPagesToI8042ScanCodes(DeviceExtension->MakeUsageList, DeviceExtension->UsageListLength, HidP_Keyboard_Make, &DeviceExtension->ModifierState, KbdHid_InsertScanCodes, DeviceExtension); + HidP_TranslateUsageAndPagesToI8042ScanCodes(DeviceExtension->MakeUsageList, + DeviceExtension->UsageListLength, + HidP_Keyboard_Make, + &DeviceExtension->ModifierState, + KbdHid_InsertScanCodes, + DeviceExtension); ASSERT(Status == HIDP_STATUS_SUCCESS); /* re-init read */ @@ -343,166 +365,168 @@ /* get device extension */ DeviceExtension = (PKBDHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_QUERY_ATTRIBUTES) - { - /* verify output buffer length */ - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUSE_ATTRIBUTES)) - { - /* invalid request */ - DPRINT1("[MOUHID] IOCTL_MOUSE_QUERY_ATTRIBUTES Buffer too small\n"); - Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + switch (IoStack->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_KEYBOARD_QUERY_ATTRIBUTES: + /* verify output buffer length */ + if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUSE_ATTRIBUTES)) + { + /* invalid request */ + DPRINT1("[MOUHID] IOCTL_MOUSE_QUERY_ATTRIBUTES Buffer too small\n"); + Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_BUFFER_TOO_SMALL; + } + + /* get output buffer */ + Attributes = (PKEYBOARD_ATTRIBUTES)Irp->AssociatedIrp.SystemBuffer; + + /* copy attributes */ + RtlCopyMemory(Attributes, + &DeviceExtension->Attributes, + sizeof(KEYBOARD_ATTRIBUTES)); + + /* complete request */ + Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES); + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + + case IOCTL_INTERNAL_KEYBOARD_CONNECT: + /* verify input buffer length */ + if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA)) + { + /* invalid request */ + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_PARAMETER; + } + + /* is it already connected */ + if (DeviceExtension->ClassService) + { + /* already connected */ + Irp->IoStatus.Status = STATUS_SHARING_VIOLATION; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SHARING_VIOLATION; + } + + /* get connect data */ + Data = (PCONNECT_DATA)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; + + /* store connect details */ + DeviceExtension->ClassDeviceObject = Data->ClassDeviceObject; + DeviceExtension->ClassService = Data->ClassService; + + /* completed successfully */ + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + + case IOCTL_INTERNAL_KEYBOARD_DISCONNECT: + /* not implemented */ + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_BUFFER_TOO_SMALL; - } - - /* get output buffer */ - Attributes = (PKEYBOARD_ATTRIBUTES)Irp->AssociatedIrp.SystemBuffer; - - /* copy attributes */ - RtlCopyMemory(Attributes, &DeviceExtension->Attributes, sizeof(KEYBOARD_ATTRIBUTES)); - - /* complete request */ - Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES); - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_KEYBOARD_CONNECT) - { - /* verify input buffer length */ - if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA)) - { - /* invalid request */ - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_PARAMETER; - } - - /* is it already connected */ - if (DeviceExtension->ClassService) - { - /* already connected */ - Irp->IoStatus.Status = STATUS_SHARING_VIOLATION; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SHARING_VIOLATION; - } - - /* get connect data */ - Data = (PCONNECT_DATA)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; - - /* store connect details */ - DeviceExtension->ClassDeviceObject = Data->ClassDeviceObject; - DeviceExtension->ClassService = Data->ClassService; - - /* completed successfully */ - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_KEYBOARD_DISCONNECT) - { - /* not implemented */ - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_IMPLEMENTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_KEYBOARD_ENABLE) - { - /* not supported */ - Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_SUPPORTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_KEYBOARD_DISABLE) - { - /* not supported */ - Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_SUPPORTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_QUERY_INDICATORS) - { - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS)) - { - /* invalid parameter */ - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_PARAMETER; - } - - /* copy indicators */ - RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, &DeviceExtension->KeyboardIndicator, sizeof(KEYBOARD_INDICATOR_PARAMETERS)); - - /* complete request */ - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = sizeof(KEYBOARD_INDICATOR_PARAMETERS); - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_IMPLEMENTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_QUERY_TYPEMATIC) - { - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) - { - /* invalid parameter */ - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_PARAMETER; - } - - /* copy indicators */ - RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, &DeviceExtension->KeyboardTypematic, sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)); - - /* done */ - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = sizeof(KEYBOARD_TYPEMATIC_PARAMETERS); - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_SET_INDICATORS) - { - if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS)) - { - /* invalid parameter */ - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_PARAMETER; - } - - /* copy indicators */ - RtlCopyMemory(&DeviceExtension->KeyboardIndicator, Irp->AssociatedIrp.SystemBuffer, sizeof(KEYBOARD_INDICATOR_PARAMETERS)); - - /* done */ - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_SET_TYPEMATIC) - { - if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) - { - /* invalid parameter */ - Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_PARAMETER; - } - - /* copy indicators */ - RtlCopyMemory(&DeviceExtension->KeyboardTypematic, Irp->AssociatedIrp.SystemBuffer, sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)); - - /* done */ - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION) - { - /* not implemented */ - DPRINT1("IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION not implemented\n"); - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_NOT_IMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; + + case IOCTL_INTERNAL_KEYBOARD_ENABLE: + /* not supported */ + Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NOT_SUPPORTED; + + case IOCTL_INTERNAL_KEYBOARD_DISABLE: + /* not supported */ + Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NOT_SUPPORTED; + + case IOCTL_KEYBOARD_QUERY_INDICATORS: + if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS)) + { + /* invalid parameter */ + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_PARAMETER; + } + + /* copy indicators */ + RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, + &DeviceExtension->KeyboardIndicator, + sizeof(KEYBOARD_INDICATOR_PARAMETERS)); + + /* complete request */ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = sizeof(KEYBOARD_INDICATOR_PARAMETERS); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NOT_IMPLEMENTED; + + case IOCTL_KEYBOARD_QUERY_TYPEMATIC: + if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) + { + /* invalid parameter */ + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_PARAMETER; + } + + /* copy indicators */ + RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, + &DeviceExtension->KeyboardTypematic, + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)); + + /* done */ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = sizeof(KEYBOARD_TYPEMATIC_PARAMETERS); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + + case IOCTL_KEYBOARD_SET_INDICATORS: + if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KEYBOARD_INDICATOR_PARAMETERS)) + { + /* invalid parameter */ + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_PARAMETER; + } + + /* copy indicators */ + RtlCopyMemory(&DeviceExtension->KeyboardIndicator, + Irp->AssociatedIrp.SystemBuffer, + sizeof(KEYBOARD_INDICATOR_PARAMETERS)); + + /* done */ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + + case IOCTL_KEYBOARD_SET_TYPEMATIC: + if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)) + { + /* invalid parameter */ + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_PARAMETER; + } + + /* copy indicators */ + RtlCopyMemory(&DeviceExtension->KeyboardTypematic, + Irp->AssociatedIrp.SystemBuffer, + sizeof(KEYBOARD_TYPEMATIC_PARAMETERS)); + + /* done */ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_SUCCESS; + + case IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION: + /* not implemented */ + DPRINT1("IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION not implemented\n"); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_NOT_IMPLEMENTED; } /* unknown control code */ @@ -563,7 +587,15 @@ KeInitializeEvent(&Event, NotificationEvent, FALSE); /* build request */ - Irp = IoBuildDeviceIoControlRequest(IoControlCode, DeviceExtension->NextDeviceObject, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize, FALSE, &Event, &IoStatus); + Irp = IoBuildDeviceIoControlRequest(IoControlCode, + DeviceExtension->NextDeviceObject, + InputBuffer, + InputBufferSize, + OutputBuffer, + OutputBufferSize, + FALSE, + &Event, + &IoStatus); if (!Irp) { /* no memory */ @@ -600,7 +632,12 @@ DeviceExtension = (PKBDHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; /* query collection information */ - Status = KbdHid_SubmitRequest(DeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, 0, NULL, sizeof(HID_COLLECTION_INFORMATION), &Information); + Status = KbdHid_SubmitRequest(DeviceObject, + IOCTL_HID_GET_COLLECTION_INFORMATION, + 0, + NULL, + sizeof(HID_COLLECTION_INFORMATION), + &Information); if (!NT_SUCCESS(Status)) { /* failed to query collection information */ @@ -618,7 +655,12 @@ } /* now obtain the preparsed data */ - Status = KbdHid_SubmitRequest(DeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, 0, NULL, Information.DescriptorSize, PreparsedData); + Status = KbdHid_SubmitRequest(DeviceObject, + IOCTL_HID_GET_COLLECTION_DESCRIPTOR, + 0, + NULL, + Information.DescriptorSize, + PreparsedData); if (!NT_SUCCESS(Status)) { /* failed to get preparsed data */ @@ -639,7 +681,7 @@ DPRINT("[KBDHID] Usage %x UsagePage %x InputReportLength %lu\n", Capabilities.Usage, Capabilities.UsagePage, Capabilities.InputReportByteLength); - /* init input report*/ + /* init input report */ DeviceExtension->ReportLength = Capabilities.InputReportByteLength; ASSERT(DeviceExtension->ReportLength); DeviceExtension->Report = (PCHAR)ExAllocatePool(NonPagedPool, DeviceExtension->ReportLength); @@ -647,7 +689,11 @@ RtlZeroMemory(DeviceExtension->Report, DeviceExtension->ReportLength); /* build mdl */ - DeviceExtension->ReportMDL = IoAllocateMdl(DeviceExtension->Report, DeviceExtension->ReportLength, FALSE, FALSE, NULL); + DeviceExtension->ReportMDL = IoAllocateMdl(DeviceExtension->Report, + DeviceExtension->ReportLength, + FALSE, + FALSE, + NULL); ASSERT(DeviceExtension->ReportMDL); /* init mdl */ @@ -752,88 +798,86 @@ IoStack = IoGetCurrentIrpStackLocation(Irp); DPRINT("[KBDHID] IRP_MJ_PNP Request: %x\n", IoStack->MinorFunction); - if (IoStack->MinorFunction == IRP_MN_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_CANCEL_REMOVE_DEVICE || - IoStack->MinorFunction == IRP_MN_QUERY_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_CANCEL_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_QUERY_REMOVE_DEVICE) - { - /* indicate success */ - Irp->IoStatus.Status = STATUS_SUCCESS; - - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - } - else if (IoStack->MinorFunction == IRP_MN_REMOVE_DEVICE) - { - /* FIXME synchronization */ - - /* cancel irp */ - IoCancelIrp(DeviceExtension->Irp); - - /* indicate success */ - Irp->IoStatus.Status = STATUS_SUCCESS; - - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - - IoFreeIrp(DeviceExtension->Irp); - IoDetachDevice(DeviceExtension->NextDeviceObject); - IoDeleteDevice(DeviceObject); - return Status; - } - else if (IoStack->MinorFunction == IRP_MN_START_DEVICE) - { - /* init event */ - KeInitializeEvent(&Event, NotificationEvent, FALSE); - - /* copy stack location */ - IoCopyCurrentIrpStackLocationToNext (Irp); - - /* set completion routine */ - IoSetCompletionRoutine(Irp, KbdHid_StartDeviceCompletion, &Event, TRUE, TRUE, TRUE); - Irp->IoStatus.Status = 0; - - /* pass request */ - Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - if (Status == STATUS_PENDING) - { - KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); - Status = Irp->IoStatus.Status; - } - - if (!NT_SUCCESS(Status)) - { - /* failed */ + switch (IoStack->MinorFunction) + { + case IRP_MN_STOP_DEVICE: + case IRP_MN_CANCEL_REMOVE_DEVICE: + case IRP_MN_QUERY_STOP_DEVICE: + case IRP_MN_CANCEL_STOP_DEVICE: + case IRP_MN_QUERY_REMOVE_DEVICE: + /* indicate success */ + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + case IRP_MN_REMOVE_DEVICE: + /* FIXME synchronization */ + + /* cancel irp */ + IoCancelIrp(DeviceExtension->Irp); + + /* indicate success */ + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + IoFreeIrp(DeviceExtension->Irp); + IoDetachDevice(DeviceExtension->NextDeviceObject); + IoDeleteDevice(DeviceObject); + return Status; + + case IRP_MN_START_DEVICE: + /* init event */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* copy stack location */ + IoCopyCurrentIrpStackLocationToNext (Irp); + + /* set completion routine */ + IoSetCompletionRoutine(Irp, KbdHid_StartDeviceCompletion, &Event, TRUE, TRUE, TRUE); + Irp->IoStatus.Status = 0; + + /* pass request */ + Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + if (Status == STATUS_PENDING) + { + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + Status = Irp->IoStatus.Status; + } + + if (!NT_SUCCESS(Status)) + { + /* failed */ + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + + /* lets start the device */ + Status = KbdHid_StartDevice(DeviceObject); + DPRINT("KbdHid_StartDevice %x\n", Status); + + /* complete request */ Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); + + /* done */ return Status; - } - - /* lets start the device */ - Status = KbdHid_StartDevice(DeviceObject); - DPRINT("KbdHid_StartDevice %x\n", Status); - - /* complete request */ - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - /* done */ - return Status; - } - else - { - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + default: + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); } } @@ -849,7 +893,13 @@ POWER_STATE State; /* create device object */ - Status = IoCreateDevice(DriverObject, sizeof(KBDHID_DEVICE_EXTENSION), NULL, FILE_DEVICE_KEYBOARD, 0, FALSE, &DeviceObject); + Status = IoCreateDevice(DriverObject, + sizeof(KBDHID_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_KEYBOARD, + 0, + FALSE, + &DeviceObject); if (!NT_SUCCESS(Status)) { /* failed to create device object */ Modified: trunk/reactos/drivers/hid/kbdhid/kbdhid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/kbdhid/kbdhid.…
============================================================================== --- trunk/reactos/drivers/hid/kbdhid/kbdhid.h [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/kbdhid/kbdhid.h [iso-8859-1] Sat May 11 10:23:54 2013 @@ -26,7 +26,7 @@ PIRP Irp; // - // event + // event // KEVENT ReadCompletionEvent; @@ -125,12 +125,12 @@ }KBDHID_DEVICE_EXTENSION, *PKBDHID_DEVICE_EXTENSION; /* defaults from kbfiltr.h */ -#define KEYBOARD_TYPEMATIC_RATE_MINIMUM 2 -#define KEYBOARD_TYPEMATIC_RATE_MAXIMUM 30 -#define KEYBOARD_TYPEMATIC_RATE_DEFAULT 30 -#define KEYBOARD_TYPEMATIC_DELAY_MINIMUM 250 -#define KEYBOARD_TYPEMATIC_DELAY_MAXIMUM 1000 -#define KEYBOARD_TYPEMATIC_DELAY_DEFAULT 250 +#define KEYBOARD_TYPEMATIC_RATE_MINIMUM 2 +#define KEYBOARD_TYPEMATIC_RATE_MAXIMUM 30 +#define KEYBOARD_TYPEMATIC_RATE_DEFAULT 30 +#define KEYBOARD_TYPEMATIC_DELAY_MINIMUM 250 +#define KEYBOARD_TYPEMATIC_DELAY_MAXIMUM 1000 +#define KEYBOARD_TYPEMATIC_DELAY_DEFAULT 250 /* FIXME: write kbd.h */ #define MICROSOFT_KBD_FUNC 12 @@ -143,4 +143,3 @@ NTSTATUS KbdHid_InitiateRead( IN PKBDHID_DEVICE_EXTENSION DeviceExtension); - Modified: trunk/reactos/drivers/hid/mouhid/mouhid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
============================================================================== --- trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/mouhid/mouhid.c [iso-8859-1] Sat May 11 10:23:54 2013 @@ -10,7 +10,7 @@ #include "mouhid.h" -static USHORT MouHid_ButtonUpFlags[] = +static USHORT MouHid_ButtonUpFlags[] = { 0xFF, /* unused */ MOUSE_LEFT_BUTTON_DOWN, @@ -20,7 +20,7 @@ MOUSE_BUTTON_5_DOWN }; -static USHORT MouHid_ButtonDownFlags[] = +static USHORT MouHid_ButtonDownFlags[] = { 0xFF, /* unused */ MOUSE_LEFT_BUTTON_UP, @@ -44,7 +44,14 @@ *LastY = 0; /* get scaled usage value x */ - Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PLONG)LastX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetScaledUsageValue(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_X, + LastX, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); if (Status != HIDP_STATUS_SUCCESS) { /* FIXME: handle more errors */ @@ -54,7 +61,14 @@ DeviceExtension->MouseAbsolute = TRUE; /* get unscaled value */ - Status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, (PULONG)&ValueX, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetUsageValue(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_X, + &ValueX, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); /* FIXME handle error */ ASSERT(Status == HIDP_STATUS_SUCCESS); @@ -67,7 +81,14 @@ } /* get scaled usage value y */ - Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PLONG)LastY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetScaledUsageValue(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_Y, + LastY, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); if (Status != HIDP_STATUS_SUCCESS) { // FIXME: handle more errors @@ -77,7 +98,14 @@ DeviceExtension->MouseAbsolute = TRUE; // get unscaled value - Status = HidP_GetUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, (PULONG)&ValueY, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetUsageValue(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_Y, + &ValueY, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); /* FIXME handle error */ ASSERT(Status == HIDP_STATUS_SUCCESS); @@ -107,7 +135,14 @@ /* get usages */ CurrentUsageListLength = DeviceExtension->UsageListLength; - Status = HidP_GetUsages(HidP_Input, HID_USAGE_PAGE_BUTTON, HIDP_LINK_COLLECTION_UNSPECIFIED, DeviceExtension->CurrentUsageList, &CurrentUsageListLength, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetUsages(HidP_Input, + HID_USAGE_PAGE_BUTTON, + HIDP_LINK_COLLECTION_UNSPECIFIED, + DeviceExtension->CurrentUsageList, + &CurrentUsageListLength, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); if (Status != HIDP_STATUS_SUCCESS) { DPRINT1("MouHid_GetButtonFlags failed to get usages with %x\n", Status); @@ -115,7 +150,11 @@ } /* extract usage list difference */ - Status = HidP_UsageListDifference(DeviceExtension->PreviousUsageList, DeviceExtension->CurrentUsageList, DeviceExtension->BreakUsageList, DeviceExtension->MakeUsageList, DeviceExtension->UsageListLength); + Status = HidP_UsageListDifference(DeviceExtension->PreviousUsageList, + DeviceExtension->CurrentUsageList, + DeviceExtension->BreakUsageList, + DeviceExtension->MakeUsageList, + DeviceExtension->UsageListLength); if (Status != HIDP_STATUS_SUCCESS) { DPRINT1("MouHid_GetButtonFlags failed to get usages with %x\n", Status); @@ -140,7 +179,7 @@ /* move to next index*/ Index++; - }while(Index < DeviceExtension->UsageListLength); + } while (Index < DeviceExtension->UsageListLength); } if (DeviceExtension->UsageListLength) @@ -161,7 +200,7 @@ /* move to next index*/ Index++; - }while(Index < DeviceExtension->UsageListLength); + } while (Index < DeviceExtension->UsageListLength); } /* now switch the previous list with current list */ @@ -258,7 +297,14 @@ { /* get usage */ UsageValue = 0; - Status = HidP_GetScaledUsageValue(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_WHEEL, &UsageValue, DeviceExtension->PreparsedData, DeviceExtension->Report, DeviceExtension->ReportLength); + Status = HidP_GetScaledUsageValue(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_WHEEL, + &UsageValue, + DeviceExtension->PreparsedData, + DeviceExtension->Report, + DeviceExtension->ReportLength); if (Status == HIDP_STATUS_SUCCESS && UsageValue != 0) { /* store wheel status */ @@ -332,7 +378,7 @@ IN PIRP Irp, IN PVOID Context) { - KeSetEvent((PKEVENT)Context, 0, FALSE); + KeSetEvent(Context, 0, FALSE); return STATUS_MORE_PROCESSING_REQUIRED; } @@ -470,8 +516,9 @@ DeviceExtension = (PMOUHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; /* handle requests */ - if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_MOUSE_QUERY_ATTRIBUTES) - { + switch (IoStack->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_MOUSE_QUERY_ATTRIBUTES: /* verify output buffer length */ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUSE_ATTRIBUTES)) { @@ -507,9 +554,8 @@ Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_MOUSE_CONNECT) - { + + case IOCTL_INTERNAL_MOUSE_CONNECT: /* verify input buffer length */ if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA)) { @@ -539,23 +585,20 @@ Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_MOUSE_DISCONNECT) - { + + case IOCTL_INTERNAL_MOUSE_DISCONNECT: /* not supported */ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_IMPLEMENTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_MOUSE_ENABLE) - { + + case IOCTL_INTERNAL_MOUSE_ENABLE: /* not supported */ Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_NOT_SUPPORTED; - } - else if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_INTERNAL_MOUSE_DISABLE) - { + + case IOCTL_INTERNAL_MOUSE_DISABLE: /* not supported */ Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -619,7 +662,15 @@ KeInitializeEvent(&Event, NotificationEvent, FALSE); /* build request */ - Irp = IoBuildDeviceIoControlRequest(IoControlCode, DeviceExtension->NextDeviceObject, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize, FALSE, &Event, &IoStatus); + Irp = IoBuildDeviceIoControlRequest(IoControlCode, + DeviceExtension->NextDeviceObject, + InputBuffer, + InputBufferSize, + OutputBuffer, + OutputBufferSize, + FALSE, + &Event, + &IoStatus); if (!Irp) { /* no memory */ @@ -658,7 +709,12 @@ DeviceExtension = (PMOUHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; /* query collection information */ - Status = MouHid_SubmitRequest(DeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, 0, NULL, sizeof(HID_COLLECTION_INFORMATION), &Information); + Status = MouHid_SubmitRequest(DeviceObject, + IOCTL_HID_GET_COLLECTION_INFORMATION, + 0, + NULL, + sizeof(HID_COLLECTION_INFORMATION), + &Information); if (!NT_SUCCESS(Status)) { /* failed to query collection information */ @@ -676,7 +732,12 @@ } /* now obtain the preparsed data */ - Status = MouHid_SubmitRequest(DeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, 0, NULL, Information.DescriptorSize, PreparsedData); + Status = MouHid_SubmitRequest(DeviceObject, + IOCTL_HID_GET_COLLECTION_DESCRIPTOR, + 0, + NULL, + Information.DescriptorSize, + PreparsedData); if (!NT_SUCCESS(Status)) { /* failed to get preparsed data */ @@ -713,14 +774,20 @@ RtlZeroMemory(DeviceExtension->Report, DeviceExtension->ReportLength); /* build mdl */ - DeviceExtension->ReportMDL = IoAllocateMdl(DeviceExtension->Report, DeviceExtension->ReportLength, FALSE, FALSE, NULL); + DeviceExtension->ReportMDL = IoAllocateMdl(DeviceExtension->Report, + DeviceExtension->ReportLength, + FALSE, + FALSE, + NULL); ASSERT(DeviceExtension->ReportMDL); /* init mdl */ MmBuildMdlForNonPagedPool(DeviceExtension->ReportMDL); /* get max number of buttons */ - Buttons = HidP_MaxUsageListLength(HidP_Input, HID_USAGE_PAGE_BUTTON, PreparsedData); + Buttons = HidP_MaxUsageListLength(HidP_Input, + HID_USAGE_PAGE_BUTTON, + PreparsedData); DPRINT("[MOUHID] Buttons %lu\n", Buttons); ASSERT(Buttons > 0); @@ -750,15 +817,33 @@ DeviceExtension->PreparsedData = PreparsedData; ValueCapsLength = 1; - HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_X, &DeviceExtension->ValueCapsX, &ValueCapsLength, PreparsedData); + HidP_GetSpecificValueCaps(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_X, + &DeviceExtension->ValueCapsX, + &ValueCapsLength, + PreparsedData); ValueCapsLength = 1; - HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Y, &DeviceExtension->ValueCapsY, &ValueCapsLength, PreparsedData); + HidP_GetSpecificValueCaps(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_Y, + &DeviceExtension->ValueCapsY, + &ValueCapsLength, + PreparsedData); /* now check for wheel mouse support */ ValueCapsLength = 1; - Status = HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_WHEEL, &ValueCaps, &ValueCapsLength, PreparsedData); - if (Status == HIDP_STATUS_SUCCESS ) + Status = HidP_GetSpecificValueCaps(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_WHEEL, + &ValueCaps, + &ValueCapsLength, + PreparsedData); + if (Status == HIDP_STATUS_SUCCESS) { /* mouse has wheel support */ DeviceExtension->MouseIdentifier = WHEELMOUSE_HID_HARDWARE; @@ -769,7 +854,13 @@ { /* check if the mouse has z-axis */ ValueCapsLength = 1; - Status = HidP_GetSpecificValueCaps(HidP_Input, HID_USAGE_PAGE_GENERIC, HIDP_LINK_COLLECTION_UNSPECIFIED, HID_USAGE_GENERIC_Z, &ValueCaps, &ValueCapsLength, PreparsedData); + Status = HidP_GetSpecificValueCaps(HidP_Input, + HID_USAGE_PAGE_GENERIC, + HIDP_LINK_COLLECTION_UNSPECIFIED, + HID_USAGE_GENERIC_Z, + &ValueCaps, + &ValueCapsLength, + PreparsedData); if (Status == HIDP_STATUS_SUCCESS && ValueCapsLength == 1) { /* wheel support */ @@ -838,101 +929,99 @@ IoStack = IoGetCurrentIrpStackLocation(Irp); DPRINT("[MOUHID] IRP_MJ_PNP Request: %x\n", IoStack->MinorFunction); - if (IoStack->MinorFunction == IRP_MN_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_CANCEL_REMOVE_DEVICE || - IoStack->MinorFunction == IRP_MN_QUERY_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_CANCEL_STOP_DEVICE || - IoStack->MinorFunction == IRP_MN_QUERY_REMOVE_DEVICE) - { - /* indicate success */ - Irp->IoStatus.Status = STATUS_SUCCESS; - - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - } - else if (IoStack->MinorFunction == IRP_MN_REMOVE_DEVICE) - { - /* FIXME synchronization */ - - /* request stop */ - DeviceExtension->StopReadReport = TRUE; - - /* cancel irp */ - IoCancelIrp(DeviceExtension->Irp); - - /* indicate success */ - Irp->IoStatus.Status = STATUS_SUCCESS; - - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - - /* wait for completion of stop event */ - KeWaitForSingleObject(&DeviceExtension->ReadCompletionEvent, Executive, KernelMode, FALSE, NULL); - - /* free irp */ - IoFreeIrp(DeviceExtension->Irp); - - /* detach device */ - IoDetachDevice(DeviceExtension->NextDeviceObject); - - /* delete device */ - IoDeleteDevice(DeviceObject); - - /* done */ - return Status; - } - else if (IoStack->MinorFunction == IRP_MN_START_DEVICE) - { - /* init event */ - KeInitializeEvent(&Event, NotificationEvent, FALSE); - - /* copy stack location */ - IoCopyCurrentIrpStackLocationToNext (Irp); - - /* set completion routine */ - IoSetCompletionRoutine(Irp, MouHid_StartDeviceCompletion, &Event, TRUE, TRUE, TRUE); - Irp->IoStatus.Status = 0; - - /* pass request */ - Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); - if (Status == STATUS_PENDING) - { - KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); - Status = Irp->IoStatus.Status; - } - - if (!NT_SUCCESS(Status)) - { - /* failed */ + switch (IoStack->MinorFunction) + { + case IRP_MN_STOP_DEVICE: + case IRP_MN_CANCEL_REMOVE_DEVICE: + case IRP_MN_QUERY_STOP_DEVICE: + case IRP_MN_CANCEL_STOP_DEVICE: + case IRP_MN_QUERY_REMOVE_DEVICE: + /* indicate success */ + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + case IRP_MN_REMOVE_DEVICE: + /* FIXME synchronization */ + + /* request stop */ + DeviceExtension->StopReadReport = TRUE; + + /* cancel irp */ + IoCancelIrp(DeviceExtension->Irp); + + /* indicate success */ + Irp->IoStatus.Status = STATUS_SUCCESS; + + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + /* wait for completion of stop event */ + KeWaitForSingleObject(&DeviceExtension->ReadCompletionEvent, Executive, KernelMode, FALSE, NULL); + + /* free irp */ + IoFreeIrp(DeviceExtension->Irp); + + /* detach device */ + IoDetachDevice(DeviceExtension->NextDeviceObject); + + /* delete device */ + IoDeleteDevice(DeviceObject); + + /* done */ + return Status; + + case IRP_MN_START_DEVICE: + /* init event */ + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + /* copy stack location */ + IoCopyCurrentIrpStackLocationToNext (Irp); + + /* set completion routine */ + IoSetCompletionRoutine(Irp, MouHid_StartDeviceCompletion, &Event, TRUE, TRUE, TRUE); + Irp->IoStatus.Status = 0; + + /* pass request */ + Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + if (Status == STATUS_PENDING) + { + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + Status = Irp->IoStatus.Status; + } + + if (!NT_SUCCESS(Status)) + { + /* failed */ + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + + /* lets start the device */ + Status = MouHid_StartDevice(DeviceObject); + DPRINT("MouHid_StartDevice %x\n", Status); + + /* complete request */ Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); + + /* done */ return Status; - } - - /* lets start the device */ - Status = MouHid_StartDevice(DeviceObject); - DPRINT("MouHid_StartDevice %x\n", Status); - - /* complete request */ - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - /* done */ - return Status; - } - else - { - /* skip irp stack location */ - IoSkipCurrentIrpStackLocation(Irp); - - /* dispatch to lower device */ - return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + + default: + /* skip irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* dispatch to lower device */ + return IoCallDriver(DeviceExtension->NextDeviceObject, Irp); } } @@ -948,7 +1037,13 @@ POWER_STATE State; /* create device object */ - Status = IoCreateDevice(DriverObject, sizeof(MOUHID_DEVICE_EXTENSION), NULL, FILE_DEVICE_MOUSE, 0, FALSE, &DeviceObject); + Status = IoCreateDevice(DriverObject, + sizeof(MOUHID_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_MOUSE, + 0, + FALSE, + &DeviceObject); if (!NT_SUCCESS(Status)) { /* failed to create device object */ Modified: trunk/reactos/drivers/hid/mouhid/mouhid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/mouhid/mouhid.…
============================================================================== --- trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/mouhid/mouhid.h [iso-8859-1] Sat May 11 10:23:54 2013 @@ -25,7 +25,7 @@ PIRP Irp; // - // event + // event // KEVENT ReadCompletionEvent;
11 years, 7 months
1
0
0
0
[akhaldi] 58988: [CDFS] * Fix the mismatch between sizeof and countof quantities in CdfsMakeFCBFromDirEntry. * Properly account for '\\' and '\0'. * Fix one more debug print specifier.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 11 09:52:37 2013 New Revision: 58988 URL:
http://svn.reactos.org/svn/reactos?rev=58988&view=rev
Log: [CDFS] * Fix the mismatch between sizeof and countof quantities in CdfsMakeFCBFromDirEntry. * Properly account for '\\' and '\0'. * Fix one more debug print specifier. Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Sat May 11 09:52:37 2013 @@ -363,8 +363,9 @@ PFCB rcFCB; ULONG Size; - if (LongName [0] != 0 && wcslen (DirectoryFCB->PathName) + - sizeof(WCHAR) + wcslen (LongName) > MAX_PATH) + /* Check if the full string would overflow the pathName buffer (the additional characters are for '\\' and '\0') */ + if ((LongName[0] != 0) && + (wcslen(DirectoryFCB->PathName) + 1 + wcslen(LongName) + 1 > MAX_PATH)) { return(STATUS_OBJECT_NAME_INVALID); } @@ -411,7 +412,7 @@ CdfsAddFCBToTable(Vcb, rcFCB); *fileFCB = rcFCB; - DPRINT("%S %d %I64d\n", LongName, Size, rcFCB->RFCB.AllocationSize.QuadPart); + DPRINT("%S %u %I64d\n", LongName, Size, rcFCB->RFCB.AllocationSize.QuadPart); return(STATUS_SUCCESS); }
11 years, 7 months
1
0
0
0
[akhaldi] 58987: [CDFS] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat May 11 09:24:31 2013 New Revision: 58987 URL:
http://svn.reactos.org/svn/reactos?rev=58987&view=rev
Log: [CDFS] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.c trunk/reactos/drivers/filesystems/cdfs/cdfs.h trunk/reactos/drivers/filesystems/cdfs/cleanup.c trunk/reactos/drivers/filesystems/cdfs/close.c trunk/reactos/drivers/filesystems/cdfs/common.c trunk/reactos/drivers/filesystems/cdfs/create.c trunk/reactos/drivers/filesystems/cdfs/devctrl.c trunk/reactos/drivers/filesystems/cdfs/dirctl.c trunk/reactos/drivers/filesystems/cdfs/fcb.c trunk/reactos/drivers/filesystems/cdfs/finfo.c trunk/reactos/drivers/filesystems/cdfs/fsctl.c trunk/reactos/drivers/filesystems/cdfs/misc.c trunk/reactos/drivers/filesystems/cdfs/rw.c trunk/reactos/drivers/filesystems/cdfs/volinfo.c Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -53,6 +53,8 @@ PDEVICE_OBJECT DeviceObject; NTSTATUS Status; UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Cdfs"); + + UNREFERENCED_PARAMETER(RegistryPath); DPRINT("CDFS 0.0.3\n"); Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Sat May 11 09:24:31 2013 @@ -243,16 +243,22 @@ /* cleanup.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsCleanup; + +NTSTATUS +NTAPI CdfsCleanup(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* close.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsClose; + +NTSTATUS +NTAPI CdfsClose(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); NTSTATUS CdfsCloseFile(PDEVICE_EXTENSION DeviceExt, @@ -279,11 +285,16 @@ /* create.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsCreate; + +NTSTATUS +NTAPI CdfsCreate(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* devctrl.c */ + +DRIVER_DISPATCH CdfsDeviceControl; NTSTATUS NTAPI CdfsDeviceControl(PDEVICE_OBJECT DeviceObject, @@ -291,9 +302,12 @@ /* dirctl.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsDirectoryControl; + +NTSTATUS +NTAPI CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* fcb.c */ @@ -366,20 +380,28 @@ /* finfo.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsQueryInformation; + +NTSTATUS +NTAPI CdfsQueryInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp); - -NTSTATUS NTAPI + PIRP Irp); + +DRIVER_DISPATCH CdfsSetInformation; + +NTSTATUS +NTAPI CdfsSetInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* fsctl.c */ + +DRIVER_DISPATCH CdfsFileSystemControl; NTSTATUS NTAPI CdfsFileSystemControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* misc.c */ @@ -406,24 +428,36 @@ /* rw.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsRead; + +NTSTATUS +NTAPI CdfsRead(PDEVICE_OBJECT DeviceObject, - PIRP Irp); - -NTSTATUS NTAPI + PIRP Irp); + +DRIVER_DISPATCH CdfsWrite; + +NTSTATUS +NTAPI CdfsWrite(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* volinfo.c */ -NTSTATUS NTAPI +DRIVER_DISPATCH CdfsQueryVolumeInformation; + +NTSTATUS +NTAPI CdfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp); - -NTSTATUS NTAPI + PIRP Irp); + +DRIVER_DISPATCH CdfsSetVolumeInformation; + +NTSTATUS +NTAPI CdfsSetVolumeInformation(PDEVICE_OBJECT DeviceObject, - PIRP Irp); + PIRP Irp); /* cdfs.c */ Modified: trunk/reactos/drivers/filesystems/cdfs/cleanup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/cleanup.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -42,7 +42,7 @@ */ { - DPRINT("CdfsCleanupFile(DeviceExt %x, FileObject %x)\n", + DPRINT("CdfsCleanupFile(DeviceExt %p, FileObject %p)\n", DeviceExt, FileObject); Modified: trunk/reactos/drivers/filesystems/cdfs/close.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/close.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -43,13 +43,13 @@ { PCCB Ccb; - DPRINT("CdfsCloseFile(DeviceExt %x, FileObject %x)\n", + DPRINT("CdfsCloseFile(DeviceExt %p, FileObject %p)\n", DeviceExt, FileObject); Ccb = (PCCB)(FileObject->FsContext2); - DPRINT("Ccb %x\n", Ccb); + DPRINT("Ccb %p\n", Ccb); if (Ccb == NULL) { return(STATUS_SUCCESS); Modified: trunk/reactos/drivers/filesystems/cdfs/common.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -60,9 +60,9 @@ BlockSize = BLOCKSIZE * SectorCount; - DPRINT("CdfsReadSectors(DeviceObject %x, DiskSector %d, Buffer %x)\n", + DPRINT("CdfsReadSectors(DeviceObject %p, DiskSector %u, Buffer %p)\n", DeviceObject, DiskSector, Buffer); - DPRINT("Offset %I64x BlockSize %ld\n", + DPRINT("Offset %I64x BlockSize %u\n", Offset.QuadPart, BlockSize); @@ -86,15 +86,15 @@ Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME; } - DPRINT("Calling IO Driver... with irp %x\n", Irp); + DPRINT("Calling IO Driver... with irp %p\n", Irp); Status = IoCallDriver(DeviceObject, Irp); - DPRINT("Waiting for IO Operation for %x\n", Irp); + DPRINT("Waiting for IO Operation for %p\n", Irp); if (Status == STATUS_PENDING) { DPRINT("Operation pending\n"); KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); - DPRINT("Getting IO Status... for %x\n", Irp); + DPRINT("Getting IO Status... for %p\n", Irp); Status = IoStatus.Status; } @@ -127,13 +127,13 @@ } DPRINT("CdfsReadSectors() failed (Status %x)\n", Status); - DPRINT("(DeviceObject %x, DiskSector %x, Buffer %x, Offset 0x%I64x)\n", + DPRINT("(DeviceObject %p, DiskSector %u, Buffer %p, Offset 0x%I64x)\n", DeviceObject, DiskSector, Buffer, Offset.QuadPart); return(Status); } - DPRINT("Block request succeeded for %x\n", Irp); + DPRINT("Block request succeeded for %p\n", Irp); return(STATUS_SUCCESS); } @@ -155,9 +155,9 @@ NTSTATUS Status; BOOLEAN LastChance = FALSE; - DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, " - "InputBuffer %x, InputBufferSize %x, OutputBuffer %x, " - "POutputBufferSize %x (%x)\n", DeviceObject, CtlCode, + DPRINT("CdfsDeviceIoControl(DeviceObject %p, CtlCode %u, " + "InputBuffer %p, InputBufferSize %u, OutputBuffer %p, " + "POutputBufferSize %p (%x)\n", DeviceObject, CtlCode, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize, OutputBufferSize ? *OutputBufferSize : 0); @@ -186,15 +186,15 @@ Stack->Flags |= SL_OVERRIDE_VERIFY_VOLUME; } - DPRINT ("Calling IO Driver... with irp %x\n", Irp); + DPRINT ("Calling IO Driver... with irp %p\n", Irp); Status = IoCallDriver(DeviceObject, Irp); - DPRINT ("Waiting for IO Operation for %x\n", Irp); + DPRINT ("Waiting for IO Operation for %p\n", Irp); if (Status == STATUS_PENDING) { DPRINT ("Operation pending\n"); KeWaitForSingleObject (&Event, Suspended, KernelMode, FALSE, NULL); - DPRINT ("Getting IO Status... for %x\n", Irp); + DPRINT ("Getting IO Status... for %p\n", Irp); Status = IoStatus.Status; } Modified: trunk/reactos/drivers/filesystems/cdfs/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/create.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -113,7 +113,7 @@ NTSTATUS Status; UNICODE_STRING AbsFileName; - DPRINT("CdfsOpenFile(%08lx, %08lx, %wZ)\n", DeviceExt, FileObject, FileName); + DPRINT("CdfsOpenFile(%p, %p, %wZ)\n", DeviceExt, FileObject, FileName); if (FileObject->RelatedFileObject) { Modified: trunk/reactos/drivers/filesystems/cdfs/devctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/devctrl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/devctrl.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -24,6 +24,8 @@ PVCB Vcb = NULL; PFILE_OBJECT FileObject; PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp); + + UNREFERENCED_PARAMETER(DeviceObject); FileObject = Stack->FileObject; Irp->IoStatus.Information = 0; Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -177,9 +177,9 @@ PDIR_RECORD Record; LARGE_INTEGER StreamOffset, OffsetOfEntry; - DPRINT("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n", + DPRINT("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %u)\n", Parent, FileToFind, pDirIndex ? *pDirIndex : 0); - DPRINT("FindFile: old Pathname %x, old Objectname %x)\n", + DPRINT("FindFile: old Pathname %p, old Objectname %p)\n", Fcb->PathName, Fcb->ObjectName); IsRoot = FALSE; @@ -236,7 +236,7 @@ DirSize = Parent->Entry.DataLengthL; } - DPRINT("StreamOffset %I64u DirSize %lu\n", StreamOffset.QuadPart, DirSize); + DPRINT("StreamOffset %I64d DirSize %u\n", StreamOffset.QuadPart, DirSize); if (pDirIndex && (*pDirIndex)) DirIndex = *pDirIndex; @@ -338,7 +338,7 @@ if (pOffset) *pOffset = Offset; - DPRINT("FindFile: new Pathname %S, new Objectname %S, DirIndex %d\n", + DPRINT("FindFile: new Pathname %S, new Objectname %S, DirIndex %u\n", Fcb->PathName, Fcb->ObjectName, DirIndex); RtlFreeUnicodeString(&FileToFindUpcase); @@ -375,6 +375,8 @@ DPRINT("CdfsGetNameInformation() called\n"); + UNREFERENCED_PARAMETER(DeviceExt); + Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR); if ((sizeof(FILE_NAMES_INFORMATION) + Length) > BufferLength) return(STATUS_BUFFER_OVERFLOW); @@ -400,6 +402,8 @@ DPRINT("CdfsGetDirectoryInformation() called\n"); + UNREFERENCED_PARAMETER(DeviceExt); + Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR); if ((sizeof (FILE_DIRECTORY_INFORMATION) + Length) > BufferLength) return(STATUS_BUFFER_OVERFLOW); @@ -447,6 +451,8 @@ DPRINT("CdfsGetFullDirectoryInformation() called\n"); + UNREFERENCED_PARAMETER(DeviceExt); + Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR); if ((sizeof (FILE_FULL_DIR_INFORMATION) + Length) > BufferLength) return(STATUS_BUFFER_OVERFLOW); @@ -495,6 +501,8 @@ ULONG Length; DPRINT("CdfsGetBothDirectoryInformation() called\n"); + + UNREFERENCED_PARAMETER(DeviceExt); Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR); if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength) @@ -764,7 +772,7 @@ break; default: - DPRINT1("CDFS: MinorFunction %d\n", Stack->MinorFunction); + DPRINT1("CDFS: MinorFunction %u\n", Stack->MinorFunction); Status = STATUS_INVALID_DEVICE_REQUEST; break; } Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -139,7 +139,7 @@ { KIRQL oldIrql; - DPRINT("grabbing FCB at %x: %S, refCount:%d\n", + DPRINT("grabbing FCB at %p: %S, refCount:%d\n", Fcb, Fcb->PathName, Fcb->RefCount); @@ -156,7 +156,7 @@ { KIRQL oldIrql; - DPRINT("releasing FCB at %x: %S, refCount:%d\n", + DPRINT("releasing FCB at %p: %S, refCount:%d\n", Fcb, Fcb->PathName, Fcb->RefCount); @@ -450,7 +450,7 @@ Fcb->Flags |= FCB_CACHE_INITIALIZED; } - DPRINT("file open: fcb:%x file size: %d\n", Fcb, Fcb->Entry.DataLengthL); + DPRINT("file open: fcb:%p file size: %u\n", Fcb, Fcb->Entry.DataLengthL); return(STATUS_SUCCESS); } @@ -616,7 +616,7 @@ PFCB FCB; PFCB parentFCB; - DPRINT("CdfsGetFCBForFile(%x, %x, %x, '%wZ')\n", + DPRINT("CdfsGetFCBForFile(%p, %p, %p, '%wZ')\n", Vcb, pParentFCB, pFCB, @@ -652,7 +652,7 @@ } DPRINT("Parsing, currentElement:%S\n", currentElement); - DPRINT(" parentFCB:%x FCB:%x\n", parentFCB, FCB); + DPRINT(" parentFCB:%p FCB:%p\n", parentFCB, FCB); /* Descend to next directory level */ if (parentFCB) Modified: trunk/reactos/drivers/filesystems/cdfs/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/finfo.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -46,6 +46,8 @@ { DPRINT("CdfsGetStandardInformation() called\n"); + UNREFERENCED_PARAMETER(DeviceObject); + if (*BufferLength < sizeof(FILE_STANDARD_INFORMATION)) return STATUS_BUFFER_OVERFLOW; @@ -112,6 +114,9 @@ { DPRINT("CdfsGetBasicInformation() called\n"); + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(DeviceObject); + if (*BufferLength < sizeof(FILE_BASIC_INFORMATION)) return STATUS_BUFFER_OVERFLOW; @@ -150,6 +155,9 @@ ASSERT(NameInfo != NULL); ASSERT(Fcb != NULL); + + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(DeviceObject); /* If buffer can't hold at least the file name length, bail out */ if (*BufferLength < (ULONG)FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0])) @@ -403,7 +411,7 @@ break; default: - DPRINT("Unimplemented information class %u\n", FileInformationClass); + DPRINT("Unimplemented information class %x\n", FileInformationClass); Status = STATUS_INVALID_PARAMETER; break; } @@ -430,8 +438,8 @@ { DPRINT ("CdfsSetPositionInformation()\n"); - DPRINT ("PositionInfo %x\n", PositionInfo); - DPRINT ("Setting position %I64u\n", PositionInfo->CurrentByteOffset.QuadPart); + DPRINT ("PositionInfo %p\n", PositionInfo); + DPRINT ("Setting position %I64d\n", PositionInfo->CurrentByteOffset.QuadPart); FileObject->CurrentByteOffset.QuadPart = PositionInfo->CurrentByteOffset.QuadPart; @@ -454,6 +462,8 @@ NTSTATUS Status = STATUS_SUCCESS; + UNREFERENCED_PARAMETER(DeviceObject); + DPRINT("CdfsSetInformation() called\n"); Stack = IoGetCurrentIrpStackLocation(Irp); Modified: trunk/reactos/drivers/filesystems/cdfs/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/fsctl.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -231,7 +231,7 @@ return Status; } - DPRINT("FirstSession %d, LastSession %d, FirstTrack %d\n", + DPRINT("FirstSession %u, LastSession %u, FirstTrack %u\n", Toc.FirstSession, Toc.LastSession, Toc.TrackData.TrackNumber); Offset = 0; @@ -241,7 +241,7 @@ } CdInfo->VolumeOffset = Offset; - DPRINT("Offset of first track in last session %d\n", Offset); + DPRINT("Offset of first track in last session %u\n", Offset); CdInfo->JolietLevel = 0; VdHeader = (PVD_HEADER)Buffer; @@ -540,6 +540,8 @@ PIO_STACK_LOCATION Stack; USHORT CompressionState; + UNREFERENCED_PARAMETER(DeviceObject); + Stack = IoGetCurrentIrpStackLocation(Irp); if (Stack->Parameters.DeviceIoControl.InputBufferLength != sizeof(CompressionState)) @@ -593,7 +595,7 @@ break; default: - DPRINT1("CDFS FSC: MinorFunction %d\n", Stack->MinorFunction); + DPRINT1("CDFS FSC: MinorFunction %u\n", Stack->MinorFunction); Status = STATUS_INVALID_DEVICE_REQUEST; break; } Modified: trunk/reactos/drivers/filesystems/cdfs/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/m…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/misc.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -145,7 +145,7 @@ PCDFS_SHORT_NAME ShortNameEntry; GENERATE_NAME_CONTEXT Context = { 0 }; - DPRINT("CdfsShortNameCacheGet(%I64u,%wZ)\n", StreamOffset->QuadPart, LongName); + DPRINT("CdfsShortNameCacheGet(%I64d,%wZ)\n", StreamOffset->QuadPart, LongName); /* Get the name list resource */ ExAcquireResourceExclusiveLite(&DirectoryFcb->NameListResource, TRUE); Modified: trunk/reactos/drivers/filesystems/cdfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/rw.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -71,7 +71,7 @@ if (ReadOffset + Length > Fcb->Entry.DataLengthL) ToRead = Fcb->Entry.DataLengthL - ReadOffset; - DPRINT("Reading %d bytes at %d\n", Length, ReadOffset); + DPRINT("Reading %u bytes at %u\n", Length, ReadOffset); if (!(IrpFlags & (IRP_NOCACHE|IRP_PAGING_IO))) { @@ -168,7 +168,7 @@ ULONG ReturnedReadLength = 0; NTSTATUS Status = STATUS_SUCCESS; - DPRINT("CdfsRead(DeviceObject %x, Irp %x)\n",DeviceObject,Irp); + DPRINT("CdfsRead(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); DeviceExt = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); @@ -210,7 +210,7 @@ CdfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT("CdfsWrite(DeviceObject %x Irp %x)\n",DeviceObject,Irp); + DPRINT("CdfsWrite(DeviceObject %p Irp %p)\n", DeviceObject, Irp); Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; Irp->IoStatus.Information = 0; Modified: trunk/reactos/drivers/filesystems/cdfs/volinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/v…
============================================================================== --- trunk/reactos/drivers/filesystems/cdfs/volinfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/cdfs/volinfo.c [iso-8859-1] Sat May 11 09:24:31 2013 @@ -86,6 +86,8 @@ DPRINT("BufferLength %lu\n", *BufferLength); DPRINT("Required length %lu\n", (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8)); + UNREFERENCED_PARAMETER(DeviceExt); + if (*BufferLength < sizeof (FILE_FS_ATTRIBUTE_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH; @@ -183,7 +185,7 @@ SystemBuffer = Irp->AssociatedIrp.SystemBuffer; DPRINT("FsInformationClass %d\n", FsInformationClass); - DPRINT("SystemBuffer %x\n", SystemBuffer); + DPRINT("SystemBuffer %p\n", SystemBuffer); switch (FsInformationClass) { @@ -233,6 +235,8 @@ { DPRINT("CdfsSetVolumeInformation() called\n"); + UNREFERENCED_PARAMETER(DeviceObject); + Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT);
11 years, 7 months
1
0
0
0
[jimtabor] 58986: [Win32k] - ATI fixup CORE-6551. - Giannis Adamopoulos fragment patch 18.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri May 10 22:28:18 2013 New Revision: 58986 URL:
http://svn.reactos.org/svn/reactos?rev=58986&view=rev
Log: [Win32k] - ATI fixup CORE-6551. - Giannis Adamopoulos fragment patch 18. Modified: trunk/reactos/include/reactos/undocuser.h trunk/reactos/win32ss/user/ntuser/event.c trunk/reactos/win32ss/user/ntuser/focus.c trunk/reactos/win32ss/user/ntuser/hook.c trunk/reactos/win32ss/user/ntuser/keyboard.c trunk/reactos/win32ss/user/ntuser/main.c trunk/reactos/win32ss/user/ntuser/message.c trunk/reactos/win32ss/user/ntuser/misc.c trunk/reactos/win32ss/user/ntuser/msgqueue.c trunk/reactos/win32ss/user/ntuser/msgqueue.h trunk/reactos/win32ss/user/ntuser/painting.c trunk/reactos/win32ss/user/ntuser/simplecall.c trunk/reactos/win32ss/user/ntuser/timer.c trunk/reactos/win32ss/user/ntuser/win32.h trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/include/reactos/undocuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/undocuser.…
============================================================================== --- trunk/reactos/include/reactos/undocuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/undocuser.h [iso-8859-1] Fri May 10 22:28:18 2013 @@ -76,6 +76,10 @@ /* Non SDK Queue state flags. */ #define QS_SMRESULT 0x8000 /* see "Undoc. Windows" */ +// +#define QS_EVENT 0x2000 +#define QS_SYSEVENT (QS_EVENT|QS_SENDMESSAGE) +// // // Definitions used by WM_CLIENTSHUTDOWN Modified: trunk/reactos/win32ss/user/ntuser/event.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/event.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/event.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/event.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -113,7 +113,7 @@ /* FIXME: Should get timeout from * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */ - Status = co_MsqSendMessage( pEH->head.pti->MessageQueue, + Status = co_MsqSendMessage( pEH->head.pti, hwnd, event, 0, Modified: trunk/reactos/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -296,18 +296,18 @@ VOID FASTCALL FindRemoveAsyncMsg(PWND Wnd) { - PUSER_MESSAGE_QUEUE MessageQueue; + PTHREADINFO pti; PUSER_SENT_MESSAGE Message; PLIST_ENTRY Entry; if (!Wnd) return; - MessageQueue = Wnd->head.pti->MessageQueue; - - if (!IsListEmpty(&MessageQueue->SentMessagesListHead)) + pti = Wnd->head.pti; + + if (!IsListEmpty(&pti->SentMessagesListHead)) { // Scan sent queue messages to see if we received async messages. - Entry = MessageQueue->SentMessagesListHead.Flink; + Entry = pti->SentMessagesListHead.Flink; Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); do { @@ -321,7 +321,7 @@ Entry = Message->ListEntry.Flink; Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); } - while (Entry != &MessageQueue->SentMessagesListHead); + while (Entry != &pti->SentMessagesListHead); } } @@ -787,7 +787,7 @@ } } - hWndPrev = MsqSetStateWindow(ThreadQueue, MSQ_STATE_CAPTURE, hWnd); + hWndPrev = MsqSetStateWindow(pti, MSQ_STATE_CAPTURE, hWnd); if (hWndPrev) { @@ -815,8 +815,8 @@ MOUSEINPUT mi; /// These are HACKS! /* Also remove other windows if not capturing anymore */ - MsqSetStateWindow(ThreadQueue, MSQ_STATE_MENUOWNER, NULL); - MsqSetStateWindow(ThreadQueue, MSQ_STATE_MOVESIZE, NULL); + MsqSetStateWindow(pti, MSQ_STATE_MENUOWNER, NULL); + MsqSetStateWindow(pti, MSQ_STATE_MOVESIZE, NULL); /// /* Somebody may have missed some mouse movements */ mi.dx = 0; Modified: trunk/reactos/win32ss/user/ntuser/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/hook.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/hook.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/hook.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -295,7 +295,7 @@ /* FIXME: Should get timeout from * HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */ - Status = co_MsqSendMessage( pti->MessageQueue, + Status = co_MsqSendMessage( pti, IntToPtr(Code), // hWnd Hook->HookId, // Msg wParam, Modified: trunk/reactos/win32ss/user/ntuser/keyboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/keyboa…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/keyboard.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/keyboard.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -763,6 +763,7 @@ { WORD wSimpleVk = 0, wFixedVk, wVk2; PUSER_MESSAGE_QUEUE pFocusQueue; + PTHREADINFO pti; BOOL bExt = (dwFlags & KEYEVENTF_EXTENDEDKEY) ? TRUE : FALSE; BOOL bIsDown = (dwFlags & KEYEVENTF_KEYUP) ? FALSE : TRUE; BOOL bPacket = (dwFlags & KEYEVENTF_UNICODE) ? TRUE : FALSE; @@ -872,6 +873,14 @@ // Focus can be null so going with Active. WM_SYSKEYXXX last wine Win test_keyboard_input. Wnd = pFocusQueue->spwndActive; } + + if ( !Wnd || Wnd->state2 & WNDS2_INDESTROY || Wnd->state & WNDS_DESTROYED ) + { + ERR("ProcessKeyEvent Active Focus window is dead!\n"); + return FALSE; + } + + pti = Wnd->head.pti; /* Init message */ Msg.hwnd = UserHMGetHandle(Wnd); @@ -900,7 +909,7 @@ /* Post a keyboard message */ TRACE("Posting keyboard msg %u wParam 0x%x lParam 0x%x\n", Msg.message, Msg.wParam, Msg.lParam); - MsqPostMessage(pFocusQueue, &Msg, TRUE, QS_KEY, 0); + MsqPostMessage(pti, &Msg, TRUE, QS_KEY, 0); } return TRUE; @@ -913,7 +922,6 @@ PKL pKl = NULL; PKBDTABLES pKbdTbl; PUSER_MESSAGE_QUEUE pFocusQueue; - struct _ETHREAD *pFocusThread; LARGE_INTEGER LargeTickCount; DWORD dwTime; BOOL bExt = (pKbdInput->dwFlags & KEYEVENTF_EXTENDEDKEY) ? TRUE : FALSE; @@ -923,11 +931,9 @@ /* Find the target thread whose locale is in effect */ pFocusQueue = IntGetFocusMessageQueue(); - if (pFocusQueue) - { - pFocusThread = pFocusQueue->Thread; - if (pFocusThread && pFocusThread->Tcb.Win32Thread) - pKl = ((PTHREADINFO)pFocusThread->Tcb.Win32Thread)->KeyboardLayout; + if (pFocusQueue && pFocusQueue->ptiOwner) + { + pKl = pFocusQueue->ptiOwner->KeyboardLayout; } if (!pKl) @@ -997,7 +1003,6 @@ PKL pKl = NULL; PKBDTABLES pKbdTbl; PUSER_MESSAGE_QUEUE pFocusQueue; - struct _ETHREAD *pFocusThread; /* Calculate scan code with prefix */ wScanCode = pKbdInputData->MakeCode & 0x7F; @@ -1009,11 +1014,9 @@ /* Find the target thread whose locale is in effect */ pFocusQueue = IntGetFocusMessageQueue(); - if (pFocusQueue) - { - pFocusThread = pFocusQueue->Thread; - if (pFocusThread && pFocusThread->Tcb.Win32Thread) - pKl = ((PTHREADINFO)pFocusThread->Tcb.Win32Thread)->KeyboardLayout; + if (pFocusQueue && pFocusQueue->ptiOwner) + { + pKl = pFocusQueue->ptiOwner->KeyboardLayout; } if (!pKl) @@ -1121,7 +1124,7 @@ NewMsg.message = (lpMsg->message == WM_KEYDOWN) ? WM_CHAR : WM_SYSCHAR; NewMsg.wParam = HIWORD(lpMsg->lParam); NewMsg.lParam = LOWORD(lpMsg->lParam); - MsqPostMessage(pti->MessageQueue, &NewMsg, FALSE, QS_KEY, 0); + MsqPostMessage(pti, &NewMsg, FALSE, QS_KEY, 0); return TRUE; } @@ -1150,7 +1153,7 @@ { TRACE("Msg: %x '%lc' (%04x) %08x\n", NewMsg.message, wch[i], wch[i], NewMsg.lParam); NewMsg.wParam = wch[i]; - MsqPostMessage(pti->MessageQueue, &NewMsg, FALSE, QS_KEY, 0); + MsqPostMessage(pti, &NewMsg, FALSE, QS_KEY, 0); } bResult = TRUE; } Modified: trunk/reactos/win32ss/user/ntuser/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/main.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/main.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -254,6 +254,7 @@ int i; NTSTATUS Status = STATUS_SUCCESS; PTEB pTeb; + LARGE_INTEGER LargeTickCount; Process = Thread->ThreadsProcess; @@ -281,8 +282,13 @@ TRACE_CH(UserThread, "Allocated pti 0x%p for TID %p\n", ptiCurrent, Thread->Cid.UniqueThread); /* Initialize the THREADINFO */ + IntReferenceThreadInfo(ptiCurrent); InitializeListHead(&ptiCurrent->WindowListHead); InitializeListHead(&ptiCurrent->W32CallbackListHead); + InitializeListHead(&ptiCurrent->PostedMessagesListHead); + InitializeListHead(&ptiCurrent->SentMessagesListHead); + InitializeListHead(&ptiCurrent->DispatchingMessagesHead); + InitializeListHead(&ptiCurrent->LocalDispatchingMessagesHead); InitializeListHead(&ptiCurrent->PtiLink); for (i = 0; i < NB_HOOKS; i++) { @@ -293,6 +299,27 @@ ptiCurrent->ptiSibling = ptiCurrent->ppi->ptiList; ptiCurrent->ppi->ptiList = ptiCurrent; ptiCurrent->ppi->cThreads++; + + ptiCurrent->hEventQueueClient = NULL; + Status = ZwCreateEvent(&ptiCurrent->hEventQueueClient, EVENT_ALL_ACCESS, + NULL, SynchronizationEvent, FALSE); + if (!NT_SUCCESS(Status)) + { + goto error; + } + Status = ObReferenceObjectByHandle(ptiCurrent->hEventQueueClient, 0, + ExEventObjectType, KernelMode, + (PVOID*)&ptiCurrent->pEventQueueServer, NULL); + if (!NT_SUCCESS(Status)) + { + ZwClose(ptiCurrent->hEventQueueClient); + ptiCurrent->hEventQueueClient = NULL; + goto error; + } + + KeQueryTickCount(&LargeTickCount); + ptiCurrent->timeLast = LargeTickCount.u.LowPart; + ptiCurrent->MessageQueue = MsqCreateMessageQueue(ptiCurrent); if(ptiCurrent->MessageQueue == NULL) { @@ -400,6 +427,35 @@ ERR_CH(UserThread,"UserCreateThreadInfo failed! Freeing pti 0x%p for TID %p\n", ptiCurrent, Thread->Cid.UniqueThread); UserDestroyThreadInfo(Thread); return Status; +} + +/* + Called from IntDereferenceThreadInfo. + */ +VOID +FASTCALL +UserDeleteW32Thread(PTHREADINFO pti) +{ + if (!pti->RefCount) + { + ERR_CH(UserThread,"UserDeleteW32Thread pti 0x%p\n",pti); + if (pti->hEventQueueClient != NULL) + ZwClose(pti->hEventQueueClient); + pti->hEventQueueClient = NULL; + + /* Free the message queue */ + if (pti->MessageQueue) + { + MsqDestroyMessageQueue(pti); + } + + MsqCleanupThreadMsgs(pti); + + IntSetThreadDesktop(NULL, TRUE); + + PsSetThreadWin32Thread(pti->pEThread, NULL); + ExFreePoolWithTag(pti, USERTAG_THREADINFO); + } } NTSTATUS @@ -439,7 +495,7 @@ if (ptiCurrent->pqAttach && ptiCurrent->MessageQueue) { PTHREADINFO ptiTo; - ptiTo = PsGetThreadWin32Thread(ptiCurrent->MessageQueue->Thread); + ptiTo = ptiCurrent->MessageQueue->ptiOwner; TRACE_CH(UserThread,"Attached Thread ptiFrom is getting switched!\n"); if (ptiTo) UserAttachThreadInput( ptiCurrent, ptiTo, FALSE); else @@ -487,7 +543,7 @@ HOOK_DestroyThreadHooks(Thread); EVENT_DestroyThreadEvents(Thread); DestroyTimersForThread(ptiCurrent); - KeSetEvent(ptiCurrent->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE); + KeSetEvent(ptiCurrent->pEventQueueServer, IO_NO_INCREMENT, FALSE); UnregisterThreadHotKeys(Thread); /* if (IsListEmpty(&ptiCurrent->WindowListHead)) @@ -520,12 +576,6 @@ } } - /* Free the message queue */ - if (ptiCurrent->MessageQueue) - { - MsqDestroyMessageQueue(ptiCurrent); - } - /* Find the THREADINFO in the PROCESSINFO's list */ ppti = &ppiCurrent->ptiList; while (*ppti != NULL && *ppti != ptiCurrent) @@ -547,8 +597,7 @@ TRACE_CH(UserThread,"Freeing pti 0x%p\n", ptiCurrent); /* Free the THREADINFO */ - PsSetThreadWin32Thread(Thread, NULL); - ExFreePoolWithTag(ptiCurrent, USERTAG_THREADINFO); + IntDereferenceThreadInfo(ptiCurrent); return STATUS_SUCCESS; } Modified: trunk/reactos/win32ss/user/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/messag…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/message.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -508,7 +508,7 @@ ForegroundQueue = IntGetFocusMessageQueue(); if (ForegroundQueue) - ptiForeground = ForegroundQueue->Thread->Tcb.Win32Thread; + ptiForeground = ForegroundQueue->ptiOwner; pti = PsGetCurrentThreadWin32Thread(); @@ -762,22 +762,15 @@ { PTHREADINFO pti; LARGE_INTEGER LargeTickCount; - PUSER_MESSAGE_QUEUE ThreadQueue; BOOL RemoveMessages; UINT ProcessMask; BOOL Hit = FALSE; pti = PsGetCurrentThreadWin32Thread(); - ThreadQueue = pti->MessageQueue; RemoveMessages = RemoveMsg & PM_REMOVE; ProcessMask = HIWORD(RemoveMsg); - - if (ThreadQueue->ptiSysLock && ThreadQueue->ptiSysLock != pti) - { - ERR("PeekMessage: Thread Q 0x%p is locked 0x%p to another pti 0x%p!\n", ThreadQueue, ThreadQueue->ptiSysLock, pti ); - } - + /* Hint, "If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed)". */ if (!ProcessMask) ProcessMask = (QS_ALLPOSTMESSAGE|QS_ALLINPUT); @@ -787,11 +780,11 @@ do { KeQueryTickCount(&LargeTickCount); - ThreadQueue->LastMsgRead = LargeTickCount.u.LowPart; + pti->timeLast = LargeTickCount.u.LowPart; pti->pcti->tickLastMsgChecked = LargeTickCount.u.LowPart; /* Dispatch sent messages here. */ - while ( co_MsqDispatchOneSentMessage(ThreadQueue) ) + while ( co_MsqDispatchOneSentMessage(pti) ) { /* if some PM_QS* flags were specified, only handle sent messages from now on */ if (HIWORD(RemoveMsg) && !bGMSG) Hit = TRUE; // wine does this; ProcessMask = QS_SENDMESSAGE; @@ -816,7 +809,7 @@ /* Now check for normal messages. */ if (( (ProcessMask & QS_POSTMESSAGE) || (ProcessMask & QS_HOTKEY) ) && - MsqPeekMessage( ThreadQueue, + MsqPeekMessage( pti, RemoveMessages, Window, MsgFilterMin, @@ -828,18 +821,18 @@ } /* Now look for a quit message. */ - if (ThreadQueue->QuitPosted) + if (pti->QuitPosted) { /* According to the PSDK, WM_QUIT messages are always returned, regardless of the filter specified */ Msg->hwnd = NULL; Msg->message = WM_QUIT; - Msg->wParam = ThreadQueue->QuitExitCode; + Msg->wParam = pti->exitCode; Msg->lParam = 0; if (RemoveMessages) { - ThreadQueue->QuitPosted = FALSE; - ClearMsgBitsMask(ThreadQueue, QS_POSTMESSAGE); + pti->QuitPosted = FALSE; + ClearMsgBitsMask(pti, QS_POSTMESSAGE); pti->pcti->fsWakeBits &= ~QS_ALLPOSTMESSAGE; pti->pcti->fsChangeBits &= ~QS_ALLPOSTMESSAGE; } @@ -848,7 +841,7 @@ /* Check for hardware events. */ if ((ProcessMask & QS_MOUSE) && - co_MsqPeekMouseMove( ThreadQueue, + co_MsqPeekMouseMove( pti, RemoveMessages, Window, MsgFilterMin, @@ -859,7 +852,7 @@ } if ((ProcessMask & QS_INPUT) && - co_MsqPeekHardwareMessage( ThreadQueue, + co_MsqPeekHardwareMessage( pti, RemoveMessages, Window, MsgFilterMin, @@ -871,7 +864,7 @@ } /* Check for sent messages again. */ - while ( co_MsqDispatchOneSentMessage(ThreadQueue) ) + while ( co_MsqDispatchOneSentMessage(pti) ) { if (HIWORD(RemoveMsg) && !bGMSG) Hit = TRUE; } @@ -912,12 +905,10 @@ UINT MsgFilterMax ) { PTHREADINFO pti; - PUSER_MESSAGE_QUEUE ThreadQueue; NTSTATUS Status = STATUS_SUCCESS; MSG Msg; pti = PsGetCurrentThreadWin32Thread(); - ThreadQueue = pti->MessageQueue; do { @@ -932,7 +923,7 @@ } /* Nothing found. Wait for new messages. */ - Status = co_MsqWaitForNewMessages( ThreadQueue, + Status = co_MsqWaitForNewMessages( pti, Window, MsgFilterMin, MsgFilterMax); @@ -1027,7 +1018,7 @@ if ( bGMSG ) { - Status = co_MsqWaitForNewMessages( pti->MessageQueue, + Status = co_MsqWaitForNewMessages( pti, Window, MsgFilterMin, MsgFilterMax); @@ -1105,7 +1096,7 @@ KeQueryTickCount(&LargeTickCount); Message.time = MsqCalculateMessageTime(&LargeTickCount); - MsqPostMessage(pThread->MessageQueue, &Message, FALSE, QS_POSTMESSAGE, 0); + MsqPostMessage(pThread, &Message, FALSE, QS_POSTMESSAGE, 0); ObDereferenceObject( peThread ); return TRUE; } @@ -1224,11 +1215,11 @@ if (WM_QUIT == Msg) { - MsqPostQuitMessage(Window->head.pti->MessageQueue, wParam); + MsqPostQuitMessage(Window->head.pti, wParam); } else { - MsqPostMessage(Window->head.pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE, 0); + MsqPostMessage(Window->head.pti, &Message, FALSE, QS_POSTMESSAGE, 0); } } return TRUE; @@ -1279,7 +1270,7 @@ Win32Thread = PsGetCurrentThreadWin32Thread(); if ( Win32Thread && - Window->head.pti->MessageQueue == Win32Thread->MessageQueue) + Window->head.pti == Win32Thread) { if (Win32Thread->TIF_flags & TIF_INCLEANUP) { @@ -1365,7 +1356,7 @@ RETURN( TRUE); } - if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue)) + if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti)) { // FIXME: Set window hung and add to a list. /* FIXME: Set a LastError? */ @@ -1381,7 +1372,7 @@ do { - Status = co_MsqSendMessage( Window->head.pti->MessageQueue, + Status = co_MsqSendMessage( Window->head.pti, hWnd, Msg, wParam, @@ -1393,7 +1384,7 @@ } while ((STATUS_TIMEOUT == Status) && (uFlags & SMTO_NOTIMEOUTIFNOTHUNG) && - !MsqIsHung(Window->head.pti->MessageQueue)); // FIXME: Set window hung and add to a list. + !MsqIsHung(Window->head.pti)); // FIXME: Set window hung and add to a list. if (STATUS_TIMEOUT == Status) { @@ -1553,7 +1544,7 @@ } if (Msg & 0x80000000 && - Window->head.pti->MessageQueue == Win32Thread->MessageQueue) + Window->head.pti == Win32Thread) { if (Win32Thread->TIF_flags & TIF_INCLEANUP) RETURN( FALSE); @@ -1574,14 +1565,14 @@ lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam); } - if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->head.pti->MessageQueue != Win32Thread->MessageQueue))) + if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->head.pti != Win32Thread))) { ERR("Failed to pack message parameters\n"); RETURN( FALSE); } /* If it can be sent now, then send it. */ - if (Window->head.pti->MessageQueue == Win32Thread->MessageQueue) + if (Window->head.pti == Win32Thread) { if (Win32Thread->TIF_flags & TIF_INCLEANUP) { @@ -1631,7 +1622,7 @@ } } - if (Window->head.pti->MessageQueue == Win32Thread->MessageQueue) + if (Window->head.pti == Win32Thread) { if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE))) { @@ -1645,12 +1636,6 @@ ERR("MsqSendMessage(): Not enough memory to allocate a message"); RETURN( FALSE); } - - IntReferenceMessageQueue(Window->head.pti->MessageQueue); - /* Take reference on this MessageQueue if its a callback. It will be released - when message is processed or removed from target hwnd MessageQueue */ - if (CompletionCallback) - IntReferenceMessageQueue(Win32Thread->MessageQueue); Message->Msg.hwnd = hWnd; Message->Msg.message = Msg; @@ -1660,8 +1645,9 @@ Message->Result = 0; Message->lResult = 0; Message->QS_Flags = 0; - Message->SenderQueue = NULL; // mjmartin, you are right! This is null. - Message->CallBackSenderQueue = Win32Thread->MessageQueue; + Message->ptiReceiver = Window->head.pti; + Message->ptiSender = NULL; // mjmartin, you are right! This is null. + Message->ptiCallBackSender = Win32Thread; Message->DispatchingListEntry.Flink = NULL; Message->CompletionCallback = CompletionCallback; Message->CompletionCallbackContext = CompletionCallbackContext; @@ -1669,9 +1655,11 @@ Message->HasPackedLParam = (lParamBufferSize > 0); Message->QS_Flags = QS_SENDMESSAGE; - InsertTailList(&Window->head.pti->MessageQueue->SentMessagesListHead, &Message->ListEntry); - MsqWakeQueue(Window->head.pti->MessageQueue, QS_SENDMESSAGE, TRUE); - IntDereferenceMessageQueue(Window->head.pti->MessageQueue); + if (Msg & 0x80000000) // Higher priority event message! + InsertHeadList(&Window->head.pti->SentMessagesListHead, &Message->ListEntry); + else + InsertTailList(&Window->head.pti->SentMessagesListHead, &Message->ListEntry); + MsqWakeQueue(Window->head.pti, QS_SENDMESSAGE, TRUE); RETURN(TRUE); @@ -2351,7 +2339,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } co_IntSendMessageTimeout( List[i], @@ -2406,7 +2394,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } UserPostMessage(List[i], Msg, wParam, lParam); @@ -2432,7 +2420,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } UserSendNotifyMessage(List[i], Msg, wParam, lParam); @@ -2489,7 +2477,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } co_IntSendMessageTimeout( List[i], @@ -2543,7 +2531,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } UserPostMessage(List[i], Msg, wParam, lParam); @@ -2569,7 +2557,7 @@ if ( parm.flags & BSF_IGNORECURRENTTASK ) { - if ( pwnd->head.pti->MessageQueue == gptiCurrent->MessageQueue ) + if ( pwnd->head.pti == gptiCurrent ) continue; } UserSendNotifyMessage(List[i], Msg, wParam, lParam); @@ -2812,7 +2800,7 @@ Handles[0] = Process; Handles[1] = W32Process->InputIdleEvent; - Handles[2] = pti->MessageQueue->NewMessages; // pEventQueueServer; IntMsqSetWakeMask returns hEventQueueClient + Handles[2] = pti->pEventQueueServer; // IntMsqSetWakeMask returns hEventQueueClient if (!Handles[1]) { Modified: trunk/reactos/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -188,7 +188,7 @@ ret = ISMEX_NOSEND; if (Message) { - if (Message->SenderQueue) + if (Message->ptiSender) ret = ISMEX_SEND; else { @@ -213,7 +213,7 @@ LARGE_INTEGER LargeTickCount; pti = PsGetCurrentThreadWin32Thread(); KeQueryTickCount(&LargeTickCount); - pti->MessageQueue->LastMsgRead = LargeTickCount.u.LowPart; + pti->timeLast = LargeTickCount.u.LowPart; pti->pcti->tickLastMsgChecked = LargeTickCount.u.LowPart; } break; Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -347,7 +347,6 @@ IntMsqSetWakeMask(DWORD WakeMask) { PTHREADINFO Win32Thread; - PUSER_MESSAGE_QUEUE MessageQueue; HANDLE MessageEventHandle; DWORD dwFlags = HIWORD(WakeMask); @@ -355,9 +354,8 @@ if (Win32Thread == NULL || Win32Thread->MessageQueue == NULL) return 0; - MessageQueue = Win32Thread->MessageQueue; // Win32Thread->pEventQueueServer; IntMsqSetWakeMask returns Win32Thread->hEventQueueClient - MessageEventHandle = MessageQueue->NewMessagesHandle; + MessageEventHandle = Win32Thread->hEventQueueClient; if (Win32Thread->pcti) { @@ -365,7 +363,7 @@ ( (dwFlags & MWMO_INPUTAVAILABLE) && (Win32Thread->pcti->fsWakeBits & LOWORD(WakeMask)) ) ) { ERR("Chg 0x%x Wake 0x%x Mask 0x%x\n",Win32Thread->pcti->fsChangeBits, Win32Thread->pcti->fsWakeBits, WakeMask); - KeSetEvent(MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE); // Wake it up! + KeSetEvent(Win32Thread->pEventQueueServer, IO_NO_INCREMENT, FALSE); // Wake it up! return MessageEventHandle; } } @@ -396,55 +394,64 @@ and even if the bits are all cleared. The same as cTimers/cPaintsReady. I think this is the best solution... (jt) */ VOID FASTCALL -MsqWakeQueue(PUSER_MESSAGE_QUEUE Queue, DWORD MessageBits, BOOL KeyEvent) -{ - PTHREADINFO pti; +MsqWakeQueue(PTHREADINFO pti, DWORD MessageBits, BOOL KeyEvent) +{ + PUSER_MESSAGE_QUEUE Queue; + + Queue = pti->MessageQueue; if (Queue->QF_flags & QF_INDESTROY) { ERR("This Message Queue is in Destroy!\n"); } - pti = Queue->Thread->Tcb.Win32Thread; + pti->pcti->fsWakeBits |= MessageBits; pti->pcti->fsChangeBits |= MessageBits; // Start bit accounting to help clear the main set of bits. - if (MessageBits & QS_KEY) Queue->nCntsQBits[QSRosKey]++; - if (MessageBits & QS_MOUSEMOVE) Queue->nCntsQBits[QSRosMouseMove]++; - if (MessageBits & QS_MOUSEBUTTON) Queue->nCntsQBits[QSRosMouseButton]++; - if (MessageBits & QS_POSTMESSAGE) Queue->nCntsQBits[QSRosPostMessage]++; - if (MessageBits & QS_SENDMESSAGE) Queue->nCntsQBits[QSRosSendMessage]++; - if (MessageBits & QS_HOTKEY) Queue->nCntsQBits[QSRosHotKey]++; + if (MessageBits & QS_KEY) + { + pti->nCntsQBits[QSRosKey]++; + } + if (MessageBits & QS_MOUSE) + { + if (MessageBits & QS_MOUSEMOVE) pti->nCntsQBits[QSRosMouseMove]++; + if (MessageBits & QS_MOUSEBUTTON) pti->nCntsQBits[QSRosMouseButton]++; + } + if (MessageBits & QS_POSTMESSAGE) pti->nCntsQBits[QSRosPostMessage]++; + if (MessageBits & QS_SENDMESSAGE) pti->nCntsQBits[QSRosSendMessage]++; + if (MessageBits & QS_HOTKEY) pti->nCntsQBits[QSRosHotKey]++; + if (MessageBits & QS_EVENT) pti->nCntsQBits[QSRosEvent]++; if (KeyEvent) - KeSetEvent(Queue->NewMessages, IO_NO_INCREMENT, FALSE); + KeSetEvent(pti->pEventQueueServer, IO_NO_INCREMENT, FALSE); } VOID FASTCALL -ClearMsgBitsMask(PUSER_MESSAGE_QUEUE Queue, UINT MessageBits) -{ - PTHREADINFO pti; +ClearMsgBitsMask(PTHREADINFO pti, UINT MessageBits) +{ + PUSER_MESSAGE_QUEUE Queue; UINT ClrMask = 0; - pti = Queue->Thread->Tcb.Win32Thread; + Queue = pti->MessageQueue; if (MessageBits & QS_KEY) { - if (--Queue->nCntsQBits[QSRosKey] == 0) ClrMask |= QS_KEY; + if (--pti->nCntsQBits[QSRosKey] == 0) ClrMask |= QS_KEY; } if (MessageBits & QS_MOUSEMOVE) // ReactOS hard coded. { // Account for tracking mouse moves.. - if (--Queue->nCntsQBits[QSRosMouseMove] == 0) ClrMask |= QS_MOUSEMOVE; + if (--pti->nCntsQBits[QSRosMouseMove] == 0) ClrMask |= QS_MOUSEMOVE; // Handle mouse move bits here. if (Queue->MouseMoved) ClrMask |= QS_MOUSEMOVE; } if (MessageBits & QS_MOUSEBUTTON) { - if (--Queue->nCntsQBits[QSRosMouseButton] == 0) ClrMask |= QS_MOUSEBUTTON; + if (--pti->nCntsQBits[QSRosMouseButton] == 0) ClrMask |= QS_MOUSEBUTTON; } if (MessageBits & QS_POSTMESSAGE) { - if (--Queue->nCntsQBits[QSRosPostMessage] == 0) ClrMask |= QS_POSTMESSAGE; + if (--pti->nCntsQBits[QSRosPostMessage] == 0) ClrMask |= QS_POSTMESSAGE; } if (MessageBits & QS_TIMER) // ReactOS hard coded. { // Handle timer bits here. @@ -462,11 +469,11 @@ } if (MessageBits & QS_SENDMESSAGE) { - if (--Queue->nCntsQBits[QSRosSendMessage] == 0) ClrMask |= QS_SENDMESSAGE; + if (--pti->nCntsQBits[QSRosSendMessage] == 0) ClrMask |= QS_SENDMESSAGE; } if (MessageBits & QS_HOTKEY) { - if (--Queue->nCntsQBits[QSRosHotKey] == 0) ClrMask |= QS_HOTKEY; + if (--pti->nCntsQBits[QSRosHotKey] == 0) ClrMask |= QS_HOTKEY; } pti->pcti->fsWakeBits &= ~ClrMask; @@ -474,26 +481,24 @@ } VOID FASTCALL -MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue) -{ - PTHREADINFO pti; - pti = Queue->Thread->Tcb.Win32Thread; +MsqIncPaintCountQueue(PTHREADINFO pti) +{ pti->cPaintsReady++; - MsqWakeQueue(Queue, QS_PAINT, TRUE); + MsqWakeQueue(pti, QS_PAINT, TRUE); } VOID FASTCALL -MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue) -{ - ClearMsgBitsMask(Queue, QS_PAINT); +MsqDecPaintCountQueue(PTHREADINFO pti) +{ + ClearMsgBitsMask(pti, QS_PAINT); } VOID FASTCALL -MsqPostMouseMove(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg) -{ - MessageQueue->MouseMoveMsg = *Msg; - MessageQueue->MouseMoved = TRUE; - MsqWakeQueue(MessageQueue, QS_MOUSEMOVE, TRUE); +MsqPostMouseMove(PTHREADINFO pti, MSG* Msg) +{ + pti->MessageQueue->MouseMoveMsg = *Msg; + pti->MessageQueue->MouseMoved = TRUE; + MsqWakeQueue(pti, QS_MOUSEMOVE, TRUE); } VOID FASTCALL @@ -504,6 +509,7 @@ PDESKTOP pDesk; PWND pwnd, pwndDesktop; HDC hdcScreen; + PTHREADINFO pti; PUSER_MESSAGE_QUEUE MessageQueue; PSYSTEM_CURSORINFO CurInfo; @@ -564,9 +570,10 @@ /* Check if we found a window */ if (Msg->hwnd != NULL && pwnd != NULL) { - MessageQueue = pwnd->head.pti->MessageQueue; - - if ( pwnd->head.pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags & QF_INDESTROY) + pti = pwnd->head.pti; + MessageQueue = pti->MessageQueue; + + if ( pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags & QF_INDESTROY) { ERR("Mouse is over the Window Thread is Dead!\n"); return; @@ -617,12 +624,12 @@ gpqCursor = MessageQueue; /* Mouse move is a special case */ - MsqPostMouseMove(MessageQueue, Msg); + MsqPostMouseMove(pti, Msg); } else { TRACE("Posting mouse message to hwnd=0x%x!\n", UserHMGetHandle(pwnd)); - MsqPostMessage(MessageQueue, Msg, TRUE, QS_MOUSEBUTTON, 0); + MsqPostMessage(pti, Msg, TRUE, QS_MOUSEBUTTON, 0); } } else if (hdcScreen) @@ -675,7 +682,7 @@ KeQueryTickCount(&LargeTickCount); Mesg.time = MsqCalculateMessageTime(&LargeTickCount); Mesg.pt = gpsi->ptCursor; - MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, Type, 0); + MsqPostMessage(Window->head.pti, &Mesg, FALSE, Type, 0); UserDereferenceObject(Window); ObDereferenceObject (Thread); @@ -704,41 +711,38 @@ } BOOLEAN FASTCALL -co_MsqDispatchOneSentMessage(_In_ PUSER_MESSAGE_QUEUE MessageQueue) +co_MsqDispatchOneSentMessage(_In_ PTHREADINFO pti) { PUSER_SENT_MESSAGE SaveMsg, Message; PLIST_ENTRY Entry; - PTHREADINFO pti; BOOL Ret; LRESULT Result = 0; - if (IsListEmpty(&MessageQueue->SentMessagesListHead)) + if (IsListEmpty(&pti->SentMessagesListHead)) { return(FALSE); } /* remove it from the list of pending messages */ - Entry = RemoveHeadList(&MessageQueue->SentMessagesListHead); + Entry = RemoveHeadList(&pti->SentMessagesListHead); Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); - - pti = MessageQueue->Thread->Tcb.Win32Thread; SaveMsg = pti->pusmCurrent; pti->pusmCurrent = Message; // Processing a message sent to it from another thread. - if ( ( Message->SenderQueue && MessageQueue != Message->SenderQueue) || - ( Message->CallBackSenderQueue && MessageQueue != Message->CallBackSenderQueue )) + if ( ( Message->ptiSender && pti != Message->ptiSender) || + ( Message->ptiCallBackSender && pti != Message->ptiCallBackSender )) { // most likely, but, to be sure. pti->pcti->CTI_flags |= CTI_INSENDMESSAGE; // Let the user know... } /* insert it to the list of messages that are currently dispatched by this message queue */ - InsertTailList(&MessageQueue->LocalDispatchingMessagesHead, + InsertTailList(&pti->LocalDispatchingMessagesHead, &Message->ListEntry); - ClearMsgBitsMask(MessageQueue, Message->QS_Flags); + ClearMsgBitsMask(pti, Message->QS_Flags); if (Message->HookMessage == MSQ_ISHOOK) { // Direct Hook Call processor @@ -761,7 +765,7 @@ Message->Msg.wParam); } else if ((Message->CompletionCallback) && - (Message->CallBackSenderQueue == MessageQueue)) + (Message->ptiCallBackSender == pti)) { /* Call the callback routine */ if (Message->QS_Flags & QS_SMRESULT) { @@ -777,7 +781,7 @@ { /* The message has not been processed yet, reinsert it. */ RemoveEntryList(&Message->ListEntry); - InsertTailList(&Message->CallBackSenderQueue->SentMessagesListHead, &Message->ListEntry); + InsertTailList(&Message->ptiCallBackSender->SentMessagesListHead, &Message->ListEntry); TRACE("Callback Message not processed yet. Requeuing the message\n"); Ret = FALSE; goto Exit; @@ -798,22 +802,21 @@ /* If the message is a callback, insert it in the callback senders MessageQueue */ if (Message->CompletionCallback) { - if (Message->CallBackSenderQueue) + if (Message->ptiCallBackSender) { Message->lResult = Result; Message->QS_Flags |= QS_SMRESULT; /* insert it in the callers message queue */ - InsertTailList(&Message->CallBackSenderQueue->SentMessagesListHead, &Message->ListEntry); - MsqWakeQueue(Message->CallBackSenderQueue, QS_SENDMESSAGE, TRUE); - IntDereferenceMessageQueue(Message->CallBackSenderQueue); + InsertTailList(&Message->ptiCallBackSender->SentMessagesListHead, &Message->ListEntry); + MsqWakeQueue(Message->ptiCallBackSender, QS_SENDMESSAGE, TRUE); } Ret = TRUE; goto Exit; } /* remove the message from the dispatching list if needed, so lock the sender's message queue */ - if (Message->SenderQueue) + if (Message->ptiSender) { if (Message->DispatchingListEntry.Flink != NULL) { @@ -845,14 +848,6 @@ if (Message->CompletionEvent != NULL) { KeSetEvent(Message->CompletionEvent, IO_NO_INCREMENT, FALSE); - } - - /* if the message has a sender */ - if (Message->SenderQueue) - { - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(Message->SenderQueue); - IntDereferenceMessageQueue(MessageQueue); } /* free the message */ @@ -867,22 +862,20 @@ } VOID APIENTRY -MsqRemoveWindowMessagesFromQueue(PVOID pWindow) -{ +MsqRemoveWindowMessagesFromQueue(PWND Window) +{ + PTHREADINFO pti; PUSER_SENT_MESSAGE SentMessage; PUSER_MESSAGE PostedMessage; - PUSER_MESSAGE_QUEUE MessageQueue; PLIST_ENTRY CurrentEntry, ListHead; - PWND Window = pWindow; ASSERT(Window); - MessageQueue = Window->head.pti->MessageQueue; - ASSERT(MessageQueue); + pti = Window->head.pti; /* remove the posted messages for this window */ - CurrentEntry = MessageQueue->PostedMessagesListHead.Flink; - ListHead = &MessageQueue->PostedMessagesListHead; + CurrentEntry = pti->PostedMessagesListHead.Flink; + ListHead = &pti->PostedMessagesListHead; while (CurrentEntry != ListHead) { PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, @@ -890,9 +883,9 @@ if (PostedMessage->Msg.hwnd == Window->head.h) { RemoveEntryList(&PostedMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, PostedMessage->QS_Flags); + ClearMsgBitsMask(pti, PostedMessage->QS_Flags); MsqDestroyMessage(PostedMessage); - CurrentEntry = MessageQueue->PostedMessagesListHead.Flink; + CurrentEntry = pti->PostedMessagesListHead.Flink; } else { @@ -900,12 +893,9 @@ } } - /* Reference we message queue, so it won't get deleted */ - IntReferenceMessageQueue(MessageQueue); - /* remove the sent messages for this window */ - CurrentEntry = MessageQueue->SentMessagesListHead.Flink; - ListHead = &MessageQueue->SentMessagesListHead; + CurrentEntry = pti->SentMessagesListHead.Flink; + ListHead = &pti->SentMessagesListHead; while (CurrentEntry != ListHead) { SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, @@ -915,15 +905,10 @@ TRACE("Notify the sender and remove a message from the queue that had not been dispatched\n"); RemoveEntryList(&SentMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, SentMessage->QS_Flags); - - /* if it is a callback and this queue is not the sender queue, dereference queue */ - if ((SentMessage->CompletionCallback) && (SentMessage->CallBackSenderQueue != MessageQueue)) - { - IntDereferenceMessageQueue(SentMessage->CallBackSenderQueue); - } + ClearMsgBitsMask(pti, SentMessage->QS_Flags); + /* Only if the message has a sender was the queue referenced */ - if ((SentMessage->SenderQueue) + if ((SentMessage->ptiSender) && (SentMessage->DispatchingListEntry.Flink != NULL)) { RemoveEntryList(&SentMessage->DispatchingListEntry); @@ -941,27 +926,16 @@ ExFreePool((PVOID)SentMessage->Msg.lParam); } - /* if the message has a sender */ - if (SentMessage->SenderQueue) - { - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(SentMessage->SenderQueue); - } - /* free the message */ ExFreePoolWithTag(SentMessage, TAG_USRMSG); - CurrentEntry = MessageQueue->SentMessagesListHead.Flink; + CurrentEntry = pti->SentMessagesListHead.Flink; } else { CurrentEntry = CurrentEntry->Flink; } } - - /* Remove the reference we added */ - IntDereferenceMessageQueue(MessageQueue); } BOOL FASTCALL @@ -1000,8 +974,9 @@ Message->CompletionEvent = NULL; Message->Result = 0; Message->lResult = 0; - Message->SenderQueue = NULL; - Message->CallBackSenderQueue = ptiSender->MessageQueue; + Message->ptiReceiver = ptiReceiver; + Message->ptiSender = NULL; + Message->ptiCallBackSender = ptiSender; Message->DispatchingListEntry.Flink = NULL; Message->CompletionCallback = CompletionCallback; Message->CompletionCallbackContext = CompletionCallbackContext; @@ -1009,33 +984,29 @@ Message->HasPackedLParam = HasPackedLParam; Message->QS_Flags = QS_SENDMESSAGE; - InsertTailList(&ptiReceiver->MessageQueue->SentMessagesListHead, &Message->ListEntry); - MsqWakeQueue(ptiReceiver->MessageQueue, QS_SENDMESSAGE, TRUE); - IntDereferenceMessageQueue(ptiReceiver->MessageQueue); + InsertTailList(&ptiReceiver->SentMessagesListHead, &Message->ListEntry); + MsqWakeQueue(ptiReceiver, QS_SENDMESSAGE, TRUE); return TRUE; } NTSTATUS FASTCALL -co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, +co_MsqSendMessage(PTHREADINFO ptirec, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uTimeout, BOOL Block, INT HookMessage, ULONG_PTR *uResult) { - PTHREADINFO pti, ptirec; + PTHREADINFO pti; PUSER_SENT_MESSAGE Message; KEVENT CompletionEvent; NTSTATUS WaitStatus; - PUSER_MESSAGE_QUEUE ThreadQueue; LARGE_INTEGER Timeout; PLIST_ENTRY Entry; PWND pWnd; LRESULT Result = 0; //// Result could be trashed. //// pti = PsGetCurrentThreadWin32Thread(); - ThreadQueue = pti->MessageQueue; - ptirec = MessageQueue->Thread->Tcb.Win32Thread; - ASSERT(ThreadQueue != MessageQueue); + ASSERT(pti != ptirec); ASSERT(ptirec->pcti); // Send must have a client side to receive it!!!! /* Don't send from or to a dying thread */ @@ -1105,24 +1076,22 @@ Message->Result = &Result; Message->lResult = 0; Message->QS_Flags = 0; - Message->SenderQueue = ThreadQueue; - Message->CallBackSenderQueue = NULL; - IntReferenceMessageQueue(ThreadQueue); + Message->ptiReceiver = ptirec; + Message->ptiSender = pti; + Message->ptiCallBackSender = NULL; Message->CompletionCallback = NULL; Message->CompletionCallbackContext = 0; Message->HookMessage = HookMessage; Message->HasPackedLParam = FALSE; - IntReferenceMessageQueue(MessageQueue); - /* Add it to the list of pending messages */ - InsertTailList(&ThreadQueue->DispatchingMessagesHead, &Message->DispatchingListEntry); + InsertTailList(&pti->DispatchingMessagesHead, &Message->DispatchingListEntry); /* Queue it in the destination's message queue */ - InsertTailList(&MessageQueue->SentMessagesListHead, &Message->ListEntry); + InsertTailList(&ptirec->SentMessagesListHead, &Message->ListEntry); Message->QS_Flags = QS_SENDMESSAGE; - MsqWakeQueue(MessageQueue, QS_SENDMESSAGE, TRUE); + MsqWakeQueue(ptirec, QS_SENDMESSAGE, TRUE); /* We can't access the Message anymore since it could have already been deleted! */ @@ -1140,8 +1109,8 @@ { /* Look up if the message has not yet dispatched, if so make sure it can't pass a result and it must not set the completion event anymore */ - Entry = MessageQueue->SentMessagesListHead.Flink; - while (Entry != &MessageQueue->SentMessagesListHead) + Entry = ptirec->SentMessagesListHead.Flink; + while (Entry != &ptirec->SentMessagesListHead) { if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry) == Message) @@ -1157,8 +1126,8 @@ /* Remove from the local dispatching list so the other thread knows, it can't pass a result and it must not set the completion event anymore */ - Entry = ThreadQueue->DispatchingMessagesHead.Flink; - while (Entry != &ThreadQueue->DispatchingMessagesHead) + Entry = pti->DispatchingMessagesHead.Flink; + while (Entry != &pti->DispatchingMessagesHead) { if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry) == Message) @@ -1178,7 +1147,7 @@ TRACE("MsqSendMessage (blocked) timed out 1\n"); } - while (co_MsqDispatchOneSentMessage(ThreadQueue)) + while (co_MsqDispatchOneSentMessage(ptirec)) ; } else @@ -1186,7 +1155,7 @@ PVOID WaitObjects[2]; WaitObjects[0] = &CompletionEvent; - WaitObjects[1] = ThreadQueue->NewMessages; + WaitObjects[1] = pti->pEventQueueServer; do { UserLeaveCo(); @@ -1200,8 +1169,8 @@ { /* Look up if the message has not yet been dispatched, if so make sure it can't pass a result and it must not set the completion event anymore */ - Entry = MessageQueue->SentMessagesListHead.Flink; - while (Entry != &MessageQueue->SentMessagesListHead) + Entry = ptirec->SentMessagesListHead.Flink; + while (Entry != &ptirec->SentMessagesListHead) { if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry) == Message) @@ -1217,8 +1186,8 @@ /* Remove from the local dispatching list so the other thread knows, it can't pass a result and it must not set the completion event anymore */ - Entry = ThreadQueue->DispatchingMessagesHead.Flink; - while (Entry != &ThreadQueue->DispatchingMessagesHead) + Entry = pti->DispatchingMessagesHead.Flink; + while (Entry != &pti->DispatchingMessagesHead) { if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry) == Message) @@ -1239,7 +1208,7 @@ TRACE("MsqSendMessage timed out 2\n"); break; } - while (co_MsqDispatchOneSentMessage(ThreadQueue)) + while (co_MsqDispatchOneSentMessage(pti)) ; } while (NT_SUCCESS(WaitStatus) && STATUS_WAIT_0 != WaitStatus); @@ -1252,27 +1221,30 @@ } VOID FASTCALL -MsqPostMessage(PUSER_MESSAGE_QUEUE MessageQueue, +MsqPostMessage(PTHREADINFO pti, MSG* Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent) { PUSER_MESSAGE Message; + PUSER_MESSAGE_QUEUE MessageQueue; if(!(Message = MsqCreateMessage(Msg))) { return; } + MessageQueue = pti->MessageQueue; + if (dwQEvent) { - InsertHeadList(&MessageQueue->PostedMessagesListHead, + InsertHeadList(&pti->PostedMessagesListHead, &Message->ListEntry); } else if (!HardwareMessage) { - InsertTailList(&MessageQueue->PostedMessagesListHead, + InsertTailList(&pti->PostedMessagesListHead, &Message->ListEntry); } else @@ -1284,15 +1256,15 @@ Message->dwQEvent = dwQEvent; Message->QS_Flags = MessageBits; //Message->pti = pti; Fixed in ATI changes. See CORE-6551 - MsqWakeQueue(MessageQueue, MessageBits, (MessageBits & QS_TIMER ? FALSE : TRUE)); + MsqWakeQueue(pti, MessageBits, (MessageBits & QS_TIMER ? FALSE : TRUE)); } VOID FASTCALL -MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode) -{ - MessageQueue->QuitPosted = TRUE; - MessageQueue->QuitExitCode = ExitCode; - MsqWakeQueue(MessageQueue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE, TRUE); +MsqPostQuitMessage(PTHREADINFO pti, ULONG ExitCode) +{ + pti->QuitPosted = TRUE; + pti->exitCode = ExitCode; + MsqWakeQueue(pti, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE, TRUE); } /*********************************************************************** @@ -1719,7 +1691,7 @@ } BOOL APIENTRY -co_MsqPeekMouseMove(IN PUSER_MESSAGE_QUEUE MessageQueue, +co_MsqPeekMouseMove(IN PTHREADINFO pti, IN BOOL Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -1728,7 +1700,7 @@ { BOOL AcceptMessage; MSG msg; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue; if(!(MessageQueue->MouseMoved)) return FALSE; @@ -1754,7 +1726,7 @@ if(Remove) { - ClearMsgBitsMask(MessageQueue, QS_MOUSEMOVE); + ClearMsgBitsMask(pti, QS_MOUSEMOVE); MessageQueue->MouseMoved = FALSE; } @@ -1781,7 +1753,7 @@ } BOOL APIENTRY -co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, +co_MsqPeekHardwareMessage(IN PTHREADINFO pti, IN BOOL Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -1795,7 +1767,7 @@ PLIST_ENTRY ListHead, CurrentEntry = NULL; MSG msg; BOOL Ret = FALSE; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + PUSER_MESSAGE_QUEUE MessageQueue = pti->MessageQueue; if (!filter_contains_hw_range( MsgFilterLow, MsgFilterHigh )) return FALSE; @@ -1843,7 +1815,7 @@ if (Remove) { RemoveEntryList(&CurrentMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, CurrentMessage->QS_Flags); + ClearMsgBitsMask(pti, CurrentMessage->QS_Flags); MsqDestroyMessage(CurrentMessage); } @@ -1865,7 +1837,7 @@ } BOOLEAN APIENTRY -MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, +MsqPeekMessage(IN PTHREADINFO pti, IN BOOLEAN Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -1877,25 +1849,12 @@ PUSER_MESSAGE CurrentMessage; PLIST_ENTRY ListHead; BOOL Ret = FALSE; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - - CurrentEntry = MessageQueue->PostedMessagesListHead.Flink; - ListHead = &MessageQueue->PostedMessagesListHead; + + CurrentEntry = pti->PostedMessagesListHead.Flink; + ListHead = &pti->PostedMessagesListHead; if (IsListEmpty(CurrentEntry)) return FALSE; - - if (!MessageQueue->ptiSysLock) - { - MessageQueue->ptiSysLock = pti; - pti->pcti->CTI_flags |= CTI_THREADSYSLOCK; - } - - if (MessageQueue->ptiSysLock != pti) - { - ERR("MsqPeekMessage: Thread Q is locked to another pti!\n"); - return FALSE; - } - + CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); do @@ -1920,7 +1879,7 @@ if (Remove) { RemoveEntryList(&CurrentMessage->ListEntry); - ClearMsgBitsMask(MessageQueue, CurrentMessage->QS_Flags); + ClearMsgBitsMask(pti, CurrentMessage->QS_Flags); MsqDestroyMessage(CurrentMessage); } Ret = TRUE; @@ -1931,18 +1890,16 @@ } while (CurrentEntry != ListHead); - MessageQueue->ptiSysLock = NULL; - pti->pcti->CTI_flags &= ~CTI_THREADSYSLOCK; return Ret; } NTSTATUS FASTCALL -co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter, +co_MsqWaitForNewMessages(PTHREADINFO pti, PWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax) { NTSTATUS ret; UserLeaveCo(); - ret = KeWaitForSingleObject( MessageQueue->NewMessages, + ret = KeWaitForSingleObject( pti->pEventQueueServer, UserRequest, UserMode, FALSE, @@ -1952,12 +1909,12 @@ } BOOL FASTCALL -MsqIsHung(PUSER_MESSAGE_QUEUE MessageQueue) +MsqIsHung(PTHREADINFO pti) { LARGE_INTEGER LargeTickCount; KeQueryTickCount(&LargeTickCount); - return ((LargeTickCount.u.LowPart - MessageQueue->LastMsgRead) > MSQ_HUNG); + return ((LargeTickCount.u.LowPart - pti->timeLast) > MSQ_HUNG); } VOID @@ -1972,83 +1929,46 @@ BOOLEAN FASTCALL MsqInitializeMessageQueue(PTHREADINFO pti, PUSER_MESSAGE_QUEUE MessageQueue) { - struct _ETHREAD *Thread; - LARGE_INTEGER LargeTickCount; - NTSTATUS Status; - - Thread = pti->pEThread; - MessageQueue->Thread = Thread; + MessageQueue->ptiOwner = pti; MessageQueue->CaretInfo = (PTHRDCARETINFO)(MessageQueue + 1); - InitializeListHead(&MessageQueue->PostedMessagesListHead); - InitializeListHead(&MessageQueue->SentMessagesListHead); InitializeListHead(&MessageQueue->HardwareMessagesListHead); - InitializeListHead(&MessageQueue->DispatchingMessagesHead); - InitializeListHead(&MessageQueue->LocalDispatchingMessagesHead); - MessageQueue->QuitPosted = FALSE; - MessageQueue->QuitExitCode = 0; - KeQueryTickCount(&LargeTickCount); - MessageQueue->LastMsgRead = LargeTickCount.u.LowPart; MessageQueue->spwndFocus = NULL; - MessageQueue->NewMessagesHandle = NULL; MessageQueue->iCursorLevel = 0; MessageQueue->CursorObject = NULL; RtlCopyMemory(MessageQueue->afKeyState, gafAsyncKeyState, sizeof(gafAsyncKeyState)); - - Status = ZwCreateEvent(&MessageQueue->NewMessagesHandle, EVENT_ALL_ACCESS, - NULL, SynchronizationEvent, FALSE); - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - - Status = ObReferenceObjectByHandle(MessageQueue->NewMessagesHandle, 0, - ExEventObjectType, KernelMode, - (PVOID*)&MessageQueue->NewMessages, NULL); - if (!NT_SUCCESS(Status)) - { - ZwClose(MessageQueue->NewMessagesHandle); - MessageQueue->NewMessagesHandle = NULL; - return FALSE; - } + MessageQueue->ptiMouse = pti; + MessageQueue->ptiKeyboard = pti; + MessageQueue->cThreads++; return TRUE; } VOID FASTCALL -MsqCleanupMessageQueue(PTHREADINFO pti) -{ - PUSER_MESSAGE_QUEUE MessageQueue; +MsqCleanupThreadMsgs(PTHREADINFO pti) +{ PLIST_ENTRY CurrentEntry; PUSER_MESSAGE CurrentMessage; PUSER_SENT_MESSAGE CurrentSentMessage; - - MessageQueue = pti->MessageQueue; - + /* cleanup posted messages */ - while (!IsListEmpty(&MessageQueue->PostedMessagesListHead)) - { - CurrentEntry = RemoveHeadList(&MessageQueue->PostedMessagesListHead); + while (!IsListEmpty(&pti->PostedMessagesListHead)) + { + CurrentEntry = RemoveHeadList(&pti->PostedMessagesListHead); CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); MsqDestroyMessage(CurrentMessage); } /* remove the messages that have not yet been dispatched */ - while (!IsListEmpty(&MessageQueue->SentMessagesListHead)) - { - CurrentEntry = RemoveHeadList(&MessageQueue->SentMessagesListHead); + while (!IsListEmpty(&pti->SentMessagesListHead)) + { + CurrentEntry = RemoveHeadList(&pti->SentMessagesListHead); CurrentSentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); - /* if it is a callback and this queue is not the sender queue, dereference queue */ - if ((CurrentSentMessage->CompletionCallback) && (CurrentSentMessage->CallBackSenderQueue != MessageQueue)) - { - IntDereferenceMessageQueue(CurrentSentMessage->CallBackSenderQueue); - } - TRACE("Notify the sender and remove a message from the queue that had not been dispatched\n"); /* Only if the message has a sender was the message in the DispatchingList */ - if ((CurrentSentMessage->SenderQueue) + if ((CurrentSentMessage->ptiSender) && (CurrentSentMessage->DispatchingListEntry.Flink != NULL)) { RemoveEntryList(&CurrentSentMessage->DispatchingListEntry); @@ -2065,32 +1985,18 @@ if (CurrentSentMessage->Msg.lParam) ExFreePool((PVOID)CurrentSentMessage->Msg.lParam); } - - /* if the message has a sender */ - if (CurrentSentMessage->SenderQueue) - { - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); - } - + /* free the message */ ExFreePool(CurrentSentMessage); } /* notify senders of dispatching messages. This needs to be cleaned up if e.g. ExitThread() was called in a SendMessage() umode callback */ - while (!IsListEmpty(&MessageQueue->LocalDispatchingMessagesHead)) - { - CurrentEntry = RemoveHeadList(&MessageQueue->LocalDispatchingMessagesHead); + while (!IsListEmpty(&pti->LocalDispatchingMessagesHead)) + { + CurrentEntry = RemoveHeadList(&pti->LocalDispatchingMessagesHead); CurrentSentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); - - /* if it is a callback and this queue is not the sender queue, dereference queue */ - if ((CurrentSentMessage->CompletionCallback) && (CurrentSentMessage->CallBackSenderQueue != MessageQueue)) - { - IntDereferenceMessageQueue(CurrentSentMessage->CallBackSenderQueue); - } /* remove the message from the dispatching list */ if(CurrentSentMessage->DispatchingListEntry.Flink != NULL) @@ -2112,22 +2018,14 @@ ExFreePool((PVOID)CurrentSentMessage->Msg.lParam); } - /* if the message has a sender */ - if (CurrentSentMessage->SenderQueue) - { - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); - } - /* free the message */ ExFreePool(CurrentSentMessage); } /* tell other threads not to bother returning any info to us */ - while (! IsListEmpty(&MessageQueue->DispatchingMessagesHead)) - { - CurrentEntry = RemoveHeadList(&MessageQueue->DispatchingMessagesHead); + while (! IsListEmpty(&pti->DispatchingMessagesHead)) + { + CurrentEntry = RemoveHeadList(&pti->DispatchingMessagesHead); CurrentSentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, DispatchingListEntry); CurrentSentMessage->CompletionEvent = NULL; @@ -2144,12 +2042,27 @@ pti->pcti->fsChangeBits = 0; } - MessageQueue->nCntsQBits[QSRosKey] = 0; - MessageQueue->nCntsQBits[QSRosMouseMove] = 0; - MessageQueue->nCntsQBits[QSRosMouseButton] = 0; - MessageQueue->nCntsQBits[QSRosPostMessage] = 0; - MessageQueue->nCntsQBits[QSRosSendMessage] = 0; - MessageQueue->nCntsQBits[QSRosHotKey] = 0; + pti->nCntsQBits[QSRosKey] = 0; + pti->nCntsQBits[QSRosMouseMove] = 0; + pti->nCntsQBits[QSRosMouseButton] = 0; + pti->nCntsQBits[QSRosPostMessage] = 0; + pti->nCntsQBits[QSRosSendMessage] = 0; + pti->nCntsQBits[QSRosHotKey] = 0; + +} + +VOID FASTCALL +MsqCleanupMessageQueue(PTHREADINFO pti) +{ + PUSER_MESSAGE_QUEUE MessageQueue; + + MessageQueue = pti->MessageQueue; + MessageQueue->cThreads--; + + if (MessageQueue->cThreads) + { + if (MessageQueue->ptiSysLock == pti) MessageQueue->ptiSysLock = NULL; + } if (MessageQueue->CursorObject) { @@ -2171,6 +2084,19 @@ UserDereferenceObject(pCursor); } + + if (gpqForeground == MessageQueue) + { + IntSetFocusMessageQueue(NULL); + } + if (gpqForegroundPrev == MessageQueue) + { + gpqForegroundPrev = NULL; + } + if (gpqCursor == MessageQueue) + { + gpqCursor = NULL; + } } PUSER_MESSAGE_QUEUE FASTCALL @@ -2218,9 +2144,6 @@ /* clean it up */ MsqCleanupMessageQueue(pti); - if (MessageQueue->NewMessagesHandle != NULL) - ZwClose(MessageQueue->NewMessagesHandle); - MessageQueue->NewMessagesHandle = NULL; /* decrease the reference counter, if it hits zero, the queue will be freed */ IntDereferenceMessageQueue(MessageQueue); } @@ -2276,7 +2199,7 @@ if (Message->QS_Flags & QS_SMRESULT) return FALSE; // SendMessageXxx || Callback msg and not a notify msg - if (Message->SenderQueue || Message->CompletionCallback) + if (Message->ptiSender || Message->CompletionCallback) { Message->lResult = lResult; Message->QS_Flags |= QS_SMRESULT; @@ -2286,9 +2209,12 @@ } HWND FASTCALL -MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, HWND hWnd) +MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd) { HWND Prev; + PUSER_MESSAGE_QUEUE MessageQueue; + + MessageQueue = pti->MessageQueue; switch(Type) { Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] Fri May 10 22:28:18 2013 @@ -5,18 +5,6 @@ #define MSQ_ISHOOK 1 #define MSQ_ISEVENT 2 #define MSQ_INJECTMODULE 3 - -#define QSIDCOUNTS 6 - -typedef enum _QS_ROS_TYPES -{ - QSRosKey = 0, - QSRosMouseMove, - QSRosMouseButton, - QSRosPostMessage, - QSRosSendMessage, - QSRosHotKey, -}QS_ROS_TYPES,*PQS_ROS_TYPES; typedef struct _USER_MESSAGE { @@ -38,9 +26,10 @@ PKEVENT CompletionEvent; LRESULT* Result; LRESULT lResult; - struct _USER_MESSAGE_QUEUE* SenderQueue; - struct _USER_MESSAGE_QUEUE* CallBackSenderQueue; + PTHREADINFO ptiSender; + PTHREADINFO ptiReceiver; SENDASYNCPROC CompletionCallback; + PTHREADINFO ptiCallBackSender; ULONG_PTR CompletionCallbackContext; /* entry in the dispatching list of the sender's message queue */ LIST_ENTRY DispatchingListEntry; @@ -53,13 +42,16 @@ /* Reference counter, only access this variable with interlocked functions! */ LONG References; + PTHREADINFO ptiOwner; // temp.. + /* Desktop that the message queue is attached to */ + struct _DESKTOP *Desktop; + PTHREADINFO ptiSysLock; /* Owner of the message queue */ - struct _ETHREAD *Thread; - /* Queue of messages sent to the queue. */ - LIST_ENTRY SentMessagesListHead; - /* Queue of messages posted to the queue. */ - LIST_ENTRY PostedMessagesListHead; +// struct _ETHREAD *Thread; + PTHREADINFO ptiMouse; + PTHREADINFO ptiKeyboard; + /* Queue for hardware messages for the queue. */ LIST_ENTRY HardwareMessagesListHead; /* True if a WM_MOUSEMOVE is pending */ @@ -68,16 +60,6 @@ MSG MouseMoveMsg; /* Last click message for translating double clicks */ MSG msgDblClk; - /* True if a WM_QUIT message is pending. */ - BOOLEAN QuitPosted; - /* The quit exit code. */ - ULONG QuitExitCode; - /* Set if there are new messages specified by WakeMask in any of the queues. */ - PKEVENT NewMessages; - /* Handle for the above event (in the context of the process owning the queue). */ - HANDLE NewMessagesHandle; - /* Last time PeekMessage() was called. */ - ULONG LastMsgRead; /* Current capture window for this queue. */ PWND spwndCapture; /* Current window with focus (ie. receives keyboard input) for this queue. */ @@ -97,13 +79,6 @@ DWORD QF_flags; DWORD cThreads; // Shared message queue counter. - /* Queue state tracking */ - // Send list QS_SENDMESSAGE - // Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY - // Hard list QS_MOUSE|QS_KEY only - // Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information. - DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY - /* Extra message information */ LPARAM ExtraInfo; @@ -116,13 +91,6 @@ /* Cursor object */ PCURICON_OBJECT CursorObject; - /* Messages that are currently dispatched by other threads */ - LIST_ENTRY DispatchingMessagesHead; - /* Messages that are currently dispatched by this message queue, required for cleanup */ - LIST_ENTRY LocalDispatchingMessagesHead; - - /* Desktop that the message queue is attached to */ - struct _DESKTOP *Desktop; } USER_MESSAGE_QUEUE, *PUSER_MESSAGE_QUEUE; #define QF_UPDATEKEYSTATE 0x00000001 @@ -152,17 +120,17 @@ WM_ASYNC_SETACTIVEWINDOW }; -BOOL FASTCALL MsqIsHung(PUSER_MESSAGE_QUEUE MessageQueue); +BOOL FASTCALL MsqIsHung(PTHREADINFO pti); VOID CALLBACK HungAppSysTimerProc(HWND,UINT,UINT_PTR,DWORD); -NTSTATUS FASTCALL co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, +NTSTATUS FASTCALL co_MsqSendMessage(PTHREADINFO ptirec, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uTimeout, BOOL Block, INT HookMessage, ULONG_PTR *uResult); PUSER_MESSAGE FASTCALL MsqCreateMessage(LPMSG Msg); VOID FASTCALL MsqDestroyMessage(PUSER_MESSAGE Message); -VOID FASTCALL MsqPostMessage(PUSER_MESSAGE_QUEUE, MSG*, BOOLEAN, DWORD, DWORD); -VOID FASTCALL MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode); +VOID FASTCALL MsqPostMessage(PTHREADINFO, MSG*, BOOLEAN, DWORD, DWORD); +VOID FASTCALL MsqPostQuitMessage(PTHREADINFO pti, ULONG ExitCode); BOOLEAN APIENTRY -MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, +MsqPeekMessage(IN PTHREADINFO pti, IN BOOLEAN Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -170,7 +138,7 @@ IN UINT QSflags, OUT PMSG Message); BOOL APIENTRY -co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue, +co_MsqPeekHardwareMessage(IN PTHREADINFO pti, IN BOOL Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -178,7 +146,7 @@ IN UINT QSflags, OUT MSG* pMsg); BOOL APIENTRY -co_MsqPeekMouseMove(IN PUSER_MESSAGE_QUEUE MessageQueue, +co_MsqPeekMouseMove(IN PTHREADINFO pti, IN BOOL Remove, IN PWND Window, IN UINT MsgFilterLow, @@ -186,14 +154,15 @@ OUT MSG* pMsg); BOOLEAN FASTCALL MsqInitializeMessageQueue(PTHREADINFO, PUSER_MESSAGE_QUEUE); PUSER_MESSAGE_QUEUE FASTCALL MsqCreateMessageQueue(PTHREADINFO); +VOID FASTCALL MsqCleanupThreadMsgs(PTHREADINFO); VOID FASTCALL MsqDestroyMessageQueue(PTHREADINFO); INIT_FUNCTION NTSTATUS NTAPI MsqInitializeImpl(VOID); -BOOLEAN FASTCALL co_MsqDispatchOneSentMessage(_In_ PUSER_MESSAGE_QUEUE MessageQueue); +BOOLEAN FASTCALL co_MsqDispatchOneSentMessage(PTHREADINFO pti); NTSTATUS FASTCALL -co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter, +co_MsqWaitForNewMessages(PTHREADINFO pti, PWND WndFilter, UINT MsgFilterMin, UINT MsgFilterMax); -VOID FASTCALL MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue); -VOID FASTCALL MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue); +VOID FASTCALL MsqIncPaintCountQueue(PTHREADINFO); +VOID FASTCALL MsqDecPaintCountQueue(PTHREADINFO); LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); LRESULT FASTCALL co_IntPostOrSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); LRESULT FASTCALL @@ -235,13 +204,13 @@ VOID FASTCALL co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook); BOOL FASTCALL MsqIsClkLck(LPMSG Msg, BOOL Remove); BOOL FASTCALL MsqIsDblClk(LPMSG Msg, BOOL Remove); -HWND FASTCALL MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, HWND hWnd); +HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd); BOOL APIENTRY IntInitMessagePumpHook(VOID); BOOL APIENTRY IntUninitMessagePumpHook(VOID); LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam); LPARAM FASTCALL MsqGetMessageExtraInfo(VOID); -VOID APIENTRY MsqRemoveWindowMessagesFromQueue(PVOID pWindow); /* F*(&$ headers, will be gone in the rewrite! */ +VOID APIENTRY MsqRemoveWindowMessagesFromQueue(PWND pWindow); #define IntReferenceMessageQueue(MsgQueue) \ InterlockedIncrement(&(MsgQueue)->References) @@ -250,9 +219,7 @@ do { \ if(InterlockedDecrement(&(MsgQueue)->References) == 0) \ { \ - TRACE("Free message queue 0x%p\n", (MsgQueue)); \ - if ((MsgQueue)->NewMessages != NULL) \ - ObDereferenceObject((MsgQueue)->NewMessages); \ + ERR("Free message queue 0x%p\n", (MsgQueue)); \ ExFreePoolWithTag((MsgQueue), USERTAG_Q); \ } \ } while(0) @@ -289,8 +256,8 @@ VOID FASTCALL IdlePing(VOID); VOID FASTCALL IdlePong(VOID); BOOL FASTCALL co_MsqReplyMessage(LRESULT); -VOID FASTCALL MsqWakeQueue(PUSER_MESSAGE_QUEUE,DWORD,BOOL); -VOID FASTCALL ClearMsgBitsMask(PUSER_MESSAGE_QUEUE,UINT); +VOID FASTCALL MsqWakeQueue(PTHREADINFO,DWORD,BOOL); +VOID FASTCALL ClearMsgBitsMask(PTHREADINFO,UINT); int UserShowCursor(BOOL bShow); PCURICON_OBJECT Modified: trunk/reactos/win32ss/user/ntuser/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -97,13 +97,12 @@ VOID FASTCALL IntSendSyncPaint(PWND Wnd, ULONG Flags) { - PTHREADINFO ptiCur; - PUSER_MESSAGE_QUEUE MessageQueue; + PTHREADINFO ptiCur, ptiWnd; PUSER_SENT_MESSAGE Message; PLIST_ENTRY Entry; BOOL bSend = TRUE; - MessageQueue = Wnd->head.pti->MessageQueue; + ptiWnd = Wnd->head.pti; ptiCur = PsGetCurrentThreadWin32Thread(); /* Not the current thread, Wnd is in send Nonclient paint also in send erase background and it is visiable. @@ -115,10 +114,10 @@ { // For testing, if you see this, break out the Champagne and have a party! ERR("SendSyncPaint Wnd in State!\n"); - if (!IsListEmpty(&MessageQueue->SentMessagesListHead)) + if (!IsListEmpty(&ptiWnd->SentMessagesListHead)) { // Scan sent queue messages to see if we received sync paint messages. - Entry = MessageQueue->SentMessagesListHead.Flink; + Entry = ptiWnd->SentMessagesListHead.Flink; Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); do { @@ -133,7 +132,7 @@ Entry = Message->ListEntry.Flink; Message = CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry); } - while (Entry != &MessageQueue->SentMessagesListHead); + while (Entry != &ptiWnd->SentMessagesListHead); } if (bSend) { @@ -270,7 +269,7 @@ Window->state &= ~WNDS_UPDATEDIRTY; Window->hrgnUpdate = NULL; if (!(Window->state & WNDS_INTERNALPAINT)) - MsqDecPaintCountQueue(Window->head.pti->MessageQueue); + MsqDecPaintCountQueue(Window->head.pti); } } @@ -557,9 +556,9 @@ if (HadPaintMessage != IntIsWindowDirty(Wnd)) { if (HadPaintMessage) - MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue); + MsqDecPaintCountQueue(Wnd->head.pti); else - MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue); + MsqIncPaintCountQueue(Wnd->head.pti); } TRACE("IntInvalidateWindows exit\n"); } @@ -781,7 +780,7 @@ { PaintWnd->state &= ~WNDS_INTERNALPAINT; if (!PaintWnd->hrgnUpdate) - MsqDecPaintCountQueue(Thread->MessageQueue); + MsqDecPaintCountQueue(Thread); } PaintWnd->state2 &= ~WNDS2_WMPAINTSENT; PaintWnd->state &= ~WNDS_UPDATEDIRTY; @@ -955,7 +954,7 @@ if (Window->hrgnUpdate != NULL) { - MsqDecPaintCountQueue(Window->head.pti->MessageQueue); + MsqDecPaintCountQueue(Window->head.pti); GdiGetClipBox(Ps->hdc, &Ps->rcPaint); IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED); /* The region is part of the dc now and belongs to the process! */ @@ -964,7 +963,7 @@ else { if (Window->state & WNDS_INTERNALPAINT) - MsqDecPaintCountQueue(Window->head.pti->MessageQueue); + MsqDecPaintCountQueue(Window->head.pti); IntGetClientRect(Window, &Ps->rcPaint); } Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -156,7 +156,7 @@ { PTHREADINFO pti; pti = PsGetCurrentThreadWin32Thread(); - MsqPostQuitMessage(pti->MessageQueue, Param); + MsqPostQuitMessage(pti, Param); RETURN(TRUE); } @@ -419,10 +419,9 @@ case TWOPARAM_ROUTINE_SETGUITHRDHANDLE: { - PUSER_MESSAGE_QUEUE MsgQueue = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->MessageQueue; - - ASSERT(MsgQueue); - RETURN( (DWORD_PTR)MsqSetStateWindow(MsgQueue, (ULONG)Param1, (HWND)Param2)); + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + ASSERT(pti->MessageQueue); + RETURN( (DWORD_PTR)MsqSetStateWindow(pti, (ULONG)Param1, (HWND)Param2)); } case TWOPARAM_ROUTINE_ENABLEWINDOW: Modified: trunk/reactos/win32ss/user/ntuser/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/timer.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/timer.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/timer.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -409,7 +409,7 @@ Msg.wParam = (WPARAM) pTmr->nID; Msg.lParam = (LPARAM) pTmr->pfn; - MsqPostMessage(ThreadQueue, &Msg, FALSE, QS_TIMER, 0); + MsqPostMessage(pti, &Msg, FALSE, QS_TIMER, 0); pTmr->flags &= ~TMRF_READY; pti->cTimersReady++; Hit = TRUE; @@ -484,8 +484,8 @@ // Set thread message queue for this timer. if (pTmr->pti->MessageQueue) { // Wakeup thread - ASSERT(pTmr->pti->MessageQueue->NewMessages != NULL); - KeSetEvent(pTmr->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE); + ASSERT(pTmr->pti->pEventQueueServer != NULL); + KeSetEvent(pTmr->pti->pEventQueueServer, IO_NO_INCREMENT, FALSE); } } } Modified: trunk/reactos/win32ss/user/ntuser/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/win32.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/win32.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/win32.h [iso-8859-1] Fri May 10 22:28:18 2013 @@ -32,8 +32,8 @@ #define W32PF_MANUALGUICHECK (0x02000000) #define W32PF_CREATEDWINORDC (0x04000000) #define W32PF_APIHOOKLOADED (0x08000000) -/* -#define QSIDCOUNTS 6 + +#define QSIDCOUNTS 7 typedef enum _QS_ROS_TYPES { @@ -43,8 +43,9 @@ QSRosPostMessage, QSRosSendMessage, QSRosHotKey, + QSRosEvent, }QS_ROS_TYPES,*PQS_ROS_TYPES; -*/ + extern BOOL ClientPfnInit; extern HINSTANCE hModClient; extern HANDLE hModuleWin; // This Win32k Instance. @@ -65,7 +66,7 @@ typedef struct _W32THREAD { PETHREAD pEThread; - ULONG RefCount; + LONG RefCount; PTL ptlW32; PVOID pgdiDcattr; PVOID pgdiBrushAttr; @@ -89,13 +90,18 @@ PCLIENTINFO pClientInfo; FLONG TIF_flags; PUNICODE_STRING pstrAppName; - LIST_ENTRY psmsSent; // DispatchingMessagesHead + /* Messages that are currently dispatched to other threads */ + LIST_ENTRY DispatchingMessagesHead; // psmsSent struct _USER_SENT_MESSAGE *pusmCurrent; - LIST_ENTRY psmsReceiveList; // SentMessagesListHead + /* Queue of messages sent to the queue. */ + LIST_ENTRY SentMessagesListHead; // psmsReceiveList + /* Last time PeekMessage() was called. */ LONG timeLast; ULONG_PTR idLast; + /* True if a WM_QUIT message is pending. */ BOOLEAN QuitPosted; - INT exitCode; // QuitExitCode + /* The quit exit code. */ + INT exitCode; HDESK hdesk; UINT cPaintsReady; /* Count of paints pending. */ UINT cTimersReady; /* Count of timers pending. */ @@ -109,26 +115,32 @@ LPARAM lParamHkCurrent; WPARAM wParamHkCurrent; struct tagSBTRACK* pSBTrack; - HANDLE hEventQueueClient; // NewMessagesHandle - PKEVENT pEventQueueServer; // NewMessages + /* Set if there are new messages specified by WakeMask in any of the queues. */ + HANDLE hEventQueueClient; + /* Handle for the above event (in the context of the process owning the queue). */ + PKEVENT pEventQueueServer; LIST_ENTRY PtiLink; INT iCursorLevel; POINT ptLast; - LIST_ENTRY mlPost; // PostedMessagesListHead - + /* Queue of messages posted to the queue. */ + LIST_ENTRY PostedMessagesListHead; // mlPost + + UINT cWindows; + UINT cVisWindows; LIST_ENTRY aphkStart[NB_HOOKS]; CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL. /* ReactOS */ - /* Queue state tracking */ + /* Thread Queue state tracking */ // Send list QS_SENDMESSAGE // Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY // Hard list QS_MOUSE|QS_KEY only // Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information. - //DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY - + DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY + + /* Messages that are currently dispatched by this message queue, required for cleanup */ LIST_ENTRY LocalDispatchingMessagesHead; LIST_ENTRY WindowListHead; LIST_ENTRY W32CallbackListHead; @@ -141,6 +153,22 @@ } THREADINFO; #include <poppack.h> + + +#define IntReferenceThreadInfo(pti) \ + InterlockedIncrement(&(pti)->RefCount) + +VOID FASTCALL UserDeleteW32Thread(PTHREADINFO); + +#define IntDereferenceThreadInfo(pti) \ + do { \ + if(InterlockedDecrement(&(pti)->RefCount) == 0) \ + { \ + ASSERT(pti->TIF_flags &= (TIF_INCLEANUP|TIF_DONTATTACHQUEUE) == (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)); \ + UserDeleteW32Thread(pti); \ + } \ + } while(0) + typedef struct _W32HEAP_USER_MAPPING { @@ -195,9 +223,9 @@ PTHREADINFO ptiList; PTHREADINFO ptiMainThread; struct _DESKTOP* rpdeskStartup; - PPROCESSINFO ppiNext; PCLS pclsPrivateList; PCLS pclsPublicList; + PPROCESSINFO ppiNext; INT cThreads; HDESK hdeskStartup; DWORD dwhmodLibLoadedMask; Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Fri May 10 22:28:18 2013 @@ -3779,7 +3779,7 @@ break; case QUERY_WINDOW_ISHUNG: - Result = (DWORD)MsqIsHung(pWnd->head.pti->MessageQueue); + Result = (DWORD)MsqIsHung(pWnd->head.pti); break; case QUERY_WINDOW_REAL_ID:
11 years, 7 months
1
0
0
0
[tkreuzer] 58985: [SCSIPORT] Fix a bug in size calculation that causes memory corruption on 64 bit Fix some MSVC/x64 warnings [UNIATA] Fix some MSVC/x64 warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 10 19:46:50 2013 New Revision: 58985 URL:
http://svn.reactos.org/svn/reactos?rev=58985&view=rev
Log: [SCSIPORT] Fix a bug in size calculation that causes memory corruption on 64 bit Fix some MSVC/x64 warnings [UNIATA] Fix some MSVC/x64 warnings Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/scsiport/scsiport.c Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Fri May 10 19:46:50 2013 @@ -10671,8 +10671,8 @@ // KdPrint(( "AtapiCheckRegValue: RegistryPath %ws\n", RegistryPath->Buffer)); paramPath.Length = 0; - paramPath.MaximumLength = RegistryPath->Length + - (wcslen(PathSuffix)+2)*sizeof(WCHAR); + paramPath.MaximumLength = (USHORT)(RegistryPath->Length + + (wcslen(PathSuffix)+2)*sizeof(WCHAR)); paramPath.Buffer = (PWCHAR)ExAllocatePool(NonPagedPool, paramPath.MaximumLength); if(!paramPath.Buffer) { KdPrint(("AtapiCheckRegValue: couldn't allocate paramPath\n")); Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
============================================================================== --- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Fri May 10 19:46:50 2013 @@ -623,8 +623,8 @@ { PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; SCSI_PHYSICAL_ADDRESS PhysicalAddress; - ULONG BufferLength = 0; - ULONG Offset; + SIZE_T BufferLength = 0; + ULONG_PTR Offset; PSCSI_SG_ADDRESS SGList; PSCSI_REQUEST_BLOCK_INFO SrbInfo; @@ -673,7 +673,7 @@ PhysicalAddress.QuadPart = (LONGLONG)(SP_UNINITIALIZED_VALUE); } - *Length = BufferLength; + *Length = (ULONG)BufferLength; return PhysicalAddress; } @@ -1034,6 +1034,7 @@ KIRQL OldIrql; PCM_RESOURCE_LIST ResourceList; BOOLEAN Conflict; + SIZE_T BusConfigSize; DPRINT ("ScsiPortInitialize() called!\n"); @@ -1635,10 +1636,11 @@ IoStartTimer(PortDeviceObject); /* Initialize bus scanning information */ + BusConfigSize = FIELD_OFFSET(BUSES_CONFIGURATION_INFORMATION, + BusScanInfo[DeviceExtension->PortConfig->NumberOfBuses]); DeviceExtension->BusesConfig = ExAllocatePoolWithTag(PagedPool, - sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses - + sizeof(ULONG), TAG_SCSIPORT); - + BusConfigSize, + TAG_SCSIPORT); if (!DeviceExtension->BusesConfig) { DPRINT1("Out of resources!\n"); @@ -1647,9 +1649,7 @@ } /* Zero it */ - RtlZeroMemory(DeviceExtension->BusesConfig, - sizeof(PVOID) * DeviceExtension->PortConfig->NumberOfBuses - + sizeof(ULONG)); + RtlZeroMemory(DeviceExtension->BusesConfig, BusConfigSize); /* Store number of buses there */ DeviceExtension->BusesConfig->NumberOfBuses = (UCHAR)DeviceExtension->BusNum; @@ -2622,6 +2622,7 @@ case SRB_FUNCTION_EXECUTE_SCSI: case SRB_FUNCTION_IO_CONTROL: + DPRINT(" SRB_FUNCTION_EXECUTE_SCSI or SRB_FUNCTION_IO_CONTROL\n"); /* Mark IRP as pending in all cases */ IoMarkIrpPending(Irp); @@ -4013,7 +4014,7 @@ BusData = &AdapterBusInfo->BusData[Bus]; /* Calculate and save an offset of the inquiry data */ - BusData->InquiryDataOffset = (PUCHAR)InquiryData - Buffer; + BusData->InquiryDataOffset = (ULONG)((PUCHAR)InquiryData - Buffer); /* Get a pointer to the LUN information structure */ LunInfo = DeviceExtension->BusesConfig->BusScanInfo[Bus]->LunInfo; @@ -4039,7 +4040,7 @@ InquiryData->InquiryDataLength = INQUIRYDATABUFFERSIZE; InquiryData->DeviceClaimed = LunInfo->DeviceClaimed; InquiryData->NextInquiryDataOffset = - (PUCHAR)InquiryData + InquiryDataSize - Buffer; + (ULONG)((PUCHAR)InquiryData + InquiryDataSize - Buffer); /* Copy data in it */ RtlCopyMemory(InquiryData->InquiryData, @@ -5364,7 +5365,7 @@ 0, REG_SZ, DriverName, - (wcslen(DriverName) + 1) * sizeof(WCHAR)); + (ULONG)((wcslen(DriverName) + 1) * sizeof(WCHAR))); if (!NT_SUCCESS(Status)) { DPRINT("ZwSetValueKey('Driver') failed (Status %lx)\n", Status); @@ -5557,7 +5558,7 @@ 0, REG_SZ, NameBuffer, - (wcslen(NameBuffer) + 1) * sizeof(WCHAR)); + (ULONG)((wcslen(NameBuffer) + 1) * sizeof(WCHAR))); if (!NT_SUCCESS(Status)) { DPRINT("ZwSetValueKey('Identifier') failed (Status %lx)\n", Status); @@ -5606,7 +5607,7 @@ 0, REG_SZ, TypeName, - (wcslen(TypeName) + 1) * sizeof(WCHAR)); + (ULONG)((wcslen(TypeName) + 1) * sizeof(WCHAR))); if (!NT_SUCCESS(Status)) { DPRINT("ZwSetValueKey('Type') failed (Status %lx)\n", Status);
11 years, 7 months
1
0
0
0
[tkreuzer] 58984: [FREELDR] Fix stack corruption.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 10 17:49:48 2013 New Revision: 58984 URL:
http://svn.reactos.org/svn/reactos?rev=58984&view=rev
Log: [FREELDR] Fix stack corruption. Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] Fri May 10 17:49:48 2013 @@ -69,7 +69,7 @@ { /* Create 'Configuration Data' value */ PartialResourceList = MmHeapAlloc(Size); - memset(&PartialResourceList, 0, Size); + memset(PartialResourceList, 0, Size); PartialResourceList->Version = 0; PartialResourceList->Revision = 0; PartialResourceList->Count = 0;
11 years, 7 months
1
0
0
0
[akhaldi] 58983: [PCMCIA] * Add some function annotations. * Properly mark some unreferenced parameters as such.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri May 10 10:30:21 2013 New Revision: 58983 URL:
http://svn.reactos.org/svn/reactos?rev=58983&view=rev
Log: [PCMCIA] * Add some function annotations. * Properly mark some unreferenced parameters as such. Modified: trunk/reactos/drivers/bus/pcmcia/fdo.c trunk/reactos/drivers/bus/pcmcia/pcmcia.c trunk/reactos/drivers/bus/pcmcia/pdo.c Modified: trunk/reactos/drivers/bus/pcmcia/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcmcia/fdo.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcmcia/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcmcia/fdo.c [iso-8859-1] Fri May 10 10:30:21 2013 @@ -16,7 +16,9 @@ PcmciaFdoPlugPlay(PPCMCIA_FDO_EXTENSION FdoExt, PIRP Irp) { - UNIMPLEMENTED + UNREFERENCED_PARAMETER(FdoExt); + + UNIMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); Modified: trunk/reactos/drivers/bus/pcmcia/pcmcia.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcmcia/pcmcia.…
============================================================================== --- trunk/reactos/drivers/bus/pcmcia/pcmcia.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcmcia/pcmcia.c [iso-8859-1] Fri May 10 10:30:21 2013 @@ -13,11 +13,15 @@ BOOLEAN IoctlEnabled; +DRIVER_DISPATCH PcmciaCreateClose; + NTSTATUS NTAPI PcmciaCreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + UNREFERENCED_PARAMETER(DeviceObject); + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; @@ -28,6 +32,8 @@ return STATUS_SUCCESS; } +DRIVER_DISPATCH PcmciaDeviceControl; + NTSTATUS NTAPI PcmciaDeviceControl(PDEVICE_OBJECT DeviceObject, @@ -35,6 +41,8 @@ { PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); NTSTATUS Status; + + UNREFERENCED_PARAMETER(DeviceObject); DPRINT("PCMCIA: DeviceIoControl\n"); @@ -54,12 +62,17 @@ return Status; } +DRIVER_UNLOAD PcmciaUnload; + VOID NTAPI PcmciaUnload(PDRIVER_OBJECT DriverObject) { + UNREFERENCED_PARAMETER(DriverObject); DPRINT("PCMCIA: Unload\n"); } + +DRIVER_DISPATCH PcmciaPlugPlay; NTSTATUS NTAPI @@ -80,6 +93,8 @@ Irp); } } + +DRIVER_DISPATCH PcmciaPower; NTSTATUS NTAPI @@ -159,6 +174,8 @@ return Status; } + +DRIVER_ADD_DEVICE PcmciaAddDevice; NTSTATUS NTAPI @@ -207,6 +224,8 @@ RTL_QUERY_REGISTRY_TABLE QueryTable[2]; NTSTATUS Status; + UNREFERENCED_PARAMETER(RegistryPath); + DPRINT1("PCMCIA: DriverEntry\n"); DriverObject->MajorFunction[IRP_MJ_CREATE] = PcmciaCreateClose; Modified: trunk/reactos/drivers/bus/pcmcia/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcmcia/pdo.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcmcia/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcmcia/pdo.c [iso-8859-1] Fri May 10 10:30:21 2013 @@ -16,7 +16,9 @@ PcmciaPdoPlugPlay(PPCMCIA_PDO_EXTENSION PdoExt, PIRP Irp) { - UNIMPLEMENTED + UNREFERENCED_PARAMETER(PdoExt); + + UNIMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -27,7 +29,9 @@ NTAPI PcmciaPdoSetPowerState(PPCMCIA_PDO_EXTENSION PdoExt) { - UNIMPLEMENTED + UNREFERENCED_PARAMETER(PdoExt); + + UNIMPLEMENTED; return STATUS_SUCCESS; }
11 years, 7 months
1
0
0
0
[akhaldi] 58982: [PCIX] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri May 10 10:22:01 2013 New Revision: 58982 URL:
http://svn.reactos.org/svn/reactos?rev=58982&view=rev
Log: [PCIX] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. Modified: trunk/reactos/drivers/bus/pcix/arb/ar_busno.c trunk/reactos/drivers/bus/pcix/arb/ar_memio.c trunk/reactos/drivers/bus/pcix/arb/arb_comn.c trunk/reactos/drivers/bus/pcix/arb/tr_irq.c trunk/reactos/drivers/bus/pcix/debug.c trunk/reactos/drivers/bus/pcix/device.c trunk/reactos/drivers/bus/pcix/dispatch.c trunk/reactos/drivers/bus/pcix/enum.c trunk/reactos/drivers/bus/pcix/fdo.c trunk/reactos/drivers/bus/pcix/hookhal.c trunk/reactos/drivers/bus/pcix/init.c trunk/reactos/drivers/bus/pcix/intrface/agpintrf.c trunk/reactos/drivers/bus/pcix/intrface/busintrf.c trunk/reactos/drivers/bus/pcix/intrface/cardbus.c trunk/reactos/drivers/bus/pcix/intrface/devhere.c trunk/reactos/drivers/bus/pcix/intrface/intrface.c trunk/reactos/drivers/bus/pcix/intrface/lddintrf.c trunk/reactos/drivers/bus/pcix/intrface/locintrf.c trunk/reactos/drivers/bus/pcix/intrface/pmeintf.c trunk/reactos/drivers/bus/pcix/intrface/routintf.c trunk/reactos/drivers/bus/pcix/pci.h trunk/reactos/drivers/bus/pcix/pci/id.c trunk/reactos/drivers/bus/pcix/pci/ppbridge.c trunk/reactos/drivers/bus/pcix/pcivrify.c trunk/reactos/drivers/bus/pcix/pdo.c trunk/reactos/drivers/bus/pcix/power.c trunk/reactos/drivers/bus/pcix/utils.c Modified: trunk/reactos/drivers/bus/pcix/arb/ar_busno.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/arb/ar_bu…
============================================================================== --- trunk/reactos/drivers/bus/pcix/arb/ar_busno.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/arb/ar_busno.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI arbusno_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* Not yet implemented */ UNIMPLEMENTED; //while (TRUE); @@ -51,6 +52,11 @@ PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension; NTSTATUS Status; PAGED_CODE(); + + UNREFERENCED_PARAMETER(PciInterface); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ if ((ULONG)InterfaceData != CmResourceTypeBusNumber) Modified: trunk/reactos/drivers/bus/pcix/arb/ar_memio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/arb/ar_me…
============================================================================== --- trunk/reactos/drivers/bus/pcix/arb/ar_memio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/arb/ar_memio.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -46,6 +46,8 @@ NTAPI ario_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); + /* Not yet implemented */ UNIMPLEMENTED; //while (TRUE); @@ -64,6 +66,11 @@ PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension; NTSTATUS Status; PAGED_CODE(); + + UNREFERENCED_PARAMETER(PciInterface); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ if ((ULONG)InterfaceData != CmResourceTypePort) @@ -135,6 +142,8 @@ NTAPI armem_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); + /* Not yet implemented */ UNIMPLEMENTED; //while (TRUE); @@ -153,6 +162,11 @@ PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension; NTSTATUS Status; PAGED_CODE(); + + UNREFERENCED_PARAMETER(PciInterface); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); /* Make sure it's the expected interface */ if ((ULONG)InterfaceData != CmResourceTypeMemory) Modified: trunk/reactos/drivers/bus/pcix/arb/arb_comn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/arb/arb_c…
============================================================================== --- trunk/reactos/drivers/bus/pcix/arb/arb_comn.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/arb/arb_comn.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -28,6 +28,7 @@ NTAPI PciArbiterDestructor(IN PPCI_ARBITER_INSTANCE Arbiter) { + UNREFERENCED_PARAMETER(Arbiter); /* This function is not yet implemented */ UNIMPLEMENTED; while (TRUE); @@ -57,7 +58,7 @@ /* Skip this bus if it does subtractive decode */ if (PdoExtension->Dependent.type1.SubtractiveDecode) { - DPRINT1("PCI Not creating arbiters for subtractive bus %d\n", + DPRINT1("PCI Not creating arbiters for subtractive bus %u\n", PdoExtension->Dependent.type1.SubtractiveDecode); continue; } @@ -77,7 +78,7 @@ if (!*Interfaces) { /* Skip this arbiter and try the next one */ - DPRINT1("PCI - FDO ext 0x%08x no %s arbiter.\n", + DPRINT1("PCI - FDO ext 0x%p no %s arbiter.\n", FdoExtension, PciArbiterNames[ArbiterType - PciArb_Io]); continue; @@ -110,7 +111,7 @@ PciArbiterDestructor); /* This arbiter is now initialized, move to the next one */ - DPRINT1("PCI - FDO ext 0x%08x %S arbiter initialized (context 0x%08x).\n", + DPRINT1("PCI - FDO ext 0x%p %S arbiter initialized (context 0x%p).\n", FdoExtension, L"ARBITER HEADER MISSING", //ArbiterInterface->CommonInstance.Name, ArbiterInterface); @@ -131,11 +132,13 @@ PVOID Instance; PCI_SIGNATURE ArbiterType; + UNREFERENCED_PARAMETER(Resources); + /* Arbiters should not already be initialized */ if (DeviceExtension->ArbitersInitialized) { /* Duplicated start request, fail initialization */ - DPRINT1("PCI Warning hot start FDOx %08x, resource ranges not checked.\n", DeviceExtension); + DPRINT1("PCI Warning hot start FDOx %p, resource ranges not checked.\n", DeviceExtension); return STATUS_INVALID_DEVICE_REQUEST; } @@ -190,7 +193,7 @@ else { /* The arbiter was not found, this is an error! */ - DPRINT1("PCI - FDO ext 0x%08x %s arbiter (REQUIRED) is missing.\n", + DPRINT1("PCI - FDO ext 0x%p %s arbiter (REQUIRED) is missing.\n", DeviceExtension, PciArbiterNames[ArbiterType - PciArb_Io]); } Modified: trunk/reactos/drivers/bus/pcix/arb/tr_irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/arb/tr_ir…
============================================================================== --- trunk/reactos/drivers/bus/pcix/arb/tr_irq.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/arb/tr_irq.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI tranirq_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI tranirq_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -52,11 +53,15 @@ INTERFACE_TYPE ParentInterface; ASSERT_FDO(FdoExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + /* Make sure it's the right resource type */ if ((ULONG)InterfaceData != CmResourceTypeInterrupt) { /* Fail this invalid request */ - DPRINT1("PCI - IRQ trans constructor doesn't like %x in InterfaceSpecificData\n", + DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n", InterfaceData); return STATUS_INVALID_PARAMETER_3; } Modified: trunk/reactos/drivers/bus/pcix/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/debug.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcix/debug.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/debug.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -190,7 +190,7 @@ } /* For an FDO, just dump the extension pointer and IRP string */ - DPRINT1("FDO(%x)<-%s\n", DeviceExtension, IrpString); + DPRINT1("FDO(%p)<-%s\n", DeviceExtension, IrpString); } /* If the function is illegal for this extension, complain */ @@ -222,17 +222,17 @@ ULONG i; /* Dump the capabilities */ - DPRINT1("Capabilities\n Lock:%d, Eject:%d, Remove:%d, Dock:%d, UniqueId:%d\n", + DPRINT1("Capabilities\n Lock:%u, Eject:%u, Remove:%u, Dock:%u, UniqueId:%u\n", DeviceCaps->LockSupported, DeviceCaps->EjectSupported, DeviceCaps->Removable, DeviceCaps->DockDevice, DeviceCaps->UniqueID); - DbgPrint(" SilentInstall:%d, RawOk:%d, SurpriseOk:%d\n", + DbgPrint(" SilentInstall:%u, RawOk:%u, SurpriseOk:%u\n", DeviceCaps->SilentInstall, DeviceCaps->RawDeviceOK, DeviceCaps->SurpriseRemovalOK); - DbgPrint(" Address %08x, UINumber %08x, Latencies D1 %d, D2 %d, D3 %d\n", + DbgPrint(" Address %08x, UINumber %08x, Latencies D1 %u, D2 %u, D3 %u\n", DeviceCaps->Address, DeviceCaps->UINumber, DeviceCaps->D1Latency, @@ -281,10 +281,10 @@ PULONG Data; /* Print out the header */ - DPRINT1(" IoResource Descriptor dump: Descriptor @0x%x\n", Descriptor); + DPRINT1(" IoResource Descriptor dump: Descriptor @0x%p\n", Descriptor); DPRINT1(" Option = 0x%x\n", Descriptor->Option); - DPRINT1(" Type = %d (%s)\n", Descriptor->Type, PciDebugCmResourceTypeToText(Descriptor->Type)); - DPRINT1(" ShareDisposition = %d\n", Descriptor->ShareDisposition); + DPRINT1(" Type = %u (%s)\n", Descriptor->Type, PciDebugCmResourceTypeToText(Descriptor->Type)); + DPRINT1(" ShareDisposition = %u\n", Descriptor->ShareDisposition); DPRINT1(" Flags = 0x%04X\n", Descriptor->Flags); /* Loop private data */ @@ -292,7 +292,7 @@ for (i = 0; i < 6; i += 3) { /* Dump it in 32-bit triplets */ - DPRINT1(" Data[%d] = %08x %08x %08x\n", i, Data[0], Data[1], Data[2]); + DPRINT1(" Data[%u] = %08x %08x %08x\n", i, Data[0], Data[1], Data[2]); } } @@ -321,7 +321,7 @@ Requirements->SlotNumber, ((PCI_SLOT_NUMBER*)&Requirements->SlotNumber)->u.bits.DeviceNumber, ((PCI_SLOT_NUMBER*)&Requirements->SlotNumber)->u.bits.FunctionNumber); - DPRINT1(" AlternativeLists %d\n", AlternativeLists); + DPRINT1(" AlternativeLists %u\n", AlternativeLists); /* Scan alternative lists */ while (AlternativeLists--) @@ -331,7 +331,7 @@ Count = List->Count; /* Print out each descriptor */ - DPRINT1("\n List[%d].Count = %d\n", AlternativeLists, Count); + DPRINT1("\n List[%u].Count = %u\n", AlternativeLists, Count); while (Count--) PciDebugPrintIoResource(Descriptor++); /* Should've reached a new list now */ @@ -347,9 +347,9 @@ PciDebugPrintPartialResource(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResource) { /* Dump all the data in the partial */ - DPRINT1(" Partial Resource Descriptor @0x%x\n", PartialResource); - DPRINT1(" Type = %d (%s)\n", PartialResource->Type, PciDebugCmResourceTypeToText(PartialResource->Type)); - DPRINT1(" ShareDisposition = %d\n", PartialResource->ShareDisposition); + DPRINT1(" Partial Resource Descriptor @0x%p\n", PartialResource); + DPRINT1(" Type = %u (%s)\n", PartialResource->Type, PciDebugCmResourceTypeToText(PartialResource->Type)); + DPRINT1(" ShareDisposition = %u\n", PartialResource->ShareDisposition); DPRINT1(" Flags = 0x%04X\n", PartialResource->Flags); DPRINT1(" Data[%d] = %08x %08x %08x\n", 0, @@ -372,7 +372,7 @@ /* Get the full list count */ ListCount = PartialList->Count; FullDescriptor = PartialList->List; - DPRINT1(" CM_RESOURCE_LIST (PCI Bus Driver) (List Count = %d)\n", PartialList->Count); + DPRINT1(" CM_RESOURCE_LIST (PCI Bus Driver) (List Count = %u)\n", PartialList->Count); /* Loop full list */ for (i = 0; i < ListCount; i++) Modified: trunk/reactos/drivers/bus/pcix/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/device.c?…
============================================================================== --- trunk/reactos/drivers/bus/pcix/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/device.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -250,6 +250,7 @@ NTAPI Device_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context) { + UNREFERENCED_PARAMETER(Context); /* Nothing to do for devices */ return; } @@ -260,6 +261,9 @@ IN PPCI_COMMON_HEADER PciData, IN PIO_RESOURCE_DESCRIPTOR IoDescriptor) { + UNREFERENCED_PARAMETER(Context); + UNREFERENCED_PARAMETER(PciData); + UNREFERENCED_PARAMETER(IoDescriptor); /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); } @@ -269,6 +273,8 @@ Device_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); } @@ -278,6 +284,8 @@ Device_ChangeResourceSettings(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); } Modified: trunk/reactos/drivers/bus/pcix/dispatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/dispatch.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/dispatch.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -16,6 +16,8 @@ /* FUNCTIONS ******************************************************************/ +IO_COMPLETION_ROUTINE PciSetEventCompletion; + NTSTATUS NTAPI PciSetEventCompletion(IN PDEVICE_OBJECT DeviceObject, @@ -24,6 +26,9 @@ { PKEVENT Event = (PVOID)Context; ASSERT(Event); + + UNREFERENCED_PARAMETER(DeviceObject); + UNREFERENCED_PARAMETER(Irp); /* Set the event and return the appropriate status code */ KeSetEvent(Event, FALSE, IO_NO_INCREMENT); @@ -258,6 +263,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + /* Not supported */ DPRINT1("WARNING: PCI received unsupported IRP!\n"); //DbgBreakPoint(); @@ -270,6 +279,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + /* Not supported */ return STATUS_INVALID_DEVICE_REQUEST; } Modified: trunk/reactos/drivers/bus/pcix/enum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/enum.c?re…
============================================================================== --- trunk/reactos/drivers/bus/pcix/enum.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/enum.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -537,6 +537,9 @@ PciQueryEjectionRelations(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(pDeviceRelations); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; @@ -549,6 +552,10 @@ OUT PIO_RESOURCE_REQUIREMENTS_LIST* Buffer) { PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList; + + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); + { /* There aren't, so use the zero descriptor */ RequirementsList = PciZeroIoResourceRequirements; @@ -792,6 +799,8 @@ ULONG LegacyBaseAddress; USHORT Command; UCHAR RegValue; + + UNREFERENCED_PARAMETER(SlotNumber); /* Check what kind of hack operation this is */ switch (OperationType) @@ -1293,6 +1302,8 @@ PPCI_COMMON_HEADER PciData, Current; PPCI_PDO_EXTENSION PdoExtension; + UNREFERENCED_PARAMETER(Reserved); + /* Grab all parameters from the context */ PdoExtension = Context->PdoExtension; Current = Context->Current; @@ -1577,7 +1588,7 @@ USHORT SubVendorId, SubSystemId; PCI_CAPABILITIES_HEADER CapHeader, PcixCapHeader; UCHAR SecondaryBus; - DPRINT1("PCI Scan Bus: FDO Extension @ 0x%x, Base Bus = 0x%x\n", + DPRINT1("PCI Scan Bus: FDO Extension @ 0x%p, Base Bus = 0x%x\n", DeviceExtension, DeviceExtension->BaseBus); /* Is this the root FDO? */ @@ -1996,7 +2007,7 @@ ((TempOffset) && (PciData->LatencyTimer == 64))) { /* Keep track of the fact that it needs configuration */ - DPRINT1("PCI - ScanBus, PDOx %x found unconfigured\n", + DPRINT1("PCI - ScanBus, PDOx %p found unconfigured\n", NewExtension); NewExtension->NeedsHotPlugConfiguration = TRUE; } @@ -2060,7 +2071,7 @@ { /* This means this PDO existed before, but not anymore */ PdoExtension->ReportedMissing = TRUE; - DPRINT1("PCI - Old device (pdox) %08x not found on rescan.\n", + DPRINT1("PCI - Old device (pdox) %p not found on rescan.\n", PdoExtension); } else @@ -2098,7 +2109,7 @@ } /* Print out that we're ready to dump relations */ - DPRINT1("PCI QueryDeviceRelations/BusRelations FDOx %08x (bus 0x%02x)\n", + DPRINT1("PCI QueryDeviceRelations/BusRelations FDOx %p (bus 0x%02x)\n", DeviceExtension, DeviceExtension->BaseBus); @@ -2108,7 +2119,7 @@ while (PdoExtension) { /* Dump this relation */ - DPRINT1(" QDR PDO %08x (x %08x)%s\n", + DPRINT1(" QDR PDO %p (x %p)%s\n", PdoExtension->PhysicalDeviceObject, PdoExtension, PdoExtension->NotPresent ? @@ -2128,7 +2139,7 @@ } /* Terminate dumping the relations */ - DPRINT1(" QDR Total PDO count = %d (%d already in list)\n", + DPRINT1(" QDR Total PDO count = %u (%u already in list)\n", NewRelations->Count + PdoCount, NewRelations->Count); @@ -2150,6 +2161,8 @@ BOOLEAN Native; PPCI_CONFIGURATOR Configurator; + UNREFERENCED_PARAMETER(SomethingSomethingDarkSide); + /* Get the FDO and read the configuration data */ FdoExtension = PdoExtension->ParentFdoExtension; PciReadDeviceConfig(PdoExtension, &PciData, 0, PCI_COMMON_HDR_LENGTH); @@ -2210,7 +2223,7 @@ if (PciData.LatencyTimer != NewLatencyTimer) { /* Debug notification */ - DPRINT1("PCI (pdox %08x) changing latency from %02x to %02x.\n", + DPRINT1("PCI (pdox %p) changing latency from %02x to %02x.\n", PdoExtension, PciData.LatencyTimer, NewLatencyTimer); @@ -2221,7 +2234,7 @@ if (PciData.CacheLineSize != NewCacheLineSize) { /* Debug notification */ - DPRINT1("PCI (pdox %08x) changing cache line size from %02x to %02x.\n", + DPRINT1("PCI (pdox %p) changing cache line size from %02x to %02x.\n", PdoExtension, PciData.CacheLineSize, NewCacheLineSize); Modified: trunk/reactos/drivers/bus/pcix/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/fdo.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/fdo.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -124,6 +124,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; return STATUS_NOT_SUPPORTED; } @@ -134,6 +138,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -144,6 +152,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -154,6 +166,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -164,6 +180,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -174,6 +194,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -290,6 +314,8 @@ PAGED_CODE(); ASSERT_FDO(DeviceExtension); + UNREFERENCED_PARAMETER(Irp); + /* Get the capabilities */ Capabilities = IoStackLocation->Parameters.DeviceCapabilities.Capabilities; @@ -311,6 +337,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -321,6 +351,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -331,6 +365,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } Modified: trunk/reactos/drivers/bus/pcix/hookhal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/hookhal.c…
============================================================================== --- trunk/reactos/drivers/bus/pcix/hookhal.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/hookhal.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -27,6 +27,10 @@ OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress) { + UNREFERENCED_PARAMETER(InterfaceType); + UNREFERENCED_PARAMETER(BusNumber); + UNREFERENCED_PARAMETER(AddressSpace); + /* FIXME: Broken translation */ UNIMPLEMENTED; TranslatedAddress->QuadPart = BusAddress.QuadPart; Modified: trunk/reactos/drivers/bus/pcix/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/init.c?re…
============================================================================== --- trunk/reactos/drivers/bus/pcix/init.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/init.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -677,15 +677,19 @@ NTAPI PciGetDebugPorts(IN HANDLE DebugKey) { + UNREFERENCED_PARAMETER(DebugKey); /* This function is not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_SUCCESS; } +DRIVER_UNLOAD PciDriverUnload; + VOID NTAPI PciDriverUnload(IN PDRIVER_OBJECT DriverObject) { + UNREFERENCED_PARAMETER(DriverObject); /* This function is not yet implemented */ UNIMPLEMENTED_DBGBREAK("PCI: Unload\n"); } Modified: trunk/reactos/drivers/bus/pcix/intrface/agpintrf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/agpintrf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/agpintrf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI agpintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI agpintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -49,6 +50,12 @@ { PPCI_PDO_EXTENSION PdoExtension = (PPCI_PDO_EXTENSION)DeviceExtension; + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Only AGP bridges are supported (which are PCI-to-PCI Bridge Devices) */ if ((PdoExtension->BaseClass != PCI_CLASS_BRIDGE_DEV) || (PdoExtension->SubClass != PCI_SUBCLASS_BR_PCI_TO_PCI)) Modified: trunk/reactos/drivers/bus/pcix/intrface/busintrf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/busintrf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/busintrf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI busintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI busintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -47,6 +48,13 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/drivers/bus/pcix/intrface/cardbus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/cardbus.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/cardbus.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI Cardbus_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context) { + UNREFERENCED_PARAMETER(Context); UNIMPLEMENTED_DBGBREAK(); } @@ -40,6 +41,7 @@ NTAPI Cardbus_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context) { + UNREFERENCED_PARAMETER(Context); UNIMPLEMENTED_DBGBREAK(); } @@ -47,6 +49,7 @@ NTAPI Cardbus_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context) { + UNREFERENCED_PARAMETER(Context); UNIMPLEMENTED_DBGBREAK(); } @@ -54,6 +57,7 @@ NTAPI Cardbus_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context) { + UNREFERENCED_PARAMETER(Context); UNIMPLEMENTED_DBGBREAK(); } @@ -63,6 +67,9 @@ IN PPCI_COMMON_HEADER PciData, IN PIO_RESOURCE_DESCRIPTOR IoDescriptor) { + UNREFERENCED_PARAMETER(Context); + UNREFERENCED_PARAMETER(PciData); + UNREFERENCED_PARAMETER(IoDescriptor); UNIMPLEMENTED_DBGBREAK(); } @@ -71,6 +78,8 @@ Cardbus_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); UNIMPLEMENTED_DBGBREAK(); } @@ -79,6 +88,8 @@ Cardbus_ChangeResourceSettings(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); UNIMPLEMENTED_DBGBREAK(); } @@ -86,6 +97,7 @@ NTAPI pcicbintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI pcicbintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -100,6 +112,13 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/drivers/bus/pcix/intrface/devhere.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/devhere.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/devhere.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI devpresent_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI devpresent_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -49,6 +50,13 @@ { PAGED_CODE(); + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/drivers/bus/pcix/intrface/intrface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/intrface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/intrface.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -56,7 +56,7 @@ RtlStringFromGUID(InterfaceType, &GuidString); DPRINT1("PCI - PciQueryInterface TYPE = %wZ\n", &GuidString); RtlFreeUnicodeString(&GuidString); - DPRINT1(" Size = %d, Version = %d, InterfaceData = %x, LastChance = %s\n", + DPRINT1(" Size = %u, Version = %u, InterfaceData = %p, LastChance = %s\n", Size, Version, InterfaceData, @@ -130,7 +130,7 @@ if (!NT_SUCCESS(Status)) { /* This interface was not initialized correctly, skip it */ - DPRINT1("PCI - PciQueryInterface - Contructor %08lx = %08lx\n", + DPRINT1("PCI - PciQueryInterface - Contructor %p = %08lx\n", PciInterface->Constructor, Status); continue; } Modified: trunk/reactos/drivers/bus/pcix/intrface/lddintrf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/lddintrf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/lddintrf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI lddintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI lddintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -47,6 +48,13 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/drivers/bus/pcix/intrface/locintrf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/locintrf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/locintrf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI locintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI locintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -47,6 +48,13 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Version); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_IMPLEMENTED; Modified: trunk/reactos/drivers/bus/pcix/intrface/pmeintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/pmeintf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/pmeintf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -33,6 +33,7 @@ NTAPI PciPmeInterfaceInitializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI PciPmeInterfaceInitializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -47,6 +48,12 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Only version 1 is supported */ if (Version != PCI_PME_INTRF_STANDARD_VER) return STATUS_NOINTERFACE; Modified: trunk/reactos/drivers/bus/pcix/intrface/routintf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/intrface/…
============================================================================== --- trunk/reactos/drivers/bus/pcix/intrface/routintf.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/intrface/routintf.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -35,6 +35,7 @@ NTAPI routeintrf_Initializer(IN PVOID Instance) { + UNREFERENCED_PARAMETER(Instance); /* PnP Interfaces don't get Initialized */ ASSERTMSG(FALSE, "PCI routeintrf_Initializer, unexpected call."); return STATUS_UNSUCCESSFUL; @@ -49,6 +50,12 @@ IN USHORT Size, IN PINTERFACE Interface) { + UNREFERENCED_PARAMETER(DeviceExtension); + UNREFERENCED_PARAMETER(Instance); + UNREFERENCED_PARAMETER(InterfaceData); + UNREFERENCED_PARAMETER(Size); + UNREFERENCED_PARAMETER(Interface); + /* Only version 1 is supported */ if (Version != PCI_INT_ROUTE_INTRF_STANDARD_VER) return STATUS_NOINTERFACE; Modified: trunk/reactos/drivers/bus/pcix/pci.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci.h?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci.h [iso-8859-1] Fri May 10 10:22:01 2013 @@ -535,6 +535,9 @@ // // IRP Dispatch Routines // + +DRIVER_DISPATCH PciDispatchIrp; + NTSTATUS NTAPI PciDispatchIrp( @@ -610,6 +613,9 @@ // // Bus FDO Routines // + +DRIVER_ADD_DEVICE PciAddDevice; + NTSTATUS NTAPI PciAddDevice( @@ -1120,6 +1126,8 @@ PciClassifyDeviceType( IN PPCI_PDO_EXTENSION PdoExtension ); + +KIPI_BROADCAST_WORKER PciExecuteCriticalSystemRoutine; ULONG_PTR NTAPI Modified: trunk/reactos/drivers/bus/pcix/pci/id.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/id.c?…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -397,6 +397,8 @@ ULONG Length; NTSTATUS Status; + UNREFERENCED_PARAMETER(Locale); + /* Check what the caller is requesting */ switch (QueryType) { Modified: trunk/reactos/drivers/bus/pcix/pci/ppbridge.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/ppbri…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/ppbridge.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/ppbridge.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -630,6 +630,9 @@ IN PPCI_COMMON_HEADER PciData, IN PIO_RESOURCE_DESCRIPTOR IoDescriptor) { + + UNREFERENCED_PARAMETER(Context); + /* Does this bridge have VGA decodes on it? */ if (PciData->u.type1.BridgeControl & PCI_ENABLE_BRIDGE_VGA) { @@ -671,6 +674,8 @@ PPBridge_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData) { + UNREFERENCED_PARAMETER(PdoExtension); + UNREFERENCED_PARAMETER(PciData); UNIMPLEMENTED_DBGBREAK(); } Modified: trunk/reactos/drivers/bus/pcix/pcivrify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pcivrify.…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pcivrify.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pcivrify.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -73,11 +73,16 @@ return VerifierData; } +DRIVER_NOTIFICATION_CALLBACK_ROUTINE PciVerifierProfileChangeCallback; + NTSTATUS NTAPI PciVerifierProfileChangeCallback(IN PVOID NotificationStructure, IN PVOID Context) { + UNREFERENCED_PARAMETER(NotificationStructure); + UNREFERENCED_PARAMETER(Context); + /* This function is not yet implemented */ UNIMPLEMENTED_DBGBREAK(); return STATUS_SUCCESS; Modified: trunk/reactos/drivers/bus/pcix/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pdo.c?rev…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pdo.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -79,6 +79,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -89,6 +93,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; return STATUS_NOT_SUPPORTED; } @@ -99,6 +107,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -113,6 +125,8 @@ BOOLEAN Changed, DoReset; POWER_STATE PowerState; PAGED_CODE(); + + UNREFERENCED_PARAMETER(Irp); DoReset = FALSE; @@ -206,6 +220,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; return STATUS_NOT_SUPPORTED; } @@ -216,6 +234,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -226,6 +248,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -236,6 +262,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -246,6 +276,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -256,6 +290,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -266,6 +304,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -312,6 +354,8 @@ { PAGED_CODE(); + UNREFERENCED_PARAMETER(Irp); + /* Call the worker function */ return PciQueryCapabilities(DeviceExtension, IoStackLocation-> @@ -326,6 +370,8 @@ { PAGED_CODE(); + UNREFERENCED_PARAMETER(IoStackLocation); + /* Call the worker function */ return PciQueryResources(DeviceExtension, (PCM_RESOURCE_LIST*)&Irp->IoStatus.Information); @@ -338,6 +384,8 @@ IN PPCI_PDO_EXTENSION DeviceExtension) { PAGED_CODE(); + + UNREFERENCED_PARAMETER(IoStackLocation); /* Call the worker function */ return PciQueryRequirements(DeviceExtension, @@ -384,6 +432,8 @@ { PAGED_CODE(); + UNREFERENCED_PARAMETER(IoStackLocation); + /* Call the worker function */ return PciQueryBusInformation(DeviceExtension, (PPNP_BUS_INFORMATION*)&Irp-> @@ -396,6 +446,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -406,6 +460,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -416,6 +474,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; return STATUS_NOT_SUPPORTED; } @@ -426,6 +488,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -436,6 +502,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } @@ -446,6 +516,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED_DBGBREAK(); return STATUS_NOT_SUPPORTED; } Modified: trunk/reactos/drivers/bus/pcix/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/power.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcix/power.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/power.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -206,6 +206,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; while (TRUE); return STATUS_NOT_SUPPORTED; @@ -217,6 +221,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; while (TRUE); return STATUS_NOT_SUPPORTED; @@ -228,6 +236,10 @@ IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension) { + UNREFERENCED_PARAMETER(Irp); + UNREFERENCED_PARAMETER(IoStackLocation); + UNREFERENCED_PARAMETER(DeviceExtension); + UNIMPLEMENTED; while (TRUE); return STATUS_NOT_SUPPORTED; Modified: trunk/reactos/drivers/bus/pcix/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/utils.c?r…
============================================================================== --- trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/utils.c [iso-8859-1] Fri May 10 10:22:01 2013 @@ -502,7 +502,7 @@ if (!Buffer) { /* No memory, fail the request */ - DPRINT1("PCI - Failed to allocate DeviceProperty buffer (%d bytes).\n", BufferLength); + DPRINT1("PCI - Failed to allocate DeviceProperty buffer (%u bytes).\n", BufferLength); Status = STATUS_INSUFFICIENT_RESOURCES; break; } @@ -750,6 +750,8 @@ PciIsDeviceOnDebugPath(IN PPCI_PDO_EXTENSION DeviceExtension) { PAGED_CODE(); + + UNREFERENCED_PARAMETER(DeviceExtension); /* Check for too many, or no, debug ports */ ASSERT(PciDebugPortsCount <= MAX_DEBUGGING_DEVICES_SUPPORTED); @@ -1315,6 +1317,8 @@ { PPNP_BUS_INFORMATION BusInfo; + UNREFERENCED_PARAMETER(Buffer); + /* Allocate a structure for the bus information */ BusInfo = ExAllocatePoolWithTag(PagedPool, sizeof(PNP_BUS_INFORMATION), @@ -1340,7 +1344,7 @@ /* Check if a $PIR from the BIOS is used (legacy IRQ routing) */ ParentExtension = PdoExtension->ParentFdoExtension; - DPRINT1("Slot lookup for %d.%d.%d\n", + DPRINT1("Slot lookup for %d.%u.%u\n", ParentExtension ? ParentExtension->BaseBus : -1, PdoExtension->Slot.u.bits.DeviceNumber, PdoExtension->Slot.u.bits.FunctionNumber); @@ -1348,12 +1352,12 @@ { /* Read every slot information entry */ SlotInfo = &PciIrqRoutingTable->Slot[0]; - DPRINT1("PIR$ %p is %lx bytes, slot 0 is at: %lx\n", + DPRINT1("PIR$ %p is %lx bytes, slot 0 is at: %p\n", PciIrqRoutingTable, PciIrqRoutingTable->TableSize, SlotInfo); while (SlotInfo < (PSLOT_INFO)((ULONG_PTR)PciIrqRoutingTable + PciIrqRoutingTable->TableSize)) { - DPRINT1("Slot Info: %d.%d->#%d\n", + DPRINT1("Slot Info: %u.%u->#%u\n", SlotInfo->BusNumber, SlotInfo->DeviceNumber, SlotInfo->SlotNumber);
11 years, 7 months
1
0
0
0
[akhaldi] 58981: [PCI] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu May 9 21:24:16 2013 New Revision: 58981 URL:
http://svn.reactos.org/svn/reactos?rev=58981&view=rev
Log: [PCI] * Add some function annotations. * Fix several debug print specifiers. * Properly mark some unreferenced parameters as such. Modified: trunk/reactos/drivers/bus/pci/fdo.c trunk/reactos/drivers/bus/pci/pci.c trunk/reactos/drivers/bus/pci/pdo.c Modified: trunk/reactos/drivers/bus/pci/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/fdo.c?rev=…
============================================================================== --- trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pci/fdo.c [iso-8859-1] Thu May 9 21:24:16 2013 @@ -456,6 +456,7 @@ { NTSTATUS Status; + UNREFERENCED_PARAMETER(DeviceObject); UNREFERENCED_PARAMETER(Irp); DPRINT("Called\n"); Modified: trunk/reactos/drivers/bus/pci/pci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/pci.c?rev=…
============================================================================== --- trunk/reactos/drivers/bus/pci/pci.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pci/pci.c [iso-8859-1] Thu May 9 21:24:16 2013 @@ -53,7 +53,7 @@ NTSTATUS Status; UNREFERENCED_PARAMETER(DeviceObject); - DPRINT("Called. IRP is at (0x%X)\n", Irp); + DPRINT("Called. IRP is at (0x%p)\n", Irp); Irp->IoStatus.Information = 0; @@ -68,7 +68,7 @@ if (Status != STATUS_PENDING) { Irp->IoStatus.Status = Status; - DPRINT("Completing IRP at 0x%X\n", Irp); + DPRINT("Completing IRP at 0x%p\n", Irp); IoCompleteRequest(Irp, IO_NO_INCREMENT); } @@ -98,7 +98,7 @@ DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - DPRINT("IsFDO %d\n", DeviceExtension->IsFDO); + DPRINT("IsFDO %u\n", DeviceExtension->IsFDO); if (DeviceExtension->IsFDO) { Status = FdoPnpControl(DeviceObject, Irp); @@ -180,6 +180,7 @@ return STATUS_SUCCESS; } +DRIVER_UNLOAD PciUnload; VOID NTAPI @@ -187,6 +188,7 @@ IN PDRIVER_OBJECT DriverObject) { /* The driver object extension is destroyed by the I/O manager */ + UNREFERENCED_PARAMETER(DriverObject); } NTSTATUS Modified: trunk/reactos/drivers/bus/pci/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pci/pdo.c?rev=…
============================================================================== --- trunk/reactos/drivers/bus/pci/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pci/pdo.c [iso-8859-1] Thu May 9 21:24:16 2013 @@ -398,7 +398,7 @@ } else { - DPRINT1("Unsupported header type %u\n", PCI_CONFIGURATION_TYPE(&PciConfig)); + DPRINT1("Unsupported header type %d\n", PCI_CONFIGURATION_TYPE(&PciConfig)); } if (ResCount == 0) @@ -708,7 +708,7 @@ } else { - DPRINT1("Unsupported header type %u\n", PCI_CONFIGURATION_TYPE(&PciConfig)); + DPRINT1("Unsupported header type %d\n", PCI_CONFIGURATION_TYPE(&PciConfig)); } if (ResCount == 0) @@ -896,8 +896,11 @@ InterlockedDecrement(&DeviceExtension->References); } - -static BOOLEAN NTAPI +static TRANSLATE_BUS_ADDRESS InterfaceBusTranslateBusAddress; + +static +BOOLEAN +NTAPI InterfaceBusTranslateBusAddress( IN PVOID Context, IN PHYSICAL_ADDRESS BusAddress, @@ -917,8 +920,11 @@ BusAddress, AddressSpace, TranslatedAddress); } - -static PDMA_ADAPTER NTAPI +static GET_DMA_ADAPTER InterfaceBusGetDmaAdapter; + +static +PDMA_ADAPTER +NTAPI InterfaceBusGetDmaAdapter( IN PVOID Context, IN PDEVICE_DESCRIPTION DeviceDescription, @@ -929,8 +935,11 @@ return (PDMA_ADAPTER)HalGetAdapter(DeviceDescription, NumberOfMapRegisters); } - -static ULONG NTAPI +static GET_SET_DEVICE_DATA InterfaceBusSetBusData; + +static +ULONG +NTAPI InterfaceBusSetBusData( IN PVOID Context, IN ULONG DataType, @@ -962,8 +971,11 @@ return Size; } - -static ULONG NTAPI +static GET_SET_DEVICE_DATA InterfaceBusGetBusData; + +static +ULONG +NTAPI InterfaceBusGetBusData( IN PVOID Context, IN ULONG DataType, @@ -1229,6 +1241,8 @@ UCHAR Irq; USHORT Command; + UNREFERENCED_PARAMETER(Irp); + if (!RawResList) return STATUS_SUCCESS; @@ -1244,7 +1258,7 @@ if (RawPartialDesc->Type == CmResourceTypeInterrupt) { - DPRINT1("Assigning IRQ %d to PCI device 0x%x on bus 0x%x\n", + DPRINT1("Assigning IRQ %u to PCI device 0x%x on bus 0x%x\n", RawPartialDesc->u.Interrupt.Vector, DeviceExtension->PciDevice->SlotNumber.u.AsULONG, DeviceExtension->PciDevice->BusNumber); @@ -1401,6 +1415,7 @@ { NTSTATUS Status; + UNREFERENCED_PARAMETER(DeviceObject); UNREFERENCED_PARAMETER(Irp); DPRINT("Called\n");
11 years, 7 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
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