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
April 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
22 participants
435 discussions
Start a n
N
ew thread
[cgutman] 46655: [CMBATT] - Remove my cmbatt driver and use lassy's cmbatt driver instead
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 00:24:34 2010 New Revision: 46655 URL:
http://svn.reactos.org/svn/reactos?rev=46655&view=rev
Log: [CMBATT] - Remove my cmbatt driver and use lassy's cmbatt driver instead Removed: trunk/reactos/drivers/battery/cmbatt/ Modified: trunk/reactos/drivers/battery/directory.rbuild trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.rbuild Modified: trunk/reactos/drivers/battery/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/battery/directory.…
============================================================================== --- trunk/reactos/drivers/battery/directory.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/battery/directory.rbuild [iso-8859-1] Fri Apr 2 00:24:34 2010 @@ -4,7 +4,4 @@ <directory name="battc"> <xi:include href="battc/battc.rbuild" /> </directory> -<directory name="cmbatt"> - <xi:include href="cmbatt/cmbatt.rbuild" /> -</directory> </group> Modified: trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/cmbatt/cm…
============================================================================== --- trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/cmbatt/cmbatt.rbuild [iso-8859-1] Fri Apr 2 00:24:34 2010 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="cmbattx" type="kernelmodedriver" installbase="system32/drivers" installname="cmbattx.sys"> +<module name="cmbatt" type="kernelmodedriver" installbase="system32/drivers" installname="cmbatt.sys"> <library>ntoskrnl</library> <library>hal</library> <library>battc</library>
14 years, 8 months
1
0
0
0
[cgutman] 46654: [NTOSKRNL] - Add 2 parameters to IopUpdateResourceMap to allows for updating different keys - Implement IopDetectResourceConflict and IopCheckForResourceConflict but don't report the conflicts until we get a resource arbiter - Halfplement IoReportResourceForDetection
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 00:10:38 2010 New Revision: 46654 URL:
http://svn.reactos.org/svn/reactos?rev=46654&view=rev
Log: [NTOSKRNL] - Add 2 parameters to IopUpdateResourceMap to allows for updating different keys - Implement IopDetectResourceConflict and IopCheckForResourceConflict but don't report the conflicts until we get a resource arbiter - Halfplement IoReportResourceForDetection Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Fri Apr 2 00:10:38 2010 @@ -57,7 +57,7 @@ IN ULONG RequiredSize); NTSTATUS -IopUpdateResourceMap( +IopUpdateResourceMapForPnPDevice( IN PDEVICE_NODE DeviceNode); PDEVICE_NODE @@ -163,7 +163,7 @@ Status = IopTranslateDeviceResources(DeviceNode, RequiredLength); if (NT_SUCCESS(Status)) { - Status = IopUpdateResourceMap(DeviceNode); + Status = IopUpdateResourceMapForPnPDevice(DeviceNode); if (!NT_SUCCESS(Status)) { DPRINT("IopUpdateResourceMap() failed (Status 0x%08lx)\n", Status); @@ -735,7 +735,7 @@ } NTSTATUS -IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode) +IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2Key) { NTSTATUS Status; ULONG Disposition; @@ -760,7 +760,7 @@ if (!NT_SUCCESS(Status)) return Status; - RtlInitUnicodeString(&KeyName, L"PnP Manager"); + RtlInitUnicodeString(&KeyName, Level1Key); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, @@ -777,7 +777,7 @@ if (!NT_SUCCESS(Status)) return Status; - RtlInitUnicodeString(&KeyName, L"PnpManager"); + RtlInitUnicodeString(&KeyName, Level2Key); InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_OPENIF, @@ -855,6 +855,12 @@ IopDeviceNodeSetFlag(DeviceNode, DNF_RESOURCE_ASSIGNED); return STATUS_SUCCESS; +} + +NTSTATUS +IopUpdateResourceMapForPnPDevice(IN PDEVICE_NODE DeviceNode) +{ + return IopUpdateResourceMap(DeviceNode, L"PnP Manager", L"PnpManager"); } NTSTATUS @@ -945,7 +951,349 @@ return STATUS_SUCCESS; } - +BOOLEAN +IopCheckForResourceConflict( + IN PCM_RESOURCE_LIST ResourceList1, + IN PCM_RESOURCE_LIST ResourceList2) +{ + ULONG i1, i2, ii1, ii2; + BOOLEAN Result = FALSE; + + for (i1 = 0; i1 < ResourceList1->Count; i1++) + { + PCM_PARTIAL_RESOURCE_LIST ResList1 = &ResourceList1->List[i1].PartialResourceList; + for (i2 = 0; i2 < ResourceList2->Count; i2++) + { + PCM_PARTIAL_RESOURCE_LIST ResList2 = &ResourceList2->List[i2].PartialResourceList; + for (ii1 = 0; ii1 < ResList1->Count; ii1++) + { + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc1 = &ResList1->PartialDescriptors[ii1]; + + if (ResDesc1->ShareDisposition == CmResourceShareShared) + continue; + + for (ii2 = 0; ii2 < ResList2->Count; ii2++) + { + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc2 = &ResList2->PartialDescriptors[ii2]; + + /* We don't care about shared resources */ + if (ResDesc2->ShareDisposition == CmResourceShareShared) + continue; + + /* Make sure we're comparing the same types */ + if (ResDesc1->Type != ResDesc2->Type) + continue; + + switch (ResDesc1->Type) + { + case CmResourceTypeMemory: + if ((ResDesc1->u.Memory.Start.QuadPart < ResDesc2->u.Memory.Start.QuadPart && + ResDesc1->u.Memory.Start.QuadPart + ResDesc1->u.Memory.Length > + ResDesc2->u.Memory.Start.QuadPart) || (ResDesc2->u.Memory.Start.QuadPart < + ResDesc1->u.Memory.Start.QuadPart && ResDesc2->u.Memory.Start.QuadPart + + ResDesc2->u.Memory.Length > ResDesc1->u.Memory.Start.QuadPart)) + { + DPRINT1("Resource conflict: Memory (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc1->u.Memory.Start.QuadPart, ResDesc1->u.Memory.Start.QuadPart + + ResDesc1->u.Memory.Length, ResDesc2->u.Memory.Start.QuadPart, + ResDesc2->u.Memory.Start.QuadPart + ResDesc2->u.Memory.Length); + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypePort: + if ((ResDesc1->u.Port.Start.QuadPart < ResDesc2->u.Port.Start.QuadPart && + ResDesc1->u.Port.Start.QuadPart + ResDesc1->u.Port.Length > + ResDesc2->u.Port.Start.QuadPart) || (ResDesc2->u.Port.Start.QuadPart < + ResDesc1->u.Port.Start.QuadPart && ResDesc2->u.Port.Start.QuadPart + + ResDesc2->u.Port.Length > ResDesc1->u.Port.Start.QuadPart)) + { + DPRINT1("Resource conflict: Port (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc1->u.Port.Start.QuadPart, ResDesc1->u.Port.Start.QuadPart + + ResDesc1->u.Port.Length, ResDesc2->u.Port.Start.QuadPart, + ResDesc2->u.Port.Start.QuadPart + ResDesc2->u.Port.Length); + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeInterrupt: + if (ResDesc1->u.Interrupt.Vector == ResDesc2->u.Interrupt.Vector) + { + DPRINT1("Resource conflict: IRQ (0x%x 0x%x vs. 0x%x 0x%x)\n", + ResDesc1->u.Interrupt.Vector, ResDesc1->u.Interrupt.Level, + ResDesc2->u.Interrupt.Vector, ResDesc2->u.Interrupt.Level); + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeBusNumber: + if ((ResDesc1->u.BusNumber.Start < ResDesc2->u.BusNumber.Start && + ResDesc1->u.BusNumber.Start + ResDesc1->u.BusNumber.Length > + ResDesc2->u.BusNumber.Start) || (ResDesc2->u.BusNumber.Start < + ResDesc1->u.BusNumber.Start && ResDesc2->u.BusNumber.Start + + ResDesc2->u.BusNumber.Length > ResDesc1->u.BusNumber.Start)) + { + DPRINT1("Resource conflict: Bus number (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc1->u.BusNumber.Start, ResDesc1->u.BusNumber.Start + + ResDesc1->u.BusNumber.Length, ResDesc2->u.BusNumber.Start, + ResDesc2->u.BusNumber.Start + ResDesc2->u.BusNumber.Length); + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeDma: + if (ResDesc1->u.Dma.Channel == ResDesc2->u.Dma.Channel) + { + DPRINT1("Resource conflict: Dma (0x%x 0x%x vs. 0x%x 0x%x)\n", + ResDesc1->u.Dma.Channel, ResDesc1->u.Dma.Port, + ResDesc2->u.Dma.Channel, ResDesc2->u.Dma.Port); + + Result = TRUE; + + goto ByeBye; + } + break; + } + } + } + } + } + +ByeBye: + +#ifdef ENABLE_RESOURCE_CONFLICT_DETECTION + return Result; +#else + return FALSE; +#endif +} + +NTSTATUS +IopDetectResourceConflict( + IN PCM_RESOURCE_LIST ResourceList) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + HANDLE ResourceMapKey = INVALID_HANDLE_VALUE, ChildKey2 = INVALID_HANDLE_VALUE, ChildKey3 = INVALID_HANDLE_VALUE; + ULONG KeyInformationLength, RequiredLength, KeyValueInformationLength, KeyNameInformationLength; + PKEY_BASIC_INFORMATION KeyInformation; + PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; + PKEY_VALUE_BASIC_INFORMATION KeyNameInformation; + ULONG ChildKeyIndex1 = 0, ChildKeyIndex2 = 0, ChildKeyIndex3 = 0; + NTSTATUS Status; + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); + InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, 0, NULL); + Status = ZwOpenKey(&ResourceMapKey, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + /* The key is missing which means we are the first device */ + return STATUS_SUCCESS; + } + + while (TRUE) + { + Status = ZwEnumerateKey(ResourceMapKey, + ChildKeyIndex1, + KeyBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL) + { + KeyInformationLength = RequiredLength; + KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + if (!KeyInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateKey(ResourceMapKey, + ChildKeyIndex1, + KeyBasicInformation, + KeyInformation, + KeyInformationLength, + &RequiredLength); + } + else + goto cleanup; + ChildKeyIndex1++; + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyName.Buffer = KeyInformation->Name; + KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ResourceMapKey, + NULL); + Status = ZwOpenKey(&ChildKey2, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); + ExFreePool(KeyInformation); + if (!NT_SUCCESS(Status)) + goto cleanup; + + while (TRUE) + { + Status = ZwEnumerateKey(ChildKey2, + ChildKeyIndex2, + KeyBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyInformationLength = RequiredLength; + KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + if (!KeyInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateKey(ChildKey2, + ChildKeyIndex2, + KeyBasicInformation, + KeyInformation, + KeyInformationLength, + &RequiredLength); + } + else + goto cleanup; + ChildKeyIndex2++; + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyName.Buffer = KeyInformation->Name; + KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ChildKey2, + NULL); + Status = ZwOpenKey(&ChildKey3, KEY_QUERY_VALUE, &ObjectAttributes); + ExFreePool(KeyInformation); + if (!NT_SUCCESS(Status)) + goto cleanup; + + while (TRUE) + { + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValuePartialInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyValueInformationLength = RequiredLength; + KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength); + if (!KeyValueInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValuePartialInformation, + KeyValueInformation, + KeyValueInformationLength, + &RequiredLength); + } + else + goto cleanup; + if (!NT_SUCCESS(Status)) + goto cleanup; + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValueBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyNameInformationLength = RequiredLength; + KeyNameInformation = ExAllocatePool(PagedPool, KeyNameInformationLength + sizeof(WCHAR)); + if (!KeyNameInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValueBasicInformation, + KeyNameInformation, + KeyNameInformationLength, + &RequiredLength); + } + else + goto cleanup; + + ChildKeyIndex3++; + + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyNameInformation->Name[KeyNameInformation->NameLength / sizeof(WCHAR)] = UNICODE_NULL; + + /* Skip translated entries */ + if (wcsstr(KeyNameInformation->Name, L".Translated")) + { + ExFreePool(KeyNameInformation); + continue; + } + + ExFreePool(KeyNameInformation); + + if (IopCheckForResourceConflict(ResourceList, + (PCM_RESOURCE_LIST)KeyValueInformation->Data)) + { + ExFreePool(KeyValueInformation); + Status = STATUS_CONFLICTING_ADDRESSES; + goto cleanup; + } + + ExFreePool(KeyValueInformation); + } + } + } + +cleanup: + if (ResourceMapKey != INVALID_HANDLE_VALUE) + ZwClose(ResourceMapKey); + if (ChildKey2 != INVALID_HANDLE_VALUE) + ZwClose(ChildKey2); + if (ChildKey3 != INVALID_HANDLE_VALUE) + ZwClose(ChildKey3); + + if (Status == STATUS_NO_MORE_ENTRIES) + Status = STATUS_SUCCESS; + + return Status; +} + NTSTATUS IopAssignDeviceResources( IN PDEVICE_NODE DeviceNode, @@ -996,6 +1344,10 @@ goto ByeBye; } RtlCopyMemory(DeviceNode->ResourceList, DeviceNode->BootResources, Size); + + Status = IopDetectResourceConflict(DeviceNode->ResourceList); + if (!NT_SUCCESS(Status)) + goto ByeBye; *pRequiredSize = Size; return STATUS_SUCCESS; @@ -1147,6 +1499,10 @@ DeviceNode->ResourceList->List[0].PartialResourceList.Count = NumberOfResources; + Status = IopDetectResourceConflict(DeviceNode->ResourceList); + if (!NT_SUCCESS(Status)) + goto ByeBye; + *pRequiredSize = Size; return STATUS_SUCCESS; Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnprepo…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] Fri Apr 2 00:10:38 2010 @@ -36,8 +36,12 @@ PVOID Context); NTSTATUS -IopUpdateResourceMap( +IopUpdateResourceMapForPnPDevice( IN PDEVICE_NODE DeviceNode); + +NTSTATUS +IopDetectResourceConflict( + IN PCM_RESOURCE_LIST ResourceList); /* PRIVATE FUNCTIONS *********************************************************/ @@ -272,7 +276,7 @@ { Status = IopTranslateDeviceResources(DeviceNode, RequiredLength); if (NT_SUCCESS(Status)) - Status = IopUpdateResourceMap(DeviceNode); + Status = IopUpdateResourceMapForPnPDevice(DeviceNode); } IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); @@ -301,7 +305,7 @@ } /* - * @unimplemented + * @halfplemented */ NTSTATUS NTAPI @@ -313,23 +317,35 @@ IN ULONG DeviceListSize OPTIONAL, OUT PBOOLEAN ConflictDetected) { - static int warned = 0; - if (!warned) - { - DPRINT1("IoReportResourceForDetection partly implemented\n"); - warned = 1; - } + PCM_RESOURCE_LIST ResourceList; + NTSTATUS Status; *ConflictDetected = FALSE; - if (PopSystemPowerDeviceNode && DriverListSize > 0) - { - /* We hope legacy devices will be enumerated by ACPI */ + if (!DriverList && !DeviceList) + return STATUS_INVALID_PARAMETER; + + /* Find the real list */ + if (!DriverList) + ResourceList = DeviceList; + else + ResourceList = DriverList; + + /* Look for a resource conflict */ + Status = IopDetectResourceConflict(ResourceList); + if (Status == STATUS_CONFLICTING_ADDRESSES) + { + /* Oh noes */ *ConflictDetected = TRUE; - return STATUS_CONFLICTING_ADDRESSES; - } - - return STATUS_SUCCESS; + } + else if (NT_SUCCESS(Status)) + { + /* Looks like we're good to go */ + + /* TODO: Claim the resources in the ResourceMap */ + } + + return Status; } VOID
14 years, 8 months
1
0
0
0
[sir_richard] 46653: [HAL]: Whoever came up with this MINIHAL idea...
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 22:54:12 2010 New Revision: 46653 URL:
http://svn.reactos.org/svn/reactos?rev=46653&view=rev
Log: [HAL]: Whoever came up with this MINIHAL idea... Modified: trunk/reactos/hal/halx86/generic/usage.c Modified: trunk/reactos/hal/halx86/generic/usage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c…
============================================================================== --- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Thu Apr 1 22:54:12 2010 @@ -60,6 +60,7 @@ /* FUNCTIONS ******************************************************************/ +#ifndef _MINIHAL_ VOID NTAPI HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, @@ -481,6 +482,7 @@ /* Get the machine's serial number */ HalpReportSerialNumber(); } +#endif VOID NTAPI
14 years, 8 months
1
0
0
0
[sir_richard] 46652: [HAL]: Move all HAL-specific names to halacpi.c and halpcat.c. This includes the PnP Device Name (e_isa_up vs acpipic_up", the HAL Name, and whether or not the firmware mapper should be disabled (tells I/O Manager to skip legacy detection). [HAL]: Implement HalpReportUsage! On ACPI, all is implemented, on PC/AT, we don't yet parse the ROM blocks in the registry (but does FreeLDR even put them in?), and I don't think we'll ever enable 16-bit port decoding since FreeLDR never
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 22:46:55 2010 New Revision: 46652 URL:
http://svn.reactos.org/svn/reactos?rev=46652&view=rev
Log: [HAL]: Move all HAL-specific names to halacpi.c and halpcat.c. This includes the PnP Device Name (e_isa_up vs acpipic_up", the HAL Name, and whether or not the firmware mapper should be disabled (tells I/O Manager to skip legacy detection). [HAL]: Implement HalpReportUsage! On ACPI, all is implemented, on PC/AT, we don't yet parse the ROM blocks in the registry (but does FreeLDR even put them in?), and I don't think we'll ever enable 16-bit port decoding since FreeLDR never detects ISA vs EISA machines (so we always run as ISA). [HAL]: Fill out the "????" entries in HalpDefaultIoSpace... more typical Alex "I copied something without knowing what it meant"-magic. Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c trunk/reactos/hal/halx86/generic/legacy/halpcat.c trunk/reactos/hal/halx86/generic/misc.c trunk/reactos/hal/halx86/generic/usage.c trunk/reactos/hal/halx86/include/halp.h Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
============================================================================== --- trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] Thu Apr 1 22:46:55 2010 @@ -36,6 +36,11 @@ LIST_ENTRY HalpAcpiTableMatchList; ULONG HalpInvalidAcpiTable; + +/* This determines the HAL type */ +BOOLEAN HalDisableFirmwareMapper = TRUE; +PWCHAR HalHardwareIdString = L"acpipic_up"; +PWCHAR HalName = L"ACPI Compatible Eisa/Isa HAL"; /* PRIVATE FUNCTIONS **********************************************************/ @@ -872,6 +877,29 @@ HalpGetNMICrashFlag(); } +VOID +NTAPI +HalpBuildAddressMap(VOID) +{ + /* ACPI is magic baby */ +} + +BOOLEAN +NTAPI +HalpGetDebugPortTable(VOID) +{ + return ((HalpDebugPortTable) && + (HalpDebugPortTable->BaseAddress.AddressSpaceID == 1)); +} + +ULONG +NTAPI +HalpIs16BitPortDecodeSupported(VOID) +{ + /* All ACPI systems are at least "EISA" so they support this */ + return CM_RESOURCE_PORT_16_BIT_DECODE; +} + /* * @implemented */ @@ -914,7 +942,7 @@ } /* Build HAL usage */ - RtlInitUnicodeString(&HalString, L"ACPI Compatible Eisa/Isa HAL"); + RtlInitUnicodeString(&HalString, HalName); HalpReportResourceUsage(&HalString, InterfaceType); /* Setup PCI debugging and Hibernation */ Modified: 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 [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Thu Apr 1 22:46:55 2010 @@ -47,56 +47,8 @@ /* 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 Modified: trunk/reactos/hal/halx86/generic/legacy/halpcat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/…
============================================================================== --- trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] Thu Apr 1 22:46:55 2010 @@ -13,6 +13,11 @@ #include <debug.h> /* GLOBALS ********************************************************************/ + +/* This determines the HAL type */ +BOOLEAN HalDisableFirmwareMapper = FALSE; +PWCHAR HalHardwareIdString = L"e_isa_up"; +PWCHAR HalName = L"PC Compatible Eisa/Isa HAL"; /* PRIVATE FUNCTIONS **********************************************************/ @@ -35,6 +40,33 @@ /* FIXME: Should detect broken PCI hardware and apply hacks */ /* FIXME: Should build resource ranges */ +} + +VOID +NTAPI +HalpBuildAddressMap(VOID) +{ + /* FIXME: Inherit ROM blocks from the registry */ + //HalpInheritROMBlocks(); + + /* FIXME: Add the ROM blocks to our ranges */ + //HalpAddROMRanges(); +} + +BOOLEAN +NTAPI +HalpGetDebugPortTable(VOID) +{ + /* No ACPI */ + return FALSE; +} + +ULONG +NTAPI +HalpIs16BitPortDecodeSupported(VOID) +{ + /* Only EISA systems support this */ + return (HalpBusType == MACHINE_TYPE_EISA) ? CM_RESOURCE_PORT_16_BIT_DECODE : 0; } /* @@ -80,7 +112,7 @@ } /* Build HAL usage */ - RtlInitUnicodeString(&HalString, L"PC Compatible Eisa/Isa HAL"); + RtlInitUnicodeString(&HalString, HalName); HalpReportResourceUsage(&HalString, InterfaceType); /* Setup PCI debugging and Hibernation */ 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] Thu Apr 1 22:46:55 2010 @@ -16,9 +16,88 @@ BOOLEAN HalpNMIInProgress; +UCHAR HalpSerialLen; +CHAR HalpSerialNumber[31]; + /* PRIVATE FUNCTIONS **********************************************************/ #ifndef _MINIHAL_ +VOID +NTAPI +HalpReportSerialNumber(VOID) +{ + NTSTATUS Status; + UNICODE_STRING KeyString; + HANDLE Handle; + + /* Make sure there is a serial number */ + if (!HalpSerialLen) return; + + /* Open the system key */ + RtlInitUnicodeString(&KeyString, L"\\Registry\\Machine\\Hardware\\Description\\System"); + Status = HalpOpenRegistryKey(&Handle, 0, &KeyString, KEY_ALL_ACCESS, FALSE); + if (NT_SUCCESS(Status)) + { + /* Add the serial number */ + RtlInitUnicodeString(&KeyString, L"Serial Number"); + ZwSetValueKey(Handle, + &KeyString, + 0, + REG_BINARY, + HalpSerialNumber, + HalpSerialLen); + + /* Close the handle */ + ZwClose(Handle); + } +} + +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 HalpOpenRegistryKey(IN PHANDLE KeyHandle, Modified: trunk/reactos/hal/halx86/generic/usage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c…
============================================================================== --- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Thu Apr 1 22:46:55 2010 @@ -14,26 +14,45 @@ /* GLOBALS ********************************************************************/ +BOOLEAN HalpGetInfoFromACPI; BOOLEAN HalpNMIDumpFlag; PUCHAR KdComPortInUse; PADDRESS_USAGE HalpAddressUsageList; IDTUsageFlags HalpIDTUsageFlags[MAXIMUM_IDTVECTOR]; IDTUsage HalpIDTUsage[MAXIMUM_IDTVECTOR]; +USHORT HalpComPortIrqMapping[5][2] = +{ + {0x3F8, 4}, + {0x2F8, 3}, + {0x3E8, 4}, + {0x2E8, 3}, + {0, 0} +}; + +ADDRESS_USAGE HalpComIoSpace = +{ + NULL, CmResourceTypePort, IDT_INTERNAL, + { + {0x2F8, 0x8}, /* COM 1 */ + {0,0}, + } +}; + ADDRESS_USAGE HalpDefaultIoSpace = { NULL, CmResourceTypePort, IDT_INTERNAL, { - {0x2000, 0xC000}, /* PIC?? */ + {0x2000, 0xC000}, /* Everything */ {0xC000, 0x1000}, /* DMA 2 */ {0x8000, 0x1000}, /* DMA 1 */ {0x2000, 0x200}, /* PIC 1 */ {0xA000, 0x200}, /* PIC 2 */ {0x4000, 0x400}, /* PIT 1 */ {0x4800, 0x400}, /* PIT 2 */ - {0x9200, 0x100}, /* ????? */ + {0x9200, 0x100}, /* System Control Port A */ {0x7000, 0x200}, /* CMOS */ - {0xF000, 0x1000}, /* ????? */ + {0xF000, 0x1000}, /* x87 Coprocessor */ {0xCF800, 0x800}, /* PCI 0 */ {0,0}, } @@ -43,10 +62,424 @@ VOID NTAPI +HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, + OUT PULONG Scale, + OUT PLARGE_INTEGER Value) +{ + /* Sorting depends on resource type */ + switch (Descriptor->Type) + { + case CmResourceTypeInterrupt: + + /* Interrupt goes by level */ + *Scale = 0; + *Value = RtlConvertUlongToLargeInteger(Descriptor->u.Interrupt.Level); + break; + + case CmResourceTypePort: + + /* Port goes by port address */ + *Scale = 1; + *Value = Descriptor->u.Port.Start; + break; + + case CmResourceTypeMemory: + + /* Memory goes by base address */ + *Scale = 2; + *Value = Descriptor->u.Memory.Start; + break; + + default: + + /* Anything else */ + *Scale = 4; + *Value = RtlConvertUlongToLargeInteger(0); + break; + } +} + +VOID +NTAPI +HalpBuildPartialFromIdt(IN ULONG Entry, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR RawDescriptor, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor) +{ + /* Exclusive interrupt entry */ + RawDescriptor->Type = CmResourceTypeInterrupt; + RawDescriptor->ShareDisposition = CmResourceShareDriverExclusive; + + /* Check the interrupt type */ + if (HalpIDTUsageFlags[Entry].Flags & IDT_LATCHED) + { + /* Latched */ + RawDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; + } + else + { + /* Level */ + RawDescriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; + } + + /* Get vector and level from IDT usage */ + RawDescriptor->u.Interrupt.Vector = HalpIDTUsage[Entry].BusReleativeVector; + RawDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].BusReleativeVector; + + /* Affinity is all the CPUs */ + RawDescriptor->u.Interrupt.Affinity = HalpActiveProcessors; + + /* The translated copy is identical */ + RtlCopyMemory(TranslatedDescriptor, RawDescriptor, sizeof(TranslatedDescriptor)); + + /* But the vector and IRQL must be set correctly */ + TranslatedDescriptor->u.Interrupt.Vector = Entry; + TranslatedDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].Irql; +} + +VOID +NTAPI +HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface, + IN PADDRESS_USAGE CurrentAddress, + IN ULONG Element, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR RawDescriptor, + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor) +{ + ULONG AddressSpace; + + /* Set the type and make it exclusive */ + RawDescriptor->Type = CurrentAddress->Type; + RawDescriptor->ShareDisposition = CmResourceShareDriverExclusive; + + /* Check what this is */ + if (RawDescriptor->Type == CmResourceTypePort) + { + /* Write out port data */ + AddressSpace = 1; + RawDescriptor->Flags = CM_RESOURCE_PORT_IO; + RawDescriptor->u.Port.Start.HighPart = 0; + RawDescriptor->u.Port.Start.LowPart = CurrentAddress->Element[Element].Start; + RawDescriptor->u.Port.Length = CurrentAddress->Element[Element].Length; + + /* Determine if 16-bit port addresses are allowed */ + RawDescriptor->Flags |= HalpIs16BitPortDecodeSupported(); + } + else + { + /* Write out memory data */ + AddressSpace = 0; + RawDescriptor->Flags = (CurrentAddress->Flags & IDT_READ_ONLY) ? + CM_RESOURCE_MEMORY_READ_ONLY : + CM_RESOURCE_MEMORY_READ_WRITE; + RawDescriptor->u.Memory.Start.HighPart = 0; + RawDescriptor->u.Memory.Start.LowPart = CurrentAddress->Element[Element].Start; + RawDescriptor->u.Memory.Length = CurrentAddress->Element[Element].Length; + } + + /* Make an identical copy to begin with */ + RtlCopyMemory(TranslatedDescriptor, RawDescriptor, sizeof(TranslatedDescriptor)); + + /* Check what this is */ + if (RawDescriptor->Type == CmResourceTypePort) + { + /* Translate the port */ + HalTranslateBusAddress(Interface, + 0, + RawDescriptor->u.Port.Start, + &AddressSpace, + &TranslatedDescriptor->u.Port.Start); + + /* If it turns out this is memory once translated, flag it */ + if (AddressSpace == 0) TranslatedDescriptor->Flags = CM_RESOURCE_PORT_MEMORY; + + } + else + { + /* Translate the memory */ + HalTranslateBusAddress(Interface, + 0, + RawDescriptor->u.Memory.Start, + &AddressSpace, + &TranslatedDescriptor->u.Memory.Start); + } +} + +VOID +NTAPI HalpReportResourceUsage(IN PUNICODE_STRING HalName, IN INTERFACE_TYPE InterfaceType) { - DbgPrint("%wZ has been initialized\n", HalName); + PCM_RESOURCE_LIST RawList, TranslatedList; + PCM_FULL_RESOURCE_DESCRIPTOR RawFull, TranslatedFull; + PCM_PARTIAL_RESOURCE_DESCRIPTOR CurrentRaw, CurrentTranslated, SortedRaw, SortedTranslated; + CM_PARTIAL_RESOURCE_DESCRIPTOR RawPartial, TranslatedPartial; + PCM_PARTIAL_RESOURCE_LIST RawPartialList = NULL, TranslatedPartialList = NULL; + INTERFACE_TYPE Interface; + ULONG i, j, k, ListSize, Count, Port, Element, CurrentScale, SortScale, ReportType, FlagMatch; + ADDRESS_USAGE *CurrentAddress; + LARGE_INTEGER CurrentSortValue, SortValue; + DbgPrint("%wZ Detected\n", HalName); + + /* Check if KD is using a COM port */ + if (KdComPortInUse) + { + /* Enter it into the I/O space */ + HalpComIoSpace.Element[0].Start = (ULONG_PTR)KdComPortInUse; + HalpComIoSpace.Next = HalpAddressUsageList; + HalpAddressUsageList = &HalpComIoSpace; + + /* Use the debug port table if we have one */ + HalpGetInfoFromACPI = HalpGetDebugPortTable(); + + /* Check if we're using ACPI */ + if (!HalpGetInfoFromACPI) + { + /* No, so use our local table */ + Port = HalpComPortIrqMapping[0][0]; + for (i = 0; Port; i++) + { + /* Is this the port we want? */ + if (Port == (ULONG_PTR)KdComPortInUse) + { + /* Register it */ + HalpRegisterVector(IDT_DEVICE | IDT_LATCHED, + HalpComPortIrqMapping[i][1], + HalpComPortIrqMapping[i][1] + + PRIMARY_VECTOR_BASE, + HIGH_LEVEL); + } + + /* Next port */ + Port = HalpComPortIrqMapping[i][0]; + } + } + } + + /* On non-ACPI systems, we need to build an address map */ + HalpBuildAddressMap(); + + /* Allocate the master raw and translated lists */ + RawList = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE * 2, ' laH'); + TranslatedList = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE * 2, ' laH'); + if (!(RawList) || !(TranslatedList)) + { + /* Bugcheck the system */ + KeBugCheckEx(HAL_MEMORY_ALLOCATION, + 4 * PAGE_SIZE, + 1, + (ULONG_PTR)__FILE__, + __LINE__); + } + + /* Zero out the lists */ + RtlZeroMemory(RawList, PAGE_SIZE * 2); + RtlZeroMemory(TranslatedList, PAGE_SIZE * 2); + + /* Set the interface type to begin with */ + RawList->List[0].InterfaceType = InterfaceTypeUndefined; + + /* Loop all IDT entries that are not IRQs */ + for (i = 0; i < PRIMARY_VECTOR_BASE; i++) + { + /* Check if the IDT isn't owned */ + if (!(HalpIDTUsageFlags[i].Flags & IDT_REGISTERED)) + { + /* Then register it for internal usage */ + HalpIDTUsageFlags[i].Flags = IDT_INTERNAL; + HalpIDTUsage[i].BusReleativeVector = i; + } + } + + /* Our full raw descriptors start here */ + RawFull = RawList->List; + + /* Keep track of the current partial raw and translated descriptors */ + CurrentRaw = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)RawList->List; + CurrentTranslated = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)TranslatedList->List; + + /* Do two passes */ + for (ReportType = 0; ReportType < 2; ReportType++) + { + /* Pass 0 is for device usage */ + if (ReportType == 0) + { + FlagMatch = IDT_DEVICE & ~IDT_REGISTERED; + Interface = InterfaceType; + } + else + { + /* Past 1 is for internal HAL usage */ + FlagMatch = IDT_INTERNAL & ~IDT_REGISTERED; + Interface = Internal; + } + + /* Reset loop variables */ + i = Element = 0; + + /* Start looping our address uage list and interrupts */ + CurrentAddress = HalpAddressUsageList; + while (TRUE) + { + /* Check for valid vector number */ + if (i <= MAXIMUM_IDTVECTOR) + { + /* Check if this entry should be parsed */ + if ((HalpIDTUsageFlags[i].Flags & FlagMatch)) + { + /* Parse it */ + HalpBuildPartialFromIdt(i, &RawPartial, &TranslatedPartial); + i++; + } + else + { + /* Skip this entry */ + i++; + continue; + } + } + else + { + /* This is an address instead */ + if (!CurrentAddress) break; + + /* Check if the address should be reported */ + if (!(CurrentAddress->Flags & FlagMatch) || + !(CurrentAddress->Element[Element].Length)) + { + /* Nope, skip it */ + Element = 0; + CurrentAddress = CurrentAddress->Next; + continue; + } + + /* Otherwise, parse the entry */ + HalpBuildPartialFromAddress(Interface, + CurrentAddress, + Element, + &RawPartial, + &TranslatedPartial); + Element++; + } + + /* Check for interface change */ + if (RawFull->InterfaceType != Interface) + { + /* We need to add another full descriptor */ + RawList->Count++; + TranslatedList->Count++; + + /* The full descriptor follows wherever we were */ + RawFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentRaw; + TranslatedFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentTranslated; + + /* And it is of this new interface type */ + RawFull->InterfaceType = Interface; + TranslatedFull->InterfaceType = Interface; + + /* And its partial descriptors begin here */ + RawPartialList = &RawFull->PartialResourceList; + TranslatedPartialList = &TranslatedFull->PartialResourceList; + + /* And our next full descriptor should follow here */ + CurrentRaw = RawFull->PartialResourceList.PartialDescriptors; + CurrentTranslated = TranslatedFull->PartialResourceList.PartialDescriptors; + } + + /* We have written a new partial descriptor */ + RawPartialList->Count++; + TranslatedPartialList->Count++; + + /* Copy our local descriptors into the actual list */ + RtlCopyMemory(CurrentRaw, &RawPartial, sizeof(RawPartial)); + RtlCopyMemory(CurrentTranslated, &TranslatedPartial, sizeof(TranslatedPartial)); + + /* Move to the next partial descriptor */ + CurrentRaw++; + CurrentTranslated++; + } + } + + /* Get the final list of the size for the kernel call later */ + ListSize = (ULONG_PTR)CurrentRaw - (ULONG_PTR)RawList; + + /* Now reset back to the first full descriptor */ + RawFull = RawList->List; + TranslatedFull = TranslatedList->List; + + /* And loop all the full descriptors */ + for (i = 0; i < RawList->Count; i++) + { + /* Get the first partial descriptor in this list */ + CurrentRaw = RawFull->PartialResourceList.PartialDescriptors; + CurrentTranslated = TranslatedFull->PartialResourceList.PartialDescriptors; + + /* Get the count of partials in this list */ + Count = RawFull->PartialResourceList.Count; + + /* Loop all the partials in this list */ + for (j = 0; j < Count; j++) + { + /* Get the sort value at this point */ + HalpGetResourceSortValue(CurrentRaw, &CurrentScale, &CurrentSortValue); + + /* Save the current sort pointer */ + SortedRaw = CurrentRaw; + SortedTranslated = CurrentTranslated; + + /* Loop all descriptors starting from this one */ + for (k = j; k < Count; k++) + { + /* Get the sort value at the sort point */ + HalpGetResourceSortValue(SortedRaw, &SortScale, &SortValue); + + /* Check if a swap needs to occur */ + if ((SortScale < CurrentScale) || + ((SortScale == CurrentScale) && + (SortValue.QuadPart <= CurrentSortValue.QuadPart))) + { + /* Swap raw partial with the sort location partial */ + RtlCopyMemory(&RawPartial, CurrentRaw, sizeof(RawPartial)); + RtlCopyMemory(CurrentRaw, SortedRaw, sizeof(RawPartial)); + RtlCopyMemory(SortedRaw, &RawPartial, sizeof(RawPartial)); + + /* Swap translated partial in the same way */ + RtlCopyMemory(&TranslatedPartial, CurrentTranslated, sizeof(TranslatedPartial)); + RtlCopyMemory(CurrentTranslated, SortedTranslated, sizeof(TranslatedPartial)); + RtlCopyMemory(SortedTranslated, &TranslatedPartial, sizeof(TranslatedPartial)); + + /* Update the sort value at this point */ + HalpGetResourceSortValue(CurrentRaw, &CurrentScale, &CurrentSortValue); + } + + /* The sort location has been updated */ + SortedRaw++; + SortedTranslated++; + } + + /* Move to the next partial */ + CurrentRaw++; + CurrentTranslated++; + } + + /* Move to the next full descriptor */ + RawFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentRaw; + TranslatedFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentTranslated; + } + + /* Mark this is an ACPI system, if it is */ + HalpMarkAcpiHal(); + + /* Tell the kernel about all this */ + IoReportHalResourceUsage(HalName, + RawList, + TranslatedList, + ListSize); + + /* Free our lists */ + ExFreePool(RawList); + ExFreePool(TranslatedList); + + /* Get the machine's serial number */ + HalpReportSerialNumber(); } VOID 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] Thu Apr 1 22:46:55 2010 @@ -49,6 +49,7 @@ /* Usage flags */ #define IDT_REGISTERED 0x01 #define IDT_LATCHED 0x02 +#define IDT_READ_ONLY 0x04 #define IDT_INTERNAL 0x11 #define IDT_DEVICE 0x21 @@ -713,11 +714,41 @@ VOID ); +BOOLEAN +NTAPI +HalpGetDebugPortTable( + VOID +); + +VOID +NTAPI +HalpReportSerialNumber( + VOID +); + +NTSTATUS +NTAPI +HalpMarkAcpiHal( + VOID +); + +VOID +NTAPI +HalpBuildAddressMap( + VOID +); + VOID NTAPI HalpReportResourceUsage( IN PUNICODE_STRING HalName, IN INTERFACE_TYPE InterfaceType +); + +ULONG +NTAPI +HalpIs16BitPortDecodeSupported( + VOID ); VOID @@ -748,3 +779,9 @@ extern PADDRESS_USAGE HalpAddressUsageList; extern LARGE_INTEGER HalpPerfCounter; + +extern KAFFINITY HalpActiveProcessors; + +extern BOOLEAN HalDisableFirmwareMapper; +extern PWCHAR HalHardwareIdString; +extern PWCHAR HalName;
14 years, 8 months
1
0
0
0
[sir_richard] 46651: [HAL]: HalpActiveProcessors is KAFFINITY, not LONG. Also, MP HAL lacked it.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 22:42:43 2010 New Revision: 46651 URL:
http://svn.reactos.org/svn/reactos?rev=46651&view=rev
Log: [HAL]: HalpActiveProcessors is KAFFINITY, not LONG. Also, MP HAL lacked it. Modified: trunk/reactos/hal/halx86/mp/processor_mp.c trunk/reactos/hal/halx86/up/processor.c Modified: trunk/reactos/hal/halx86/mp/processor_mp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/processor_mp…
============================================================================== --- trunk/reactos/hal/halx86/mp/processor_mp.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/mp/processor_mp.c [iso-8859-1] Thu Apr 1 22:42:43 2010 @@ -18,6 +18,8 @@ #define NDEBUG #include <debug.h> +KAFFINITY HalpActiveProcessors; + /* PRIVATE FUNCTIONS *********************************************************/ VOID Modified: trunk/reactos/hal/halx86/up/processor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/processor.c?…
============================================================================== --- trunk/reactos/hal/halx86/up/processor.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/up/processor.c [iso-8859-1] Thu Apr 1 22:42:43 2010 @@ -12,7 +12,7 @@ #define NDEBUG #include <debug.h> -LONG HalpActiveProcessors; +KAFFINITY HalpActiveProcessors; KAFFINITY HalpDefaultInterruptAffinity; /* PRIVATE FUNCTIONS *********************************************************/ @@ -41,7 +41,7 @@ KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT; /* Update the interrupt affinity and processor mask */ - InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber); + InterlockedBitTestAndSet((PLONG)&HalpActiveProcessors, ProcessorNumber); InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity, ProcessorNumber);
14 years, 8 months
1
0
0
0
[sir_richard] 46650: [HAL]: Fucken' A, I knew I'd forget one.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 22:41:46 2010 New Revision: 46650 URL:
http://svn.reactos.org/svn/reactos?rev=46650&view=rev
Log: [HAL]: Fucken' A, I knew I'd forget one. Modified: trunk/reactos/hal/halx86/hal_generic.rbuild 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] Thu Apr 1 22:41:46 2010 @@ -1,65 +1,12 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> <group> - <module name="hal_generic_legacy" type="objectlibrary"> + <module name="hal_generic" type="objectlibrary"> <include>include</include> <include base="ntoskrnl">include</include> <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> <directory name="generic"> - <directory name="legacy"> - <file>halpcat.c</file> - </directory> - <directory name="bus"> - <file>bushndlr.c</file> - <file>isabus.c</file> - <file>halbus.c</file> - <file>pcibus.c</file> - <file>pcidata.c</file> - <file>sysbus.c</file> - </directory> - <file>beep.c</file> - <file>bios.c</file> - <file>cmos.c</file> - <file>display.c</file> - <file>dma.c</file> - <file>drive.c</file> - <file>halinit.c</file> - <file>misc.c</file> - <file>profil.c</file> - <file>reboot.c</file> - <file>sysinfo.c</file> - <file>timer.c</file> - <file>usage.c</file> - <if property="ARCH" value="i386"> - <directory name="i386"> - <file>portio.c</file> - <file>systimer.S</file> - <file>trap.S</file> - </directory> - </if> - <if property="ARCH" value="amd64"> - <directory name="amd64"> - <file>x86bios.c</file> - <file>systimer.S</file> - </directory> - </if> - </directory> - <directory name="include"> - <pch>hal.h</pch> - </directory> - </module> - - <module name="hal_generic_acpi" type="objectlibrary"> - <include>include</include> - <include base="ntoskrnl">include</include> - <define name="_NTHALDLL_" /> - <define name="_NTHAL_" /> - <directory name="generic"> - <directory name="acpi"> - <file>halacpi.c</file> - <file>halpnpdd.c</file> - </directory> <directory name="bus"> <file>bushndlr.c</file> <file>isabus.c</file>
14 years, 8 months
1
0
0
0
[sir_richard] 46649: [HAL]: Smarter .rbuild separation so that ACPI and PC/AT hal don't rebuild the generic library twice. Now generic stays generic, and generic_pcat/acpi are add-on libaries just like generic_up and generic_mp.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 22:41:04 2010 New Revision: 46649 URL:
http://svn.reactos.org/svn/reactos?rev=46649&view=rev
Log: [HAL]: Smarter .rbuild separation so that ACPI and PC/AT hal don't rebuild the generic library twice. Now generic stays generic, and generic_pcat/acpi are add-on libaries just like generic_up and generic_mp. Added: trunk/reactos/hal/halx86/hal_generic_acpi.rbuild (with props) trunk/reactos/hal/halx86/hal_generic_pcat.rbuild (with props) Modified: trunk/reactos/hal/halx86/directory.rbuild trunk/reactos/hal/halx86/hal.rbuild trunk/reactos/hal/halx86/halacpi.rbuild trunk/reactos/hal/halx86/halamd64.rbuild trunk/reactos/hal/halx86/halmps.rbuild trunk/reactos/hal/halx86/halxbox.rbuild Modified: trunk/reactos/hal/halx86/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/directory.rbuil…
============================================================================== --- trunk/reactos/hal/halx86/directory.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/directory.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -5,7 +5,9 @@ <xi:include href="hal_generic.rbuild" /> <xi:include href="hal_generic_up.rbuild" /> <xi:include href="hal_generic_mp.rbuild" /> - + <xi:include href="hal_generic_pcat.rbuild" /> + <xi:include href="hal_generic_acpi.rbuild" /> + <if property="ARCH" value="i386"> <xi:include href="hal.rbuild" /> <xi:include href="halacpi.rbuild" /> Modified: trunk/reactos/hal/halx86/hal.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal.rbuild?rev=…
============================================================================== --- trunk/reactos/hal/halx86/hal.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -8,7 +8,8 @@ <include base="ntoskrnl">include</include> <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> - <library>hal_generic_legacy</library> + <library>hal_generic</library> + <library>hal_generic_pcat</library> <library>hal_generic_up</library> <library>ntoskrnl</library> <library>libcntpr</library> Added: trunk/reactos/hal/halx86/hal_generic_acpi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic_acp…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic_acpi.rbuild (added) +++ trunk/reactos/hal/halx86/hal_generic_acpi.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -1,0 +1,16 @@ +<?xml version="1.0"?> +<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> +<group> + <module name="hal_generic_acpi" type="objectlibrary"> + <include>include</include> + <include base="ntoskrnl">include</include> + <define name="_NTHALDLL_" /> + <define name="_NTHAL_" /> + <directory name="generic"> + <directory name="acpi"> + <file>halacpi.c</file> + <file>halpnpdd.c</file> + </directory> + </directory> + </module> +</group> Propchange: trunk/reactos/hal/halx86/hal_generic_acpi.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/hal/halx86/hal_generic_pcat.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic_pca…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic_pcat.rbuild (added) +++ trunk/reactos/hal/halx86/hal_generic_pcat.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -1,0 +1,15 @@ +<?xml version="1.0"?> +<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd"> +<group> + <module name="hal_generic_pcat" type="objectlibrary"> + <include>include</include> + <include base="ntoskrnl">include</include> + <define name="_NTHALDLL_" /> + <define name="_NTHAL_" /> + <directory name="generic"> + <directory name="legacy"> + <file>halpcat.c</file> + </directory> + </directory> + </module> +</group> Propchange: trunk/reactos/hal/halx86/hal_generic_pcat.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/hal/halx86/halacpi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/halacpi.rbuild?…
============================================================================== --- trunk/reactos/hal/halx86/halacpi.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/halacpi.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -8,6 +8,7 @@ <include base="ntoskrnl">include</include> <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> + <library>hal_generic</library> <library>hal_generic_acpi</library> <library>hal_generic_up</library> <library>ntoskrnl</library> Modified: trunk/reactos/hal/halx86/halamd64.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/halamd64.rbuild…
============================================================================== --- trunk/reactos/hal/halx86/halamd64.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/halamd64.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -10,6 +10,7 @@ <define name="_DISABLE_TIDENTS" /> <define name="_NTHAL_" /> <define name="_X86BIOS_" /> + <library>hal_generic</library> <library>hal_generic_acpi</library> <library>hal_generic_up</library> <library>ntoskrnl</library> Modified: trunk/reactos/hal/halx86/halmps.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/halmps.rbuild?r…
============================================================================== --- trunk/reactos/hal/halx86/halmps.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/halmps.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -9,7 +9,8 @@ <define name="CONFIG_SMP" /> <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> - <library>hal_generic_legacy</library> + <library>hal_generic</library> + <library>hal_generic_pcat</library> <library>hal_generic_mp</library> <library>ntoskrnl</library> <library>libcntpr</library> Modified: trunk/reactos/hal/halx86/halxbox.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/halxbox.rbuild?…
============================================================================== --- trunk/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/halxbox.rbuild [iso-8859-1] Thu Apr 1 22:41:04 2010 @@ -8,7 +8,8 @@ <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> <define name="SARCH_XBOX" /> - <library>hal_generic_legacy</library> + <library>hal_generic</library> + <library>hal_generic_pcat</library> <library>hal_generic_up</library> <library>ntoskrnl</library> <library>libcntpr</library>
14 years, 8 months
1
0
0
0
[janderwald] 46648: [DEVENUM] - Extend device enumerator to support class enumerators of device interfaces
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 1 21:48:49 2010 New Revision: 46648 URL:
http://svn.reactos.org/svn/reactos?rev=46648&view=rev
Log: [DEVENUM] - Extend device enumerator to support class enumerators of device interfaces Modified: trunk/reactos/dll/directx/devenum/createdevenum.c trunk/reactos/dll/directx/devenum/devenum_private.h trunk/reactos/dll/directx/devenum/mediacatenum.c Modified: trunk/reactos/dll/directx/devenum/createdevenum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/devenum/create…
============================================================================== --- trunk/reactos/dll/directx/devenum/createdevenum.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/devenum/createdevenum.c [iso-8859-1] Thu Apr 1 21:48:49 2010 @@ -48,6 +48,7 @@ #include "wine/debug.h" #include "mmddk.h" +#include <regstr.h> WINE_DEFAULT_DEBUG_CHANNEL(devenum); @@ -124,6 +125,7 @@ WCHAR wszRegKey[MAX_PATH]; HKEY hkey; HKEY hbasekey; + BOOL bInterface = FALSE; CreateDevEnumImpl *This = (CreateDevEnumImpl *)iface; TRACE("(%p)->(%s, %p, %lx)\n\tDeviceClass:\t%s\n", This, debugstr_guid(clsidDeviceClass), ppEnumMoniker, dwFlags, debugstr_guid(clsidDeviceClass)); @@ -174,12 +176,23 @@ } else { - FIXME("Category %s not found\n", debugstr_guid(clsidDeviceClass)); - return S_FALSE; + wcscpy(wszRegKey, REGSTR_PATH_DEVICE_CLASSES); + wcscat(wszRegKey, L"\\"); + + if (!StringFromGUID2(clsidDeviceClass, wszRegKey + wcslen(wszRegKey), MAX_PATH - CLSID_STR_LEN)) + return E_OUTOFMEMORY; + + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRegKey, 0, KEY_READ, &hkey) != ERROR_SUCCESS) + { + FIXME("Category %s not found\n", debugstr_guid(clsidDeviceClass)); + return S_FALSE; + } + + bInterface = TRUE; } } - return DEVENUM_IEnumMoniker_Construct(hkey, ppEnumMoniker); + return DEVENUM_IEnumMoniker_Construct(hkey, ppEnumMoniker, bInterface); } /********************************************************************** Modified: trunk/reactos/dll/directx/devenum/devenum_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/devenum/devenu…
============================================================================== --- trunk/reactos/dll/directx/devenum/devenum_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/devenum/devenum_private.h [iso-8859-1] Thu Apr 1 21:48:49 2010 @@ -71,6 +71,7 @@ LONG ref; DWORD index; HKEY hkey; + BOOL bInterface; } EnumMonikerImpl; typedef struct @@ -79,10 +80,11 @@ LONG ref; HKEY hkey; + BOOL bInterface; } MediaCatMoniker; MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void); -HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker); +HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker, BOOL bInterface); HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( ICreateDevEnum * iface, REFCLSID clsidDeviceClass, Modified: trunk/reactos/dll/directx/devenum/mediacatenum.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/devenum/mediac…
============================================================================== --- trunk/reactos/dll/directx/devenum/mediacatenum.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/devenum/mediacatenum.c [iso-8859-1] Thu Apr 1 21:48:49 2010 @@ -42,6 +42,7 @@ IPropertyBagVtbl *lpVtbl; LONG ref; HKEY hkey; + BOOL bInterface; } RegPropBagImpl; @@ -108,13 +109,31 @@ RegPropBagImpl *This = (RegPropBagImpl *)iface; HRESULT res = S_OK; LONG reswin32; + WCHAR buffer[MAX_PATH]; + HKEY hkey; + LPCOLESTR pszName; TRACE("(%p)->(%s, %p, %p)\n", This, debugstr_w(pszPropName), pVar, pErrorLog); if (!pszPropName || !pVar) return E_POINTER; - reswin32 = RegQueryValueExW(This->hkey, pszPropName, NULL, NULL, NULL, &received); + hkey = This->hkey; + pszName = pszPropName; + if (This->bInterface) + { + buffer[0] = 0; + received = sizeof(buffer)/sizeof(WCHAR); + reswin32 = RegEnumKeyEx(This->hkey, 0, buffer, &received, NULL, NULL, NULL, NULL); + + reswin32 = RegOpenKeyExW(This->hkey, buffer, 0, KEY_READ, &hkey); + + if (!wcsicmp(pszPropName, L"DevicePath")) + pszName = L"SymbolicLink"; + + } + + reswin32 = RegQueryValueExW(hkey, pszName, NULL, NULL, NULL, &received); res = HRESULT_FROM_WIN32(reswin32); if (SUCCEEDED(res)) @@ -122,7 +141,7 @@ pData = HeapAlloc(GetProcessHeap(), 0, received); /* work around a GCC bug that occurs here unless we use the reswin32 variable as well */ - reswin32 = RegQueryValueExW(This->hkey, pszPropName, NULL, &type, pData, &received); + reswin32 = RegQueryValueExW(hkey, pszName, NULL, &type, pData, &received); res = HRESULT_FROM_WIN32(reswin32); } @@ -201,6 +220,9 @@ if (pData) HeapFree(GetProcessHeap(), 0, pData); + if (This->bInterface) + RegCloseKey(hkey); + TRACE("<- %lx\n", res); return res; } @@ -270,7 +292,7 @@ DEVENUM_IPropertyBag_Write }; -static HRESULT DEVENUM_IPropertyBag_Construct(HANDLE hkey, IPropertyBag **ppBag) +static HRESULT DEVENUM_IPropertyBag_Construct(HANDLE hkey, IPropertyBag **ppBag, BOOL bInterface) { RegPropBagImpl * rpb = CoTaskMemAlloc(sizeof(RegPropBagImpl)); if (!rpb) @@ -278,6 +300,8 @@ rpb->lpVtbl = &IPropertyBag_Vtbl; rpb->ref = 1; rpb->hkey = hkey; + rpb->bInterface = bInterface; + *ppBag = (IPropertyBag*)rpb; DEVENUM_LockModule(); return S_OK; @@ -393,6 +417,7 @@ { IUnknown * pObj = NULL; IPropertyBag * pProp = NULL; + IPersistPropertyBag * pBag; CLSID clsID; VARIANT var; HRESULT res = E_FAIL; @@ -430,6 +455,15 @@ if (pObj!=NULL) { + if (This->bInterface) + { + res = IUnknown_QueryInterface(pObj, &IID_IPersistPropertyBag, (void**)&pBag); + if (SUCCEEDED(res)) + { + res = IPersistPropertyBag_Load(pBag, pProp, NULL); /* FIXME */ + IPersistPropertyBag_Release(pBag); + } + } /* get the requested interface from the loaded class */ res= IUnknown_QueryInterface(pObj,riidResult,ppvResult); } @@ -463,7 +497,7 @@ { HANDLE hkey; DuplicateHandle(GetCurrentProcess(), This->hkey, GetCurrentProcess(), &hkey, 0, 0, DUPLICATE_SAME_ACCESS); - return DEVENUM_IPropertyBag_Construct(hkey, (IPropertyBag**)ppvObj); + return DEVENUM_IPropertyBag_Construct(hkey, (IPropertyBag**)ppvObj, This->bInterface); } return MK_E_NOSTORAGE; @@ -679,6 +713,7 @@ pMoniker->lpVtbl = &IMoniker_Vtbl; pMoniker->ref = 0; pMoniker->hkey = NULL; + pMoniker->bInterface = FALSE; DEVENUM_IMediaCatMoniker_AddRef((LPMONIKER)pMoniker); @@ -764,6 +799,7 @@ if (!pMoniker) return E_OUTOFMEMORY; + pMoniker->bInterface = This->bInterface; if (RegOpenKeyW(This->hkey, buffer, &pMoniker->hkey) != ERROR_SUCCESS) { DEVENUM_IMediaCatMoniker_Release((LPMONIKER)pMoniker); @@ -829,7 +865,7 @@ DEVENUM_IEnumMoniker_Clone }; -HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker) +HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker, BOOL bInterface) { EnumMonikerImpl * pEnumMoniker = CoTaskMemAlloc(sizeof(EnumMonikerImpl)); if (!pEnumMoniker) @@ -839,6 +875,7 @@ pEnumMoniker->ref = 1; pEnumMoniker->index = 0; pEnumMoniker->hkey = hkey; + pEnumMoniker->bInterface = bInterface; *ppEnumMoniker = (IEnumMoniker *)pEnumMoniker;
14 years, 8 months
1
0
0
0
[sir_richard] 46647: [HAL]: Split HalReportResouceUsage into per-platform function, since PC/AT HAL and ACPI HAL have different requirements. As a bonus, the ACPI HAL now identifies itself as ACPI Compatible, instead of using the "PC Compatible" moniker. [HAL]: Implement HalpGetNMICrashFlag so you can do NMI crashes now. [HAL]: Implement basic HalpRegistryPciDebuggingDeviceInfo for the day someone implements the Kd routines. [HAL]: HalpInitializePciBus needs to be different between "Bus Handler
by sir_richard@svn.reactos.org
Author: sir_richard Date: Thu Apr 1 21:42:07 2010 New Revision: 46647 URL:
http://svn.reactos.org/svn/reactos?rev=46647&view=rev
Log: [HAL]: Split HalReportResouceUsage into per-platform function, since PC/AT HAL and ACPI HAL have different requirements. As a bonus, the ACPI HAL now identifies itself as ACPI Compatible, instead of using the "PC Compatible" moniker. [HAL]: Implement HalpGetNMICrashFlag so you can do NMI crashes now. [HAL]: Implement basic HalpRegistryPciDebuggingDeviceInfo for the day someone implements the Kd routines. [HAL]: HalpInitializePciBus needs to be different between "Bus Handler HALs" (non-ACPI/embedded) and "Non-Bus Handler HALs" (ACPI/x64). On ACPI, all we do is setup the raw PCI Stubs and NMI crashing. PC/AT will need more involved code. Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c trunk/reactos/hal/halx86/generic/bus/pcibus.c trunk/reactos/hal/halx86/generic/legacy/halpcat.c trunk/reactos/hal/halx86/generic/usage.c trunk/reactos/hal/halx86/include/bus.h trunk/reactos/hal/halx86/include/halp.h Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
============================================================================== --- trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] Thu Apr 1 21:42:07 2010 @@ -861,4 +861,64 @@ return STATUS_SUCCESS; } +VOID +NTAPI +HalpInitializePciBus(VOID) +{ + /* Setup the PCI stub support */ + HalpInitializePciStubs(); + + /* Set the NMI crash flag */ + HalpGetNMICrashFlag(); +} + +/* + * @implemented + */ +VOID +NTAPI +HalReportResourceUsage(VOID) +{ + INTERFACE_TYPE InterfaceType; + UNICODE_STRING HalString; + + /* FIXME: Initialize DMA 64-bit support */ + + /* FIXME: Initialize MCA bus */ + + /* Initialize PCI bus. */ + HalpInitializePciBus(); + + /* What kind of bus is this? */ + switch (HalpBusType) + { + /* ISA Machine */ + case MACHINE_TYPE_ISA: + InterfaceType = Isa; + break; + + /* EISA Machine */ + case MACHINE_TYPE_EISA: + InterfaceType = Eisa; + break; + + /* MCA Machine */ + case MACHINE_TYPE_MCA: + InterfaceType = MicroChannel; + break; + + /* Unknown */ + default: + InterfaceType = Internal; + break; + } + + /* Build HAL usage */ + RtlInitUnicodeString(&HalString, L"ACPI Compatible Eisa/Isa HAL"); + HalpReportResourceUsage(&HalString, InterfaceType); + + /* Setup PCI debugging and Hibernation */ + HalpRegisterPciDebuggingDeviceInfo(); +} + /* EOF */ Modified: trunk/reactos/hal/halx86/generic/bus/pcibus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pci…
============================================================================== --- trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] Thu Apr 1 21:42:07 2010 @@ -13,6 +13,8 @@ #include <debug.h> /* GLOBALS *******************************************************************/ + +PCI_TYPE1_CFG_CYCLE_BITS HalpPciDebuggingDevice[2] = {{{{0}}}}; BOOLEAN HalpPCIConfigInitialized; ULONG HalpMinPciBus, HalpMaxPciBus; @@ -519,6 +521,34 @@ { DPRINT1("Unimplemented!\n"); return STATUS_NOT_IMPLEMENTED; +} + +VOID +NTAPI +HalpRegisterPciDebuggingDeviceInfo(VOID) +{ + BOOLEAN Found = FALSE; + ULONG i; + PAGED_CODE(); + + /* Loop PCI debugging devices */ + for (i = 0; i < 2; i++) + { + /* Reserved bit is set if we found one */ + if (HalpPciDebuggingDevice[i].u.bits.Reserved1) + { + Found = TRUE; + break; + } + } + + /* Bail out if there aren't any */ + if (!Found) return; + + /* FIXME: TODO */ + DPRINT1("You have implemented the KD routines for searching PCI debugger" + "devices, but you have forgotten to implement this routine\n"); + while (TRUE); } static ULONG NTAPI @@ -1026,9 +1056,3 @@ HalpPCIConfigInitialized = TRUE; } -VOID -NTAPI -HalpInitializePciBus(VOID) -{ - /* FIXME: Initialize NMI Crash Flag */ -} Modified: trunk/reactos/hal/halx86/generic/legacy/halpcat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/…
============================================================================== --- trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] Thu Apr 1 21:42:07 2010 @@ -24,4 +24,67 @@ return STATUS_NO_SUCH_DEVICE; } +VOID +NTAPI +HalpInitializePciBus(VOID) +{ + /* FIXME: Should do legacy PCI bus detection */ + + /* FIXME: Should detect chipset hacks */ + + /* FIXME: Should detect broken PCI hardware and apply hacks */ + + /* FIXME: Should build resource ranges */ +} + +/* + * @implemented + */ +VOID +NTAPI +HalReportResourceUsage(VOID) +{ + INTERFACE_TYPE InterfaceType; + UNICODE_STRING HalString; + + /* FIXME: Initialize MCA bus */ + + /* Initialize PCI bus. */ + HalpInitializePciBus(); + + /* Initialize the stubs */ + HalpInitializePciStubs(); + + /* What kind of bus is this? */ + switch (HalpBusType) + { + /* ISA Machine */ + case MACHINE_TYPE_ISA: + InterfaceType = Isa; + break; + + /* EISA Machine */ + case MACHINE_TYPE_EISA: + InterfaceType = Eisa; + break; + + /* MCA Machine */ + case MACHINE_TYPE_MCA: + InterfaceType = MicroChannel; + break; + + /* Unknown */ + default: + InterfaceType = Internal; + break; + } + + /* Build HAL usage */ + RtlInitUnicodeString(&HalString, L"PC Compatible Eisa/Isa HAL"); + HalpReportResourceUsage(&HalString, InterfaceType); + + /* Setup PCI debugging and Hibernation */ + HalpRegisterPciDebuggingDeviceInfo(); +} + /* EOF */ Modified: trunk/reactos/hal/halx86/generic/usage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c…
============================================================================== --- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Thu Apr 1 21:42:07 2010 @@ -14,6 +14,7 @@ /* GLOBALS ********************************************************************/ +BOOLEAN HalpNMIDumpFlag; PUCHAR KdComPortInUse; PADDRESS_USAGE HalpAddressUsageList; IDTUsageFlags HalpIDTUsageFlags[MAXIMUM_IDTVECTOR]; @@ -88,55 +89,56 @@ /* Enable the interrupt */ HalEnableSystemInterrupt(SystemVector, Irql, Mode); } + +VOID +NTAPI +HalpGetNMICrashFlag(VOID) +{ + UNICODE_STRING ValueName; + UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\CrashControl"); + OBJECT_ATTRIBUTES ObjectAttributes; + ULONG ResultLength; + HANDLE Handle; + NTSTATUS Status; + KEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; + + /* Set default */ + HalpNMIDumpFlag = 0; + + /* Initialize attributes */ + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + /* Open crash key */ + Status = ZwOpenKey(&Handle, KEY_READ, &ObjectAttributes); + if (NT_SUCCESS(Status)) + { + /* Query key value */ + RtlInitUnicodeString(&ValueName, L"NMICrashDump"); + Status = ZwQueryValueKey(Handle, + &ValueName, + KeyValuePartialInformation, + &KeyValueInformation, + sizeof(KeyValueInformation), + &ResultLength); + if (NT_SUCCESS(Status)) + { + /* Check for valid data */ + if (ResultLength == sizeof(KEY_VALUE_PARTIAL_INFORMATION)) + { + /* Read the flag */ + HalpNMIDumpFlag = KeyValueInformation.Data[0]; + } + } + + /* We're done */ + ZwClose(Handle); + } +} #endif -/* - * @unimplemented - */ -VOID -NTAPI -HalReportResourceUsage(VOID) -{ - INTERFACE_TYPE InterfaceType; - UNICODE_STRING HalString; +/* EOF */ - /* FIXME: Initialize DMA 64-bit support */ - - /* FIXME: Initialize MCA bus */ - - /* Initialize PCI bus. */ - HalpInitializePciBus(); - - /* Initialize the stubs */ - HalpInitializePciStubs(); - - /* What kind of bus is this? */ - switch (HalpBusType) - { - /* ISA Machine */ - case MACHINE_TYPE_ISA: - InterfaceType = Isa; - break; - - /* EISA Machine */ - case MACHINE_TYPE_EISA: - InterfaceType = Eisa; - break; - - /* MCA Machine */ - case MACHINE_TYPE_MCA: - InterfaceType = MicroChannel; - break; - - /* Unknown */ - default: - InterfaceType = Internal; - break; - } - - /* Build HAL usage */ - RtlInitUnicodeString(&HalString, L"PC Compatible Eisa/Isa HAL"); - HalpReportResourceUsage(&HalString, InterfaceType); - - /* FIXME: Setup PCI debugging and Hibernation */ -} Modified: trunk/reactos/hal/halx86/include/bus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/bus.h?r…
============================================================================== --- trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/bus.h [iso-8859-1] Thu Apr 1 21:42:07 2010 @@ -158,6 +158,38 @@ PCI_CARD_DESCRIPTOR CardList[ANYSIZE_ARRAY]; } PCI_REGISTRY_INFO_INTERNAL, *PPCI_REGISTRY_INFO_INTERNAL; +typedef struct _PCI_TYPE0_CFG_CYCLE_BITS +{ + union + { + struct + { + ULONG Reserved1:2; + ULONG RegisterNumber:6; + ULONG FunctionNumber:3; + ULONG Reserved2:21; + } bits; + ULONG AsULONG; + } u; +} PCI_TYPE0_CFG_CYCLE_BITS, *PPCI_TYPE0_CFG_CYCLE_BITS; + +typedef struct _PCI_TYPE1_CFG_CYCLE_BITS +{ + union + { + struct + { + ULONG Reserved1:2; + ULONG RegisterNumber:6; + ULONG FunctionNumber:3; + ULONG DeviceNumber:5; + ULONG BusNumber:8; + ULONG Reserved2:8; + } bits; + ULONG AsULONG; + } u; +} PCI_TYPE1_CFG_CYCLE_BITS, *PPCI_TYPE1_CFG_CYCLE_BITS; + typedef struct _ARRAY { ULONG ArraySize; @@ -359,6 +391,12 @@ IN BOOLEAN NextBus ); +VOID +NTAPI +HalpRegisterPciDebuggingDeviceInfo( + VOID +); + extern ULONG HalpBusType; extern BOOLEAN HalpPCIConfigInitialized; extern BUS_HANDLER HalpFakePciBusHandler; 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] Thu Apr 1 21:42:07 2010 @@ -708,6 +708,19 @@ ); VOID +NTAPI +HalpGetNMICrashFlag( + VOID +); + +VOID +NTAPI +HalpReportResourceUsage( + IN PUNICODE_STRING HalName, + IN INTERFACE_TYPE InterfaceType +); + +VOID FASTCALL KeUpdateSystemTime( IN PKTRAP_FRAME TrapFrame,
14 years, 8 months
1
0
0
0
[janderwald] 46646: [MSDVBNP] - Remove DebugBreak - Implement IPin::Connect, IPin::ReceiveConnection, IPin::Disconnect, IPin::ConnectedTo - Remove spaces - DVBT Network Provider can now connect tv tuner in ReactOS
by janderwald@svn.reactos.org
Author: janderwald Date: Thu Apr 1 21:20:12 2010 New Revision: 46646 URL:
http://svn.reactos.org/svn/reactos?rev=46646&view=rev
Log: [MSDVBNP] - Remove DebugBreak - Implement IPin::Connect, IPin::ReceiveConnection, IPin::Disconnect, IPin::ConnectedTo - Remove spaces - DVBT Network Provider can now connect tv tuner in ReactOS Modified: trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp trunk/reactos/dll/directx/msdvbnp/pin.cpp Modified: trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp [iso-8859-1] Thu Apr 1 21:20:12 2010 @@ -122,7 +122,7 @@ { UINT i; HRESULT hres = E_OUTOFMEMORY; - IClassFactory * pcf = NULL; + IClassFactory * pcf = NULL; if (!ppv) return E_INVALIDARG; @@ -138,7 +138,7 @@ } } - if (!pcf) + if (!pcf) { return CLASS_E_CLASSNOTAVAILABLE; } Modified: trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/networ…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] Thu Apr 1 21:20:12 2010 @@ -201,7 +201,6 @@ swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s !!!\n", lpstr); OutputDebugStringW(Buffer); CoTaskMemFree(lpstr); - DebugBreak(); return E_NOINTERFACE; } Modified: trunk/reactos/dll/directx/msdvbnp/pin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/pin.cp…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/pin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/msdvbnp/pin.cpp [iso-8859-1] Thu Apr 1 21:20:12 2010 @@ -51,7 +51,7 @@ HRESULT STDMETHODCALLTYPE EndFlush(); HRESULT STDMETHODCALLTYPE NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); - CPin(IBaseFilter * ParentFilter) : m_Ref(0), m_ParentFilter(ParentFilter){}; + CPin(IBaseFilter * ParentFilter); virtual ~CPin(){}; static LPCWSTR PIN_ID; @@ -59,10 +59,30 @@ protected: LONG m_Ref; IBaseFilter * m_ParentFilter; + AM_MEDIA_TYPE m_MediaType; + IPin * m_Pin; }; LPCWSTR CPin::PIN_ID = L"Antenna Out"; + + +CPin::CPin( + IBaseFilter * ParentFilter) : m_Ref(0), + m_ParentFilter(ParentFilter), + m_Pin(0) +{ + m_MediaType.majortype = KSDATAFORMAT_TYPE_BDA_ANTENNA; + m_MediaType.subtype = MEDIASUBTYPE_None; + m_MediaType.formattype = FORMAT_None; + m_MediaType.bFixedSizeSamples = true; + m_MediaType.bTemporalCompression = false; + m_MediaType.lSampleSize = sizeof(CHAR); + m_MediaType.pUnk = NULL; + m_MediaType.cbFormat = 0; + m_MediaType.pbFormat = NULL; +} + HRESULT STDMETHODCALLTYPE @@ -100,36 +120,97 @@ STDMETHODCALLTYPE CPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) { + HRESULT hr; OutputDebugStringW(L"CPin::Connect called\n"); - return E_NOTIMPL; + + if (pmt) + { + hr = pReceivePin->QueryAccept(pmt); + if (FAILED(hr)) + { + OutputDebugStringW(L"CPin::Connect QueryAccept failed\n"); + return hr; + } + } + else + { + // query accept + hr = pReceivePin->QueryAccept(&m_MediaType); + if (FAILED(hr)) + { + OutputDebugStringW(L"CPin::Connect QueryAccept pmt default failed\n"); + return hr; + } + + pmt = &m_MediaType; + } + + // receive connection; + hr = pReceivePin->ReceiveConnection((IPin*)this, pmt); + if (SUCCEEDED(hr)) + { + // increment reference count + pReceivePin->AddRef(); + m_Pin = pReceivePin; + OutputDebugStringW(L"CPin::Connect success\n"); + } + + return hr; } HRESULT STDMETHODCALLTYPE CPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE *pmt) { - OutputDebugStringW(L"CPin::ReceiveConnection called\n"); - return E_NOTIMPL; -} + return E_UNEXPECTED; +} + HRESULT STDMETHODCALLTYPE CPin::Disconnect( void) { - OutputDebugStringW(L"CPin::Disconnect called\n"); - return E_NOTIMPL; +#ifdef MSDVBNP_TRACE + OutputDebugStringW(L"CPin::Disconnect\n"); +#endif + + if (!m_Pin) + { + // pin was not connected + return S_FALSE; + } + + m_Pin->Release(); + m_Pin = NULL; + + return S_OK; } HRESULT STDMETHODCALLTYPE CPin::ConnectedTo(IPin **pPin) { - OutputDebugStringW(L"CPin::ConnectedTo called\n"); +#ifdef MSDVBNP_TRACE + OutputDebugStringW(L"CPin::ConnectedTo\n"); +#endif + + if (!pPin) + return E_POINTER; + + if (m_Pin) + { + // increment reference count + m_Pin->AddRef(); + *pPin = m_Pin; + return S_OK; + } + + *pPin = NULL; return VFW_E_NOT_CONNECTED; } HRESULT STDMETHODCALLTYPE CPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt) { - OutputDebugStringW(L"CPin::ConnectionMediaType called\n"); + OutputDebugStringW(L"CPin::ConnectionMediaType NotImplemented\n"); return E_NOTIMPL; } HRESULT @@ -170,7 +251,7 @@ STDMETHODCALLTYPE CPin::QueryAccept(const AM_MEDIA_TYPE *pmt) { - OutputDebugStringW(L"CPin::QueryAccept called\n"); + OutputDebugStringW(L"CPin::QueryAccept NotImplemented\n"); return E_NOTIMPL; } HRESULT @@ -200,35 +281,35 @@ STDMETHODCALLTYPE CPin::QueryInternalConnections(IPin **apPin, ULONG *nPin) { - OutputDebugStringW(L"CPin::QueryInternalConnections called\n"); + OutputDebugStringW(L"CPin::QueryInternalConnections NotImplemented\n"); return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE CPin::EndOfStream( void) { - OutputDebugStringW(L"CPin::EndOfStream called\n"); + OutputDebugStringW(L"CPin::EndOfStream NotImplemented\n"); return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE CPin::BeginFlush( void) { - OutputDebugStringW(L"CPin::BeginFlush called\n"); + OutputDebugStringW(L"CPin::BeginFlush NotImplemented\n"); return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE CPin::EndFlush( void) { - OutputDebugStringW(L"CPin::EndFlush called\n"); + OutputDebugStringW(L"CPin::EndFlush NotImplemented\n"); return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE CPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) { - OutputDebugStringW(L"CPin::NewSegment called\n"); + OutputDebugStringW(L"CPin::NewSegment NotImplemented\n"); return E_NOTIMPL; }
14 years, 8 months
1
0
0
0
← Newer
1
...
39
40
41
42
43
44
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
Results per page:
10
25
50
100
200