ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[tkreuzer] 46630: [win32k] Use PREGION as type fo the DC regions instead of PVOID.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Apr 1 00:43:02 2010 New Revision: 46630 URL:
http://svn.reactos.org/svn/reactos?rev=46630&view=rev
Log: [win32k] Use PREGION as type fo the DC regions instead of PVOID. Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h branches/reactos-yarotows/subsystems/win32/win32k/include/region.h branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h [iso-8859-1] Thu Apr 1 00:43:02 2010 @@ -8,6 +8,7 @@ #include "bitmaps.h" #include "pdevobj.h" #include "palette.h" +#include "region.h" /* Constants ******************************************************************/ @@ -127,9 +128,9 @@ RECTL erclWindow; RECTL erclBounds; RECTL erclBoundsApp; - PVOID prgnAPI; /* PROSRGNDATA */ - PVOID prgnVis; /* Visible region (must never be 0) */ - PVOID prgnRao; + PREGION prgnAPI; /* PROSRGNDATA */ + PREGION prgnVis; /* Visible region (must never be 0) */ + PREGION prgnRao; POINTL ptlFillOrigin; EBRUSHOBJ eboFill; EBRUSHOBJ eboLine; Modified: branches/reactos-yarotows/subsystems/win32/win32k/include/region.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/include/region.h [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/include/region.h [iso-8859-1] Thu Apr 1 00:43:02 2010 @@ -14,7 +14,7 @@ RGNDATAHEADER rdh; RECTL *Buffer; -} ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA; +} ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA, REGION, *PREGION; /* Functions ******************************************************************/ Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c [iso-8859-1] Thu Apr 1 00:43:02 2010 @@ -365,7 +365,7 @@ if (pdc->rosdc.hClipRgn) GreDeleteObject(pdc->rosdc.hClipRgn); if (pdc->prgnVis) - REGION_FreeRgnByHandle(((PROSRGNDATA)pdc->prgnVis)->BaseObject.hHmgr); + REGION_FreeRgnByHandle(pdc->prgnVis->BaseObject.hHmgr); ASSERT(pdc->rosdc.hGCClipRgn); if (pdc->rosdc.hGCClipRgn) GreDeleteObject(pdc->rosdc.hGCClipRgn); @@ -419,12 +419,12 @@ } if (pDC->prgnVis) { // FIXME! HAX!!! - Index = GDI_HANDLE_GET_INDEX(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr); + Index = GDI_HANDLE_GET_INDEX(pDC->prgnVis->BaseObject.hHmgr); Entry = &GdiHandleTable->Entries[Index]; if (Entry->UserData) FreeObjectAttr(Entry->UserData); Entry->UserData = NULL; // - if (!GDIOBJ_SetOwnership(((PROSRGNDATA)pDC->prgnVis)->BaseObject.hHmgr, Owner)) goto leave; + if (!GDIOBJ_SetOwnership(pDC->prgnVis->BaseObject.hHmgr, Owner)) goto leave; } if (pDC->rosdc.hGCClipRgn) { // FIXME! HAX!!!
14 years, 8 months
1
0
0
0
[ekohl] 46629: [NTORKRNL] SepAccessCheck: Deny access if the DACL is is empty (but not NULL).
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Mar 31 23:02:38 2010 New Revision: 46629 URL:
http://svn.reactos.org/svn/reactos?rev=46629&view=rev
Log: [NTORKRNL] SepAccessCheck: Deny access if the DACL is is empty (but not NULL). Modified: trunk/reactos/ntoskrnl/se/semgr.c Modified: trunk/reactos/ntoskrnl/se/semgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=46…
============================================================================== --- trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] Wed Mar 31 23:02:38 2010 @@ -457,6 +457,14 @@ } } + /* Deny access if the DACL is empty */ + if (Dacl->AceCount == 0) + { + *GrantedAccess = 0; + *AccessStatus = STATUS_ACCESS_DENIED; + return FALSE; + } + /* RULE 3: Check whether the token is the owner */ Status = RtlGetOwnerSecurityDescriptor(SecurityDescriptor, &Sid,
14 years, 8 months
1
0
0
0
[sir_richard] 46628: [HALACPI]: Begin rough implementation of the Hal ACPI PnP Driver. Will probably need some changes to the ReactOS PnP Manager to work properly (it is not initialized yet). [HAL]: Implement helper registry routine. [HAL]: Implement function to set ACPI mode the "Windows way", which is to enable/disable the firmware mapper. PnP Manager should probably check this in the future.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Mar 31 22:58:42 2010 New Revision: 46628 URL:
http://svn.reactos.org/svn/reactos?rev=46628&view=rev
Log: [HALACPI]: Begin rough implementation of the Hal ACPI PnP Driver. Will probably need some changes to the ReactOS PnP Manager to work properly (it is not initialized yet). [HAL]: Implement helper registry routine. [HAL]: Implement function to set ACPI mode the "Windows way", which is to enable/disable the firmware mapper. PnP Manager should probably check this in the future. Added: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c (with props) Modified: trunk/reactos/hal/halx86/generic/misc.c trunk/reactos/hal/halx86/hal_generic.rbuild trunk/reactos/hal/halx86/include/halacpi.h trunk/reactos/hal/halx86/include/halp.h Added: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
============================================================================== --- trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c (added) +++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Wed Mar 31 22:58:42 2010 @@ -1,0 +1,817 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: hal/halx86/generic/acpi/halpnpdd.c + * PURPOSE: HAL Plug and Play Device Driver + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include <hal.h> +#define NDEBUG +#include <debug.h> + +typedef enum _EXTENSION_TYPE +{ + PdoExtensionType = 0xC0, + FdoExtensionType +} EXTENSION_TYPE; + +typedef enum _PDO_TYPE +{ + AcpiPdo = 0x80, + WdPdo +} PDO_TYPE; + +typedef struct _FDO_EXTENSION +{ + EXTENSION_TYPE ExtensionType; + struct _PDO_EXTENSION* ChildPdoList; + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT FunctionalDeviceObject; + PDEVICE_OBJECT AttachedDeviceObject; +} FDO_EXTENSION, *PFDO_EXTENSION; + +typedef struct _PDO_EXTENSION +{ + EXTENSION_TYPE ExtensionType; + struct _PDO_EXTENSION* Next; + PDEVICE_OBJECT PhysicalDeviceObject; + PFDO_EXTENSION ParentFdoExtension; + PDO_TYPE PdoType; + PDESCRIPTION_HEADER WdTable; + LONG InterfaceReferenceCount; +} PDO_EXTENSION, *PPDO_EXTENSION; + +/* GLOBALS ********************************************************************/ + +PDRIVER_OBJECT HalpDriverObject; +BOOLEAN HalDisableFirmwareMapper = TRUE; +PWCHAR HalHardwareIdString = L"acpipic_up"; + +/* PRIVATE FUNCTIONS **********************************************************/ + +NTSTATUS +NTAPI +HalpMarkAcpiHal(VOID) +{ + NTSTATUS Status; + UNICODE_STRING KeyString; + HANDLE KeyHandle; + HANDLE Handle; + + /* Open the control set key */ + RtlInitUnicodeString(&KeyString, + L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET"); + Status = HalpOpenRegistryKey(&Handle, 0, &KeyString, KEY_ALL_ACCESS, FALSE); + if (NT_SUCCESS(Status)) + { + /* Open the PNP key */ + RtlInitUnicodeString(&KeyString, L"Control\\Pnp"); + Status = HalpOpenRegistryKey(&KeyHandle, + Handle, + &KeyString, + KEY_ALL_ACCESS, + TRUE); + /* Close root key */ + ZwClose(Handle); + + /* Check if PNP BIOS key exists */ + if (NT_SUCCESS(Status)) + { + /* Set the disable value to false -- we need the mapper */ + RtlInitUnicodeString(&KeyString, L"DisableFirmwareMapper"); + Status = ZwSetValueKey(KeyHandle, + &KeyString, + 0, + REG_DWORD, + &HalDisableFirmwareMapper, + sizeof(HalDisableFirmwareMapper)); + + /* Close subkey */ + ZwClose(KeyHandle); + } + } + + /* Return status */ + return Status; +} + +NTSTATUS +NTAPI +HalpAddDevice(IN PDRIVER_OBJECT DriverObject, + IN PDEVICE_OBJECT TargetDevice) +{ + NTSTATUS Status; + PFDO_EXTENSION FdoExtension; + PPDO_EXTENSION PdoExtension; + PDEVICE_OBJECT DeviceObject, PdoDeviceObject, AttachedDevice; + PDESCRIPTION_HEADER Wdrt; + DbgPrint("HAL: PnP Driver ADD!\n"); + + /* Create the FDO */ + Status = IoCreateDevice(DriverObject, + sizeof(FDO_EXTENSION), + NULL, + FILE_DEVICE_BUS_EXTENDER, + 0, + FALSE, + &DeviceObject); + if (!NT_SUCCESS(Status)) + { + /* Should not happen */ + DbgBreakPoint(); + return Status; + } + + /* Setup the FDO extension */ + FdoExtension = DeviceObject->DeviceExtension; + FdoExtension->ExtensionType = FdoExtensionType; + FdoExtension->PhysicalDeviceObject = TargetDevice; + FdoExtension->FunctionalDeviceObject = DeviceObject; + + /* FDO is done initializing */ + DeviceObject->Flags &= DO_DEVICE_INITIALIZING; + + /* Attach to the physical device object (the bus) */ + AttachedDevice = IoAttachDeviceToDeviceStack(DeviceObject, TargetDevice); + if (!AttachedDevice) + { + /* Failed, undo everything */ + IoDeleteDevice(DeviceObject); + return STATUS_NO_SUCH_DEVICE; + } + + /* Save the attachment */ + FdoExtension->AttachedDeviceObject = AttachedDevice; + + /* Create the PDO */ + Status = IoCreateDevice(DriverObject, + sizeof(PDO_EXTENSION), + NULL, + FILE_DEVICE_BUS_EXTENDER, + FILE_AUTOGENERATED_DEVICE_NAME, + FALSE, + &PdoDeviceObject); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + DbgPrint("HAL: Could not create ACPI device object status=0x%08x\n", Status); + return Status; + } + + /* Setup the PDO device extension */ + PdoExtension = PdoDeviceObject->DeviceExtension; + PdoExtension->Next = NULL; + PdoExtension->ExtensionType = PdoExtensionType; + PdoExtension->PhysicalDeviceObject = PdoDeviceObject; + PdoExtension->ParentFdoExtension = FdoExtension; + PdoExtension->PdoType = AcpiPdo; + + /* Find the ACPI watchdog table */ + Wdrt = HalAcpiGetTable(0, 'TRDW'); + if (!Wdrt) + { + /* None exists, there is nothing to do more */ + PdoDeviceObject->Flags &= DO_DEVICE_INITIALIZING; + FdoExtension->ChildPdoList = PdoExtension; + } + else + { + /* FIXME: TODO */ + DPRINT1("You have an ACPI Watchdog. That's great! You should be proud ;-)\n"); + PdoDeviceObject->Flags &= DO_DEVICE_INITIALIZING; + FdoExtension->ChildPdoList = PdoExtension; + } + + /* Return status */ + DPRINT1("Device added %lx\n", Status); + return Status; +} + +NTSTATUS +NTAPI +HalpQueryInterface(IN PDEVICE_OBJECT DeviceObject, + IN CONST GUID* InterfaceType, + IN USHORT Version, + IN PVOID InterfaceSpecificData, + IN ULONG InterfaceBufferSize, + IN PINTERFACE Interface, + OUT PULONG Length) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NO_SUCH_DEVICE; +} + +NTSTATUS +NTAPI +HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject, + IN DEVICE_RELATION_TYPE RelationType, + OUT PDEVICE_RELATIONS* DeviceRelations) +{ + EXTENSION_TYPE ExtensionType; + PPDO_EXTENSION PdoExtension; + PFDO_EXTENSION FdoExtension; + PDEVICE_RELATIONS PdoRelations, FdoRelations; + PDEVICE_OBJECT* ObjectEntry; + ULONG i = 0, PdoCount = 0; + + /* Get FDO device extension and PDO count */ + FdoExtension = DeviceObject->DeviceExtension; + ExtensionType = FdoExtension->ExtensionType; + + /* What do they want? */ + if (RelationType == BusRelations) + { + /* This better be an FDO */ + if (ExtensionType == FdoExtensionType) + { + /* Count how many PDOs we have */ + PdoExtension = FdoExtension->ChildPdoList; + while (PdoExtension) + { + /* Next one */ + PdoExtension = PdoExtension->Next; + PdoCount++; + } + + /* Allocate our structure */ + FdoRelations = ExAllocatePoolWithTag(PagedPool, + FIELD_OFFSET(DEVICE_RELATIONS, + Objects) + + 4 * PdoCount, + ' laH'); + if (!FdoRelations) return STATUS_INSUFFICIENT_RESOURCES; + + /* Save our count */ + FdoRelations->Count = PdoCount; + + /* Query existing relations */ + ObjectEntry = FdoRelations->Objects; + if (*DeviceRelations) + { + /* Check if there were any */ + if ((*DeviceRelations)->Count) + { + /* Loop them all */ + do + { + /* Copy into our structure */ + *ObjectEntry++ = (*DeviceRelations)->Objects[i]; + } + while (++i < (*DeviceRelations)->Count); + } + + /* Free existing structure */ + ExFreePoolWithTag(*DeviceRelations, 0); + } + + /* Now check if we have a PDO list */ + PdoExtension = FdoExtension->ChildPdoList; + if (PdoExtension) + { + /* Loop the PDOs */ + do + { + /* Save our own PDO and reference it */ + *ObjectEntry++ = PdoExtension->PhysicalDeviceObject; + ObfReferenceObject(PdoExtension->PhysicalDeviceObject); + + /* Go to our next PDO */ + PdoExtension = PdoExtension->Next; + } + while (PdoExtension); + } + + /* Return the new structure */ + *DeviceRelations = FdoRelations; + return STATUS_SUCCESS; + } + } + else + { + /* The only other thing we support is a target relation for the PDO */ + if ((RelationType == TargetDeviceRelation) && + (ExtensionType == PdoExtensionType)) + { + /* Only one entry */ + PdoRelations = ExAllocatePoolWithTag(PagedPool, + sizeof(DEVICE_RELATIONS), + ' laH'); + if (!PdoRelations) return STATUS_INSUFFICIENT_RESOURCES; + + /* Fill it out and reference us */ + PdoRelations->Count = 1; + PdoRelations->Objects[0] = DeviceObject; + ObfReferenceObject(DeviceObject); + + /* Return it */ + *DeviceRelations = PdoRelations; + return STATUS_SUCCESS; + } + } + + /* We don't support anything else */ + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +HalpQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, + OUT PDEVICE_CAPABILITIES Capabilities) +{ + PPDO_EXTENSION PdoExtension; + NTSTATUS Status; + PAGED_CODE(); + + /* Get the extension and check for valid version */ + PdoExtension = DeviceObject->DeviceExtension; + ASSERT(Capabilities->Version == 1); + if (Capabilities->Version == 1) + { + /* Can't lock or eject us */ + Capabilities->LockSupported = FALSE; + Capabilities->EjectSupported = FALSE; + + /* Can't remove or dock us */ + Capabilities->Removable = FALSE; + Capabilities->DockDevice = FALSE; + + /* Can't access us raw */ + Capabilities->RawDeviceOK = FALSE; + + /* We have a unique ID, and don't bother the user */ + Capabilities->UniqueID = TRUE; + Capabilities->SilentInstall = TRUE; + + /* Fill out the adress */ + Capabilities->Address = InterfaceTypeUndefined; + Capabilities->UINumber = InterfaceTypeUndefined; + + /* Fill out latencies */ + Capabilities->D1Latency = 0; + Capabilities->D2Latency = 0; + Capabilities->D3Latency = 0; + + /* Fill out supported device states */ + Capabilities->DeviceState[PowerSystemWorking] = PowerDeviceD0; + Capabilities->DeviceState[PowerSystemHibernate] = PowerDeviceD3; + Capabilities->DeviceState[PowerSystemShutdown] = PowerDeviceD3; + Capabilities->DeviceState[PowerSystemSleeping3] = PowerDeviceD3; + + /* Done */ + Status = STATUS_SUCCESS; + } + else + { + /* Fail */ + Status = STATUS_NOT_SUPPORTED; + } + + /* Return status */ + return Status; +} + +NTSTATUS +NTAPI +HalpQueryResources(IN PDEVICE_OBJECT DeviceObject, + OUT PCM_RESOURCE_LIST *Resources) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NO_SUCH_DEVICE; +} + +NTSTATUS +NTAPI +HalpQueryResourceRequirements(IN PDEVICE_OBJECT DeviceObject, + OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NO_SUCH_DEVICE; +} + +NTSTATUS +NTAPI +HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject, + IN BUS_QUERY_ID_TYPE IdType, + OUT PUSHORT *BusQueryId) +{ + PPDO_EXTENSION PdoExtension; + PDO_TYPE PdoType; + PWCHAR Id; + NTSTATUS Status; + ULONG Length; + PWCHAR Buffer; + + /* Get the PDO type */ + PdoExtension = DeviceObject->DeviceExtension; + PdoType = PdoExtension->PdoType; + + /* What kind of ID is being requested? */ + DPRINT("ID: %d\n", IdType); + switch (IdType) + { + case BusQueryDeviceID: + case BusQueryHardwareIDs: + + /* What kind of PDO is this? */ + if (PdoType == AcpiPdo) + { + /* PCI ID */ + Id = L"ACPI_HAL\\PNP0C08"; + } + else if (PdoType == WdPdo) + { + /* WatchDog ID */ + Id = L"ACPI_HAL\\PNP0C18"; + } + else + { + /* Unknown */ + return STATUS_NOT_SUPPORTED; + } + + /* Static length */ + Length = 32; + break; + + case BusQueryInstanceID: + + /* And our instance ID */ + Id = L"0"; + Length = sizeof(L"0") + sizeof(UNICODE_NULL); + break; + + case BusQueryCompatibleIDs: + default: + + /* We don't support anything else */ + return STATUS_NOT_SUPPORTED; + } + + /* Allocate the buffer */ + Buffer = ExAllocatePoolWithTag(PagedPool, + Length + sizeof(UNICODE_NULL), + ' laH'); + if (Buffer) + { + /* Copy the string and null-terminate it */ + RtlCopyMemory(Buffer, Id, Length); + Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL; + + /* Return string */ + *BusQueryId = Buffer; + Status = STATUS_SUCCESS; + DPRINT("Returning: %S\n", *BusQueryId); + } + else + { + /* Fail */ + Status = STATUS_INSUFFICIENT_RESOURCES; + } + + /* Return status */ + return Status; +} + +NTSTATUS +NTAPI +HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject, + IN BUS_QUERY_ID_TYPE IdType, + OUT PUSHORT *BusQueryId) +{ + NTSTATUS Status; + ULONG Length; + PWCHAR Id; + PWCHAR Buffer; + + /* What kind of ID is being requested? */ + DPRINT("ID: %d\n", IdType); + switch (IdType) + { + case BusQueryDeviceID: + case BusQueryHardwareIDs: + + /* This is our hardware ID */ + Id = HalHardwareIdString; + Length = wcslen(HalHardwareIdString) + sizeof(UNICODE_NULL); + break; + + case BusQueryInstanceID: + + /* And our instance ID */ + Id = L"0"; + Length = sizeof(L"0") + sizeof(UNICODE_NULL); + break; + + default: + + /* We don't support anything else */ + return STATUS_NOT_SUPPORTED; + } + + /* Allocate the buffer */ + Buffer = ExAllocatePoolWithTag(PagedPool, + Length + sizeof(UNICODE_NULL), + ' laH'); + if (Buffer) + { + /* Copy the string and null-terminate it */ + RtlCopyMemory(Buffer, Id, Length); + Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL; + + /* Return string */ + *BusQueryId = Buffer; + Status = STATUS_SUCCESS; + DPRINT("Returning: %S\n", *BusQueryId); + } + else + { + /* Fail */ + Status = STATUS_INSUFFICIENT_RESOURCES; + } + + /* Return status */ + return Status; +} + +NTSTATUS +NTAPI +HalpPassIrpFromFdoToPdo(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PFDO_EXTENSION FdoExtension; + + /* Get the extension */ + FdoExtension = DeviceObject->DeviceExtension; + + /* Pass it to the attached device (our PDO) */ + IoSkipCurrentIrpStackLocation(Irp); + return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp); +} + +NTSTATUS +NTAPI +HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PIO_STACK_LOCATION IoStackLocation; + PPDO_EXTENSION PdoExtension; + PFDO_EXTENSION FdoExtension; + NTSTATUS Status; + UCHAR Minor; + + /* Get the device extension and stack location */ + FdoExtension = DeviceObject->DeviceExtension; + IoStackLocation = IoGetCurrentIrpStackLocation(Irp); + Minor = IoStackLocation->MinorFunction; + + /* FDO? */ + if (FdoExtension->ExtensionType == FdoExtensionType) + { + /* Query the IRP type */ + switch (Minor) + { + case IRP_MN_QUERY_DEVICE_RELATIONS: + + /* Call the worker */ + DPRINT("Querying device relations for FDO\n"); + Status = HalpQueryDeviceRelations(DeviceObject, + IoStackLocation->Parameters.QueryDeviceRelations.Type, + (PVOID)&Irp->IoStatus.Information); + break; + + case IRP_MN_QUERY_INTERFACE: + + /* Call the worker */ + DPRINT("Querying interface for FDO\n"); + Status = HalpQueryInterface(DeviceObject, + IoStackLocation->Parameters.QueryInterface.InterfaceType, + IoStackLocation->Parameters.QueryInterface.Size, + IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData, + IoStackLocation->Parameters.QueryInterface.Version, + IoStackLocation->Parameters.QueryInterface.Interface, + (PVOID)&Irp->IoStatus.Information); + break; + + + case IRP_MN_QUERY_ID: + + /* Call the worker */ + DPRINT("Querying ID for FDO\n"); + Status = HalpQueryIdFdo(DeviceObject, + IoStackLocation->Parameters.QueryId.IdType, + (PVOID)&Irp->IoStatus.Information); + break; + + default: + + /* Pass it to the PDO */ + DPRINT("Other IRP: %lx\n", Minor); + return HalpPassIrpFromFdoToPdo(DeviceObject, Irp); + } + + /* What happpened? */ + if ((NT_SUCCESS(Status)) || (Status == STATUS_NOT_SUPPORTED)) + { + /* Set the IRP status, unless this isn't understood */ + if (Status != STATUS_NOT_SUPPORTED) Irp->IoStatus.Status = Status; + + /* Pass it on */ + DPRINT("Passing IRP to PDO\n"); + return HalpPassIrpFromFdoToPdo(DeviceObject, Irp); + } + + /* Otherwise, we failed, so set the status and complete the request */ + DPRINT1("IRP failed with status: %lx\n", Status); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + else + { + /* This is a PDO instead */ + ASSERT(FdoExtension->ExtensionType == PdoExtensionType); + PdoExtension = (PPDO_EXTENSION)FdoExtension; + + /* Query the IRP type */ + Status = STATUS_SUCCESS; + switch (Minor) + { + case IRP_MN_START_DEVICE: + + /* We only care about a PCI PDO */ + DPRINT1("Start device received\n"); + /* Complete the IRP normally */ + break; + + case IRP_MN_REMOVE_DEVICE: + + /* Check if this is a PCI device */ + DPRINT1("Remove device received\n"); + + /* We're done */ + Status = STATUS_SUCCESS; + break; + + case IRP_MN_SURPRISE_REMOVAL: + + /* Inherit whatever status we had */ + DPRINT1("Surprise removal IRP\n"); + Status = Irp->IoStatus.Status; + break; + + case IRP_MN_QUERY_DEVICE_RELATIONS: + + /* Query the device relations */ + DPRINT("Querying PDO relations\n"); + Status = HalpQueryDeviceRelations(DeviceObject, + IoStackLocation->Parameters.QueryDeviceRelations.Type, + (PVOID)&Irp->IoStatus.Information); + break; + + case IRP_MN_QUERY_INTERFACE: + + /* Call the worker */ + DPRINT("Querying interface for PDO\n"); + Status = HalpQueryInterface(DeviceObject, + IoStackLocation->Parameters.QueryInterface.InterfaceType, + IoStackLocation->Parameters.QueryInterface.Size, + IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData, + IoStackLocation->Parameters.QueryInterface.Version, + IoStackLocation->Parameters.QueryInterface.Interface, + (PVOID)&Irp->IoStatus.Information); + break; + + case IRP_MN_QUERY_CAPABILITIES: + + /* Call the worker */ + DPRINT("Querying the capabilities for the PDO\n"); + Status = HalpQueryCapabilities(DeviceObject, + IoStackLocation->Parameters.DeviceCapabilities.Capabilities); + break; + + case IRP_MN_QUERY_RESOURCES: + + /* Call the worker */ + DPRINT("Querying the resources for the PDO\n"); + Status = HalpQueryResources(DeviceObject, (PVOID)&Irp->IoStatus.Information); + break; + + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: + + /* Call the worker */ + DPRINT("Querying the resource requirements for the PDO\n"); + Status = HalpQueryResourceRequirements(DeviceObject, + (PVOID)&Irp->IoStatus.Information); + break; + + case IRP_MN_QUERY_ID: + + /* Call the worker */ + DPRINT("Query the ID for the PDO\n"); + Status = HalpQueryIdPdo(DeviceObject, + IoStackLocation->Parameters.QueryId.IdType, + (PVOID)&Irp->IoStatus.Information); + break; + + default: + + /* We don't handle anything else, so inherit the old state */ + DPRINT("Illegal IRP: %lx\n", Minor); + Status = Irp->IoStatus.Status; + break; + } + + /* If it's not supported, inherit the old status */ + if (Status == STATUS_NOT_SUPPORTED) Status = Irp->IoStatus.Status; + + /* Complete the IRP */ + DPRINT("IRP completed with status: %lx\n", Status); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } +} + +NTSTATUS +NTAPI +HalpDispatchWmi(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + DbgPrint("HAL: PnP Driver WMI!\n"); + while (TRUE); + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +HalpDispatchPower(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + DbgPrint("HAL: PnP Driver Power!\n"); + while (TRUE); + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +HalpDriverEntry(IN PDRIVER_OBJECT DriverObject, + IN PUNICODE_STRING RegistryPath) +{ + NTSTATUS Status; + PDEVICE_OBJECT TargetDevice = NULL; + DPRINT("HAL: PnP Driver ENTRY!\n"); + + /* This is us */ + HalpDriverObject = DriverObject; + + /* Set up add device */ + DriverObject->DriverExtension->AddDevice = HalpAddDevice; + + /* Set up the callouts */ + DriverObject->MajorFunction[IRP_MJ_PNP] = HalpDispatchPnp; + DriverObject->MajorFunction[IRP_MJ_POWER] = HalpDispatchPower; + DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HalpDispatchWmi; + + /* Tell the PnP about us */ + Status = IoReportDetectedDevice(DriverObject, + InterfaceTypeUndefined, + -1, + -1, + NULL, + NULL, + FALSE, + &TargetDevice); + + /* Now add us */ + if (NT_SUCCESS(Status)) Status = HalpAddDevice(DriverObject, TargetDevice); + + /* Force re-enumeration??? */ + IoInvalidateDeviceRelations(TargetDevice, 0); + + /* Return to kernel */ + return Status; +} + +NTSTATUS +NTAPI +HaliInitPnpDriver(VOID) +{ + NTSTATUS Status; + UNICODE_STRING DriverString; + PAGED_CODE(); + + /* Create the driver */ + RtlInitUnicodeString(&DriverString, L"\\Driver\\ACPI_HAL"); + Status = IoCreateDriver(&DriverString, HalpDriverEntry); + + /* Return status */ + return Status; +} + +/* EOF */ Propchange: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/hal/halx86/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/misc.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] Wed Mar 31 22:58:42 2010 @@ -18,6 +18,47 @@ /* PRIVATE FUNCTIONS **********************************************************/ +NTSTATUS +NTAPI +HalpOpenRegistryKey(IN PHANDLE KeyHandle, + IN HANDLE RootKey, + IN PUNICODE_STRING KeyName, + IN ACCESS_MASK DesiredAccess, + IN BOOLEAN Create) +{ + NTSTATUS Status; + ULONG Disposition; + OBJECT_ATTRIBUTES ObjectAttributes; + + /* Setup the attributes we received */ + InitializeObjectAttributes(&ObjectAttributes, + KeyName, + OBJ_CASE_INSENSITIVE, + RootKey, + NULL); + + /* What to do? */ + if ( Create ) + { + /* Create the key */ + Status = ZwCreateKey(KeyHandle, + DesiredAccess, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + } + else + { + /* Open the key */ + Status = ZwOpenKey(KeyHandle, DesiredAccess, &ObjectAttributes); + } + + /* We're done */ + return Status; +} + VOID NTAPI HalpCheckPowerButton(VOID) Modified: trunk/reactos/hal/halx86/hal_generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic.rbu…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] Wed Mar 31 22:58:42 2010 @@ -58,6 +58,7 @@ <directory name="generic"> <directory name="acpi"> <file>halacpi.c</file> + <file>halpnpdd.c</file> </directory> <directory name="bus"> <file>bushndlr.c</file> Modified: trunk/reactos/hal/halx86/include/halacpi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halacpi…
============================================================================== --- trunk/reactos/hal/halx86/include/halacpi.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/halacpi.h [iso-8859-1] Wed Mar 31 22:58:42 2010 @@ -227,4 +227,11 @@ IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +PVOID +NTAPI +HalAcpiGetTable( + IN PLOADER_PARAMETER_BLOCK LoaderBlock, + IN ULONG Signature +); + /* EOF */ Modified: trunk/reactos/hal/halx86/include/halp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
============================================================================== --- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Wed Mar 31 22:58:42 2010 @@ -697,6 +697,16 @@ IN ULONG PageCount ); +NTSTATUS +NTAPI +HalpOpenRegistryKey( + IN PHANDLE KeyHandle, + IN HANDLE RootKey, + IN PUNICODE_STRING KeyName, + IN ACCESS_MASK DesiredAccess, + IN BOOLEAN Create +); + VOID FASTCALL KeUpdateSystemTime(
14 years, 8 months
1
0
0
0
[sir_richard] 46627: [NDK]: Add missing Io functions.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Mar 31 22:54:22 2010 New Revision: 46627 URL:
http://svn.reactos.org/svn/reactos?rev=46627&view=rev
Log: [NDK]: Add missing Io functions. Modified: trunk/reactos/include/ndk/iofuncs.h Modified: trunk/reactos/include/ndk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/iofuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/iofuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/iofuncs.h [iso-8859-1] Wed Mar 31 22:54:22 2010 @@ -44,6 +44,22 @@ IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type ); + +NTSTATUS +NTAPI +IoCreateDriver( + IN PUNICODE_STRING DriverName OPTIONAL, + IN PDRIVER_INITIALIZE InitializationFunction +); + +NTSTATUS +NTAPI +IoReportHalResourceUsage( + IN PUNICODE_STRING HalName, + IN PCM_RESOURCE_LIST RawResourceList, + IN PCM_RESOURCE_LIST TranslatedResourceList, + IN ULONG ResourceListSize +); #endif //
14 years, 8 months
1
0
0
0
[ekohl] 46626: [NTOSKRNL] - Move subject context locking to SeAccessCheck because NtAccessCheck already locks it. - Do not use the captured security descriptor in NtAccessCheck yet, because SeCaptureSecurityDescriptor seems to create broken SDs.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Mar 31 21:53:19 2010 New Revision: 46626 URL:
http://svn.reactos.org/svn/reactos?rev=46626&view=rev
Log: [NTOSKRNL] - Move subject context locking to SeAccessCheck because NtAccessCheck already locks it. - Do not use the captured security descriptor in NtAccessCheck yet, because SeCaptureSecurityDescriptor seems to create broken SDs. Modified: trunk/reactos/ntoskrnl/se/semgr.c Modified: trunk/reactos/ntoskrnl/se/semgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=46…
============================================================================== --- trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/semgr.c [iso-8859-1] Wed Mar 31 21:53:19 2010 @@ -355,7 +355,6 @@ BOOLEAN NTAPI SepAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, - IN BOOLEAN SubjectContextLocked, IN ACCESS_MASK DesiredAccess, IN ACCESS_MASK PreviouslyGrantedAccess, OUT PPRIVILEGE_SET* Privileges, @@ -394,9 +393,6 @@ return TRUE; } - /* Acquire the lock if needed */ - if (!SubjectContextLocked) SeLockSubjectContext(SubjectSecurityContext); - /* Map given accesses */ RtlMapGenericMask(&DesiredAccess, GenericMapping); if (PreviouslyGrantedAccess) @@ -418,11 +414,6 @@ &Defaulted); if (!NT_SUCCESS(Status)) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *AccessStatus = Status; return FALSE; } @@ -430,11 +421,6 @@ /* RULE 1: Grant desired access if the object is unprotected */ if (Present == FALSE || Dacl == NULL) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - if (DesiredAccess & MAXIMUM_ALLOWED) { *GrantedAccess = GenericMapping->GenericAll; @@ -465,11 +451,6 @@ if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == (CurrentAccess & ~VALID_INHERIT_FLAGS)) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *GrantedAccess = CurrentAccess; *AccessStatus = STATUS_SUCCESS; return TRUE; @@ -483,11 +464,6 @@ if (!NT_SUCCESS(Status)) { DPRINT1("RtlGetOwnerSecurityDescriptor() failed (Status %lx)\n", Status); - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *AccessStatus = Status; return FALSE; } @@ -498,11 +474,6 @@ if ((DesiredAccess & ~VALID_INHERIT_FLAGS) == (CurrentAccess & ~VALID_INHERIT_FLAGS)) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *GrantedAccess = CurrentAccess; *AccessStatus = STATUS_SUCCESS; return TRUE; @@ -512,11 +483,6 @@ /* Fail if DACL is absent */ if (Present == FALSE) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *GrantedAccess = 0; *AccessStatus = STATUS_ACCESS_DENIED; return FALSE; @@ -531,11 +497,6 @@ { if (SepSidInToken(Token, Sid)) { - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); - } - *GrantedAccess = 0; *AccessStatus = STATUS_ACCESS_DENIED; return FALSE; @@ -556,11 +517,6 @@ DPRINT1("Unknown Ace type 0x%lx\n", CurrentAce->Header.AceType); } CurrentAce = (PACE)((ULONG_PTR)CurrentAce + CurrentAce->Header.AceSize); - } - - if (SubjectContextLocked == FALSE) - { - SeUnlockSubjectContext(SubjectSecurityContext); } DPRINT("CurrentAccess %08lx\n DesiredAccess %08lx\n", @@ -639,6 +595,8 @@ OUT PACCESS_MASK GrantedAccess, OUT PNTSTATUS AccessStatus) { + BOOLEAN ret; + PAGED_CODE(); /* Check if this is kernel mode */ @@ -679,17 +637,26 @@ return FALSE; } + /* Acquire the lock if needed */ + if (!SubjectContextLocked) + SeLockSubjectContext(SubjectSecurityContext); + /* Call the internal function */ - return SepAccessCheck(SecurityDescriptor, - SubjectSecurityContext, - SubjectContextLocked, - DesiredAccess, - PreviouslyGrantedAccess, - Privileges, - GenericMapping, - AccessMode, - GrantedAccess, - AccessStatus); + ret = SepAccessCheck(SecurityDescriptor, + SubjectSecurityContext, + DesiredAccess, + PreviouslyGrantedAccess, + Privileges, + GenericMapping, + AccessMode, + GrantedAccess, + AccessStatus); + + /* Release the lock if needed */ + if (!SubjectContextLocked) + SeUnlockSubjectContext(SubjectSecurityContext); + + return ret; } /* SYSTEM CALLS ***************************************************************/ @@ -808,8 +775,8 @@ } /* Check security descriptor for valid owner and group */ - if (SepGetSDOwner(SecurityDescriptor)== NULL || - SepGetSDGroup(SecurityDescriptor) == NULL) + if (SepGetSDOwner(SecurityDescriptor) == NULL || // FIXME: use CapturedSecurityDescriptor + SepGetSDGroup(SecurityDescriptor) == NULL) // FIXME: use CapturedSecurityDescriptor { DPRINT("Security Descriptor does not have a valid group or owner\n"); SeReleaseSecurityDescriptor(CapturedSecurityDescriptor, @@ -827,9 +794,8 @@ SeLockSubjectContext(&SubjectSecurityContext); /* Now perform the access check */ - SepAccessCheck(CapturedSecurityDescriptor, + SepAccessCheck(SecurityDescriptor, // FIXME: use CapturedSecurityDescriptor &SubjectSecurityContext, - TRUE, DesiredAccess, 0, &PrivilegeSet, //FIXME
14 years, 8 months
1
0
0
0
[janderwald] 46625: [KS] - Enable registered device interfaces when device successfully initializes - Fix totally broken KsFilterFactorySetDeviceClassesState implementation
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 31 19:33:49 2010 New Revision: 46625 URL:
http://svn.reactos.org/svn/reactos?rev=46625&view=rev
Log: [KS] - Enable registered device interfaces when device successfully initializes - Fix totally broken KsFilterFactorySetDeviceClassesState implementation Modified: trunk/reactos/drivers/ksfilter/ks/device.c trunk/reactos/drivers/ksfilter/ks/deviceinterface.c trunk/reactos/drivers/ksfilter/ks/filterfactory.c trunk/reactos/drivers/ksfilter/ks/ksfunc.h Modified: trunk/reactos/drivers/ksfilter/ks/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Wed Mar 31 19:33:49 2010 @@ -231,6 +231,7 @@ { /* set state to enabled */ Ctx->DeviceHeader->TargetState = KSTARGET_STATE_ENABLED; + Status = KspSetFilterFactoriesState(Ctx->DeviceHeader, TRUE); } /* free work item */ @@ -376,6 +377,7 @@ { /* set state to enabled, IRP_MJ_CREATE request may now succeed */ DeviceHeader->TargetState = KSTARGET_STATE_ENABLED; + Status = KspSetFilterFactoriesState(DeviceHeader, TRUE); } } } Modified: trunk/reactos/drivers/ksfilter/ks/deviceinterface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] Wed Mar 31 19:33:49 2010 @@ -17,6 +17,9 @@ SymEntry = (PSYMBOLIC_LINK_ENTRY)CONTAINING_RECORD(Entry, SYMBOLIC_LINK_ENTRY, Entry); /* set device interface state */ Status = IoSetDeviceInterfaceState(&SymEntry->SymbolicLink, Enable); + + DPRINT("KspSetDeviceInterfacesState SymbolicLink %S Status %lx\n", SymEntry->SymbolicLink.Buffer, Status, Enable); + /* check for success */ if (!NT_SUCCESS(Status)) return Status; @@ -95,4 +98,34 @@ return Status; } +NTSTATUS +KspSetFilterFactoriesState( + IN PKSIDEVICE_HEADER DeviceHeader, + IN BOOLEAN NewState) +{ + PCREATE_ITEM_ENTRY CreateEntry; + PLIST_ENTRY Entry; + NTSTATUS Status = STATUS_SUCCESS; + /* grab first device interface */ + Entry = DeviceHeader->ItemList.Flink; + while(Entry != &DeviceHeader->ItemList && Status == STATUS_SUCCESS) + { + /* grab create entry */ + CreateEntry = CONTAINING_RECORD(Entry, CREATE_ITEM_ENTRY, Entry); + + /* sanity check */ + ASSERT(CreateEntry->CreateItem); + + if (CreateEntry->CreateItem->Create == IKsFilterFactory_Create) + { + /* found our own filterfactory */ + Status = KsFilterFactorySetDeviceClassesState((PKSFILTERFACTORY)CreateEntry->CreateItem->Context, NewState); + } + + Entry = Entry->Flink; + } + + /* store result */ + return Status; +} Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Wed Mar 31 19:33:49 2010 @@ -398,8 +398,10 @@ IN PKSFILTERFACTORY FilterFactory, IN BOOLEAN NewState) { - IKsFilterFactory * Factory = (IKsFilterFactory*)CONTAINING_RECORD(FilterFactory, IKsFilterFactoryImpl, FilterFactory); - + IKsFilterFactory * Factory; + IKsFilterFactoryImpl * This = (IKsFilterFactoryImpl*)CONTAINING_RECORD(FilterFactory, IKsFilterFactoryImpl, FilterFactory); + + Factory = (IKsFilterFactory*)&This->lpVtbl; return Factory->lpVtbl->SetDeviceClassesState(Factory, NewState); } Modified: trunk/reactos/drivers/ksfilter/ks/ksfunc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ksfunc…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] Wed Mar 31 19:33:49 2010 @@ -144,3 +144,15 @@ IN const KSPROPERTY_SET* PropertySet, IN PFNKSALLOCATOR Allocator OPTIONAL, IN ULONG PropertyItemSize OPTIONAL); + +NTSTATUS +NTAPI +IKsFilterFactory_Create( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); + +NTSTATUS +KspSetFilterFactoriesState( + IN PKSIDEVICE_HEADER DeviceHeader, + IN BOOLEAN NewState); +
14 years, 8 months
1
0
0
0
[janderwald] 46624: [PSDK] - Add KsFilterFactorySetDeviceClassesState prototype
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 31 19:13:41 2010 New Revision: 46624 URL:
http://svn.reactos.org/svn/reactos?rev=46624&view=rev
Log: [PSDK] - Add KsFilterFactorySetDeviceClassesState prototype Modified: trunk/reactos/include/psdk/ks.h Modified: trunk/reactos/include/psdk/ks.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ks.h?rev=4662…
============================================================================== --- trunk/reactos/include/psdk/ks.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ks.h [iso-8859-1] Wed Mar 31 19:13:41 2010 @@ -4071,6 +4071,14 @@ KSDDKAPI NTSTATUS NTAPI +KsFilterFactorySetDeviceClassesState( + IN PKSFILTERFACTORY FilterFactory, + IN BOOLEAN NewState + ); + +KSDDKAPI +NTSTATUS +NTAPI KsFilterFactoryUpdateCacheData( IN PKSFILTERFACTORY FilterFactory, IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL
14 years, 8 months
1
0
0
0
[janderwald] 46623: [KS] - Fix a malicous bug in KsAddItemToObjectBag which caused inifite loops while iterating through object bags - Use a different mutex than the device mutex for object bags - Initialize device / object bag mutex when initializing the device - Initialize object bag lists when initializing the device - Set device / system power state before calling device Add's routine - Check if object driver extension has already been allocated in KsInitializeDevice - Hack KsFilterFactoryUp
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 31 18:12:02 2010 New Revision: 46623 URL:
http://svn.reactos.org/svn/reactos?rev=46623&view=rev
Log: [KS] - Fix a malicous bug in KsAddItemToObjectBag which caused inifite loops while iterating through object bags - Use a different mutex than the device mutex for object bags - Initialize device / object bag mutex when initializing the device - Initialize object bag lists when initializing the device - Set device / system power state before calling device Add's routine - Check if object driver extension has already been allocated in KsInitializeDevice - Hack KsFilterFactoryUpdateCacheData to return STATUS_SUCCESS - PinnacleSys PCTV DVB-T tv tuner now successfully initializes and registers its device interfaces Modified: trunk/reactos/drivers/ksfilter/ks/bag.c trunk/reactos/drivers/ksfilter/ks/device.c trunk/reactos/drivers/ksfilter/ks/driver.c trunk/reactos/drivers/ksfilter/ks/filterfactory.c trunk/reactos/drivers/ksfilter/ks/kcom.c trunk/reactos/drivers/ksfilter/ks/kstypes.h trunk/reactos/drivers/ksfilter/ks/misc.c Modified: trunk/reactos/drivers/ksfilter/ks/bag.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/bag.c?…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/bag.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/bag.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -127,7 +127,7 @@ BagEntry->Free = ExFreePool; /* insert item */ - InsertTailList(&Bag->ObjectList, &Bag->Entry); + InsertTailList(&Bag->ObjectList, &BagEntry->Entry); /* release mutex */ KeReleaseMutex(Bag->BagMutex, FALSE); Modified: trunk/reactos/drivers/ksfilter/ks/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -74,7 +74,7 @@ if (!Mutex) { /* use device mutex */ - Mutex = &This->DeviceMutex; + Mutex = &This->BagMutex; } /* initialize object bag */ @@ -220,12 +220,10 @@ PPNP_POSTSTART_CONTEXT Ctx = (PPNP_POSTSTART_CONTEXT)Context; /* call driver pnp post routine */ - Status = Ctx->DeviceHeader->Descriptor->Dispatch->PostStart(&Ctx->DeviceHeader->KsDevice); + Status = Ctx->DeviceHeader->KsDevice.Descriptor->Dispatch->PostStart(&Ctx->DeviceHeader->KsDevice); if (!NT_SUCCESS(Status)) { - DPRINT1("Driver: PostStart Routine returned %x\n", Status); - /* set state to disabled */ Ctx->DeviceHeader->TargetState = KSTARGET_STATE_DISABLED; } @@ -240,6 +238,8 @@ /* free work context */ FreeItem(Ctx); + + DPRINT("IKsDevice_PnpPostStart: PostStart Routine returned %x\n", Status); } NTSTATUS @@ -253,6 +253,10 @@ PKSIDEVICE_HEADER DeviceHeader; PPNP_POSTSTART_CONTEXT Ctx = NULL; NTSTATUS Status; + PCM_RESOURCE_LIST TranslatedResourceList; + PCM_RESOURCE_LIST UntranslatedResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor, UnPartialDescriptor; + ULONG Index; /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); @@ -261,6 +265,8 @@ /* get device header */ DeviceHeader = DeviceExtension->DeviceHeader; + DPRINT("IKsDevice_PnpStartDevice DeviceHeader %p\n", DeviceHeader); + /* first forward irp to lower device object */ Status = KspForwardIrpSynchronous(DeviceObject, Irp); @@ -273,20 +279,55 @@ return Status; } + TranslatedResourceList = IoStack->Parameters.StartDevice.AllocatedResourcesTranslated; + UntranslatedResourceList = IoStack->Parameters.StartDevice.AllocatedResources; + + DPRINT("ResourceDescriptorCount %lu\n", TranslatedResourceList->List[0].PartialResourceList.Count); + for (Index = 0; Index < TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ ) + { + PartialDescriptor = &TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; + UnPartialDescriptor = &UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; + DPRINT("Descriptor Type %u\n", PartialDescriptor->Type); + + if (PartialDescriptor->Type == CmResourceTypeInterrupt) + { + DPRINT("CmResourceTypeInterrupt Index %u TRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\n", Index, PartialDescriptor->u.Interrupt.Affinity, PartialDescriptor->u.Interrupt.Level, PartialDescriptor->u.Interrupt.Vector, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); + DPRINT("CmResourceTypeInterrupt Index %u UNTRANS Interrupt Number Affinity %x Level %u Vector %u Flags %x Share %x\\n", Index, UnPartialDescriptor->u.Interrupt.Affinity, UnPartialDescriptor->u.Interrupt.Level, UnPartialDescriptor->u.Interrupt.Vector, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); + + } + else if (PartialDescriptor->Type == CmResourceTypePort) + { + DPRINT("CmResourceTypePort Index %u TRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, PartialDescriptor->u.Port.Length, PartialDescriptor->u.Port.Start.HighPart, PartialDescriptor->u.Port.Start.LowPart, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); + DPRINT("CmResourceTypePort Index %u UNTRANS Port Length %u Start %u %u Flags %x Share %x\n", Index, UnPartialDescriptor->u.Port.Length, UnPartialDescriptor->u.Port.Start.HighPart, UnPartialDescriptor->u.Port.Start.LowPart, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); + } + else if (PartialDescriptor->Type == CmResourceTypeMemory) + { + DPRINT("CmResourceTypeMemory Index %u TRANS Start %x Length %u Flags %x Share %x\n", Index, PartialDescriptor->u.Memory.Start.LowPart, PartialDescriptor->u.Memory.Length, PartialDescriptor->Flags, PartialDescriptor->ShareDisposition); + DPRINT("CmResourceTypeMemory Index %u TRANS Start %x Length %u Flags %x Share %x\n", Index, UnPartialDescriptor->u.Memory.Start.LowPart, UnPartialDescriptor->u.Memory.Length, UnPartialDescriptor->Flags, UnPartialDescriptor->ShareDisposition); + } + } + + ASSERT(DeviceHeader->KsDevice.Descriptor); + ASSERT(DeviceHeader->KsDevice.Descriptor->Dispatch); + ASSERT(DeviceHeader->KsDevice.Descriptor->Dispatch->Start); + + /* do we have a device descriptor */ - if (DeviceHeader->Descriptor) + if (DeviceHeader->KsDevice.Descriptor) { /* does the device want pnp notifications */ - if (DeviceHeader->Descriptor->Dispatch) + if (DeviceHeader->KsDevice.Descriptor->Dispatch) { /* does the driver care about IRP_MN_START_DEVICE */ - if (DeviceHeader->Descriptor->Dispatch->Start) + if (DeviceHeader->KsDevice.Descriptor->Dispatch->Start) { /* call driver start device routine */ - Status = DeviceHeader->Descriptor->Dispatch->Start(&DeviceHeader->KsDevice, Irp, - IoStack->Parameters.StartDevice.AllocatedResourcesTranslated, - IoStack->Parameters.StartDevice.AllocatedResources); - + Status = DeviceHeader->KsDevice.Descriptor->Dispatch->Start(&DeviceHeader->KsDevice, Irp, + TranslatedResourceList, + UntranslatedResourceList); + + + DPRINT("IKsDevice_PnpStartDevice Start %p, Context %p\n", DeviceHeader->KsDevice.Descriptor->Dispatch->Start, DeviceHeader->KsDevice.Context); ASSERT(Status != STATUS_PENDING); if (!NT_SUCCESS(Status)) @@ -303,7 +344,7 @@ } /* does the driver need post start routine */ - if (DeviceHeader->Descriptor->Dispatch->PostStart) + if (DeviceHeader->KsDevice.Descriptor->Dispatch->PostStart) { /* allocate pnp post workitem context */ Ctx = (PPNP_POSTSTART_CONTEXT)AllocateItem(NonPagedPool, sizeof(PNP_POSTSTART_CONTEXT)); @@ -351,6 +392,7 @@ } /* return result */ + DPRINT1("IKsDevice_PnpStartDevice Status %x PostStartRoutine %p\n", Status, Ctx); return Status; } @@ -375,10 +417,10 @@ DeviceHeader = DeviceExtension->DeviceHeader; /* do we have a device descriptor */ - if (DeviceHeader->Descriptor) + if (DeviceHeader->KsDevice.Descriptor && DeviceHeader->KsDevice.Descriptor->Dispatch) { /* does the device want pnp notifications */ - Dispatch = (PKSDEVICE_DISPATCH)DeviceHeader->Descriptor->Dispatch; + Dispatch = (PKSDEVICE_DISPATCH)DeviceHeader->KsDevice.Descriptor->Dispatch; } switch (IoStack->MinorFunction) @@ -472,7 +514,7 @@ /* pass the irp down the driver stack */ Status = KspForwardIrpSynchronous(DeviceObject, Irp); - DPRINT("Next Device: Status %x\n", Status); + DPRINT1("IRP_MN_QUERY_INTERFACE Next Device: Status %x\n", Status); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -480,36 +522,32 @@ } case IRP_MN_QUERY_DEVICE_RELATIONS: { - DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS\n"); - /* pass the irp down the driver stack */ Status = KspForwardIrpSynchronous(DeviceObject, Irp); - DPRINT("Next Device: Status %x\n", Status); - - Irp->IoStatus.Status = Status; + DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS Next Device: Status %x\n", Status); + + //Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); return Status; } case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: { - DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); + /* pass the irp down the driver stack */ + //Status = KspForwardIrpSynchronous(DeviceObject, Irp); + Status = Irp->IoStatus.Status; + DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS Next Device: Status %x\n", Status); + + //Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: + { /* pass the irp down the driver stack */ Status = KspForwardIrpSynchronous(DeviceObject, Irp); - DPRINT("Next Device: Status %x\n", Status); - - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return Status; - } - case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: - { - DPRINT("IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n"); - /* pass the irp down the driver stack */ - Status = KspForwardIrpSynchronous(DeviceObject, Irp); - - DPRINT("Next Device: Status %x\n", Status); + DPRINT("IRP_MN_QUERY_RESOURCE_REQUIREMENTS Next Device: Status %x\n", Status); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); @@ -552,7 +590,7 @@ PKSIOBJECT_HEADER ObjectHeader; NTSTATUS Status; - DPRINT("KS / CREATE\n"); + DPRINT("IKsDevice_Create\n"); /* get current stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); /* get device extension */ @@ -630,8 +668,10 @@ PDEVICE_EXTENSION DeviceExtension; PKSIDEVICE_HEADER Header; ULONG Index; - IKsDevice * KsDevice; + PKSIOBJECT_BAG Bag; NTSTATUS Status = STATUS_SUCCESS; + + DPRINT("KsInitializeDevice Descriptor %p\n", Descriptor); /* get device extension */ DeviceExtension = (PDEVICE_EXTENSION)FunctionalDeviceObject->DeviceExtension; @@ -642,10 +682,13 @@ /* point to allocated header */ Header = DeviceExtension->DeviceHeader; + DPRINT("DeviceHeader %p\n", DeviceExtension->DeviceHeader); + + /* check for success */ if (!NT_SUCCESS(Status)) { - DPRINT1("Failed to allocate device header with %x\n", Status); + DPRINT1("KsInitializeDevice Failed to allocate device header with %x\n", Status); return Status; } @@ -653,7 +696,7 @@ Header->lpVtblIKsDevice = &vt_IKsDevice; Header->ref = 1; - /* initialize object bag */ + /* allocate object bag */ Header->KsDevice.Bag = AllocateItem(NonPagedPool, sizeof(KSIOBJECT_BAG)); if (!Header->KsDevice.Bag) { @@ -662,25 +705,41 @@ return STATUS_INSUFFICIENT_RESOURCES; } - KsDevice = (IKsDevice*)&DeviceExtension->DeviceHeader->lpVtblIKsDevice; - KsDevice->lpVtbl->InitializeObjectBag(KsDevice, Header->KsDevice.Bag, NULL); - + /* initialize object bag */ + KeInitializeMutex(&Header->BagMutex, 0); + KeInitializeMutex(&Header->DeviceMutex, 0); + + Bag = (PKSIOBJECT_BAG)Header->KsDevice.Bag; + Bag->BagMutex = &Header->BagMutex; + InitializeListHead(&Header->ObjectBags); + InitializeListHead(&Bag->ObjectList); + Bag->DeviceHeader = (PVOID)Header; + + /* insert bag into device list */ + InsertTailList(&Header->ObjectBags, &Bag->Entry); /* initialize device header */ Header->KsDevice.FunctionalDeviceObject = FunctionalDeviceObject; Header->KsDevice.PhysicalDeviceObject = PhysicalDeviceObject; Header->KsDevice.NextDeviceObject = NextDeviceObject; Header->KsDevice.Descriptor = Descriptor; + Header->KsDevice.SystemPowerState = PowerSystemWorking; + Header->KsDevice.DevicePowerState = PowerDeviceD0; + Header->KsDevice.Started = FALSE; + Header->KsDevice.Context = NULL; KsSetDevicePnpAndBaseObject(Header, PhysicalDeviceObject, NextDeviceObject); - /* FIXME Power state */ + if (Descriptor) { /* create a filter factory for each filter descriptor */ + DPRINT("KsInitializeDevice FilterDescriptorCount %lu\n", Descriptor->FilterDescriptorsCount); for(Index = 0; Index < Descriptor->FilterDescriptorsCount; Index++) { Status = KspCreateFilterFactory(FunctionalDeviceObject, Descriptor->FilterDescriptors[Index], NULL, NULL, 0, NULL, NULL, NULL); + + DPRINT("KsInitializeDevice Index %lu KspCreateFilterFactory Status %lx\n", Index, Status); /* check for success */ if (!NT_SUCCESS(Status)) { @@ -697,6 +756,7 @@ Status = Descriptor->Dispatch->Add(&Header->KsDevice); DPRINT("Driver: AddHandler Status %x\n", Status); + Header->KsDevice.Descriptor = Descriptor; } } Modified: trunk/reactos/drivers/ksfilter/ks/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/driver…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -39,6 +39,8 @@ { PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)(ULONG_PTR)Object - sizeof(KSBASIC_HEADER); + DPRINT("KsGetDevice %p\n", Object); + ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory || BasicHeader->Type == KsObjectTypeFilter || BasicHeader->Type == BasicHeader->Type); return BasicHeader->KsDevice; @@ -62,6 +64,8 @@ PDEVICE_OBJECT OldHighestDeviceObject; if (!ExtensionSize) ExtensionSize = sizeof(KSDEVICE_HEADER); + + DPRINT("KsCreateDevice Descriptor %p ExtensionSize %lu\n", Descriptor, ExtensionSize); Status = IoCreateDevice(DriverObject, ExtensionSize, NULL, FILE_DEVICE_KS, FILE_DEVICE_SECURE_OPEN, FALSE, &FunctionalDeviceObject); if (!NT_SUCCESS(Status)) @@ -120,7 +124,8 @@ const KSDEVICE_DESCRIPTOR *Descriptor = NULL; /* get stored driver object extension */ - DriverObjectExtension = IoGetDriverObjectExtension(DriverObject, (PVOID)KsAddDevice); + + DriverObjectExtension = IoGetDriverObjectExtension(DriverObject, (PVOID)KsInitializeDriver); if (DriverObjectExtension) { @@ -144,16 +149,22 @@ ) { PKS_DRIVER_EXTENSION DriverObjectExtension; - NTSTATUS Status; + NTSTATUS Status = STATUS_SUCCESS; if (Descriptor) { - Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KsAddDevice, sizeof(KS_DRIVER_EXTENSION), (PVOID*)&DriverObjectExtension); + Status = IoAllocateDriverObjectExtension(DriverObject, (PVOID)KsInitializeDriver, sizeof(KS_DRIVER_EXTENSION), (PVOID*)&DriverObjectExtension); if (NT_SUCCESS(Status)) { DriverObjectExtension->Descriptor = Descriptor; } } + + /* sanity check */ + ASSERT(Status == STATUS_SUCCESS); + + if (!NT_SUCCESS(Status)) + return Status; /* Setting our IRP handlers */ DriverObject->MajorFunction[IRP_MJ_CREATE] = IKsDevice_Create; @@ -168,7 +179,7 @@ DriverObject->DriverExtension->AddDevice = KsAddDevice; /* KS handles these */ - DPRINT1("Setting KS function handlers\n"); + DPRINT1("KsInitializeDriver Setting KS function handlers\n"); KsSetMajorFunctionHandler(DriverObject, IRP_MJ_CLOSE); KsSetMajorFunctionHandler(DriverObject, IRP_MJ_DEVICE_CONTROL); Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -338,6 +338,8 @@ IKsFilterFactory * Filter; NTSTATUS Status; + DPRINT("KsCreateFilterFactory\n"); + /* Lets allocate a filterfactory */ This = AllocateItem(NonPagedPool, sizeof(IKsFilterFactoryImpl)); if (!This) @@ -465,7 +467,8 @@ IN const KSFILTER_DESCRIPTOR* FilterDescriptor OPTIONAL) { UNIMPLEMENTED - - return STATUS_NOT_IMPLEMENTED; + DPRINT("KsFilterFactoryUpdateCacheData %p\n", FilterDescriptor); + + return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/ksfilter/ks/kcom.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kcom.c…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kcom.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kcom.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -9,7 +9,7 @@ #include "priv.h" -const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; +const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x46}}; /*
http://msdn2.microsoft.com/en-us/library/ms809781.aspx
*/ COMDDKAPI NTSTATUS NTAPI Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -103,7 +103,7 @@ LIST_ENTRY TargetDeviceList; KMUTEX DeviceMutex; - KSDEVICE_DESCRIPTOR* Descriptor; + KMUTEX BagMutex; LIST_ENTRY PowerDispatchList; LIST_ENTRY ObjectBags; Modified: trunk/reactos/drivers/ksfilter/ks/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/misc.c…
============================================================================== --- trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/ksfilter/ks/misc.c [iso-8859-1] Wed Mar 31 18:12:02 2010 @@ -70,7 +70,7 @@ IoSetCompletionRoutine(Irp, KspForwardIrpSynchronousCompletion, (PVOID)&Event, TRUE, TRUE, TRUE); /* now call the driver */ - Status = IoCallDriver(DeviceHeader->BaseDevice, Irp); + Status = IoCallDriver(DeviceHeader->KsDevice.NextDeviceObject, Irp); /* did the request complete yet */ if (Status == STATUS_PENDING) {
14 years, 8 months
1
0
0
0
[janderwald] 46622: [BDASUP] - Fix initialization of filter / pin automation table - Add debug traces
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Mar 31 17:37:36 2010 New Revision: 46622 URL:
http://svn.reactos.org/svn/reactos?rev=46622&view=rev
Log: [BDASUP] - Fix initialization of filter / pin automation table - Add debug traces Modified: trunk/reactos/drivers/multimedia/bdasup/bdasup.c Modified: trunk/reactos/drivers/multimedia/bdasup/bdasup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/bdasup/…
============================================================================== --- trunk/reactos/drivers/multimedia/bdasup/bdasup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/multimedia/bdasup/bdasup.c [iso-8859-1] Wed Mar 31 17:37:36 2010 @@ -52,13 +52,13 @@ KSAUTOMATION_TABLE FilterAutomationTable = { 1, - sizeof(KSPROPERTY_SET), + sizeof(KSPROPERTY_ITEM), &FilterPropertySet, 1, - sizeof(KSMETHOD_SET), + sizeof(KSMETHOD_ITEM), &FilterMethodSet, 0, - sizeof(KSEVENT_SET), + sizeof(KSEVENT_ITEM), NULL }; @@ -80,13 +80,13 @@ KSAUTOMATION_TABLE PinAutomationTable = { 1, - sizeof(KSPROPERTY_SET), + sizeof(KSPROPERTY_ITEM), &PinPropertySet, 0, - sizeof(KSMETHOD_SET), + sizeof(KSMETHOD_ITEM), NULL, 0, - sizeof(KSEVENT_SET), + sizeof(KSEVENT_ITEM), NULL }; @@ -157,6 +157,8 @@ DllInitialize( PUNICODE_STRING RegistryPath) { + DPRINT("BDASUP::DllInitialize\n"); + KeInitializeSpinLock(&g_Settings.FilterFactoryInstanceListLock); InitializeListHead(&g_Settings.FilterFactoryInstanceList); g_Settings.Initialized = TRUE; @@ -171,6 +173,8 @@ NTAPI BdaCheckChanges(IN PIRP Irp) { + DPRINT("BdaCheckChanges\n"); + if (!Irp) return STATUS_INVALID_PARAMETER; @@ -184,6 +188,8 @@ NTAPI BdaCommitChanges(IN PIRP Irp) { + DPRINT("BdaCommitChanges\n"); + if (!Irp) return STATUS_INVALID_PARAMETER; @@ -257,6 +263,7 @@ NTSTATUS Status; KSFILTER_DESCRIPTOR FilterDescriptor; + DPRINT("BdaCreateFilterFactoryEx\n"); /* backup filter descriptor */ RtlMoveMemory(&FilterDescriptor, pFilterDescriptor, sizeof(KSFILTER_DESCRIPTOR)); @@ -265,7 +272,10 @@ /* check for success */ if (!NT_SUCCESS(Status)) + { + DPRINT1("KsMergeAutomationTables failed with %lx\n", Status); return Status; + } /* allocate filter instance */ FilterInstance = AllocateItem(NonPagedPool, sizeof(BDA_FILTER_INSTANCE_ENTRY)); @@ -287,6 +297,7 @@ if (!NT_SUCCESS(Status)) { /* destroy filter instance */ + DPRINT1("KsAddItemToObjectBag failed with %lx\n", Status); FreeItem(FilterInstance); KsDeleteFilterFactory(FilterFactory); return Status; @@ -316,9 +327,11 @@ { /* failed to create filter factory */ FreeItem(FilterInstance); + DPRINT1("KsCreateFilterFactory failed with %lx\n", Status); } /* done */ + DPRINT("BdaCreateFilterFactoryEx Status %x\n", Status); return Status; } @@ -339,6 +352,8 @@ ULONG PinId; KSPIN_DESCRIPTOR_EX NewPinDescriptor; + DPRINT("BdaCreatePin\n"); + if (!pulPinId || !pKSFilter) return STATUS_INVALID_PARAMETER; @@ -419,6 +434,8 @@ PKSM_PIN Pin; PKSFILTER Filter; + DPRINT("BdaMethodCreatePin\n"); + if (!Irp) { /* invalid parameter */ @@ -453,6 +470,8 @@ ULONG Index, PinId; NTSTATUS Status = STATUS_SUCCESS; + DPRINT("BdaInitFilter\n"); + /* check input parameters */ if (!pKSFilter) return STATUS_INVALID_PARAMETER; @@ -500,6 +519,8 @@ PBDA_FILTER_INSTANCE_ENTRY InstanceEntry; PKSFILTERFACTORY FilterFactory; KSTOPOLOGY_CONNECTION Connection; + + DPRINT("BdaCreateTopology\n"); /* check input parameters */ if (!pKSFilter) @@ -547,6 +568,7 @@ IN ULONG *pulPinId) { UNIMPLEMENTED + DPRINT("BdaDeletePin\n"); return STATUS_NOT_IMPLEMENTED; } @@ -559,6 +581,7 @@ IN PKSFILTERFACTORY FilterFactory, IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL) { + DPRINT("BdaFilterFactoryUpdateCacheData\n"); return KsFilterFactoryUpdateCacheData(FilterFactory, FilterDescriptor); } @@ -571,6 +594,8 @@ IN PIRP Irp, OUT BDA_CHANGE_STATE *ChangeState) { + DPRINT("BdaGetChangeState\n"); + if (Irp && ChangeState) { *ChangeState = BDA_CHANGES_COMPLETE; @@ -595,6 +620,8 @@ PKSFILTER Filter; PKSP_BDA_NODE_PIN Node; + DPRINT("BdaMethodCreateTopology\n"); + /* check input parameters */ if (!Irp || !pKSMethod) return STATUS_INVALID_PARAMETER; @@ -622,6 +649,8 @@ IN KSMETHOD *pKSMethod, OPTIONAL PVOID pvIgnored) { + DPRINT("BdaMethodDeletePin\n"); + if (!Irp) return STATUS_INVALID_PARAMETER; @@ -639,6 +668,7 @@ OUT ULONG *pulControllingPinId) { UNIMPLEMENTED + DPRINT("BdaPropertyGetControllingPinId\n"); return STATUS_NOT_IMPLEMENTED; } @@ -657,6 +687,8 @@ PKSFILTERFACTORY FilterFactory; PBDA_FILTER_INSTANCE_ENTRY InstanceEntry; + DPRINT("BdaPropertyGetPinControl\n"); + /* first get the pin */ Pin = KsGetPinFromIrp(Irp); ASSERT(Pin); @@ -694,6 +726,7 @@ OUT BDANODE_DESCRIPTOR *pNodeDescriptorProperty) { UNIMPLEMENTED + DPRINT("BdaPropertyNodeDescriptors\n"); return STATUS_NOT_IMPLEMENTED; } @@ -708,6 +741,7 @@ OUT GUID *pguidProperty) { UNIMPLEMENTED + DPRINT("BdaPropertyNodeEvents\n"); return STATUS_NOT_IMPLEMENTED; } @@ -722,6 +756,7 @@ OUT GUID *pguidProperty) { UNIMPLEMENTED + DPRINT("BdaPropertyNodeMethods\n"); return STATUS_NOT_IMPLEMENTED; } @@ -736,6 +771,7 @@ OUT GUID *pguidProperty) { UNIMPLEMENTED + DPRINT("BdaPropertyNodeProperties\n"); return STATUS_NOT_IMPLEMENTED; } @@ -755,6 +791,8 @@ PIO_STACK_LOCATION IoStack; ULONG Index; + DPRINT("BdaPropertyNodeTypes\n"); + /* check input parameter */ if (!Irp || !pKSProperty) return STATUS_INVALID_PARAMETER; @@ -821,6 +859,8 @@ PIO_STACK_LOCATION IoStack; ULONG Index; + DPRINT("BdaPropertyPinTypes\n"); + /* check input parameter */ if (!Irp || !pKSProperty) return STATUS_INVALID_PARAMETER; @@ -886,6 +926,8 @@ PIO_STACK_LOCATION IoStack; ULONG Index; + DPRINT("BdaPropertyTemplateConnections\n"); + /* validate parameters */ if (!Irp || !pKSProperty) return STATUS_INVALID_PARAMETER; @@ -941,6 +983,8 @@ NTAPI BdaStartChanges(IN PIRP Irp) { + DPRINT("BdaStartChanges\n"); + if (Irp) return STATUS_SUCCESS; else @@ -955,6 +999,7 @@ NTAPI BdaUninitFilter(IN PKSFILTER pKSFilter) { + DPRINT("BdaUninitFilter\n"); return STATUS_SUCCESS; } @@ -967,6 +1012,8 @@ IN PIRP Irp, IN KSPROPERTY *KSProperty) { + DPRINT("BdaValidateNodeProperty\n"); + /* check for valid parameter */ if (Irp && KSProperty) return STATUS_SUCCESS;
14 years, 8 months
1
0
0
0
[tkreuzer] 46621: [KDCOM] Include ntifs, instead of ntddk, needed by NDK
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 31 17:19:01 2010 New Revision: 46621 URL:
http://svn.reactos.org/svn/reactos?rev=46621&view=rev
Log: [KDCOM] Include ntifs, instead of ntddk, needed by NDK Modified: trunk/reactos/drivers/base/kddll/kddll.h Modified: trunk/reactos/drivers/base/kddll/kddll.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kddll/kddll.h…
============================================================================== --- trunk/reactos/drivers/base/kddll/kddll.h [iso-8859-1] (original) +++ trunk/reactos/drivers/base/kddll/kddll.h [iso-8859-1] Wed Mar 31 17:19:01 2010 @@ -9,7 +9,7 @@ #pragma once #define NOEXTAPI -#include <ntddk.h> +#include <ntifs.h> #define NDEBUG #include <halfuncs.h> #include <stdio.h>
14 years, 8 months
1
0
0
0
← Newer
1
2
3
4
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200