ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2013
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
348 discussions
Start a n
N
ew thread
[aandrejevic] 61150: [FAST486] FPU instructions never generate #UD. If CR0.EM is set, they generate #NM. If there is no FPU and CR0.EM is cleared, they do nothing. Add a helper macro FPU_ST for acc...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sat Nov 30 02:03:51 2013 New Revision: 61150 URL:
http://svn.reactos.org/svn/reactos?rev=61150&view=rev
Log: [FAST486] FPU instructions never generate #UD. If CR0.EM is set, they generate #NM. If there is no FPU and CR0.EM is cleared, they do nothing. Add a helper macro FPU_ST for accessing FPU registers. Add a compile-time option to disable the FPU. Modified: branches/ntvdm/lib/fast486/fast486.c branches/ntvdm/lib/fast486/fpu.c branches/ntvdm/lib/fast486/fpu.h Modified: branches/ntvdm/lib/fast486/fast486.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fast486.c?rev…
============================================================================== --- branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fast486.c [iso-8859-1] Sat Nov 30 02:03:51 2013 @@ -266,8 +266,10 @@ State->Idtr.Size = 0x3FF; State->Idtr.Address = 0; +#ifndef FAST486_NO_FPU /* Initialize CR0 */ State->ControlRegisters[FAST486_REG_CR0] |= FAST486_CR0_ET; +#endif /* Restore the callbacks and TLB */ State->MemReadCallback = MemReadCallback; Modified: branches/ntvdm/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.c?rev=611…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] Sat Nov 30 02:03:51 2013 @@ -35,66 +35,122 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF) { + FPU_CHECK(); + +#ifndef FAST486_NO_FPU // TODO: NOT IMPLEMENTED UNIMPLEMENTED; - Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +#else + /* Do nothing */ + return TRUE; +#endif } /* EOF */ Modified: branches/ntvdm/lib/fast486/fpu.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.h?rev=611…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.h [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/fpu.h [iso-8859-1] Sat Nov 30 02:03:51 2013 @@ -26,6 +26,13 @@ /* DEFINES ********************************************************************/ +#define FPU_CHECK() if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_EM) \ + { \ + Fast486Exception(State, FAST486_EXCEPTION_NM); \ + return FALSE; \ + } +#define FPU_ST(i) State->FpuRegisters[(State->FpuStatus.Top + (i)) % FAST486_NUM_FPU_REGS] + enum { FPU_SINGLE_PRECISION = 0,
11 years, 4 months
1
0
0
0
[ekohl] 61149: [FDC] - Move FdcAddDevice from fdo.c to fdc.c. - Create a PDO for each enumerated floppy disk drive.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Nov 29 23:52:53 2013 New Revision: 61149 URL:
http://svn.reactos.org/svn/reactos?rev=61149&view=rev
Log: [FDC] - Move FdcAddDevice from fdo.c to fdc.c. - Create a PDO for each enumerated floppy disk drive. Modified: trunk/reactos/drivers/storage/fdc/fdc/fdc.c trunk/reactos/drivers/storage/fdc/fdc/fdc.h trunk/reactos/drivers/storage/fdc/fdc/fdo.c Modified: trunk/reactos/drivers/storage/fdc/fdc/fdc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/fdc/fdc/fd…
============================================================================== --- trunk/reactos/drivers/storage/fdc/fdc/fdc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/fdc/fdc/fdc.c [iso-8859-1] Fri Nov 29 23:52:53 2013 @@ -14,12 +14,64 @@ #include <debug.h> - /* GLOBALS ********************************************************************/ ULONG ControllerCount = 0; /* FUNCTIONS ******************************************************************/ + +static +NTSTATUS +NTAPI +FdcAddDevice( + IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT Pdo) +{ + PFDO_DEVICE_EXTENSION DeviceExtension = NULL; + PDEVICE_OBJECT Fdo = NULL; + NTSTATUS Status; + + DPRINT1("FdcAddDevice()\n"); + + ASSERT(DriverObject); + ASSERT(Pdo); + + /* Create functional device object */ + Status = IoCreateDevice(DriverObject, + sizeof(FDO_DEVICE_EXTENSION), + NULL, + FILE_DEVICE_CONTROLLER, + FILE_DEVICE_SECURE_OPEN, + FALSE, + &Fdo); + if (NT_SUCCESS(Status)) + { + DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension; + RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION)); + + DeviceExtension->Common.IsFDO = TRUE; + DeviceExtension->Common.DeviceObject = Fdo; + + DeviceExtension->Pdo = Pdo; + + Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status); + IoDeleteDevice(Fdo); + return Status; + } + + + Fdo->Flags |= DO_DIRECT_IO; + Fdo->Flags |= DO_POWER_PAGABLE; + + Fdo->Flags &= ~DO_DEVICE_INITIALIZING; + } + + return Status; +} + static VOID Modified: trunk/reactos/drivers/storage/fdc/fdc/fdc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/fdc/fdc/fd…
============================================================================== --- trunk/reactos/drivers/storage/fdc/fdc/fdc.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/fdc/fdc/fdc.h [iso-8859-1] Fri Nov 29 23:52:53 2013 @@ -6,7 +6,9 @@ * PROGRAMMERS: Eric Kohl */ +#include <ntifs.h> #include <ntddk.h> +#include <stdio.h> #include <debug.h> #define MAX_DEVICE_NAME 255 @@ -20,53 +22,54 @@ { struct _CONTROLLER_INFO *ControllerInfo; UCHAR UnitNumber; /* 0,1,2,3 */ - LARGE_INTEGER MotorStartTime; - PDEVICE_OBJECT DeviceObject; +// LARGE_INTEGER MotorStartTime; + PDEVICE_OBJECT DeviceObject; CM_FLOPPY_DEVICE_DATA FloppyDeviceData; // DISK_GEOMETRY DiskGeometry; - UCHAR BytesPerSectorCode; - WCHAR SymLinkBuffer[MAX_DEVICE_NAME]; - WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN]; - ULONG DiskChangeCount; - BOOLEAN Initialized; +// UCHAR BytesPerSectorCode; +// WCHAR SymLinkBuffer[MAX_DEVICE_NAME]; +// WCHAR ArcPathBuffer[MAX_ARC_PATH_LEN]; +// ULONG DiskChangeCount; +// BOOLEAN Initialized; } DRIVE_INFO, *PDRIVE_INFO; typedef struct _CONTROLLER_INFO { BOOLEAN Populated; - BOOLEAN Initialized; - ULONG ControllerNumber; - INTERFACE_TYPE InterfaceType; - ULONG BusNumber; - ULONG Level; - KIRQL MappedLevel; - ULONG Vector; - ULONG MappedVector; - KINTERRUPT_MODE InterruptMode; +// BOOLEAN Initialized; +// ULONG ControllerNumber; +// INTERFACE_TYPE InterfaceType; +// ULONG BusNumber; +// ULONG Level; +// KIRQL MappedLevel; +// ULONG Vector; +// ULONG MappedVector; +// KINTERRUPT_MODE InterruptMode; PUCHAR BaseAddress; - ULONG Dma; - ULONG MapRegisters; - PVOID MapRegisterBase; - BOOLEAN Master; - KEVENT SynchEvent; - KDPC Dpc; - PKINTERRUPT InterruptObject; - PADAPTER_OBJECT AdapterObject; +// ULONG Dma; +// ULONG MapRegisters; +// PVOID MapRegisterBase; +// BOOLEAN Master; +// KEVENT SynchEvent; +// KDPC Dpc; +// PKINTERRUPT InterruptObject; +// PADAPTER_OBJECT AdapterObject; UCHAR NumberOfDrives; - BOOLEAN ImpliedSeeks; +// BOOLEAN ImpliedSeeks; DRIVE_INFO DriveInfo[MAX_DRIVES_PER_CONTROLLER]; - PDRIVE_INFO CurrentDrive; - BOOLEAN Model30; - KEVENT MotorStoppedEvent; - KTIMER MotorTimer; - KDPC MotorStopDpc; - BOOLEAN StopDpcQueued; +// PDRIVE_INFO CurrentDrive; +// BOOLEAN Model30; +// KEVENT MotorStoppedEvent; +// KTIMER MotorTimer; +// KDPC MotorStopDpc; +// BOOLEAN StopDpcQueued; } CONTROLLER_INFO, *PCONTROLLER_INFO; typedef struct _COMMON_DEVICE_EXTENSION { BOOLEAN IsFDO; + PDEVICE_OBJECT DeviceObject; } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; typedef struct _FDO_DEVICE_EXTENSION @@ -74,7 +77,6 @@ COMMON_DEVICE_EXTENSION Common; PDEVICE_OBJECT LowerDevice; - PDEVICE_OBJECT Fdo; PDEVICE_OBJECT Pdo; CONTROLLER_INFO ControllerInfo; @@ -82,12 +84,22 @@ } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION; +typedef struct _PDO_DEVICE_EXTENSION +{ + COMMON_DEVICE_EXTENSION Common; + + PDEVICE_OBJECT Fdo; + PDRIVE_INFO DriveInfo; + + UNICODE_STRING DeviceDescription; // REG_SZ + UNICODE_STRING DeviceId; // REG_SZ + UNICODE_STRING InstanceId; // REG_SZ + UNICODE_STRING HardwareIds; // REG_MULTI_SZ + UNICODE_STRING CompatibleIds; // REG_MULTI_SZ +} PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION; + + /* fdo.c */ - -NTSTATUS -NTAPI -FdcAddDevice(IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT Pdo); NTSTATUS NTAPI Modified: trunk/reactos/drivers/storage/fdc/fdc/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/fdc/fdc/fd…
============================================================================== --- trunk/reactos/drivers/storage/fdc/fdc/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/fdc/fdc/fdo.c [iso-8859-1] Fri Nov 29 23:52:53 2013 @@ -72,57 +72,6 @@ } -NTSTATUS -NTAPI -FdcAddDevice( - IN PDRIVER_OBJECT DriverObject, - IN PDEVICE_OBJECT Pdo) -{ - PFDO_DEVICE_EXTENSION DeviceExtension = NULL; - PDEVICE_OBJECT Fdo = NULL; - NTSTATUS Status; - - DPRINT1("FdcAddDevice()\n"); - - ASSERT(DriverObject); - ASSERT(Pdo); - - /* Create functional device object */ - Status = IoCreateDevice(DriverObject, - sizeof(FDO_DEVICE_EXTENSION), - NULL, - FILE_DEVICE_CONTROLLER, - FILE_DEVICE_SECURE_OPEN, - FALSE, - &Fdo); - if (NT_SUCCESS(Status)) - { - DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension; - RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION)); - - DeviceExtension->Common.IsFDO = TRUE; - - DeviceExtension->Fdo = Fdo; - DeviceExtension->Pdo = Pdo; - - - Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status); - IoDeleteDevice(Fdo); - return Status; - } - - - Fdo->Flags |= DO_DIRECT_IO; - Fdo->Flags |= DO_POWER_PAGABLE; - - Fdo->Flags &= ~DO_DEVICE_INITIALIZING; - } - - return Status; -} static @@ -318,15 +267,24 @@ IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *DeviceRelations) { - PFDO_DEVICE_EXTENSION DeviceExtension; + PFDO_DEVICE_EXTENSION FdoDeviceExtension; + PPDO_DEVICE_EXTENSION PdoDeviceExtension; INTERFACE_TYPE InterfaceType = Isa; CONFIGURATION_TYPE ControllerType = DiskController; CONFIGURATION_TYPE PeripheralType = FloppyDiskPeripheral; + PDEVICE_RELATIONS Relations; + PDRIVE_INFO DriveInfo; + PDEVICE_OBJECT Pdo; + WCHAR DeviceNameBuffer[80]; + UNICODE_STRING DeviceName; + ULONG DeviceNumber = 0; + ULONG Size; + ULONG i; NTSTATUS Status; DPRINT1("FdcFdoQueryBusRelations() called\n"); - DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; Status = IoQueryDeviceDescription(&InterfaceType, NULL, @@ -335,13 +293,83 @@ &PeripheralType, NULL, FdcFdoConfigCallback, - DeviceExtension); - if (!NT_SUCCESS(Status) && (Status != STATUS_OBJECT_NAME_NOT_FOUND)) - { + FdoDeviceExtension); + if (!NT_SUCCESS(Status) && (Status != STATUS_NO_MORE_ENTRIES)) return Status; - } - - return STATUS_SUCCESS; + + Size = sizeof(DEVICE_RELATIONS) + + sizeof(Relations->Objects) * (FdoDeviceExtension->ControllerInfo.NumberOfDrives - 1); + Relations = (PDEVICE_RELATIONS)ExAllocatePool(PagedPool, Size); + if (Relations == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + Relations->Count = FdoDeviceExtension->ControllerInfo.NumberOfDrives; + + for (i = 0; i < FdoDeviceExtension->ControllerInfo.NumberOfDrives; i++) + { + DriveInfo = &FdoDeviceExtension->ControllerInfo.DriveInfo[i]; + + if (DriveInfo->DeviceObject == NULL) + { + do + { + swprintf(DeviceNameBuffer, L"\\Device\\FloppyPDO%lu", DeviceNumber++); + RtlInitUnicodeString(&DeviceName, DeviceNameBuffer); + DPRINT1("Device name: %S\n", DeviceNameBuffer); + + /* Create physical device object */ + Status = IoCreateDevice(FdoDeviceExtension->Common.DeviceObject->DriverObject, + sizeof(PDO_DEVICE_EXTENSION), + &DeviceName, + FILE_DEVICE_MASS_STORAGE, + FILE_DEVICE_SECURE_OPEN, + FALSE, + &Pdo); + } + while (Status == STATUS_OBJECT_NAME_COLLISION); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("PDO creation failed (Status 0x%08lx)\n", Status); + goto done; + } + + DPRINT1("PDO created: %S\n", DeviceNameBuffer); + + DriveInfo->DeviceObject = Pdo; + + PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension; + RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION)); + + PdoDeviceExtension->Common.IsFDO = FALSE; + PdoDeviceExtension->Common.DeviceObject = Pdo; + + PdoDeviceExtension->Fdo = FdoDeviceExtension->Common.DeviceObject; + PdoDeviceExtension->DriveInfo = DriveInfo; + + Pdo->Flags |= DO_DIRECT_IO; + Pdo->Flags |= DO_POWER_PAGABLE; + Pdo->Flags &= ~DO_DEVICE_INITIALIZING; + } + + ObReferenceObject(DriveInfo->DeviceObject); + Relations->Objects[i] = DriveInfo->DeviceObject; + } + +done: + if (NT_SUCCESS(Status)) + { + *DeviceRelations = Relations; + } + else + { + if (Relations != NULL) + ExFreePool(Relations); + } + + return Status; }
11 years, 4 months
1
0
0
0
[dgorbachev] 61148: [NTOSKRNL] Fix undefined behavior issue.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Fri Nov 29 22:34:43 2013 New Revision: 61148 URL:
http://svn.reactos.org/svn/reactos?rev=61148&view=rev
Log: [NTOSKRNL] Fix undefined behavior issue. Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] Fri Nov 29 22:34:43 2013 @@ -747,9 +747,11 @@ Status = STATUS_INSUFFICIENT_RESOURCES; goto cleanup; } - RtlCopyMemory(NewBuffer, ReturnBuffer.Buffer, ReturnBuffer.Length); if (ReturnBuffer.Buffer) + { + RtlCopyMemory(NewBuffer, ReturnBuffer.Buffer, ReturnBuffer.Length); ExFreePool(ReturnBuffer.Buffer); + } ReturnBuffer.Buffer = NewBuffer; } DPRINT("Adding symbolic link %wZ\n", &KeyName);
11 years, 4 months
1
0
0
0
[janderwald] 61147: [DEVMGR] - fix warning & bug - patch by Thomas Faber CORE-7593 #resolve #comment fixed
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Nov 29 22:25:51 2013 New Revision: 61147 URL:
http://svn.reactos.org/svn/reactos?rev=61147&view=rev
Log: [DEVMGR] - fix warning & bug - patch by Thomas Faber CORE-7593 #resolve #comment fixed Modified: trunk/reactos/dll/win32/devmgr/hwresource.c Modified: trunk/reactos/dll/win32/devmgr/hwresource.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/hwresourc…
============================================================================== --- trunk/reactos/dll/win32/devmgr/hwresource.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/hwresource.c [iso-8859-1] Fri Nov 29 22:25:51 2013 @@ -251,7 +251,7 @@ DWORD dwSize; PCM_RESOURCE_LIST ResourceList; LONG Result; - INT ItemCount = 0, Index = 0; + ULONG ItemCount = 0, Index; wsprintf(szBuffer, L"SYSTEM\\CurrentControlSet\\Enum\\%s\\LogConf", dap->szDeviceID); Result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szBuffer, 0, KEY_READ, &hKey); @@ -273,9 +273,9 @@ ResourceList = (PCM_RESOURCE_LIST)szData; - do - { - PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)&ResourceList->List[0].PartialResourceList.PartialDescriptors[ItemCount]; + for (Index = 0; Index < ResourceList->List[0].PartialResourceList.Count; Index++) + { + PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; if (Descriptor->Type == CmResourceTypeInterrupt) { if (LoadString(hDllInstance, IDS_RESOURCE_INTERRUPT, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) @@ -312,9 +312,7 @@ ItemCount++; } } - - Index++; - }while(Index <= ResourceList->List[0].PartialResourceList.Count); + } }
11 years, 4 months
1
0
0
0
[tfaber] 61146: [MSCONFIG] - Remove unused rsrc.rc file
by tfaber@svn.reactos.org
Author: tfaber Date: Fri Nov 29 18:13:28 2013 New Revision: 61146 URL:
http://svn.reactos.org/svn/reactos?rev=61146&view=rev
Log: [MSCONFIG] - Remove unused rsrc.rc file Removed: trunk/reactos/base/applications/msconfig/rsrc.rc Removed: trunk/reactos/base/applications/msconfig/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
============================================================================== --- trunk/reactos/base/applications/msconfig/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/msconfig/rsrc.rc (removed) @@ -1,85 +0,0 @@ -/* define language neutral resources */ - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - -/* include localised resources */ -// UTF-8 -#pragma code_page(65001) -#ifdef LANGUAGE_BG_BG - #include "lang/bg-BG.rc" -#endif -#ifdef LANGUAGE_CA_ES - #include "lang/ca-ES.rc" -#endif -#ifdef LANGUAGE_CS_CZ - #include "lang/cs-CZ.rc" -#endif -#ifdef LANGUAGE_DE_DE - #include "lang/de-DE.rc" -#endif -#ifdef LANGUAGE_EL_GR - #include "lang/el-GR.rc" -#endif -#ifdef LANGUAGE_EN_US - #include "lang/en-US.rc" -#endif -#ifdef LANGUAGE_ES_ES - #include "lang/es-ES.rc" -#endif -#ifdef LANGUAGE_FR_FR - #include "lang/fr-FR.rc" -#endif -#ifdef LANGUAGE_HE_IL - #include "lang/he-IL.rc" -#endif -#ifdef LANGUAGE_HU_HU - #include "lang/hu-HU.rc" -#endif -#ifdef LANGUAGE_ID_ID - #include "lang/id-ID.rc" -#endif -#ifdef LANGUAGE_IT_IT - #include "lang/it-IT.rc" -#endif -#ifdef LANGUAGE_KO_KR - #include "lang/ko-KR.rc" -#endif -#ifdef LANGUAGE_NL_NL - #include "lang/nl-NL.rc" -#endif -#ifdef LANGUAGE_NB_NO - #include "lang/no-NO.rc" -#endif -#ifdef LANGUAGE_PL_PL - #include "lang/pl-PL.rc" -#endif -#ifdef LANGUAGE_PT_BR - #include "lang/pt-BR.rc" -#endif -#ifdef LANGUAGE_RO_RO - #include "lang/ro-RO.rc" -#endif -#ifdef LANGUAGE_RU_RU - #include "lang/ru-RU.rc" -#endif -#ifdef LANGUAGE_SK_SK - #include "lang/sk-SK.rc" -#endif -#ifdef LANGUAGE_SV_SE - #include "lang/sv-SE.rc" -#endif -#ifdef LANGUAGE_TH_TH - #include "lang/th-TH.rc" -#endif -#ifdef LANGUAGE_TR_TR - #include "lang/tr-TR.rc" -#endif -#ifdef LANGUAGE_UK_UA - #include "lang/uk-UA.rc" -#endif -#ifdef LANGUAGE_ZH_CN - #include "lang/zh-CN.rc" -#endif -#ifdef LANGUAGE_ZH_TW - #include "lang/zh-TW.rc" -#endif
11 years, 4 months
1
0
0
0
[ekohl] 61145: [FASTFAT] FsdGetFsVolumeInformation: Return volume creation time.
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Nov 29 14:05:43 2013 New Revision: 61145 URL:
http://svn.reactos.org/svn/reactos?rev=61145&view=rev
Log: [FASTFAT] FsdGetFsVolumeInformation: Return volume creation time. Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c 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] Fri Nov 29 14:05:43 2013 @@ -21,6 +21,8 @@ PFILE_FS_VOLUME_INFORMATION FsVolumeInfo, PULONG BufferLength) { + PDEVICE_EXTENSION DeviceExt; + DPRINT("FsdGetFsVolumeInformation()\n"); DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo); DPRINT("BufferLength %lu\n", *BufferLength); @@ -34,14 +36,29 @@ if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)) return STATUS_BUFFER_OVERFLOW; + + DeviceExt = DeviceObject->DeviceExtension; /* valid entries */ FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber; FsVolumeInfo->VolumeLabelLength = DeviceObject->Vpb->VolumeLabelLength; RtlCopyMemory(FsVolumeInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabel, FsVolumeInfo->VolumeLabelLength); - /* dummy entries */ - FsVolumeInfo->VolumeCreationTime.QuadPart = 0; + if (DeviceExt->VolumeFcb->Flags & FCB_IS_FATX_ENTRY) + { + FsdDosDateTimeToSystemTime(DeviceExt, + DeviceExt->VolumeFcb->entry.FatX.CreationDate, + DeviceExt->VolumeFcb->entry.FatX.CreationTime, + &FsVolumeInfo->VolumeCreationTime); + } + else + { + FsdDosDateTimeToSystemTime(DeviceExt, + DeviceExt->VolumeFcb->entry.Fat.CreationDate, + DeviceExt->VolumeFcb->entry.Fat.CreationTime, + &FsVolumeInfo->VolumeCreationTime); + } + FsVolumeInfo->SupportsObjects = FALSE; DPRINT("Finished FsdGetFsVolumeInformation()\n");
11 years, 4 months
1
0
0
0
[ekohl] 61144: [FASTFAT] Removed accidential code change!
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Nov 29 11:05:04 2013 New Revision: 61144 URL:
http://svn.reactos.org/svn/reactos?rev=61144&view=rev
Log: [FASTFAT] Removed accidential code change! Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c 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] Fri Nov 29 11:05:04 2013 @@ -21,8 +21,6 @@ PFILE_FS_VOLUME_INFORMATION FsVolumeInfo, PULONG BufferLength) { - PDEVICE_EXTENSION DeviceExt; - DPRINT("FsdGetFsVolumeInformation()\n"); DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo); DPRINT("BufferLength %lu\n", *BufferLength); @@ -36,8 +34,6 @@ if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)) return STATUS_BUFFER_OVERFLOW; - - DeviceExt = DeviceObject->DeviceExtension; /* valid entries */ FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber;
11 years, 4 months
1
0
0
0
[ekohl] 61143: [FORMATTING] Fix indentation and coding style. No code changes!
by ekohl@svn.reactos.org
Author: ekohl Date: Fri Nov 29 11:03:34 2013 New Revision: 61143 URL:
http://svn.reactos.org/svn/reactos?rev=61143&view=rev
Log: [FORMATTING] Fix indentation and coding style. No code changes! Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c 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] Fri Nov 29 11:03:34 2013 @@ -14,424 +14,445 @@ /* FUNCTIONS ****************************************************************/ -static NTSTATUS -FsdGetFsVolumeInformation(PDEVICE_OBJECT DeviceObject, - PFILE_FS_VOLUME_INFORMATION FsVolumeInfo, - PULONG BufferLength) -{ - DPRINT("FsdGetFsVolumeInformation()\n"); - DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo); - DPRINT("BufferLength %lu\n", *BufferLength); - - DPRINT("Required length %lu\n", (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)); - DPRINT("LabelLength %hu\n", DeviceObject->Vpb->VolumeLabelLength); - DPRINT("Label %*.S\n", DeviceObject->Vpb->VolumeLabelLength / sizeof(WCHAR), DeviceObject->Vpb->VolumeLabel); - - if (*BufferLength < sizeof(FILE_FS_VOLUME_INFORMATION)) - return STATUS_INFO_LENGTH_MISMATCH; - - if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)) - return STATUS_BUFFER_OVERFLOW; - - /* valid entries */ - FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber; - FsVolumeInfo->VolumeLabelLength = DeviceObject->Vpb->VolumeLabelLength; - RtlCopyMemory(FsVolumeInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabel, FsVolumeInfo->VolumeLabelLength); - - /* dummy entries */ - FsVolumeInfo->VolumeCreationTime.QuadPart = 0; - FsVolumeInfo->SupportsObjects = FALSE; - - DPRINT("Finished FsdGetFsVolumeInformation()\n"); - - *BufferLength -= (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength); - - DPRINT("BufferLength %lu\n", *BufferLength); - - return(STATUS_SUCCESS); -} - - -static NTSTATUS -FsdGetFsAttributeInformation(PDEVICE_EXTENSION DeviceExt, - PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo, - PULONG BufferLength) -{ - PCWSTR pName; ULONG Length; - DPRINT("FsdGetFsAttributeInformation()\n"); - DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo); - DPRINT("BufferLength %lu\n", *BufferLength); - - if (*BufferLength < sizeof (FILE_FS_ATTRIBUTE_INFORMATION)) - return STATUS_INFO_LENGTH_MISMATCH; - - if (DeviceExt->FatInfo.FatType == FAT32) - { - Length = 10; - pName = L"FAT32"; - } - else - { - Length = 6; - pName = L"FAT"; - } - - DPRINT("Required length %lu\n", (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length)); - - if (*BufferLength < (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length)) - return STATUS_BUFFER_OVERFLOW; - - FsAttributeInfo->FileSystemAttributes = - FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK; - - FsAttributeInfo->MaximumComponentNameLength = 255; - - FsAttributeInfo->FileSystemNameLength = Length; - - RtlCopyMemory(FsAttributeInfo->FileSystemName, pName, Length ); - - DPRINT("Finished FsdGetFsAttributeInformation()\n"); - - *BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length); - DPRINT("BufferLength %lu\n", *BufferLength); - - return(STATUS_SUCCESS); -} - - -static NTSTATUS -FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject, - PFILE_FS_SIZE_INFORMATION FsSizeInfo, - PULONG BufferLength) -{ - PDEVICE_EXTENSION DeviceExt; - NTSTATUS Status; - - DPRINT("FsdGetFsSizeInformation()\n"); - DPRINT("FsSizeInfo = %p\n", FsSizeInfo); - - if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION)) - return(STATUS_BUFFER_OVERFLOW); - - DeviceExt = DeviceObject->DeviceExtension; - Status = CountAvailableClusters(DeviceExt, &FsSizeInfo->AvailableAllocationUnits); - - FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->FatInfo.NumberOfClusters; - FsSizeInfo->SectorsPerAllocationUnit = DeviceExt->FatInfo.SectorsPerCluster; - FsSizeInfo->BytesPerSector = DeviceExt->FatInfo.BytesPerSector; - - DPRINT("Finished FsdGetFsSizeInformation()\n"); - if (NT_SUCCESS(Status)) - *BufferLength -= sizeof(FILE_FS_SIZE_INFORMATION); - - return(Status); -} - - -static NTSTATUS -FsdGetFsDeviceInformation -( - PDEVICE_OBJECT DeviceObject, - PFILE_FS_DEVICE_INFORMATION FsDeviceInfo, - PULONG BufferLength -) -{ - DPRINT("FsdGetFsDeviceInformation()\n"); - DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo); - DPRINT("BufferLength %lu\n", *BufferLength); - DPRINT("Required length %lu\n", sizeof(FILE_FS_DEVICE_INFORMATION)); - - if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION)) - return(STATUS_BUFFER_OVERFLOW); - - FsDeviceInfo->DeviceType = FILE_DEVICE_DISK; - FsDeviceInfo->Characteristics = DeviceObject->Characteristics; - - DPRINT("FsdGetFsDeviceInformation() finished.\n"); - - *BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION); - DPRINT("BufferLength %lu\n", *BufferLength); - - return(STATUS_SUCCESS); -} - - -static NTSTATUS -FsdSetFsLabelInformation(PDEVICE_OBJECT DeviceObject, - PFILE_FS_LABEL_INFORMATION FsLabelInfo) -{ - PDEVICE_EXTENSION DeviceExt; - PVOID Context = NULL; - ULONG DirIndex = 0; - PDIR_ENTRY Entry; - PVFATFCB pRootFcb; - LARGE_INTEGER FileOffset; - BOOLEAN LabelFound = FALSE; - DIR_ENTRY VolumeLabelDirEntry; - ULONG VolumeLabelDirIndex; - ULONG LabelLen; - NTSTATUS Status = STATUS_UNSUCCESSFUL; - OEM_STRING StringO; - UNICODE_STRING StringW; - CHAR cString[43]; - ULONG SizeDirEntry; - ULONG EntriesPerPage; - - DPRINT("FsdSetFsLabelInformation()\n"); - - DeviceExt = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; - - if (sizeof(DeviceObject->Vpb->VolumeLabel) < FsLabelInfo->VolumeLabelLength) - { - return STATUS_NAME_TOO_LONG; - } - - if (DeviceExt->Flags & VCB_IS_FATX) - { - if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 42) - return STATUS_NAME_TOO_LONG; - SizeDirEntry = sizeof(FATX_DIR_ENTRY); - EntriesPerPage = FATX_ENTRIES_PER_PAGE; - } - else - { - if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 11) - return STATUS_NAME_TOO_LONG; - SizeDirEntry = sizeof(FAT_DIR_ENTRY); - EntriesPerPage = FAT_ENTRIES_PER_PAGE; - } - - /* Create Volume label dir entry */ - LabelLen = FsLabelInfo->VolumeLabelLength / sizeof(WCHAR); - RtlZeroMemory(&VolumeLabelDirEntry, SizeDirEntry); - StringW.Buffer = FsLabelInfo->VolumeLabel; - StringW.Length = StringW.MaximumLength = (USHORT)FsLabelInfo->VolumeLabelLength; - StringO.Buffer = cString; - StringO.Length = 0; - StringO.MaximumLength = 42; - Status = RtlUnicodeStringToOemString(&StringO, &StringW, FALSE); - if (!NT_SUCCESS(Status)) +static +NTSTATUS +FsdGetFsVolumeInformation( + PDEVICE_OBJECT DeviceObject, + PFILE_FS_VOLUME_INFORMATION FsVolumeInfo, + PULONG BufferLength) +{ + PDEVICE_EXTENSION DeviceExt; + + DPRINT("FsdGetFsVolumeInformation()\n"); + DPRINT("FsVolumeInfo = %p\n", FsVolumeInfo); + DPRINT("BufferLength %lu\n", *BufferLength); + + DPRINT("Required length %lu\n", (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)); + DPRINT("LabelLength %hu\n", DeviceObject->Vpb->VolumeLabelLength); + DPRINT("Label %*.S\n", DeviceObject->Vpb->VolumeLabelLength / sizeof(WCHAR), DeviceObject->Vpb->VolumeLabel); + + if (*BufferLength < sizeof(FILE_FS_VOLUME_INFORMATION)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (*BufferLength < (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength)) + return STATUS_BUFFER_OVERFLOW; + + DeviceExt = DeviceObject->DeviceExtension; + + /* valid entries */ + FsVolumeInfo->VolumeSerialNumber = DeviceObject->Vpb->SerialNumber; + FsVolumeInfo->VolumeLabelLength = DeviceObject->Vpb->VolumeLabelLength; + RtlCopyMemory(FsVolumeInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabel, FsVolumeInfo->VolumeLabelLength); + + /* dummy entries */ + FsVolumeInfo->VolumeCreationTime.QuadPart = 0; + FsVolumeInfo->SupportsObjects = FALSE; + + DPRINT("Finished FsdGetFsVolumeInformation()\n"); + + *BufferLength -= (sizeof(FILE_FS_VOLUME_INFORMATION) + DeviceObject->Vpb->VolumeLabelLength); + + DPRINT("BufferLength %lu\n", *BufferLength); + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +FsdGetFsAttributeInformation( + PDEVICE_EXTENSION DeviceExt, + PFILE_FS_ATTRIBUTE_INFORMATION FsAttributeInfo, + PULONG BufferLength) +{ + PCWSTR pName; ULONG Length; + DPRINT("FsdGetFsAttributeInformation()\n"); + DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo); + DPRINT("BufferLength %lu\n", *BufferLength); + + if (*BufferLength < sizeof (FILE_FS_ATTRIBUTE_INFORMATION)) + return STATUS_INFO_LENGTH_MISMATCH; + + if (DeviceExt->FatInfo.FatType == FAT32) + { + Length = 10; + pName = L"FAT32"; + } + else + { + Length = 6; + pName = L"FAT"; + } + + DPRINT("Required length %lu\n", (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length)); + + if (*BufferLength < (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length)) + return STATUS_BUFFER_OVERFLOW; + + FsAttributeInfo->FileSystemAttributes = + FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK; + + FsAttributeInfo->MaximumComponentNameLength = 255; + + FsAttributeInfo->FileSystemNameLength = Length; + + RtlCopyMemory(FsAttributeInfo->FileSystemName, pName, Length); + + DPRINT("Finished FsdGetFsAttributeInformation()\n"); + + *BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + Length); + DPRINT("BufferLength %lu\n", *BufferLength); + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +FsdGetFsSizeInformation( + PDEVICE_OBJECT DeviceObject, + PFILE_FS_SIZE_INFORMATION FsSizeInfo, + PULONG BufferLength) +{ + PDEVICE_EXTENSION DeviceExt; + NTSTATUS Status; + + DPRINT("FsdGetFsSizeInformation()\n"); + DPRINT("FsSizeInfo = %p\n", FsSizeInfo); + + if (*BufferLength < sizeof(FILE_FS_SIZE_INFORMATION)) + return STATUS_BUFFER_OVERFLOW; + + DeviceExt = DeviceObject->DeviceExtension; + Status = CountAvailableClusters(DeviceExt, &FsSizeInfo->AvailableAllocationUnits); + + FsSizeInfo->TotalAllocationUnits.QuadPart = DeviceExt->FatInfo.NumberOfClusters; + FsSizeInfo->SectorsPerAllocationUnit = DeviceExt->FatInfo.SectorsPerCluster; + FsSizeInfo->BytesPerSector = DeviceExt->FatInfo.BytesPerSector; + + DPRINT("Finished FsdGetFsSizeInformation()\n"); + if (NT_SUCCESS(Status)) + *BufferLength -= sizeof(FILE_FS_SIZE_INFORMATION); + return Status; - if (DeviceExt->Flags & VCB_IS_FATX) - { - RtlCopyMemory(VolumeLabelDirEntry.FatX.Filename, cString, LabelLen); - memset(&VolumeLabelDirEntry.FatX.Filename[LabelLen], ' ', 42 - LabelLen); - VolumeLabelDirEntry.FatX.Attrib = _A_VOLID; - } - else - { - RtlCopyMemory(VolumeLabelDirEntry.Fat.Filename, cString, max(sizeof(VolumeLabelDirEntry.Fat.Filename), LabelLen)); - if (LabelLen > sizeof(VolumeLabelDirEntry.Fat.Filename)) - { - memset(VolumeLabelDirEntry.Fat.Ext, ' ', sizeof(VolumeLabelDirEntry.Fat.Ext)); - RtlCopyMemory(VolumeLabelDirEntry.Fat.Ext, cString + sizeof(VolumeLabelDirEntry.Fat.Filename), LabelLen - sizeof(VolumeLabelDirEntry.Fat.Filename)); +} + + +static +NTSTATUS +FsdGetFsDeviceInformation( + PDEVICE_OBJECT DeviceObject, + PFILE_FS_DEVICE_INFORMATION FsDeviceInfo, + PULONG BufferLength) +{ + DPRINT("FsdGetFsDeviceInformation()\n"); + DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo); + DPRINT("BufferLength %lu\n", *BufferLength); + DPRINT("Required length %lu\n", sizeof(FILE_FS_DEVICE_INFORMATION)); + + if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION)) + return STATUS_BUFFER_OVERFLOW; + + FsDeviceInfo->DeviceType = FILE_DEVICE_DISK; + FsDeviceInfo->Characteristics = DeviceObject->Characteristics; + + DPRINT("FsdGetFsDeviceInformation() finished.\n"); + + *BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION); + DPRINT("BufferLength %lu\n", *BufferLength); + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +FsdSetFsLabelInformation( + PDEVICE_OBJECT DeviceObject, + PFILE_FS_LABEL_INFORMATION FsLabelInfo) +{ + PDEVICE_EXTENSION DeviceExt; + PVOID Context = NULL; + ULONG DirIndex = 0; + PDIR_ENTRY Entry; + PVFATFCB pRootFcb; + LARGE_INTEGER FileOffset; + BOOLEAN LabelFound = FALSE; + DIR_ENTRY VolumeLabelDirEntry; + ULONG VolumeLabelDirIndex; + ULONG LabelLen; + NTSTATUS Status = STATUS_UNSUCCESSFUL; + OEM_STRING StringO; + UNICODE_STRING StringW; + CHAR cString[43]; + ULONG SizeDirEntry; + ULONG EntriesPerPage; + + DPRINT("FsdSetFsLabelInformation()\n"); + + DeviceExt = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension; + + if (sizeof(DeviceObject->Vpb->VolumeLabel) < FsLabelInfo->VolumeLabelLength) + { + return STATUS_NAME_TOO_LONG; + } + + if (DeviceExt->Flags & VCB_IS_FATX) + { + if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 42) + return STATUS_NAME_TOO_LONG; + + SizeDirEntry = sizeof(FATX_DIR_ENTRY); + EntriesPerPage = FATX_ENTRIES_PER_PAGE; } else { - memset(&VolumeLabelDirEntry.Fat.Filename[LabelLen], ' ', sizeof(VolumeLabelDirEntry.Fat.Filename) - LabelLen); - } - VolumeLabelDirEntry.Fat.Attrib = _A_VOLID; - } - - pRootFcb = vfatOpenRootFCB(DeviceExt); - - /* Search existing volume entry on disk */ - FileOffset.QuadPart = 0; - if (CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE, &Context, (PVOID*)&Entry)) - { - while (TRUE) - { - if (ENTRY_VOLUME(DeviceExt, Entry)) - { - /* Update entry */ - LabelFound = TRUE; - RtlCopyMemory(Entry, &VolumeLabelDirEntry, SizeDirEntry); - CcSetDirtyPinnedData(Context, NULL); - Status = STATUS_SUCCESS; - break; - } - if (ENTRY_END(DeviceExt, Entry)) - { - break; - } - DirIndex++; - Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry); - if ((DirIndex % EntriesPerPage) == 0) - { - CcUnpinData(Context); - FileOffset.u.LowPart += PAGE_SIZE; - if (!CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE, &Context, (PVOID*)&Entry)) + if (FsLabelInfo->VolumeLabelLength / sizeof(WCHAR) > 11) + return STATUS_NAME_TOO_LONG; + + SizeDirEntry = sizeof(FAT_DIR_ENTRY); + EntriesPerPage = FAT_ENTRIES_PER_PAGE; + } + + /* Create Volume label dir entry */ + LabelLen = FsLabelInfo->VolumeLabelLength / sizeof(WCHAR); + RtlZeroMemory(&VolumeLabelDirEntry, SizeDirEntry); + StringW.Buffer = FsLabelInfo->VolumeLabel; + StringW.Length = StringW.MaximumLength = (USHORT)FsLabelInfo->VolumeLabelLength; + StringO.Buffer = cString; + StringO.Length = 0; + StringO.MaximumLength = 42; + Status = RtlUnicodeStringToOemString(&StringO, &StringW, FALSE); + if (!NT_SUCCESS(Status)) + return Status; + + if (DeviceExt->Flags & VCB_IS_FATX) + { + RtlCopyMemory(VolumeLabelDirEntry.FatX.Filename, cString, LabelLen); + memset(&VolumeLabelDirEntry.FatX.Filename[LabelLen], ' ', 42 - LabelLen); + VolumeLabelDirEntry.FatX.Attrib = _A_VOLID; + } + else + { + RtlCopyMemory(VolumeLabelDirEntry.Fat.Filename, cString, max(sizeof(VolumeLabelDirEntry.Fat.Filename), LabelLen)); + if (LabelLen > sizeof(VolumeLabelDirEntry.Fat.Filename)) { - Context = NULL; - break; + memset(VolumeLabelDirEntry.Fat.Ext, ' ', sizeof(VolumeLabelDirEntry.Fat.Ext)); + RtlCopyMemory(VolumeLabelDirEntry.Fat.Ext, cString + sizeof(VolumeLabelDirEntry.Fat.Filename), LabelLen - sizeof(VolumeLabelDirEntry.Fat.Filename)); } - } - } - if (Context) - { - CcUnpinData(Context); - } - } - if (!LabelFound) - { - /* Add new entry for label */ - if (!vfatFindDirSpace(DeviceExt, pRootFcb, 1, &VolumeLabelDirIndex)) - Status = STATUS_DISK_FULL; - else - { - FileOffset.u.HighPart = 0; - FileOffset.u.LowPart = VolumeLabelDirIndex * SizeDirEntry; - if (!CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, - TRUE, &Context, (PVOID*)&Entry)) - { - Status = STATUS_UNSUCCESSFUL; - } - else - { - RtlCopyMemory(Entry, &VolumeLabelDirEntry, SizeDirEntry); - CcSetDirtyPinnedData(Context, NULL); - CcUnpinData(Context); - Status = STATUS_SUCCESS; - } - } - } - - vfatReleaseFCB(DeviceExt, pRootFcb); - if (!NT_SUCCESS(Status)) - { + else + { + memset(&VolumeLabelDirEntry.Fat.Filename[LabelLen], ' ', sizeof(VolumeLabelDirEntry.Fat.Filename) - LabelLen); + } + VolumeLabelDirEntry.Fat.Attrib = _A_VOLID; + } + + pRootFcb = vfatOpenRootFCB(DeviceExt); + + /* Search existing volume entry on disk */ + FileOffset.QuadPart = 0; + if (CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE, &Context, (PVOID*)&Entry)) + { + while (TRUE) + { + if (ENTRY_VOLUME(DeviceExt, Entry)) + { + /* Update entry */ + LabelFound = TRUE; + RtlCopyMemory(Entry, &VolumeLabelDirEntry, SizeDirEntry); + CcSetDirtyPinnedData(Context, NULL); + Status = STATUS_SUCCESS; + break; + } + + if (ENTRY_END(DeviceExt, Entry)) + { + break; + } + + DirIndex++; + Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry); + if ((DirIndex % EntriesPerPage) == 0) + { + CcUnpinData(Context); + FileOffset.u.LowPart += PAGE_SIZE; + if (!CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE, &Context, (PVOID*)&Entry)) + { + Context = NULL; + break; + } + } + } + + if (Context) + { + CcUnpinData(Context); + } + } + + if (!LabelFound) + { + /* Add new entry for label */ + if (!vfatFindDirSpace(DeviceExt, pRootFcb, 1, &VolumeLabelDirIndex)) + Status = STATUS_DISK_FULL; + else + { + FileOffset.u.HighPart = 0; + FileOffset.u.LowPart = VolumeLabelDirIndex * SizeDirEntry; + if (!CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, + TRUE, &Context, (PVOID*)&Entry)) + { + Status = STATUS_UNSUCCESSFUL; + } + else + { + RtlCopyMemory(Entry, &VolumeLabelDirEntry, SizeDirEntry); + CcSetDirtyPinnedData(Context, NULL); + CcUnpinData(Context); + Status = STATUS_SUCCESS; + } + } + } + + vfatReleaseFCB(DeviceExt, pRootFcb); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Update volume label in memory */ + DeviceObject->Vpb->VolumeLabelLength = (USHORT)FsLabelInfo->VolumeLabelLength; + RtlCopyMemory(DeviceObject->Vpb->VolumeLabel, FsLabelInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabelLength); + return Status; - } - - /* Update volume label in memory */ - DeviceObject->Vpb->VolumeLabelLength = (USHORT)FsLabelInfo->VolumeLabelLength; - RtlCopyMemory(DeviceObject->Vpb->VolumeLabel, FsLabelInfo->VolumeLabel, DeviceObject->Vpb->VolumeLabelLength); - - return Status; -} - - -NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) +} + + +NTSTATUS +VfatQueryVolumeInformation( + PVFAT_IRP_CONTEXT IrpContext) /* * FUNCTION: Retrieve the specified volume information */ { - FS_INFORMATION_CLASS FsInformationClass; - NTSTATUS RC = STATUS_SUCCESS; - PVOID SystemBuffer; - ULONG BufferLength; - - /* PRECONDITION */ - ASSERT(IrpContext); - - DPRINT("VfatQueryVolumeInformation(IrpContext %p)\n", IrpContext); - - if (!ExAcquireResourceSharedLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, - (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) - { - return VfatQueueRequest (IrpContext); - } - - /* INITIALIZATION */ - FsInformationClass = IrpContext->Stack->Parameters.QueryVolume.FsInformationClass; - BufferLength = IrpContext->Stack->Parameters.QueryVolume.Length; - SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; - - - DPRINT ("FsInformationClass %d\n", FsInformationClass); - DPRINT ("SystemBuffer %p\n", SystemBuffer); - - switch (FsInformationClass) - { - case FileFsVolumeInformation: - RC = FsdGetFsVolumeInformation(IrpContext->DeviceObject, - SystemBuffer, - &BufferLength); - break; - - case FileFsAttributeInformation: - RC = FsdGetFsAttributeInformation(IrpContext->DeviceObject->DeviceExtension, - SystemBuffer, - &BufferLength); - break; - - case FileFsSizeInformation: - RC = FsdGetFsSizeInformation(IrpContext->DeviceObject, - SystemBuffer, - &BufferLength); - break; - - case FileFsDeviceInformation: - RC = FsdGetFsDeviceInformation(IrpContext->DeviceObject, - SystemBuffer, - &BufferLength); - break; - - default: - RC = STATUS_NOT_SUPPORTED; - } - - ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); - IrpContext->Irp->IoStatus.Status = RC; - if (NT_SUCCESS(RC)) - IrpContext->Irp->IoStatus.Information = - IrpContext->Stack->Parameters.QueryVolume.Length - BufferLength; - else - IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); - - return RC; -} - - -NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) + FS_INFORMATION_CLASS FsInformationClass; + NTSTATUS RC = STATUS_SUCCESS; + PVOID SystemBuffer; + ULONG BufferLength; + + /* PRECONDITION */ + ASSERT(IrpContext); + + DPRINT("VfatQueryVolumeInformation(IrpContext %p)\n", IrpContext); + + if (!ExAcquireResourceSharedLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, + (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) + { + return VfatQueueRequest(IrpContext); + } + + /* INITIALIZATION */ + FsInformationClass = IrpContext->Stack->Parameters.QueryVolume.FsInformationClass; + BufferLength = IrpContext->Stack->Parameters.QueryVolume.Length; + SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; + + DPRINT("FsInformationClass %d\n", FsInformationClass); + DPRINT("SystemBuffer %p\n", SystemBuffer); + + switch (FsInformationClass) + { + case FileFsVolumeInformation: + RC = FsdGetFsVolumeInformation(IrpContext->DeviceObject, + SystemBuffer, + &BufferLength); + break; + + case FileFsAttributeInformation: + RC = FsdGetFsAttributeInformation(IrpContext->DeviceObject->DeviceExtension, + SystemBuffer, + &BufferLength); + break; + + case FileFsSizeInformation: + RC = FsdGetFsSizeInformation(IrpContext->DeviceObject, + SystemBuffer, + &BufferLength); + break; + + case FileFsDeviceInformation: + RC = FsdGetFsDeviceInformation(IrpContext->DeviceObject, + SystemBuffer, + &BufferLength); + break; + + default: + RC = STATUS_NOT_SUPPORTED; + } + + ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); + IrpContext->Irp->IoStatus.Status = RC; + if (NT_SUCCESS(RC)) + IrpContext->Irp->IoStatus.Information = + IrpContext->Stack->Parameters.QueryVolume.Length - BufferLength; + else + IrpContext->Irp->IoStatus.Information = 0; + IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); + VfatFreeIrpContext(IrpContext); + + return RC; +} + + +NTSTATUS +VfatSetVolumeInformation( + PVFAT_IRP_CONTEXT IrpContext) /* * FUNCTION: Set the specified volume information */ { - FS_INFORMATION_CLASS FsInformationClass; - NTSTATUS Status = STATUS_SUCCESS; - PVOID SystemBuffer; - ULONG BufferLength; - PIO_STACK_LOCATION Stack = IrpContext->Stack; - - /* PRECONDITION */ - ASSERT(IrpContext); - - DPRINT ("VfatSetVolumeInformation(IrpContext %p)\n", IrpContext); - - if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, - (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) - { - return VfatQueueRequest (IrpContext); - } - - FsInformationClass = Stack->Parameters.SetVolume.FsInformationClass; - BufferLength = Stack->Parameters.SetVolume.Length; - SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; - - DPRINT ("FsInformationClass %d\n", FsInformationClass); - DPRINT ("BufferLength %u\n", BufferLength); - DPRINT ("SystemBuffer %p\n", SystemBuffer); - - switch(FsInformationClass) - { - case FileFsLabelInformation: - Status = FsdSetFsLabelInformation(IrpContext->DeviceObject, - SystemBuffer); - break; - - default: - Status = STATUS_NOT_SUPPORTED; - } - - ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); - IrpContext->Irp->IoStatus.Status = Status; - IrpContext->Irp->IoStatus.Information = 0; - IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); - VfatFreeIrpContext(IrpContext); - - return(Status); + FS_INFORMATION_CLASS FsInformationClass; + NTSTATUS Status = STATUS_SUCCESS; + PVOID SystemBuffer; + ULONG BufferLength; + PIO_STACK_LOCATION Stack = IrpContext->Stack; + + /* PRECONDITION */ + ASSERT(IrpContext); + + DPRINT("VfatSetVolumeInformation(IrpContext %p)\n", IrpContext); + + if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource, + (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT))) + { + return VfatQueueRequest(IrpContext); + } + + FsInformationClass = Stack->Parameters.SetVolume.FsInformationClass; + BufferLength = Stack->Parameters.SetVolume.Length; + SystemBuffer = IrpContext->Irp->AssociatedIrp.SystemBuffer; + + DPRINT("FsInformationClass %d\n", FsInformationClass); + DPRINT("BufferLength %u\n", BufferLength); + DPRINT("SystemBuffer %p\n", SystemBuffer); + + switch (FsInformationClass) + { + case FileFsLabelInformation: + Status = FsdSetFsLabelInformation(IrpContext->DeviceObject, + SystemBuffer); + break; + + default: + Status = STATUS_NOT_SUPPORTED; + } + + ExReleaseResourceLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource); + IrpContext->Irp->IoStatus.Status = Status; + IrpContext->Irp->IoStatus.Information = 0; + IoCompleteRequest(IrpContext->Irp, IO_NO_INCREMENT); + VfatFreeIrpContext(IrpContext); + + return Status; } /* EOF */
11 years, 4 months
1
0
0
0
[jimtabor] 61142: [Win32k] - Fix CORE-1161 and CORE-6651. - Minor fixups.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Nov 29 03:43:41 2013 New Revision: 61142 URL:
http://svn.reactos.org/svn/reactos?rev=61142&view=rev
Log: [Win32k] - Fix CORE-1161 and CORE-6651. - Minor fixups. Modified: trunk/reactos/win32ss/user/ntuser/desktop.c trunk/reactos/win32ss/user/ntuser/focus.c trunk/reactos/win32ss/user/ntuser/winpos.c Modified: trunk/reactos/win32ss/user/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/deskto…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/desktop.c [iso-8859-1] Fri Nov 29 03:43:41 2013 @@ -518,8 +518,16 @@ gpqForegroundPrev = Old; } // Only one Q can have active foreground even when there are more than one desktop. - if (NewQueue) gpqForeground = pdo->ActiveMessageQueue; - else gpqForeground = NULL; + if (NewQueue) + { + gpqForeground = pdo->ActiveMessageQueue; + } + else + { + gpqForeground = NULL; + ERR("ptiLastInput is CLEARED!!\n"); + ptiLastInput = NULL; // ReactOS hacks,,,, should check for process death. + } } PWND FASTCALL 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 Nov 29 03:43:41 2013 @@ -136,6 +136,31 @@ co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, flags); } } + } + //// + //// CORE-1161 and CORE-6651 + if (Window->spwndPrev) + { + HWND *phwndTopLevel, *phwndCurrent; + PWND pwndCurrent, pwndDesktop; + + pwndDesktop = UserGetDesktopWindow(); + if (Window->spwndParent == pwndDesktop ) + { + phwndTopLevel = IntWinListChildren(pwndDesktop); + phwndCurrent = phwndTopLevel; + while(*phwndCurrent) + { + pwndCurrent = UserGetWindowObject(*phwndCurrent); + + if (pwndCurrent && pwndCurrent->spwndOwner == Window ) + { + co_WinPosSetWindowPos(pwndCurrent, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE); + } + phwndCurrent++; + } + ExFreePool(phwndTopLevel); + } } //// OldTID = WindowPrev ? IntGetWndThreadId(WindowPrev) : NULL; @@ -184,7 +209,7 @@ } } } - ExFreePool(List);//ExFreePoolWithTag(List, USERTAG_WINDOWLIST); + ExFreePoolWithTag(List, USERTAG_WINDOWLIST); } } if (WindowPrev) Modified: trunk/reactos/win32ss/user/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Fri Nov 29 03:43:41 2013 @@ -359,7 +359,7 @@ //ERR("WinPosActivateOtherWindow Set Active 0x%p\n",WndTo); if (!co_IntSetActiveWindow(WndTo,FALSE,TRUE,FALSE)) /* Ok for WndTo to be NULL here */ { - co_IntSetActiveWindow(0,FALSE,TRUE,FALSE); + co_IntSetActiveWindow(NULL,FALSE,TRUE,FALSE); } if (WndTo) UserDerefObjectCo(WndTo); }
11 years, 4 months
1
0
0
0
[aandrejevic] 61141: [FAST486] Start implementing the FPU. Stubplement the FPU opcode handlers.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri Nov 29 03:00:59 2013 New Revision: 61141 URL:
http://svn.reactos.org/svn/reactos?rev=61141&view=rev
Log: [FAST486] Start implementing the FPU. Stubplement the FPU opcode handlers. Added: branches/ntvdm/lib/fast486/fpu.c (with props) branches/ntvdm/lib/fast486/fpu.h (with props) Modified: branches/ntvdm/include/reactos/libs/fast486/fast486.h branches/ntvdm/lib/fast486/CMakeLists.txt branches/ntvdm/lib/fast486/opcodes.c Modified: branches/ntvdm/include/reactos/libs/fast486/fast486.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/libs/fast…
============================================================================== --- branches/ntvdm/include/reactos/libs/fast486/fast486.h [iso-8859-1] (original) +++ branches/ntvdm/include/reactos/libs/fast486/fast486.h [iso-8859-1] Fri Nov 29 03:00:59 2013 @@ -34,6 +34,7 @@ #define FAST486_NUM_SEG_REGS 6 #define FAST486_NUM_CTRL_REGS 3 #define FAST486_NUM_DBG_REGS 6 +#define FAST486_NUM_FPU_REGS 8 #define FAST486_CR0_PE (1 << 0) #define FAST486_CR0_MP (1 << 1) @@ -376,6 +377,55 @@ ULONG IopbOffset; } FAST486_TSS, *PFAST486_TSS; +typedef struct _FAST486_FPU_DATA_REG +{ + ULONGLONG Mantissa; + USHORT Exponent; +} FAST486_FPU_DATA_REG, *PFAST486_FPU_DATA_REG; + +typedef union _FAST486_FPU_STATUS_REG +{ + USHORT Value; + + struct + { + ULONG Ie : 1; + ULONG De : 1; + ULONG Ze : 1; + ULONG Oe : 1; + ULONG Ue : 1; + ULONG Pe : 1; + ULONG Sf : 1; + ULONG Es : 1; + ULONG Code0 : 1; + ULONG Code1 : 1; + ULONG Code2 : 1; + ULONG Top : 3; + ULONG Code3 : 1; + ULONG Busy : 1; + }; +} FAST486_FPU_STATUS_REG, *PFAST486_FPU_STATUS_REG; + +typedef union _FAST486_FPU_CONTROL_REG +{ + USHORT Value; + + struct + { + ULONG Im : 1; + ULONG Dm : 1; + ULONG Zm : 1; + ULONG Om : 1; + ULONG Um : 1; + ULONG Pm : 1; + ULONG Reserved : 2; + ULONG Pc : 2; + ULONG Rc : 2; + ULONG Inf : 1; + // ULONG Reserved1 : 3; + }; +} FAST486_FPU_CONTROL_REG, *PFAST486_FPU_CONTROL_REG; + struct _FAST486_STATE { FAST486_MEM_READ_PROC MemReadCallback; @@ -399,6 +449,10 @@ FAST486_INT_STATUS IntStatus; UCHAR PendingIntNum; PULONG Tlb; + FAST486_FPU_DATA_REG FpuRegisters[FAST486_NUM_FPU_REGS]; + FAST486_FPU_STATUS_REG FpuStatus; + FAST486_FPU_CONTROL_REG FpuControl; + USHORT FpuTag; }; /* FUNCTIONS ******************************************************************/ Modified: branches/ntvdm/lib/fast486/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/CMakeLists.tx…
============================================================================== --- branches/ntvdm/lib/fast486/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/CMakeLists.txt [iso-8859-1] Fri Nov 29 03:00:59 2013 @@ -6,6 +6,7 @@ opcodes.c opgroups.c extraops.c - common.c) + common.c + fpu.c) add_library(fast486 ${SOURCE}) Added: branches/ntvdm/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.c?rev=611…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.c (added) +++ branches/ntvdm/lib/fast486/fpu.c [iso-8859-1] Fri Nov 29 03:00:59 2013 @@ -0,0 +1,100 @@ +/* + * Fast486 386/486 CPU Emulation Library + * fpu.c + * + * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/* INCLUDES *******************************************************************/ + +#include <windef.h> + +// #define NDEBUG +#include <debug.h> + +#include <fast486.h> +#include "common.h" +#include "opcodes.h" +#include "fpu.h" + +/* PUBLIC FUNCTIONS ***********************************************************/ + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF) +{ + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; +} + +/* EOF */ Propchange: branches/ntvdm/lib/fast486/fpu.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ntvdm/lib/fast486/fpu.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/fpu.h?rev=611…
============================================================================== --- branches/ntvdm/lib/fast486/fpu.h (added) +++ branches/ntvdm/lib/fast486/fpu.h [iso-8859-1] Fri Nov 29 03:00:59 2013 @@ -0,0 +1,55 @@ +/* + * Fast486 386/486 CPU Emulation Library + * fpu.h + * + * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _FPU_H_ +#define _FPU_H_ + +#pragma once + +/* DEFINES ********************************************************************/ + +enum +{ + FPU_SINGLE_PRECISION = 0, + FPU_DOUBLE_PRECISION = 2, + FPU_DOUBLE_EXT_PRECISION = 3 +}; + +enum +{ + FPU_TAG_VALID = 0, + FPU_TAG_ZERO = 1, + FPU_TAG_SPECIAL = 2, + FPU_TAG_EMPTY = 3 +}; + +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE); +FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF); + +#endif // _FPU_H_ + +/* EOF */ Propchange: branches/ntvdm/lib/fast486/fpu.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/ntvdm/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opcodes.c?rev…
============================================================================== --- branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] Fri Nov 29 03:00:59 2013 @@ -31,6 +31,7 @@ #include "opgroups.h" #include "extraops.h" #include "common.h" +#include "fpu.h" /* PUBLIC VARIABLES ***********************************************************/ @@ -253,14 +254,14 @@ Fast486OpcodeAad, Fast486OpcodeSalc, Fast486OpcodeXlat, - NULL, // TODO: OPCODE 0xD8 NOT SUPPORTED - NULL, // TODO: OPCODE 0xD9 NOT SUPPORTED - NULL, // TODO: OPCODE 0xDA NOT SUPPORTED - NULL, // TODO: OPCODE 0xDB NOT SUPPORTED - NULL, // TODO: OPCODE 0xDC NOT SUPPORTED - NULL, // TODO: OPCODE 0xDD NOT SUPPORTED - NULL, // TODO: OPCODE 0xDE NOT SUPPORTED - NULL, // TODO: OPCODE 0xDF NOT SUPPORTED + Fast486FpuOpcodeD8, + Fast486FpuOpcodeD9, + Fast486FpuOpcodeDA, + Fast486FpuOpcodeDB, + Fast486FpuOpcodeDC, + Fast486FpuOpcodeDD, + Fast486FpuOpcodeDE, + Fast486FpuOpcodeDF, Fast486OpcodeLoop, Fast486OpcodeLoop, Fast486OpcodeLoop,
11 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200