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] 46665: [NTOSKRNL] - Implement IoOpenDeviceInterfaceRegistryKey - Dedicated to Janderwald
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 09:29:54 2010 New Revision: 46665 URL:
http://svn.reactos.org/svn/reactos?rev=46665&view=rev
Log: [NTOSKRNL] - Implement IoOpenDeviceInterfaceRegistryKey - Dedicated to Janderwald Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] Fri Apr 2 09:29:54 2010 @@ -50,7 +50,169 @@ IN ACCESS_MASK DesiredAccess, OUT PHANDLE DeviceInterfaceKey) { - return STATUS_NOT_IMPLEMENTED; + WCHAR StrBuff[MAX_PATH], PathBuff[MAX_PATH]; + PWCHAR Guid; + UNICODE_STRING EnumU = RTL_CONSTANT_STRING(ENUM_ROOT L"\\"); + UNICODE_STRING DevParamU = RTL_CONSTANT_STRING(L"\\Device Parameters"); + UNICODE_STRING PrefixU = RTL_CONSTANT_STRING(L"\\??\\"); + UNICODE_STRING KeyPath, KeyName; + UNICODE_STRING MatchableGuid; + HANDLE GuidKey, ChildKey; + ULONG Index = 0; + PKEY_BASIC_INFORMATION KeyInformation; + ULONG KeyInformationLength; + PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; + ULONG KeyValueInformationLength; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + ULONG RequiredLength; + + MatchableGuid.Length = 0; + MatchableGuid.Length += swprintf(StrBuff, + L"##?#%ls", + &SymbolicLinkName->Buffer[PrefixU.Length / sizeof(WCHAR)]); + StrBuff[++MatchableGuid.Length] = UNICODE_NULL; + + MatchableGuid.Buffer = StrBuff; + MatchableGuid.MaximumLength = MAX_PATH * sizeof(WCHAR); + MatchableGuid.Length = (MatchableGuid.Length-1) * sizeof(WCHAR); + + Guid = wcsstr(StrBuff, L"{"); + if (!Guid) + return STATUS_OBJECT_NAME_NOT_FOUND; + + KeyPath.Buffer = PathBuff; + KeyPath.Length = 0; + KeyPath.MaximumLength = MAX_PATH * sizeof(WCHAR); + + RtlAppendUnicodeToString(&KeyPath, BaseKeyString); + RtlAppendUnicodeToString(&KeyPath, Guid); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + 0, + NULL); + + Status = ZwOpenKey(&GuidKey, KEY_CREATE_SUB_KEY, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + return Status; + + while (TRUE) + { + Status = ZwEnumerateKey(GuidKey, + Index, + 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) + { + ZwClose(GuidKey); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Status = ZwEnumerateKey(GuidKey, + Index, + KeyBasicInformation, + KeyInformation, + KeyInformationLength, + &RequiredLength); + } + else + { + ZwClose(GuidKey); + return STATUS_OBJECT_PATH_NOT_FOUND; + } + Index++; + + if (!NT_SUCCESS(Status)) + { + ZwClose(GuidKey); + return Status; + } + + KeyName.Length = KeyName.MaximumLength = KeyInformation->NameLength; + KeyName.Buffer = KeyInformation->Name; + + if (!RtlEqualUnicodeString(&KeyName, &MatchableGuid, TRUE)) + continue; + + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + GuidKey, + NULL); + Status = ZwOpenKey(&ChildKey, KEY_QUERY_VALUE, &ObjectAttributes); + ZwClose(GuidKey); + if (!NT_SUCCESS(Status)) + return Status; + + RtlInitUnicodeString(&KeyName, L"DeviceInstance"); + Status = ZwQueryValueKey(ChildKey, + &KeyName, + KeyValuePartialInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyValueInformationLength = RequiredLength; + KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength); + if (!KeyValueInformation) + { + ZwClose(ChildKey); + return Status; + } + + Status = ZwQueryValueKey(ChildKey, + &KeyName, + KeyValuePartialInformation, + KeyValueInformation, + KeyValueInformationLength, + &RequiredLength); + } + else + { + ZwClose(ChildKey); + return STATUS_OBJECT_PATH_NOT_FOUND; + } + ZwClose(ChildKey); + + if (!NT_SUCCESS(Status)) + return Status; + + KeyPath.Length = 0; + + KeyName.Length = KeyName.MaximumLength = KeyValueInformation->DataLength; + KeyName.Buffer = (PWCHAR)KeyValueInformation->Data; + + RtlAppendUnicodeStringToString(&KeyPath, &EnumU); + RtlAppendUnicodeStringToString(&KeyPath, &KeyName); + RtlAppendUnicodeStringToString(&KeyPath, &DevParamU); + + InitializeObjectAttributes(&ObjectAttributes, + &KeyPath, + OBJ_CASE_INSENSITIVE, + 0, + NULL); + Status = ZwCreateKey(DeviceInterfaceKey, + DesiredAccess, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL); + return Status; + } + + return STATUS_OBJECT_PATH_NOT_FOUND; } /*++
14 years, 8 months
1
0
0
0
[sir_richard] 46664: [HALACPI]: Implement HalpQueryResources: We take the resource requirements, find the SCI requirement, and convert it into a resource. The ACPI HAL should now report its resoures once the PnP HAL driver model is enabled.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Fri Apr 2 08:46:33 2010 New Revision: 46664 URL:
http://svn.reactos.org/svn/reactos?rev=46664&view=rev
Log: [HALACPI]: Implement HalpQueryResources: We take the resource requirements, find the SCI requirement, and convert it into a resource. The ACPI HAL should now report its resoures once the PnP HAL driver model is enabled. Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c 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] Fri Apr 2 08:46:33 2010 @@ -331,9 +331,95 @@ HalpQueryResources(IN PDEVICE_OBJECT DeviceObject, OUT PCM_RESOURCE_LIST *Resources) { - UNIMPLEMENTED; - while (TRUE); - return STATUS_NO_SUCH_DEVICE; + PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; + NTSTATUS Status; + PCM_RESOURCE_LIST ResourceList; + PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList; + PIO_RESOURCE_DESCRIPTOR Descriptor; + PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDesc; + ULONG i; + PAGED_CODE(); + + /* Only the ACPI PDO has requirements */ + if (DeviceExtension->PdoType == AcpiPdo) + { + /* Query ACPI requirements */ + Status = HalpQueryAcpiResourceRequirements(&RequirementsList); + ASSERT(RequirementsList->AlternativeLists == 1); + if (!NT_SUCCESS(Status)) return Status; + + /* Allocate the resourcel ist */ + ResourceList = ExAllocatePoolWithTag(PagedPool, + sizeof(CM_RESOURCE_LIST), + ' laH'); + if (!ResourceList ) + { + /* Fail, no memory */ + Status = STATUS_INSUFFICIENT_RESOURCES; + ExFreePoolWithTag(RequirementsList, 0); + return Status; + } + + /* Initialize it */ + RtlZeroMemory(ResourceList, sizeof(CM_RESOURCE_LIST)); + ResourceList->Count = 1; + + /* Setup the list fields */ + ResourceList->List[0].BusNumber = -1; + ResourceList->List[0].InterfaceType = PNPBus; + ResourceList->List[0].PartialResourceList.Version = 1; + ResourceList->List[0].PartialResourceList.Revision = 1; + ResourceList->List[0].PartialResourceList.Count = 1; + + /* Setup the first descriptor */ + PartialDesc = ResourceList->List[0].PartialResourceList.PartialDescriptors; + PartialDesc->Type = CmResourceTypeInterrupt; + + /* Find the requirement descriptor for the SCI */ + for (i = 0; i < RequirementsList->List[0].Count; i++) + { + /* Get this descriptor */ + Descriptor = &RequirementsList->List[0].Descriptors[i]; + if (Descriptor->Type == CmResourceTypeInterrupt) break; + Descriptor = NULL; + } + + /* Make sure we found the descriptor */ + if (Descriptor) + { + /* Copy requirements descriptor into resource descriptor */ + PartialDesc->ShareDisposition = Descriptor->ShareDisposition; + PartialDesc->Flags = Descriptor->Flags; + ASSERT(Descriptor->u.Interrupt.MinimumVector == + Descriptor->u.Interrupt.MaximumVector); + PartialDesc->u.Interrupt.Vector = Descriptor->u.Interrupt.MinimumVector; + PartialDesc->u.Interrupt.Level = Descriptor->u.Interrupt.MinimumVector; + PartialDesc->u.Interrupt.Affinity = 0xFFFFFFFF; + + /* Return resources and success */ + *Resources = ResourceList; + ExFreePoolWithTag(RequirementsList, 0); + return STATUS_SUCCESS; + } + + /* Free memory and fail */ + ExFreePoolWithTag(RequirementsList, 0); + ExFreePoolWithTag(ResourceList, 0); + Status = STATUS_NOT_FOUND; + } + else if (DeviceExtension->PdoType == WdPdo) + { + /* Watchdog doesn't */ + return STATUS_NOT_SUPPORTED; + } + else + { + /* This shouldn't happen */ + return STATUS_UNSUCCESSFUL; + } + + /* Return the status */ + return Status; } NTSTATUS
14 years, 8 months
1
0
0
0
[sir_richard] 46663: [HALACPI]: Implement querying HALACPI resource requirements. If it exists, the SCI Vector is added to the list as a requirement.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Fri Apr 2 08:28:43 2010 New Revision: 46663 URL:
http://svn.reactos.org/svn/reactos?rev=46663&view=rev
Log: [HALACPI]: Implement querying HALACPI resource requirements. If it exists, the SCI Vector is added to the list as a requirement. Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c trunk/reactos/hal/halx86/generic/acpi/halpnpdd.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] Fri Apr 2 08:28:43 2010 @@ -36,6 +36,8 @@ LIST_ENTRY HalpAcpiTableMatchList; ULONG HalpInvalidAcpiTable; + +ULONG HalpPicVectorRedirect[] = {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15}; /* This determines the HAL type */ BOOLEAN HalDisableFirmwareMapper = TRUE; @@ -900,6 +902,98 @@ return CM_RESOURCE_PORT_16_BIT_DECODE; } +VOID +NTAPI +HalpAcpiDetectResourceListSize(OUT PULONG ListSize) +{ + PAGED_CODE(); + + /* One element if there is a SCI */ + *ListSize = HalpFixedAcpiDescTable.sci_int_vector ? 1: 0; +} + +NTSTATUS +NTAPI +HalpBuildAcpiResourceList(IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceList) +{ + ULONG Interrupt; + PAGED_CODE(); + ASSERT(ResourceList != NULL); + + /* Initialize the list */ + ResourceList->BusNumber = -1; + ResourceList->AlternativeLists = 1; + ResourceList->InterfaceType = PNPBus; + ResourceList->List[0].Version = 1; + ResourceList->List[0].Revision = 1; + + /* Is there a SCI? */ + if (HalpFixedAcpiDescTable.sci_int_vector) + { + /* Fill out the entry for it */ + ResourceList->List[0].Descriptors[0].Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; + ResourceList->List[0].Descriptors[0].Type = CmResourceTypeInterrupt; + ResourceList->List[0].Descriptors[0].ShareDisposition = CmResourceShareShared; + + /* Get the interrupt number */ + Interrupt = HalpPicVectorRedirect[HalpFixedAcpiDescTable.sci_int_vector]; + ResourceList->List[0].Descriptors[0].u.Interrupt.MinimumVector = Interrupt; + ResourceList->List[0].Descriptors[0].u.Interrupt.MaximumVector = Interrupt; + + /* One more */ + ++ResourceList->List[0].Count; + } + + /* All good */ + return STATUS_SUCCESS; +} + +NTSTATUS +NTAPI +HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements) +{ + PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList; + ULONG Count = 0, ListSize; + NTSTATUS Status; + PAGED_CODE(); + + /* Get ACPI resources */ + HalpAcpiDetectResourceListSize(&Count); + + /* Compute size of the list and allocate it */ + ListSize = sizeof(IO_RESOURCE_LIST) * (Count - 1) + + sizeof(IO_RESOURCE_REQUIREMENTS_LIST); + RequirementsList = ExAllocatePoolWithTag(PagedPool, ListSize, ' laH'); + if (RequirementsList) + { + /* Initialize it */ + RtlZeroMemory(RequirementsList, ListSize); + RequirementsList->ListSize = ListSize; + + /* Build it */ + Status = HalpBuildAcpiResourceList(RequirementsList); + if (NT_SUCCESS(Status)) + { + /* It worked, return it */ + *Requirements = RequirementsList; + } + else + { + /* Fail */ + ExFreePoolWithTag(RequirementsList, 0); + Status = STATUS_NO_SUCH_DEVICE; + } + } + else + { + /* Not enough memory */ + Status = STATUS_INSUFFICIENT_RESOURCES; + } + + /* Return the status */ + return Status; +} + /* * @implemented */ 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] Fri Apr 2 08:28:43 2010 @@ -341,9 +341,29 @@ HalpQueryResourceRequirements(IN PDEVICE_OBJECT DeviceObject, OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements) { - UNIMPLEMENTED; - while (TRUE); - return STATUS_NO_SUCH_DEVICE; + PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; + NTSTATUS Status; + PAGED_CODE(); + + /* Only the ACPI PDO has requirements */ + if (DeviceExtension->PdoType == AcpiPdo) + { + /* Query ACPI requirements */ + Status = HalpQueryAcpiResourceRequirements(Requirements); + } + else if (DeviceExtension->PdoType == WdPdo) + { + /* Watchdog doesn't */ + return STATUS_NOT_SUPPORTED; + } + else + { + /* This shouldn't happen */ + return STATUS_UNSUCCESSFUL; + } + + /* Return the status */ + return Status; } NTSTATUS 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] Fri Apr 2 08:28:43 2010 @@ -751,6 +751,12 @@ VOID ); +NTSTATUS +NTAPI +HalpQueryAcpiResourceRequirements( + OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements +); + VOID FASTCALL KeUpdateSystemTime(
14 years, 8 months
1
0
0
0
[tkreuzer] 46662: delete wine/cfgmgr32.h (leftover from merge)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Apr 2 08:20:32 2010 New Revision: 46662 URL:
http://svn.reactos.org/svn/reactos?rev=46662&view=rev
Log: delete wine/cfgmgr32.h (leftover from merge) Removed: branches/reactos-yarotows/include/reactos/wine/cfgmgr32.h Removed: branches/reactos-yarotows/include/reactos/wine/cfgmgr32.h URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/include/reacto…
============================================================================== --- branches/reactos-yarotows/include/reactos/wine/cfgmgr32.h [iso-8859-1] (original) +++ branches/reactos-yarotows/include/reactos/wine/cfgmgr32.h (removed) @@ -1,373 +1,0 @@ -/* - * Copyright (C) 2005 Mike McCormack - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef _CFGMGR32_H_ -#define _CFGMGR32_H_ - -/* cfgmgr32 doesn't use the normal convention, it adds an underscore before A/W */ -#ifdef __WINESRC__ -# define DECL_WINELIB_CFGMGR32_TYPE_AW(type) /* nothing */ -#else /* __WINESRC__ */ -# define DECL_WINELIB_CFGMGR32_TYPE_AW(type) typedef WINELIB_NAME_AW(type##_) type; -#endif /* __WINESRC__ */ - -typedef DWORD CONFIGRET; -typedef HANDLE HMACHINE; -typedef HMACHINE *PHMACHINE; -typedef DWORD DEVINST; -typedef DEVINST *PDEVINST; -typedef DWORD DEVNODE; -typedef DEVNODE *PDEVNODE; -typedef ULONG REGDISPOSITION; -typedef DWORD_PTR LOG_CONF; -typedef LOG_CONF *PLOG_CONF; -typedef ULONG PRIORITY; -typedef PRIORITY *PPRIORITY; - - -typedef CHAR *DEVINSTID_A; -typedef WCHAR *DEVINSTID_W; -DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID) - -#define CR_SUCCESS 0x00000000 -#define CR_OUT_OF_MEMORY 0x00000002 -#define CR_INVALID_POINTER 0x00000003 -#define CR_INVALID_FLAG 0x00000004 -#define CR_INVALID_DEVNODE 0x00000005 -#define CR_INVALID_DEVINST CR_INVALID_DEVNODE -#define CR_INVALID_LOG_CONF 0x00000007 -#define CR_NO_SUCH_DEVNODE 0x0000000D -#define CR_NO_SUCH_DEVINST CR_NO_SUCH_DEVNODE -#define CR_FAILURE 0x00000013 -#define CR_BUFFER_SMALL 0x0000001A -#define CR_REGISTRY_ERROR 0x0000001D -#define CR_INVALID_DEVICE_ID 0x0000001E -#define CR_INVALID_DATA 0x0000001F -#define CR_NO_SUCH_VALUE 0x00000025 -#define CR_INVALID_PRIORITY 0x00000027 -#define CR_NO_SUCH_REGISTRY_KEY 0x0000002E -#define CR_INVALID_MACHINENAME 0x0000002F -#define CR_ACCESS_DENIED 0x00000033 -#define CR_CALL_NOT_IMPLEMENTED 0x00000034 -#define CR_INVALID_PROPERTY 0x00000035 - -#define MAX_CLASS_NAME_LEN 32 -#define MAX_GUID_STRING_LEN 39 -#define MAX_PROFILE_LEN 80 -#define MAX_DEVICE_ID_LEN 200 -#define MAX_DEVNODE_ID_LEN MAX_DEVICE_ID_LEN - -/* Disposition values for CM_Open_Class_Key[_Ex] */ -#define RegDisposition_OpenAlways 0x00000000 -#define RegDisposition_OpenExisting 0x00000001 -#define RegDisposition_Bits 0x00000001 - -/* ulFlags for CM_Add_ID[_Ex] */ -#define CM_ADD_ID_HARDWARE 0x00000000 -#define CM_ADD_ID_COMPATIBLE 0x00000001 -#define CM_ADD_ID_BITS 0x00000001 - -/* ulFlags for CM_Open_Class_Key[_Ex] */ -#define CM_OPEN_CLASS_KEY_INSTALLER 0x00000000 -#define CM_OPEN_CLASS_KEY_INTERFACE 0x00000001 -#define CM_OPEN_CLASS_KEY_BITS 0x00000001 - -/* ulFlags for CM_Locate_DevNode[_Ex] */ -#define CM_LOCATE_DEVNODE_NORMAL 0x00000000 -#define CM_LOCATE_DEVNODE_PHANTOM 0x00000001 -#define CM_LOCATE_DEVNODE_CANCELREMOVE 0x00000002 -#define CM_LOCATE_DEVNODE_NOVALIDATION 0x00000004 -#define CM_LOCATE_DEVNODE_BITS 0x00000007 - -#define CM_LOCATE_DEVINST_NORMAL CM_LOCATE_DEVNODE_NORMAL -#define CM_LOCATE_DEVINST_PHANTOM CM_LOCATE_DEVNODE_PHANTOM -#define CM_LOCATE_DEVINST_CANCELREMOVE CM_LOCATE_DEVNODE_CANCELREMOVE -#define CM_LOCATE_DEVINST_NOVALIDATION CM_LOCATE_DEVNODE_NOVALIDATION -#define CM_LOCATE_DEVINST_BITS CM_LOCATE_DEVNODE_BITS - -/* ulFlags for CM_Set_DevNode_Problem[_Ex] */ -#define CM_SET_DEVNODE_PROBLEM_NORMAL 0x00000000 -#define CM_SET_DEVNODE_PROBLEM_OVERRIDE 0x00000001 -#define CM_SET_DEVNODE_PROBLEM_BITS 0x00000001 - -#define CM_SET_DEVINST_PROBLEM_NORMAL CM_SET_DEVNODE_PROBLEM_NORMAL -#define CM_SET_DEVINST_PROBLEM_OVERRIDE CM_SET_DEVNODE_PROBLEM_OVERRIDE -#define CM_SET_DEVINST_PROBLEM_BITS CM_SET_DEVNODE_PROBLEM_BITS - -/* Properties for CM_Get/Set_DevNode_Registry_Property[_Ex]A/W */ -#define CM_DRP_DEVICEDESC 0x00000001 -#define CM_DRP_HARDWAREID 0x00000002 -#define CM_DRP_COMPATIBLEIDS 0x00000003 -#define CM_DRP_UNUSED0 0x00000004 -#define CM_DRP_SERVICE 0x00000005 -#define CM_DRP_UNUSED1 0x00000006 -#define CM_DRP_UNUSED2 0x00000007 -#define CM_DRP_CLASS 0x00000008 -#define CM_DRP_CLASSGUID 0x00000009 -#define CM_DRP_DRIVER 0x0000000A -#define CM_DRP_CONFIGFLAGS 0x0000000B -#define CM_DRP_MFG 0x0000000C -#define CM_DRP_FRIENDLYNAME 0x0000000D -#define CM_DRP_LOCATION_INFORMATION 0x0000000E -#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME 0x0000000F -#define CM_DRP_CAPABILITIES 0x00000010 -#define CM_DRP_UI_NUMBER 0x00000011 -#define CM_DRP_UPPERFILTERS 0x00000012 -#define CM_DRP_LOWERFILTERS 0x00000013 -#define CM_DRP_BUSTYPEGUID 0x00000014 -#define CM_DRP_LEGACYBUSTYPE 0x00000015 -#define CM_DRP_BUSNUMBER 0x00000016 -#define CM_DRP_ENUMERATOR_NAME 0x00000017 - -#define CM_DRP_MIN 0x00000001 -#define CM_DRP_MAX 0x00000017 - -/* ulFlags for CM_Delete_Class_Key[_Ex] */ -#define CM_DELETE_CLASS_ONLY 0x00000000 -#define CM_DELETE_CLASS_SUBKEYS 0x00000001 -#define CM_DELETE_CLASS_BITS 0x00000001 - -/* ulFlags for CM_Get_Device_ID_List and CM_Get_Device_ID_List_Size */ -#define CM_GETIDLIST_FILTER_NONE (0x00000000) -#define CM_GETIDLIST_FILTER_ENUMERATOR (0x00000001) -#define CM_GETIDLIST_FILTER_SERVICE (0x00000002) -#define CM_GETIDLIST_FILTER_EJECTRELATIONS (0x00000004) -#define CM_GETIDLIST_FILTER_REMOVALRELATIONS (0x00000008) -#define CM_GETIDLIST_FILTER_POWERRELATIONS (0x00000010) -#define CM_GETIDLIST_FILTER_BUSRELATIONS (0x00000020) -#define CM_GETIDLIST_DONOTGENERATE (0x10000040) -#define CM_GETIDLIST_FILTER_BITS (0x1000007F) - -/* ulFlags for CM_Reenumerate_DevNode[_Ex] */ -#define CM_REENUMERATE_NORMAL 0x00000000 -#define CM_REENUMERATE_SYNCHRONOUS 0x00000001 -#define CM_REENUMERATE_RETRY_INSTALLATION 0x00000002 -#define CM_REENUMERATE_ASYNCHRONOUS 0x00000004 -#define CM_REENUMERATE_BITS 0x00000007 - -/* ulFlags for CM_Run_Detection[_Ex] */ -#define CM_DETECT_NEW_PROFILE 0x00000001 -#define CM_DETECT_CRASHED 0x00000002 -#define CM_DETECT_HWPROF_FIRST_BOOT 0x00000004 -#define CM_DETECT_RUN 0x80000000 -#define CM_DETECT_BITS 0x80000007 - -/* ulFlags for CM_Setup_DevInst[_Ex] */ -#define CM_SETUP_DEVNODE_READY 0x00000000 -#define CM_SETUP_DEVINST_READY CM_SETUP_DEVNODE_READY -#define CM_SETUP_DOWNLOAD 0x00000001 -#define CM_SETUP_WRITE_LOG_CONFS 0x00000002 -#define CM_SETUP_PROP_CHANGE 0x00000003 -#define CM_SETUP_DEVNODE_RESET 0x00000004 -#define CM_SETUP_DEVINST_RESET CM_SETUP_DEVNODE_RESET -#define CM_SETUP_BITS 0x00000007 - -/* ulFlags for CM_Create_DevNode[_Ex]A/W */ -#define CM_CREATE_DEVNODE_NORMAL 0x00000000 -#define CM_CREATE_DEVNODE_NO_WAIT_INSTALL 0x00000001 -#define CM_CREATE_DEVNODE_PHANTOM 0x00000002 -#define CM_CREATE_DEVNODE_GENERATE_ID 0x00000004 -#define CM_CREATE_DEVNODE_DO_NOT_INSTALL 0x00000008 -#define CM_CREATE_DEVNODE_BITS 0x0000000F - -#define CM_CREATE_DEVINST_NORMAL CM_CREATE_DEVNODE_NORMAL -#define CM_CREATE_DEVINST_NO_WAIT_INSTALL CM_CREATE_DEVNODE_NO_WAIT_INSTALL -#define CM_CREATE_DEVINST_PHANTOM CM_CREATE_DEVNODE_PHANTOM -#define CM_CREATE_DEVINST_GENERATE_ID CM_CREATE_DEVNODE_GENERATE_ID -#define CM_CREATE_DEVINST_DO_NOT_INSTALL CM_CREATE_DEVNODE_DO_NOT_INSTALL -#define CM_CREATE_DEVINST_BITS CM_CREATE_DEVNODE_BITS - -/* ulFlags for CM_Set_HW_Prof_Flags[_Ex]A/W */ -#define CM_SET_HW_PROF_FLAGS_UI_NOT_OK 0x00000001 -#define CM_SET_HW_PROF_FLAGS_BITS 0x00000001 - -/* ulFlags for Log_Conf functions */ -#define BASIC_LOG_CONF 0x00000000 -#define FILTERED_LOG_CONF 0x00000001 -#define ALLOC_LOG_CONF 0x00000002 -#define BOOT_LOG_CONF 0x00000003 -#define FORCED_LOG_CONF 0x00000004 -#define OVERRIDE_LOG_CONF 0x00000005 -#define NUM_LOG_CONF 0x00000006 -#define LOG_CONF_BITS 0x00000007 - -#define PRIORITY_EQUAL_FIRST 0x00000008 -#define PRIORITY_EQUAL_LAST 0x00000000 -#define PRIORITY_BIT 0x00000008 - -#define CMP_MAGIC 0x01234567 - - -CONFIGRET WINAPI CMP_Init_Detection( DWORD ); -CONFIGRET WINAPI CMP_Report_LogOn( DWORD, DWORD ); - -CONFIGRET WINAPI CM_Add_Empty_Log_Conf( PLOG_CONF, DEVINST, PRIORITY, ULONG ); -CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex( PLOG_CONF, DEVINST, PRIORITY, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Add_IDA( DEVINST, PSTR, ULONG ); -CONFIGRET WINAPI CM_Add_IDW( DEVINST, PWSTR, ULONG ); -#define CM_Add_ID WINELIB_NAME_AW(CM_Add_ID) -CONFIGRET WINAPI CM_Add_ID_ExA( DEVINST, PSTR, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Add_ID_ExW( DEVINST, PWSTR, ULONG, HMACHINE ); -#define CM_Add_ID_Ex WINELIB_NAME_AW(CM_Add_ID_Ex) -CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE ); -CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE ); -#define CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine) -CONFIGRET WINAPI CM_Create_DevNodeA( PDEVINST, DEVINSTID_A, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Create_DevNodeW( PDEVINST, DEVINSTID_W, DEVINST, ULONG ); -#define CM_Create_DevNode WINELIB_NAME_AW(CM_Create_DevNode) -CONFIGRET WINAPI CM_Create_DevNode_ExA( PDEVINST, DEVINSTID_A, DEVINST, ULONG, HANDLE ); -CONFIGRET WINAPI CM_Create_DevNode_ExW( PDEVINST, DEVINSTID_W, DEVINST, ULONG, HANDLE ); -#define CM_Create_DevNode_Ex WINELIB_NAME_AW(CM_Create_DevNode_Ex) -CONFIGRET WINAPI CM_Delete_Class_Key( LPGUID, ULONG ); -CONFIGRET WINAPI CM_Delete_Class_Key_Ex( LPGUID, ULONG, HANDLE ); -CONFIGRET WINAPI CM_Delete_DevNode_Key( DEVNODE, ULONG, ULONG ); -CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex( DEVNODE, ULONG, ULONG, HANDLE ); -CONFIGRET WINAPI CM_Disable_DevNode( DEVINST, ULONG ); -CONFIGRET WINAPI CM_Disable_DevNode_Ex( DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Disconnect_Machine( HMACHINE ); -CONFIGRET WINAPI CM_Enable_DevNode( DEVINST, ULONG ); -CONFIGRET WINAPI CM_Enable_DevNode_Ex( DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Enumerate_Classes( ULONG, LPGUID, ULONG ); -CONFIGRET WINAPI CM_Enumerate_Classes_Ex( ULONG, LPGUID, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Enumerate_EnumeratorsA( ULONG, PCHAR, PULONG, ULONG ); -CONFIGRET WINAPI CM_Enumerate_EnumeratorsW( ULONG, PWCHAR, PULONG, ULONG ); -#define CM_Enumerate_Enumerators WINELIB_NAME_AW(CM_Enumerate_Enumerators) -CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA( ULONG, PCHAR, PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW( ULONG, PWCHAR, PULONG, ULONG, HMACHINE ); -#define CM_Enumerate_Enumerators_Ex WINELIB_NAME_AW(CM_Enumerate_Enumerators_Ex) -CONFIGRET WINAPI CM_Free_Log_Conf( LOG_CONF, ULONG ); -CONFIGRET WINAPI CM_Free_Log_Conf_Ex( LOG_CONF, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Free_Log_Conf_Handle( LOG_CONF ); -CONFIGRET WINAPI CM_Get_Child( PDEVINST, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Class_Key_NameA( LPGUID, LPSTR, PULONG, ULONG ); -CONFIGRET WINAPI CM_Get_Class_Key_NameW( LPGUID, LPWSTR, PULONG, ULONG ); -#define CM_Get_Class_Key_Name WINELIB_NAME_AW(CM_Get_Class_Key_Name) -CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA( LPGUID, LPSTR, PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW( LPGUID, LPWSTR, PULONG, ULONG, HMACHINE ); -#define CM_Get_Class_Key_Name_Ex WINELIB_NAME_AW(CM_Get_Class_Key_Name_Ex) -CONFIGRET WINAPI CM_Get_Class_NameA( LPGUID, PCHAR, PULONG, ULONG ); -CONFIGRET WINAPI CM_Get_Class_NameW( LPGUID, PWCHAR, PULONG, ULONG ); -#define CM_Get_Class_Name WINELIB_NAME_AW(CM_Get_Class_Name) -CONFIGRET WINAPI CM_Get_Class_Name_ExA( LPGUID, PCHAR, PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Class_Name_ExW( LPGUID, PWCHAR, PULONG, ULONG, HMACHINE ); -#define CM_Get_Class_Name_Ex WINELIB_NAME_AW(CM_Get_Class_Name_Ex) -CONFIGRET WINAPI CM_Get_Depth( PULONG, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_Depth_Ex( PULONG, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG ); -CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG ); -#define CM_Get_DevNode_Registry_Property WINELIB_NAME_AW(CM_Get_DevNode_Registry_Property) -CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExA( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW( DEVINST, ULONG, PULONG, PVOID, PULONG, ULONG, HMACHINE ); -#define CM_Get_DevNode_Registry_Property_Ex WINELIB_NAME_AW(CM_Get_DevNode_Registry_Property_Ex) -CONFIGRET WINAPI CM_Get_DevNode_Status( PULONG, PULONG, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_DevNode_Status_Ex( PULONG, PULONG, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Device_IDA( DEVINST, PCHAR, ULONG, ULONG ); -CONFIGRET WINAPI CM_Get_Device_IDW( DEVINST, PWCHAR, ULONG, ULONG ); -#define CM_Get_Device_ID WINELIB_NAME_AW(CM_Get_Device_ID) -CONFIGRET WINAPI CM_Get_Device_ID_ExW( DEVINST, PWCHAR, ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Device_ID_ExA( DEVINST, PCHAR, ULONG, ULONG, HMACHINE ); -#define CM_Get_Device_ID_Ex WINELIB_NAME_AW(CM_Get_Device_ID_Ex) -CONFIGRET WINAPI CM_Get_Device_ID_ListA( PCSTR, PCHAR, ULONG, ULONG ); -CONFIGRET WINAPI CM_Get_Device_ID_ListW( PCWSTR, PWCHAR, ULONG, ULONG ); -#define CM_Get_Device_ID_List WINELIB_NAME_AW(CM_Get_Device_ID_List) -CONFIGRET WINAPI CM_Get_Device_ID_List_ExA( PCSTR, PCHAR, ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Device_ID_List_ExW( PCWSTR, PWCHAR, ULONG, ULONG, HMACHINE ); -#define CM_Get_Device_ID_List_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Ex) -CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA( PULONG, PCSTR, ULONG ); -CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW( PULONG, PCWSTR, ULONG ); -#define CM_Get_Device_ID_List_Size WINELIB_NAME_AW(CM_Get_Device_ID_List_Size) -CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA( PULONG, PCSTR, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW( PULONG, PCWSTR, ULONG, HMACHINE ); -#define CM_Get_Device_ID_List_Size_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Size_Ex) -CONFIGRET WINAPI CM_Get_Device_ID_Size( PULONG, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( PULONG, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_First_Log_Conf( PLOG_CONF, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex( PLOG_CONF, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Global_State( PULONG, ULONG ); -CONFIGRET WINAPI CM_Get_Global_State_Ex( PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Set_HW_Prof( ULONG, ULONG ); -CONFIGRET WINAPI CM_Set_HW_Prof_Ex( ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_HW_Prof_FlagsA( DEVINSTID_A, ULONG, PULONG, ULONG ); -CONFIGRET WINAPI CM_Get_HW_Prof_FlagsW( DEVINSTID_W, ULONG, PULONG, ULONG ); -#define CM_Get_HW_Prof_Flags WINELIB_NAME_AW(CM_Get_HW_Prof_Flags) -CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExA( DEVINSTID_A, ULONG, PULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExW( DEVINSTID_W, ULONG, PULONG, ULONG, HMACHINE ); -#define CM_Get_HW_Prof_Flags_Ex WINELIB_NAME_AW(CM_Get_HW_Prof_Flags_Ex) -CONFIGRET WINAPI CM_Get_Log_Conf_Priority( LOG_CONF, PPRIORITY, ULONG ); -CONFIGRET WINAPI CM_Get_Log_Conf_Priority_Ex( LOG_CONF, PPRIORITY, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Next_Log_Conf( PLOG_CONF, LOG_CONF, ULONG ); -CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex( PLOG_CONF, LOG_CONF, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Parent( PDEVINST, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_Parent_Ex( PDEVINST, DEVINST, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Get_Sibling( PDEVINST, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Get_Sibling_Ex( PDEVINST, DEVINST, ULONG, HMACHINE ); -WORD WINAPI CM_Get_Version( VOID ); -WORD WINAPI CM_Get_Version_Ex( HMACHINE ); - -CONFIGRET WINAPI CM_Is_Dock_Station_Present( PBOOL ); -CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex( PBOOL, HMACHINE ); -CONFIGRET WINAPI CM_Locate_DevNodeA( PDEVINST, DEVINSTID_A, ULONG ); -CONFIGRET WINAPI CM_Locate_DevNodeW( PDEVINST, DEVINSTID_W, ULONG ); -#define CM_Locate_DevNode WINELIB_NAME_AW(CM_Locate_DevNode) -CONFIGRET WINAPI CM_Locate_DevNode_ExA( PDEVINST, DEVINSTID_A, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Locate_DevNode_ExW( PDEVINST, DEVINSTID_W, ULONG, HMACHINE ); -#define CM_Locate_DevNode_Ex WINELIB_NAME_AW(CM_Locate_DevNode_Ex) - -CONFIGRET WINAPI CM_Move_DevNode( DEVINST, DEVINST, ULONG ); -CONFIGRET WINAPI CM_Move_DevNode_Ex( DEVINST, DEVINST, ULONG, HMACHINE ); - -CONFIGRET WINAPI CM_Open_Class_KeyA( LPGUID, LPCSTR, REGSAM, REGDISPOSITION, PHKEY, ULONG ); -CONFIGRET WINAPI CM_Open_Class_KeyW( LPGUID, LPCWSTR, REGSAM, REGDISPOSITION, PHKEY, ULONG ); -#define CM_Open_Class_Key WINELIB_NAME_AW(CM_Open_Class_Key) -CONFIGRET WINAPI CM_Open_Class_Key_ExA( LPGUID, LPCSTR, REGSAM, REGDISPOSITION, PHKEY, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Open_Class_Key_ExW( LPGUID, LPCWSTR, REGSAM, REGDISPOSITION, PHKEY, ULONG, HMACHINE ); -#define CM_Open_Class_Key_Ex WINELIB_NAME_AW(CM_Open_Class_Key_Ex) -CONFIGRET WINAPI CM_Open_DevNode_Key( DEVINST, REGSAM, ULONG, REGDISPOSITION, PHKEY, ULONG ); -CONFIGRET WINAPI CM_Open_DevNode_Key_Ex( DEVINST, REGSAM, ULONG, REGDISPOSITION, PHKEY, ULONG, HMACHINE ); - -CONFIGRET WINAPI CM_Reenumerate_DevNode( DEVINST, ULONG ); -CONFIGRET WINAPI CM_Reenumerate_DevNode_Ex( DEVINST, ULONG, HMACHINE ); - -CONFIGRET WINAPI CM_Request_Eject_PC( VOID ); -CONFIGRET WINAPI CM_Request_Eject_PC_Ex( HMACHINE ); - -CONFIGRET WINAPI CM_Run_Detection( ULONG ); -CONFIGRET WINAPI CM_Run_Detection_Ex( ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Set_DevNode_Problem( DEVINST, ULONG, ULONG ); -CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex( DEVINST, ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyA( DEVINST, ULONG, PCVOID, ULONG, ULONG ); -CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyW( DEVINST, ULONG, PCVOID, ULONG, ULONG ); -#define CM_Set_DevNode_Registry_Property WINELIB_NAME_AW(CM_Set_DevNode_Registry_Property) -CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExA( DEVINST, ULONG, PCVOID, ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW( DEVINST, ULONG, PCVOID, ULONG, ULONG, HMACHINE ); -#define CM_Set_DevNode_Registry_Property_Ex WINELIB_NAME_AW(CM_Set_DevNode_Registry_Property_Ex) - -CONFIGRET WINAPI CM_Set_HW_Prof_FlagsA( DEVINSTID_A, ULONG, ULONG, ULONG ); -CONFIGRET WINAPI CM_Set_HW_Prof_FlagsW( DEVINSTID_W, ULONG, ULONG, ULONG ); -#define CM_Set_HW_Prof_Flags WINELIB_NAME_AW(CM_Set_HW_Prof_Flags) -CONFIGRET WINAPI CM_Set_HW_Prof_Flags_ExA( DEVINSTID_A, ULONG, ULONG, ULONG, HMACHINE ); -CONFIGRET WINAPI CM_Set_HW_Prof_Flags_ExW( DEVINSTID_W, ULONG, ULONG, ULONG, HMACHINE ); -#define CM_Set_HW_Prof_Flags_Ex WINELIB_NAME_AW(CM_Set_HW_Prof_Flags_Ex) -CONFIGRET WINAPI CM_Setup_DevNode( DEVINST, ULONG ); -CONFIGRET WINAPI CM_Setup_DevNode_Ex( DEVINST, ULONG, HMACHINE ); - -CONFIGRET WINAPI CM_Uninstall_DevNode( DEVINST, ULONG ); -CONFIGRET WINAPI CM_Uninstall_DevNode_Ex( DEVINST, ULONG, HMACHINE ); - -#endif /* _CFGMGR32_H_ */
14 years, 8 months
1
0
0
0
[cgutman] 46661: - Forgot this file
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 06:58:41 2010 New Revision: 46661 URL:
http://svn.reactos.org/svn/reactos?rev=46661&view=rev
Log: - Forgot this file Modified: trunk/reactos/ntoskrnl/include/internal/io.h Modified: trunk/reactos/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Fri Apr 2 06:58:41 2010 @@ -852,7 +852,8 @@ NTSTATUS PnpRootCreateDevice( IN PUNICODE_STRING ServiceName, - IN OUT PDEVICE_OBJECT *PhysicalDeviceObject + OUT PDEVICE_OBJECT *PhysicalDeviceObject, + OUT OPTIONAL PUNICODE_STRING FullInstancePath ); //
14 years, 8 months
1
0
0
0
[mjmartin] 46660: [usb/usbehci] - Implement tracking port status and change status. - When device has connected on port, set the port status. For now assume high speed device. - Fix returning root hubs Status Change Endpoint for URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER. - Implement USB_REQUEST_GET_STATUS for functions URB_FUNCTION_GET_STATUS_FROM_DEVICE and URB_FUNCTION_CLASS_OTHER. Implement USB_REQUEST_CLEAR_FEATURE and USB_REQUEST_SET_FEATURE. - Implement IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE t
by mjmartin@svn.reactos.org
Author: mjmartin Date: Fri Apr 2 06:49:01 2010 New Revision: 46660 URL:
http://svn.reactos.org/svn/reactos?rev=46660&view=rev
Log: [usb/usbehci] - Implement tracking port status and change status. - When device has connected on port, set the port status. For now assume high speed device. - Fix returning root hubs Status Change Endpoint for URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER. - Implement USB_REQUEST_GET_STATUS for functions URB_FUNCTION_GET_STATUS_FROM_DEVICE and URB_FUNCTION_CLASS_OTHER. Implement USB_REQUEST_CLEAR_FEATURE and USB_REQUEST_SET_FEATURE. - Implement IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE to return the root hubs device handle, fix IOCTL_INTERNAL_USB_GET_HUB_COUNT to return 1 vice 0 as the root hub must be accounted for. - Code based on XEN PV Drivers by James Harper. Modified: trunk/reactos/drivers/usb/usbehci/fdo.c trunk/reactos/drivers/usb/usbehci/irp.c trunk/reactos/drivers/usb/usbehci/pdo.c trunk/reactos/drivers/usb/usbehci/usbehci.h Modified: trunk/reactos/drivers/usb/usbehci/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/fdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/fdo.c [iso-8859-1] Fri Apr 2 06:49:01 2010 @@ -100,9 +100,9 @@ tmp = READ_REGISTER_ULONG((PULONG)((Base + EHCI_PORTSC) + (4 * i))); - DPRINT("port tmp %x\n", tmp); GetDeviceDescriptor(FdoDeviceExtension, 0, 0, FALSE); PdoDeviceExtension->ChildDeviceCount++; + PdoDeviceExtension->Ports[i].PortStatus |= USB_PORT_STATUS_HIGH_SPEED | USB_PORT_STATUS_CONNECT | USB_PORT_STATUS_ENABLE; WorkItemData = ExAllocatePool(NonPagedPool, sizeof(WORKITEM_DATA)); if (!WorkItemData) ASSERT(FALSE); WorkItemData->IoWorkItem = IoAllocateWorkItem(PdoDeviceExtension->DeviceObject); Modified: trunk/reactos/drivers/usb/usbehci/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/irp.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/irp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/irp.c [iso-8859-1] Fri Apr 2 06:49:01 2010 @@ -88,35 +88,65 @@ if (UsbDevice == NULL) UsbDevice = DeviceExtension->UsbDevices[0]; + /* Assume URB success */ + Urb->UrbHeader.Status = USBD_STATUS_SUCCESS; + /* Set the DeviceHandle to the Internal Device */ + Urb->UrbHeader.UsbdDeviceHandle = UsbDevice; + switch (Urb->UrbHeader.Function) { case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: { - /* Are we suppose to only return on this request when a device is connected - or is it the RootHubInitNotification Callback */ DPRINT1("URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:\n"); DPRINT1("--->TransferBufferLength %x\n",Urb->UrbBulkOrInterruptTransfer.TransferBufferLength); DPRINT1("--->TransferBuffer %x\n",Urb->UrbBulkOrInterruptTransfer.TransferBuffer); DPRINT1("--->PipeHandle %x\n",Urb->UrbBulkOrInterruptTransfer.PipeHandle); + DPRINT1("---->(PVOID)&UsbDevice->EndPointDescriptor %x\n", (PVOID)&UsbDevice->EndPointDescriptor); DPRINT1("--->TransferFlags %x\n", Urb->UrbBulkOrInterruptTransfer.TransferFlags); - /* FIXME */ + RtlZeroMemory(Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength); - ((PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer)[0] = 1; - /* Turn off Irp handling as nothing is handled beyond this */ - DeviceExtension->HaltUrbHandling = TRUE; + if (UsbDevice == DeviceExtension->UsbDevices[0]) + { + if (Urb->UrbBulkOrInterruptTransfer.TransferFlags & (USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK)) + { + LONG i; + for (i = 0; i < 8; i++) + { + if (DeviceExtension->Ports[i].PortChange) + { + DPRINT1("Inform hub driver that port %d has changed\n", i+1); + ((PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer)[0] = 1 << (i + 1); + } + } + } + else + { + Urb->UrbHeader.Status = USBD_STATUS_INVALID_PARAMETER; + Status = STATUS_UNSUCCESSFUL; + } + } break; } case URB_FUNCTION_GET_STATUS_FROM_DEVICE: { - DPRINT1("Get Status from Device\n"); + DPRINT("Get Status from Device\n"); + DPRINT("Index : %d\n", Urb->UrbControlGetStatusRequest.Index); + + /* Copied from pvdrivers */ + if (Urb->UrbControlGetStatusRequest.Index == 0) + { + *(PUSHORT)Urb->UrbControlGetStatusRequest.TransferBuffer = USB_PORT_STATUS_CONNECT | USB_PORT_STATUS_ENABLE; + } + else + { + DPRINT1("Uknown identifier\n"); + Urb->UrbHeader.Status = USBD_STATUS_INVALID_URB_FUNCTION; + Status = STATUS_UNSUCCESSFUL; + } break; } case URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE: { - Urb->UrbHeader.Function = 0x08; - Urb->UrbHeader.UsbdFlags = 0; - Urb->UrbHeader.UsbdDeviceHandle = UsbDevice; - switch(Urb->UrbControlDescriptorRequest.DescriptorType) { case USB_DEVICE_DESCRIPTOR_TYPE: @@ -130,9 +160,6 @@ RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, &UsbDevice->DeviceDescriptor, Urb->UrbControlDescriptorRequest.TransferBufferLength); - - Urb->UrbHeader.Status = USBD_STATUS_SUCCESS; - break; } case USB_CONFIGURATION_DESCRIPTOR_TYPE: @@ -150,9 +177,6 @@ RtlCopyMemory(Urb->UrbControlDescriptorRequest.TransferBuffer, &UsbDevice->ConfigurationDescriptor, Urb->UrbControlDescriptorRequest.TransferBufferLength); - - Urb->UrbHeader.Status = USBD_STATUS_SUCCESS; - break; } case USB_STRING_DESCRIPTOR_TYPE: @@ -232,10 +256,6 @@ } InterfaceInfo = (PUSBD_INTERFACE_INFORMATION)((PUCHAR)InterfaceInfo + InterfaceInfo->Length); } - - Urb->UrbHeader.UsbdDeviceHandle = UsbDevice; - Urb->UrbHeader.UsbdFlags = 0; - Urb->UrbHeader.Status = USBD_STATUS_SUCCESS; } else { @@ -251,7 +271,6 @@ { DPRINT1("TransferFlags %x\n", Urb->UrbControlVendorClassRequest.TransferFlags); DPRINT1("Urb->UrbControlVendorClassRequest.Value %x\n", Urb->UrbControlVendorClassRequest.Value); - switch (Urb->UrbControlVendorClassRequest.Value >> 8) { @@ -328,10 +347,16 @@ DPRINT1("Unknown UrbControlVendorClassRequest Value\n"); } } - Urb->UrbHeader.Function = 0x08; - Urb->UrbHeader.Status = USBD_STATUS_SUCCESS; - Urb->UrbHeader.UsbdDeviceHandle = UsbDevice; - Urb->UrbHeader.UsbdFlags = 0; + break; + } + case USB_REQUEST_GET_STATUS: + { + DPRINT1("DEVICE: USB_REQUEST_GET_STATUS for port %d\n", Urb->UrbControlVendorClassRequest.Index); + + if (Urb->UrbControlVendorClassRequest.Index == 1) + { + ((PULONG)Urb->UrbControlVendorClassRequest.TransferBuffer)[0] = 0; + } break; } default: @@ -348,22 +373,51 @@ { case USB_REQUEST_GET_STATUS: { - DPRINT1("USB_REQUEST_GET_STATUS\n"); + DPRINT1("OTHER: USB_REQUEST_GET_STATUS for port %d\n", Urb->UrbControlVendorClassRequest.Index); + + ((PUSHORT)Urb->UrbControlVendorClassRequest.TransferBuffer)[0] = DeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortStatus; + ((PUSHORT)Urb->UrbControlVendorClassRequest.TransferBuffer)[1] = DeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortChange; break; } case USB_REQUEST_CLEAR_FEATURE: { - DPRINT1("USB_REQUEST_CLEAR_FEATURE\n"); + DPRINT1("USB_REQUEST_CLEAR_FEATURE Port %d, value %x\n", Urb->UrbControlVendorClassRequest.Index, + Urb->UrbControlVendorClassRequest.Value); + switch (Urb->UrbControlVendorClassRequest.Value) + { + case C_PORT_CONNECTION: + DeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortChange &= ~USB_PORT_STATUS_CONNECT; + break; + case C_PORT_RESET: + DeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortChange &= ~USB_PORT_STATUS_RESET; + break; + default: + DPRINT1("Unknown Value for Clear Feature %x \n", Urb->UrbControlVendorClassRequest.Value); + break; + } break; } case USB_REQUEST_SET_FEATURE: { - DPRINT1("USB_REQUEST_SET_FEATURE value %x\n", Urb->UrbControlVendorClassRequest.Value); + DPRINT1("USB_REQUEST_SET_FEATURE Port %d, value %x\n", Urb->UrbControlVendorClassRequest.Index, + Urb->UrbControlVendorClassRequest.Value); + switch(Urb->UrbControlVendorClassRequest.Value) { - /* FIXME: Needs research */ - case 0x01: - { + case PORT_RESET: + { + DeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortChange |= USB_PORT_STATUS_RESET; + break; + } + case PORT_ENABLE: + { + DPRINT1("Unhandled Set Feature\n"); + break; + } + default: + { + DPRINT1("Unknown Set Feature!\n"); + break; } } break; @@ -371,6 +425,7 @@ case USB_REQUEST_SET_ADDRESS: { DPRINT1("USB_REQUEST_SET_ADDRESS\n"); + ASSERT(FALSE); break; } case USB_REQUEST_GET_DESCRIPTOR: @@ -406,6 +461,12 @@ case USB_REQUEST_SYNC_FRAME: { DPRINT1("USB_REQUEST_SYNC_FRAME\n"); + break; + } + default: + { + DPRINT1("Unknown Function Class Unknown request\n"); + ASSERT(FALSE); break; } } @@ -415,6 +476,7 @@ { DPRINT1("Unhandled URB %x\n", Urb->UrbHeader.Function); Urb->UrbHeader.Status = USBD_STATUS_INVALID_URB_FUNCTION; + ASSERT(FALSE); } } @@ -423,6 +485,13 @@ Irp->IoStatus.Status = Status; Irp->IoStatus.Information = Information; + + if (Urb->UrbHeader.Status == USBD_STATUS_SUCCESS) + { + /* Fake a successful Control Transfer */ + Urb->UrbHeader.Function = 0x08; + Urb->UrbHeader.UsbdFlags = 0; + } IoCompleteRequest(Irp, IO_NO_INCREMENT); KeAcquireSpinLock(&DeviceExtension->IrpQueueLock, &oldIrql); Modified: trunk/reactos/drivers/usb/usbehci/pdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/pdo.c?…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/pdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/pdo.c [iso-8859-1] Fri Apr 2 06:49:01 2010 @@ -172,18 +172,24 @@ } case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE: { - DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE\n"); + DPRINT1("IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE %x\n", IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE); + if (Stack->Parameters.Others.Argument1) + { + /* Return the root hubs devicehandle */ + *(PVOID *)Stack->Parameters.Others.Argument1 = (PVOID)PdoDeviceExtension->UsbDevices[0]; + } + else + Status = STATUS_INVALID_DEVICE_REQUEST; break; } case IOCTL_INTERNAL_USB_GET_HUB_COUNT: { - DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT\n"); - + DPRINT1("IOCTL_INTERNAL_USB_GET_HUB_COUNT %x\n", IOCTL_INTERNAL_USB_GET_HUB_COUNT); if (Stack->Parameters.Others.Argument1) { /* FIXME: Determine the number of hubs between the usb device and root hub */ - /* For now return 0 */ - *(PVOID *)Stack->Parameters.Others.Argument1 = 0; + /* For now return 1, the root hub */ + *(PVOID *)Stack->Parameters.Others.Argument1 = (PVOID)1; } break; } @@ -216,9 +222,8 @@ if (Stack->Parameters.Others.Argument2) *(PVOID *)Stack->Parameters.Others.Argument2 = IoGetAttachedDevice(FdoDeviceExtension->DeviceObject); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_SUCCESS; - return STATUS_SUCCESS; + Information = 0; + Status = STATUS_SUCCESS; break; } case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION: @@ -287,7 +292,6 @@ } } - /* Lifted from hpoussin */ Status = DuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &SourceString, &String); @@ -350,12 +354,19 @@ PPDO_DEVICE_EXTENSION PdoDeviceExtension; PFDO_DEVICE_EXTENSION FdoDeviceExtension; UNICODE_STRING InterfaceSymLinkName; + LONG i; PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->ControllerFdo->DeviceExtension; /* Create the root hub */ RootHubDevice = InternalCreateUsbDevice(1, 0, NULL, TRUE); + + for (i = 0; i < 8; i++) + { + PdoDeviceExtension->Ports[i].PortStatus = USB_PORT_STATUS_ENABLE; + PdoDeviceExtension->Ports[i].PortChange = 0; + } RtlCopyMemory(&RootHubDevice->DeviceDescriptor, ROOTHUB2_DEVICE_DESCRIPTOR, @@ -409,8 +420,16 @@ break; } case BusRelations: + DPRINT1("BusRelations!!!!!\n"); case RemovalRelations: case EjectionRelations: + { + /* Ignore the request */ + Information = Irp->IoStatus.Information; + Status = Irp->IoStatus.Status; + break; + + } default: { DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unhandled type 0x%lx\n", @@ -534,7 +553,8 @@ else { DPRINT1("Not Supported\n"); - Status = STATUS_NOT_SUPPORTED; + Status = Irp->IoStatus.Status; + Information = Irp->IoStatus.Information; } break; } Modified: trunk/reactos/drivers/usb/usbehci/usbehci.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usbehc…
============================================================================== --- trunk/reactos/drivers/usb/usbehci/usbehci.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbehci/usbehci.h [iso-8859-1] Fri Apr 2 06:49:01 2010 @@ -74,6 +74,25 @@ /* Ping States, OR with QUEUE_TRANSFER_DESCRIPTOR Token. */ #define PING_STATE_DO_OUT 0x00 #define PING_STATE_DO_PING 0x01 + +#define C_HUB_LOCAL_POWER 0 +#define C_HUB_OVER_CURRENT 1 +#define PORT_CONNECTION 0 +#define PORT_ENABLE 1 +#define PORT_SUSPEND 2 +#define PORT_OVER_CURRENT 3 +#define PORT_RESET 4 +#define PORT_POWER 8 +#define PORT_LOW_SPEED 9 +#define PORT_HIGH_SPEED 9 +#define C_PORT_CONNECTION 16 +#define C_PORT_ENABLE 17 +#define C_PORT_SUSPEND 18 +#define C_PORT_OVER_CURRENT 19 +#define C_PORT_RESET 20 +#define PORT_TEST 21 +#define PORT_INDICATOR 22 +#define USB_PORT_STATUS_CHANGE 0x4000 /* QUEUE ELEMENT TRANSFER DESCRIPTOR TOKEN */ typedef struct _QETD_TOKEN_BITS @@ -273,16 +292,16 @@ } EHCI_HCC_CONTENT, *PEHCI_HCC_CONTENT; typedef struct _EHCI_CAPS { - UCHAR Length; - UCHAR Reserved; - USHORT HCIVersion; + UCHAR Length; + UCHAR Reserved; + USHORT HCIVersion; union { - EHCI_HCS_CONTENT HCSParams; - ULONG HCSParamsLong; + EHCI_HCS_CONTENT HCSParams; + ULONG HCSParamsLong; }; - ULONG HCCParams; - UCHAR PortRoute [8]; + ULONG HCCParams; + UCHAR PortRoute [8]; } EHCI_CAPS, *PEHCI_CAPS; typedef struct _COMMON_DEVICE_EXTENSION @@ -291,6 +310,14 @@ PDRIVER_OBJECT DriverObject; PDEVICE_OBJECT DeviceObject; } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; + +typedef struct _EHCIPORTS +{ + ULONG PortNumber; + ULONG PortType; + USHORT PortStatus; + USHORT PortChange; +} EHCIPORTS, *PEHCIPORTS; typedef struct _FDO_DEVICE_EXTENSION { @@ -333,8 +360,8 @@ PULONG PeriodicFramList; PULONG AsyncListQueueHeadPtr; - PHYSICAL_ADDRESS PeriodicFramListPhysAddr; - PHYSICAL_ADDRESS AsyncListQueueHeadPtrPhysAddr; + PHYSICAL_ADDRESS PeriodicFramListPhysAddr; + PHYSICAL_ADDRESS AsyncListQueueHeadPtrPhysAddr; BOOLEAN AsyncComplete; @@ -356,6 +383,8 @@ BOOLEAN HaltUrbHandling; PVOID CallbackContext; PRH_INIT_CALLBACK CallbackRoutine; + ULONG NumberOfPorts; + EHCIPORTS Ports[32]; } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION; typedef struct _WORKITEM_DATA
14 years, 8 months
1
0
0
0
[cgutman] 46659: [NTOSKRNL] - Fix certain scenarios in which a device node can have a NULL instance path which causes registry corruption when we try to write registry keys for that device node - Create the 'Control' subkey and add the ActiveService value inside it - Fix a memory leak - TODO: Fill AllocConfig and FilteredConfigVector
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 05:47:14 2010 New Revision: 46659 URL:
http://svn.reactos.org/svn/reactos?rev=46659&view=rev
Log: [NTOSKRNL] - Fix certain scenarios in which a device node can have a NULL instance path which causes registry corruption when we try to write registry keys for that device node - Create the 'Control' subkey and add the ActiveService value inside it - Fix a memory leak - TODO: Fill AllocConfig and FilteredConfigVector Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpreport.c trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.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 05:47:14 2010 @@ -60,6 +60,11 @@ IopUpdateResourceMapForPnPDevice( IN PDEVICE_NODE DeviceNode); +NTSTATUS +NTAPI +IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, + OUT PHANDLE Handle); + PDEVICE_NODE FASTCALL IopGetDeviceNode(PDEVICE_OBJECT DeviceObject) @@ -141,6 +146,9 @@ IO_STACK_LOCATION Stack; ULONG RequiredLength; NTSTATUS Status; + HANDLE InstanceHandle, ControlHandle; + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES ObjectAttributes; IopDeviceNodeSetFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); DPRINT("Sending IRP_MN_FILTER_RESOURCE_REQUIREMENTS to device stack\n"); @@ -215,8 +223,31 @@ } } + Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, &InstanceHandle); + if (!NT_SUCCESS(Status)) + return Status; + + RtlInitUnicodeString(&KeyName, L"Control"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + InstanceHandle, + NULL); + Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); + if (!NT_SUCCESS(Status)) + { + ZwClose(InstanceHandle); + return Status; + } + + RtlInitUnicodeString(&KeyName, L"ActiveService"); + Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length); + if (NT_SUCCESS(Status)) IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); + + ZwClose(ControlHandle); + ZwClose(InstanceHandle); return Status; } @@ -372,6 +403,8 @@ KIRQL OldIrql; UNICODE_STRING FullServiceName; UNICODE_STRING LegacyPrefix = RTL_CONSTANT_STRING(L"LEGACY_"); + UNICODE_STRING UnknownDeviceName = RTL_CONSTANT_STRING(L"UNKNOWN"); + HANDLE TempHandle; DPRINT("ParentNode 0x%p PhysicalDeviceObject 0x%p ServiceName %wZ\n", ParentNode, PhysicalDeviceObject, ServiceName); @@ -384,30 +417,37 @@ RtlZeroMemory(Node, sizeof(DEVICE_NODE)); + if (!ServiceName) + ServiceName = &UnknownDeviceName; + if (!PhysicalDeviceObject) { - if (ServiceName) - { - FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName->Length; - FullServiceName.Length = 0; - FullServiceName.Buffer = ExAllocatePool(PagedPool, FullServiceName.MaximumLength); - if (!FullServiceName.Buffer) - { - ExFreePool(Node); - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix); - RtlAppendUnicodeStringToString(&FullServiceName, ServiceName); - } - - Status = PnpRootCreateDevice(ServiceName ? &FullServiceName : NULL, &PhysicalDeviceObject); + FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName->Length; + FullServiceName.Length = 0; + FullServiceName.Buffer = ExAllocatePool(PagedPool, FullServiceName.MaximumLength); + if (!FullServiceName.Buffer) + { + ExFreePool(Node); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix); + RtlAppendUnicodeStringToString(&FullServiceName, ServiceName); + + Status = PnpRootCreateDevice(&FullServiceName, &PhysicalDeviceObject, &Node->InstancePath); if (!NT_SUCCESS(Status)) { DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status); ExFreePool(Node); return Status; } + + /* Create the device key for legacy drivers */ + Status = IopCreateDeviceKeyPath(&Node->InstancePath, &TempHandle); + if (NT_SUCCESS(Status)) + ZwClose(TempHandle); + + ExFreePool(FullServiceName.Buffer); /* This is for drivers passed on the command line to ntoskrnl.exe */ IopDeviceNodeSetFlag(Node, DNF_STARTED); @@ -873,6 +913,7 @@ ULONG ResCount; ULONG ListSize, ResultLength; NTSTATUS Status; + HANDLE ControlHandle; DPRINT("IopSetDeviceInstanceData() called\n"); @@ -946,9 +987,21 @@ sizeof(DefaultConfigFlags)); } + /* Create the 'Control' key */ + RtlInitUnicodeString(&KeyName, L"Control"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + InstanceKey, + NULL); + Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); + + if (NT_SUCCESS(Status)) + ZwClose(ControlHandle); + DPRINT("IopSetDeviceInstanceData() done\n"); - return STATUS_SUCCESS; + return Status; } BOOLEAN 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 05:47:14 2010 @@ -161,7 +161,8 @@ { /* Create the PDO */ Status = PnpRootCreateDevice(&ServiceName, - &Pdo); + &Pdo, + NULL); if (!NT_SUCCESS(Status)) { DPRINT("PnpRootCreateDevice() failed (Status 0x%08lx)\n", Status); Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c [iso-8859-1] Fri Apr 2 05:47:14 2010 @@ -131,30 +131,25 @@ NTSTATUS PnpRootCreateDevice( IN PUNICODE_STRING ServiceName, - IN PDEVICE_OBJECT *PhysicalDeviceObject) + OUT PDEVICE_OBJECT *PhysicalDeviceObject, + OUT OPTIONAL PUNICODE_STRING FullInstancePath) { PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension; - UNICODE_STRING UnknownServiceName = RTL_CONSTANT_STRING(L"LEGACY_UNKNOWN"); - PUNICODE_STRING LocalServiceName; PPNPROOT_PDO_DEVICE_EXTENSION PdoDeviceExtension; WCHAR DevicePath[MAX_PATH + 1]; WCHAR InstancePath[5]; PPNPROOT_DEVICE Device = NULL; NTSTATUS Status; ULONG i; + UNICODE_STRING PathSep = RTL_CONSTANT_STRING(L"\\"); DeviceExtension = PnpRootDeviceObject->DeviceExtension; KeAcquireGuardedMutex(&DeviceExtension->DeviceListLock); - if (ServiceName) - LocalServiceName = ServiceName; - else - LocalServiceName = &UnknownServiceName; - - DPRINT("Creating a PnP root device for service '%wZ'\n", LocalServiceName); + DPRINT("Creating a PnP root device for service '%wZ'\n", ServiceName); /* Search for a free instance ID */ - _snwprintf(DevicePath, sizeof(DevicePath) / sizeof(WCHAR), L"%s\\%wZ", REGSTR_KEY_ROOTENUM, LocalServiceName); + _snwprintf(DevicePath, sizeof(DevicePath) / sizeof(WCHAR), L"%s\\%wZ", REGSTR_KEY_ROOTENUM, ServiceName); for (i = 0; i < 9999; i++) { _snwprintf(InstancePath, sizeof(InstancePath) / sizeof(WCHAR), L"%04lu", i); @@ -164,7 +159,7 @@ } if (i == 9999) { - DPRINT1("Too much legacy devices reported for service '%wZ'\n", &LocalServiceName); + DPRINT1("Too much legacy devices reported for service '%wZ'\n", ServiceName); Status = STATUS_INSUFFICIENT_RESOURCES; goto cleanup; } @@ -187,6 +182,22 @@ { Status = STATUS_NO_MEMORY; goto cleanup; + } + + if (FullInstancePath) + { + FullInstancePath->MaximumLength = Device->DeviceID.Length + PathSep.Length + Device->InstanceID.Length; + FullInstancePath->Length = 0; + FullInstancePath->Buffer = ExAllocatePool(PagedPool, FullInstancePath->MaximumLength); + if (!FullInstancePath->Buffer) + { + Status = STATUS_NO_MEMORY; + goto cleanup; + } + + RtlAppendUnicodeStringToString(FullInstancePath, &Device->DeviceID); + RtlAppendUnicodeStringToString(FullInstancePath, &PathSep); + RtlAppendUnicodeStringToString(FullInstancePath, &Device->InstanceID); } /* Initialize a device object */
14 years, 8 months
1
0
0
0
[tkreuzer] 46658: [WIN32K] - EngAcquireSemaphoreShared: update dwEngAcquireCount - DC_LockDc/DC_UnlockDc: Acquire PDEV lock only for direct DCs, in that case also update the pSurface pointer - When copying DC states, copy the surface only for memory dcs - after switching the mode, update system metrics and redraw the desktop window. - Remove testdraw code.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Apr 2 00:36:40 2010 New Revision: 46658 URL:
http://svn.reactos.org/svn/reactos?rev=46658&view=rev
Log: [WIN32K] - EngAcquireSemaphoreShared: update dwEngAcquireCount - DC_LockDc/DC_UnlockDc: Acquire PDEV lock only for direct DCs, in that case also update the pSurface pointer - When copying DC states, copy the surface only for memory dcs - after switching the mode, update system metrics and redraw the desktop window. - Remove testdraw code. Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c branches/reactos-yarotows/subsystems/win32/win32k/eng/semaphor.c branches/reactos-yarotows/subsystems/win32/win32k/include/dc.h branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dclife.c branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/eng/pdevobj.c [iso-8859-1] Fri Apr 2 00:36:40 2010 @@ -329,37 +329,6 @@ ppdev2->pfn.CompletePDEV(ppdev2->dhpdev, (HDEV)ppdev2); } -void -TestDraw() -{ - RECTL rclTrg; - PPDEVOBJ ppdev; - PDC pdc; - - ppdev = EngpGetPDEV(0); - - pdc = DC_AllocDcWithHandle(); - DC_vInitDc(pdc, 0, ppdev); - - - rclTrg.left = rclTrg.top = 0; - rclTrg.right = rclTrg.bottom = 400; - - IntEngBitBltEx(&ppdev->pSurface->SurfObj, - NULL, - NULL, - NULL, - NULL, - &rclTrg, - NULL, - NULL, - &pdc->eboFill.BrushObject, - NULL, - ROP3_TO_ROP4(PATCOPY), - FALSE); - - ASSERT(FALSE); -} BOOL NTAPI @@ -429,8 +398,6 @@ DPRINT1("leave, ppdev = %p, pSurface = %p\n", ppdev, ppdev->pSurface); ASSERT(ppdev->pSurface->BitsLock); - - TestDraw(); return retval; } Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/semaphor.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/eng/semaphor.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/eng/semaphor.c [iso-8859-1] Fri Apr 2 00:36:40 2010 @@ -74,8 +74,12 @@ EngAcquireSemaphoreShared( IN HSEMAPHORE hsem) { + PTHREADINFO pti; + ASSERT(hsem); ExEnterCriticalRegionAndAcquireResourceShared((PERESOURCE)hsem); + pti = PsGetThreadWin32Thread(PsGetCurrentThread()); + if (pti) ++pti->dwEngAcquireCount; } /* 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] Fri Apr 2 00:36:40 2010 @@ -169,7 +169,16 @@ { PDC pdc; pdc = GDIOBJ_LockObj(hdc, GDILoObjType_LO_DC_TYPE); - if(pdc) EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock); + + /* Direct DC's need PDEV locking */ + if(pdc && pdc->dctype == DCTYPE_DIRECT) + { + /* Acquire shared PDEV lock */ + EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock); + + /* Get the current surface */ + pdc->dclevel.pSurface = pdc->ppdev->pSurface; + } return pdc; } @@ -177,7 +186,12 @@ FORCEINLINE DC_UnlockDc(PDC pdc) { - EngReleaseSemaphore(pdc->ppdev->hsemDevLock); + if(pdc->dctype == DCTYPE_DIRECT) + { + /* Release PDEV lock */ + EngReleaseSemaphore(pdc->ppdev->hsemDevLock); + } + GDIOBJ_UnlockObjByPtr(&pdc->BaseObject); } Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Fri Apr 2 00:36:40 2010 @@ -710,6 +710,8 @@ return Status; } +BOOL APIENTRY UserClipCursor(RECTL *prcl); +VOID APIENTRY UserRedrawDesktop(); LONG APIENTRY @@ -725,6 +727,7 @@ HKEY hkey; NTSTATUS Status; PPDEVOBJ ppdev; + PDESKTOP pdesk; /* If no DEVMODE is given, use registry settings */ if (!pdm) @@ -792,6 +795,19 @@ lResult = (lResult == DISP_CHANGE_NOTUPDATED) ? DISP_CHANGE_FAILED : DISP_CHANGE_RESTART; } + + /* Update the system metrics */ + InitMetrics(); + + /* Remove all cursor clipping */ + UserClipCursor(NULL); + + pdesk = IntGetActiveDesktop(); + IntHideDesktop(pdesk); + co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes); + //UserRedrawDesktop(); + + //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); /* Send message */ @@ -883,10 +899,13 @@ } // FIXME: Copy videoparameters + UserEnterExclusive(); /* Call internal function */ Ret = UserChangeDisplaySettings(pustrDevice, lpDevMode, hwnd, dwflags, NULL); + UserLeave(); + return Ret; } 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] Fri Apr 2 00:36:40 2010 @@ -117,8 +117,11 @@ DCTYPE dctype, PPDEVOBJ ppdev) { - /* Lock ppdev */ - EngAcquireSemaphoreShared(ppdev->hsemDevLock); + if (dctype == DCTYPE_DIRECT) + { + /* Lock ppdev */ + EngAcquireSemaphoreShared(ppdev->hsemDevLock); + } /* Setup some basic fields */ pdc->dctype = dctype; Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/objects/dcstate.c [iso-8859-1] Fri Apr 2 00:36:40 2010 @@ -41,7 +41,6 @@ pdcDst->dclevel.hpal = pdcSrc->dclevel.hpal; /* Handle references here correctly */ - DC_vSelectSurface(pdcDst, pdcSrc->dclevel.pSurface); DC_vSelectFillBrush(pdcDst, pdcSrc->dclevel.pbrFill); DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine); DC_vSelectPalette(pdcDst, pdcSrc->dclevel.ppal); @@ -160,6 +159,10 @@ /* Copy the state back */ DC_vCopyState(pdcSave, pdc, FALSE); + /* Only memory DC's change their surface */ + if (pdcSave->dctype == DCTYPE_MEMORY) + DC_vSelectSurface(pdc, pdcSave->dclevel.pSurface); + // Restore Path by removing it, if the Save flag is set. // BeginPath will takecare of the rest. if (pdc->dclevel.hPath && pdc->dclevel.flPath & DCPATH_SAVE) @@ -274,6 +277,10 @@ /* Copy the current state */ DC_vCopyState(pdc, pdcSave, TRUE); + /* Only memory DC's change their surface */ + if (pdc->dctype == DCTYPE_MEMORY) + DC_vSelectSurface(pdcSave, pdc->dclevel.pSurface); + /* Copy path. FIXME: why this way? */ pdcSave->dclevel.hPath = pdc->dclevel.hPath; pdcSave->dclevel.flPath = pdc->dclevel.flPath | DCPATH_SAVESTATE;
14 years, 8 months
1
0
0
0
[tkreuzer] 46657: [WIN32K] Refactor NtUserClipCursor, don't acquire user lock in UserRedrawDesktop,
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Apr 2 00:30:44 2010 New Revision: 46657 URL:
http://svn.reactos.org/svn/reactos?rev=46657&view=rev
Log: [WIN32K] Refactor NtUserClipCursor, don't acquire user lock in UserRedrawDesktop, Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/cursoricon.c branches/reactos-yarotows/subsystems/win32/win32k/ntuser/desktop.c Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Fri Apr 2 00:30:44 2010 @@ -776,6 +776,39 @@ END_CLEANUP; } +BOOL +APIENTRY +UserClipCursor( + RECTL *prcl) +{ + /* FIXME - check if process has WINSTA_WRITEATTRIBUTES */ + PSYSTEM_CURSORINFO CurInfo; + PWINDOW_OBJECT DesktopWindow = NULL; + + CurInfo = IntGetSysCursorInfo(); + + DesktopWindow = UserGetDesktopWindow(); + + if (prcl != NULL && + (prcl->right > prcl->left) && + (prcl->bottom > prcl->top) && + DesktopWindow != NULL) + { + CurInfo->CursorClipInfo.IsClipped = TRUE; + CurInfo->CursorClipInfo.Left = max(prcl->left, DesktopWindow->Wnd->rcWindow.left); + CurInfo->CursorClipInfo.Top = max(prcl->top, DesktopWindow->Wnd->rcWindow.top); + CurInfo->CursorClipInfo.Right = min(prcl->right, DesktopWindow->Wnd->rcWindow.right); + CurInfo->CursorClipInfo.Bottom = min(prcl->bottom, DesktopWindow->Wnd->rcWindow.bottom); + + UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y); + } + else + { + CurInfo->CursorClipInfo.IsClipped = FALSE; + } + + return TRUE; +} /* * @implemented @@ -783,49 +816,38 @@ BOOL APIENTRY NtUserClipCursor( - RECTL *UnsafeRect) + RECTL *prcl) { /* FIXME - check if process has WINSTA_WRITEATTRIBUTES */ - PSYSTEM_CURSORINFO CurInfo; - RECTL Rect; - PWINDOW_OBJECT DesktopWindow = NULL; - DECLARE_RETURN(BOOL); - - DPRINT("Enter NtUserClipCursor\n"); + RECTL rclLocal; + BOOL bResult; + + if (prcl) + { + _SEH2_TRY + { + /* Probe and copy rect */ + ProbeForRead(prcl, sizeof(RECTL), 1); + rclLocal = *prcl; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + _SEH2_YIELD(return FALSE;) + } + _SEH2_END + + prcl = &rclLocal; + } + UserEnterExclusive(); - if (NULL != UnsafeRect && ! NT_SUCCESS(MmCopyFromCaller(&Rect, UnsafeRect, sizeof(RECT)))) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - RETURN(FALSE); - } - - CurInfo = IntGetSysCursorInfo(); - - DesktopWindow = UserGetDesktopWindow(); - - if ((Rect.right > Rect.left) && (Rect.bottom > Rect.top) - && DesktopWindow && UnsafeRect != NULL) - { - - CurInfo->CursorClipInfo.IsClipped = TRUE; - CurInfo->CursorClipInfo.Left = max(Rect.left, DesktopWindow->Wnd->rcWindow.left); - CurInfo->CursorClipInfo.Top = max(Rect.top, DesktopWindow->Wnd->rcWindow.top); - CurInfo->CursorClipInfo.Right = min(Rect.right, DesktopWindow->Wnd->rcWindow.right); - CurInfo->CursorClipInfo.Bottom = min(Rect.bottom, DesktopWindow->Wnd->rcWindow.bottom); - - UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y); - - RETURN(TRUE); - } - - CurInfo->CursorClipInfo.IsClipped = FALSE; - RETURN(TRUE); - -CLEANUP: - DPRINT("Leave NtUserClipCursor, ret=%i\n",_ret_); + /* Call the internal function */ + bResult = UserClipCursor(prcl); + UserLeave(); - END_CLEANUP; + + return bResult; } Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win…
============================================================================== --- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original) +++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Fri Apr 2 00:30:44 2010 @@ -645,8 +645,6 @@ { PWINDOW_OBJECT Window = NULL; - UserEnterExclusive(); - Window = UserGetDesktopWindow(); IntInvalidateWindows( Window, @@ -655,7 +653,6 @@ RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN); - UserLeave(); }
14 years, 8 months
1
0
0
0
[cgutman] 46656: - Fix the cmbatt.sys path - Add compbatt.sys
by cgutman@svn.reactos.org
Author: cgutman Date: Fri Apr 2 00:28:35 2010 New Revision: 46656 URL:
http://svn.reactos.org/svn/reactos?rev=46656&view=rev
Log: - Fix the cmbatt.sys path - Add compbatt.sys Modified: trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Fri Apr 2 00:28:35 2010 @@ -487,10 +487,12 @@ drivers\base\null\null.sys 2 drivers\base\nmidebug\nmidebug.sys 2 -drivers\battery\cmbatt\cmbatt.sys 2 drivers\battery\battc\battc.sys 2 drivers\bus\isapnp\isapnp.sys 2 + +drivers\bus\acpi\cmbatt\cmbatt.sys 2 +drivers\bus\acpi\compbatt\compbatt.sys 2 drivers\directx\dxapi\dxapi.sys 2 drivers\directx\dxg\dxg.sys 2
14 years, 8 months
1
0
0
0
← Newer
1
...
38
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