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
September 2018
----- 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
24 participants
223 discussions
Start a n
N
ew thread
01/01: [DWNL] Add French translation
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82a7f083639e7036191ba…
commit 82a7f083639e7036191baa13a1592aa212f70cbd Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Sep 21 22:35:33 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Sep 21 22:36:10 2018 +0200 [DWNL] Add French translation --- base/applications/network/dwnl/dwnl.rc | 3 +++ base/applications/network/dwnl/lang/fr-FR.rc | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/base/applications/network/dwnl/dwnl.rc b/base/applications/network/dwnl/dwnl.rc index 5917869230..c73cb425dd 100644 --- a/base/applications/network/dwnl/dwnl.rc +++ b/base/applications/network/dwnl/dwnl.rc @@ -17,6 +17,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" #endif +#ifdef LANGUAGE_FR_FR + #include "lang/fr-FR.rc" +#endif #ifdef LANGUAGE_RU_RU #include "lang/ru-RU.rc" #endif diff --git a/base/applications/network/dwnl/lang/fr-FR.rc b/base/applications/network/dwnl/lang/fr-FR.rc new file mode 100644 index 0000000000..c848b3682c --- /dev/null +++ b/base/applications/network/dwnl/lang/fr-FR.rc @@ -0,0 +1,25 @@ +LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + IDS_USAGE "Utilisation : dwnl URL [DESTINATION]\n" + IDS_RESOLVING "Résolution de %s... " + IDS_DONE "terminé.\n" + IDS_LENGTH_FULL "Longueur : %I64u [%s]\n" + IDS_LENGTH "Longueur : %I64u\n" + IDS_FILE_SAVED "\nFichier enregistré.\n" + IDS_CONNECTING_TO_FULL "Connexion à %s [%s]... " + IDS_CONNECTING_TO "Connexion à %s... " + IDS_REDIRECTING_TO "Redirection vers %s... " + IDS_SEND_REQUEST "Envoi de la requête... " + IDS_BYTES_DOWNLOADED "%I64u octets téléchargés" + IDS_BYTES_DOWNLOADED_FULL "%2d%% (%I64u octet(s) téléchargés)" +END + +STRINGTABLE +BEGIN + IDS_ERROR_DOWNLOAD "\nERREUR : échec du téléchargement.\n" + IDS_ERROR_CODE "\n ERREUR : %u\n" + IDS_ERROR_FILENAME "\nERREUR : impossible de déterminer le nom du fichier, veuillez spécifier un nom de fichier de destination.\n" + IDS_ERROR_PROTOCOL "\nERREUR : protocole non supporté.\n" +END
6 years, 3 months
1
0
0
0
02/02: [NTOSKRNL] Create the 'Device Parameters' subkey and add the 'FirmwareIdentified' value for all ACPI-enumerated devices.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e1b82b5b91473a8f92826…
commit e1b82b5b91473a8f92826ca54b8d0e6a84616fe2 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Fri Sep 21 15:37:34 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Fri Sep 21 15:37:34 2018 +0200 [NTOSKRNL] Create the 'Device Parameters' subkey and add the 'FirmwareIdentified' value for all ACPI-enumerated devices. --- ntoskrnl/io/pnpmgr/pnpmgr.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index e0e040a1d7..5456b8aa68 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -1536,11 +1536,10 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName; - HANDLE LogConfKey; + HANDLE LogConfKey, ControlKey, DeviceParamsKey; ULONG ResCount; ULONG ResultLength; NTSTATUS Status; - HANDLE ControlHandle; DPRINT("IopSetDeviceInstanceData() called\n"); @@ -1619,10 +1618,46 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, InstanceKey, NULL); - Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); - + Status = ZwCreateKey(&ControlKey, + 0, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + NULL); if (NT_SUCCESS(Status)) - ZwClose(ControlHandle); + ZwClose(ControlKey); + + /* Create the 'Device Parameters' key and set the 'FirmwareIdentified' value for all ACPI-enumerated devices */ + if (_wcsnicmp(DeviceNode->InstancePath.Buffer, L"ACPI\\", 5) == 0) + { + RtlInitUnicodeString(&KeyName, L"Device Parameters"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + InstanceKey, + NULL); + Status = ZwCreateKey(&DeviceParamsKey, + 0, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL); + if (NT_SUCCESS(Status)) + { + ULONG FirmwareIdentified = 1; + RtlInitUnicodeString(&KeyName, L"FirmwareIdentified"); + Status = ZwSetValueKey(DeviceParamsKey, + &KeyName, + 0, + REG_DWORD, + &FirmwareIdentified, + sizeof(FirmwareIdentified)); + + ZwClose(DeviceParamsKey); + } + } DPRINT("IopSetDeviceInstanceData() done\n");
6 years, 3 months
1
0
0
0
01/02: [NTOSKRNL] Fix the indentation of some pnp manager functions.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2550325577365765d453c…
commit 2550325577365765d453c7aa77bad1760ac127ef Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Fri Sep 21 15:08:43 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Fri Sep 21 15:08:43 2018 +0200 [NTOSKRNL] Fix the indentation of some pnp manager functions. --- ntoskrnl/io/pnpmgr/pnpmgr.c | 1170 +++++++++++++++++++++---------------------- 1 file changed, 585 insertions(+), 585 deletions(-) diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index e4cb7db6d6..e0e040a1d7 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -435,68 +435,68 @@ FASTCALL IopInitializeDevice(PDEVICE_NODE DeviceNode, PDRIVER_OBJECT DriverObject) { - PDEVICE_OBJECT Fdo; - NTSTATUS Status; + PDEVICE_OBJECT Fdo; + NTSTATUS Status; - if (!DriverObject) - { - /* Special case for bus driven devices */ - DeviceNode->Flags |= DNF_ADDED; - return STATUS_SUCCESS; - } + if (!DriverObject) + { + /* Special case for bus driven devices */ + DeviceNode->Flags |= DNF_ADDED; + return STATUS_SUCCESS; + } - if (!DriverObject->DriverExtension->AddDevice) - { - DeviceNode->Flags |= DNF_LEGACY_DRIVER; - } + if (!DriverObject->DriverExtension->AddDevice) + { + DeviceNode->Flags |= DNF_LEGACY_DRIVER; + } - if (DeviceNode->Flags & DNF_LEGACY_DRIVER) - { - DeviceNode->Flags |= (DNF_ADDED | DNF_STARTED); - return STATUS_SUCCESS; - } + if (DeviceNode->Flags & DNF_LEGACY_DRIVER) + { + DeviceNode->Flags |= (DNF_ADDED | DNF_STARTED); + return STATUS_SUCCESS; + } - /* This is a Plug and Play driver */ - DPRINT("Plug and Play driver found\n"); - ASSERT(DeviceNode->PhysicalDeviceObject); + /* This is a Plug and Play driver */ + DPRINT("Plug and Play driver found\n"); + ASSERT(DeviceNode->PhysicalDeviceObject); - DPRINT("Calling %wZ->AddDevice(%wZ)\n", - &DriverObject->DriverName, - &DeviceNode->InstancePath); - Status = DriverObject->DriverExtension->AddDevice( - DriverObject, DeviceNode->PhysicalDeviceObject); - if (!NT_SUCCESS(Status)) - { - DPRINT1("%wZ->AddDevice(%wZ) failed with status 0x%x\n", - &DriverObject->DriverName, - &DeviceNode->InstancePath, - Status); - IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); - DeviceNode->Problem = CM_PROB_FAILED_ADD; - return Status; - } + DPRINT("Calling %wZ->AddDevice(%wZ)\n", + &DriverObject->DriverName, + &DeviceNode->InstancePath); + Status = DriverObject->DriverExtension->AddDevice(DriverObject, + DeviceNode->PhysicalDeviceObject); + if (!NT_SUCCESS(Status)) + { + DPRINT1("%wZ->AddDevice(%wZ) failed with status 0x%x\n", + &DriverObject->DriverName, + &DeviceNode->InstancePath, + Status); + IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + DeviceNode->Problem = CM_PROB_FAILED_ADD; + return Status; + } - Fdo = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject); + Fdo = IoGetAttachedDeviceReference(DeviceNode->PhysicalDeviceObject); - /* Check if we have a ACPI device (needed for power management) */ - if (Fdo->DeviceType == FILE_DEVICE_ACPI) - { - static BOOLEAN SystemPowerDeviceNodeCreated = FALSE; + /* Check if we have a ACPI device (needed for power management) */ + if (Fdo->DeviceType == FILE_DEVICE_ACPI) + { + static BOOLEAN SystemPowerDeviceNodeCreated = FALSE; - /* There can be only one system power device */ - if (!SystemPowerDeviceNodeCreated) - { - PopSystemPowerDeviceNode = DeviceNode; - ObReferenceObject(PopSystemPowerDeviceNode->PhysicalDeviceObject); - SystemPowerDeviceNodeCreated = TRUE; - } - } + /* There can be only one system power device */ + if (!SystemPowerDeviceNodeCreated) + { + PopSystemPowerDeviceNode = DeviceNode; + ObReferenceObject(PopSystemPowerDeviceNode->PhysicalDeviceObject); + SystemPowerDeviceNodeCreated = TRUE; + } + } - ObDereferenceObject(Fdo); + ObDereferenceObject(Fdo); - IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); + IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } static @@ -762,59 +762,59 @@ NTSTATUS IopStopDevice( PDEVICE_NODE DeviceNode) { - NTSTATUS Status; + NTSTATUS Status; - DPRINT("Stopping device: %wZ\n", &DeviceNode->InstancePath); + DPRINT("Stopping device: %wZ\n", &DeviceNode->InstancePath); - Status = IopQueryStopDevice(DeviceNode->PhysicalDeviceObject); - if (NT_SUCCESS(Status)) - { - IopSendStopDevice(DeviceNode->PhysicalDeviceObject); + Status = IopQueryStopDevice(DeviceNode->PhysicalDeviceObject); + if (NT_SUCCESS(Status)) + { + IopSendStopDevice(DeviceNode->PhysicalDeviceObject); - DeviceNode->Flags &= ~(DNF_STARTED | DNF_START_REQUEST_PENDING); - DeviceNode->Flags |= DNF_STOPPED; + DeviceNode->Flags &= ~(DNF_STARTED | DNF_START_REQUEST_PENDING); + DeviceNode->Flags |= DNF_STOPPED; - return STATUS_SUCCESS; - } + return STATUS_SUCCESS; + } - return Status; + return Status; } NTSTATUS IopStartDevice( PDEVICE_NODE DeviceNode) { - NTSTATUS Status; - HANDLE InstanceHandle = NULL, ControlHandle = NULL; - UNICODE_STRING KeyName, ValueString; - OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + HANDLE InstanceHandle = NULL, ControlHandle = NULL; + UNICODE_STRING KeyName, ValueString; + OBJECT_ATTRIBUTES ObjectAttributes; - if (DeviceNode->Flags & DNF_DISABLED) - return STATUS_SUCCESS; + if (DeviceNode->Flags & DNF_DISABLED) + return STATUS_SUCCESS; - Status = IopAssignDeviceResources(DeviceNode); - if (!NT_SUCCESS(Status)) - goto ByeBye; + Status = IopAssignDeviceResources(DeviceNode); + if (!NT_SUCCESS(Status)) + goto ByeBye; - /* New PnP ABI */ - IopStartAndEnumerateDevice(DeviceNode); + /* New PnP ABI */ + IopStartAndEnumerateDevice(DeviceNode); - /* FIX: Should be done in new device instance code */ - Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceHandle); - if (!NT_SUCCESS(Status)) - goto ByeBye; + /* FIX: Should be done in new device instance code */ + Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceHandle); + if (!NT_SUCCESS(Status)) + goto ByeBye; - /* FIX: Should be done in IoXxxPrepareDriverLoading */ - // { - RtlInitUnicodeString(&KeyName, L"Control"); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, - InstanceHandle, - NULL); - Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); - if (!NT_SUCCESS(Status)) - goto ByeBye; + /* FIX: Should be done in IoXxxPrepareDriverLoading */ + // { + RtlInitUnicodeString(&KeyName, L"Control"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + InstanceHandle, + NULL); + Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); + if (!NT_SUCCESS(Status)) + goto ByeBye; RtlInitUnicodeString(&KeyName, L"ActiveService"); ValueString = DeviceNode->ServiceName; @@ -824,13 +824,13 @@ IopStartDevice( // } ByeBye: - if (ControlHandle != NULL) - ZwClose(ControlHandle); + if (ControlHandle != NULL) + ZwClose(ControlHandle); - if (InstanceHandle != NULL) - ZwClose(InstanceHandle); + if (InstanceHandle != NULL) + ZwClose(InstanceHandle); - return Status; + return Status; } NTSTATUS @@ -838,72 +838,72 @@ NTAPI IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode, PDEVICE_CAPABILITIES DeviceCaps) { - IO_STATUS_BLOCK StatusBlock; - IO_STACK_LOCATION Stack; - NTSTATUS Status; - HANDLE InstanceKey; - UNICODE_STRING ValueName; - - /* Set up the Header */ - RtlZeroMemory(DeviceCaps, sizeof(DEVICE_CAPABILITIES)); - DeviceCaps->Size = sizeof(DEVICE_CAPABILITIES); - DeviceCaps->Version = 1; - DeviceCaps->Address = -1; - DeviceCaps->UINumber = -1; - - /* Set up the Stack */ - RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); - Stack.Parameters.DeviceCapabilities.Capabilities = DeviceCaps; - - /* Send the IRP */ - Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject, - &StatusBlock, - IRP_MN_QUERY_CAPABILITIES, - &Stack); - if (!NT_SUCCESS(Status)) - { - if (Status != STATUS_NOT_SUPPORTED) - { - DPRINT1("IRP_MN_QUERY_CAPABILITIES failed with status 0x%lx\n", Status); - } - return Status; - } + IO_STATUS_BLOCK StatusBlock; + IO_STACK_LOCATION Stack; + NTSTATUS Status; + HANDLE InstanceKey; + UNICODE_STRING ValueName; - DeviceNode->CapabilityFlags = *(PULONG)((ULONG_PTR)&DeviceCaps->Version + sizeof(DeviceCaps->Version)); + /* Set up the Header */ + RtlZeroMemory(DeviceCaps, sizeof(DEVICE_CAPABILITIES)); + DeviceCaps->Size = sizeof(DEVICE_CAPABILITIES); + DeviceCaps->Version = 1; + DeviceCaps->Address = -1; + DeviceCaps->UINumber = -1; - if (DeviceCaps->NoDisplayInUI) - DeviceNode->UserFlags |= DNUF_DONT_SHOW_IN_UI; - else - DeviceNode->UserFlags &= ~DNUF_DONT_SHOW_IN_UI; + /* Set up the Stack */ + RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); + Stack.Parameters.DeviceCapabilities.Capabilities = DeviceCaps; - Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey); - if (NT_SUCCESS(Status)) - { - /* Set 'Capabilities' value */ - RtlInitUnicodeString(&ValueName, L"Capabilities"); - Status = ZwSetValueKey(InstanceKey, - &ValueName, - 0, - REG_DWORD, - &DeviceNode->CapabilityFlags, - sizeof(ULONG)); + /* Send the IRP */ + Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject, + &StatusBlock, + IRP_MN_QUERY_CAPABILITIES, + &Stack); + if (!NT_SUCCESS(Status)) + { + if (Status != STATUS_NOT_SUPPORTED) + { + DPRINT1("IRP_MN_QUERY_CAPABILITIES failed with status 0x%lx\n", Status); + } + return Status; + } - /* Set 'UINumber' value */ - if (DeviceCaps->UINumber != MAXULONG) - { - RtlInitUnicodeString(&ValueName, L"UINumber"); - Status = ZwSetValueKey(InstanceKey, - &ValueName, - 0, - REG_DWORD, - &DeviceCaps->UINumber, - sizeof(ULONG)); - } + DeviceNode->CapabilityFlags = *(PULONG)((ULONG_PTR)&DeviceCaps->Version + sizeof(DeviceCaps->Version)); - ZwClose(InstanceKey); - } + if (DeviceCaps->NoDisplayInUI) + DeviceNode->UserFlags |= DNUF_DONT_SHOW_IN_UI; + else + DeviceNode->UserFlags &= ~DNUF_DONT_SHOW_IN_UI; - return Status; + Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey); + if (NT_SUCCESS(Status)) + { + /* Set 'Capabilities' value */ + RtlInitUnicodeString(&ValueName, L"Capabilities"); + Status = ZwSetValueKey(InstanceKey, + &ValueName, + 0, + REG_DWORD, + &DeviceNode->CapabilityFlags, + sizeof(ULONG)); + + /* Set 'UINumber' value */ + if (DeviceCaps->UINumber != MAXULONG) + { + RtlInitUnicodeString(&ValueName, L"UINumber"); + Status = ZwSetValueKey(InstanceKey, + &ValueName, + 0, + REG_DWORD, + &DeviceCaps->UINumber, + sizeof(ULONG)); + } + + ZwClose(InstanceKey); + } + + return Status; } static @@ -939,85 +939,86 @@ IopDeviceActionWorker( NTSTATUS IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject) { - KIRQL OldIrql; + KIRQL OldIrql; - if (PopSystemPowerDeviceNode) - { - KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); - *DeviceObject = PopSystemPowerDeviceNode->PhysicalDeviceObject; - KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); + if (PopSystemPowerDeviceNode) + { + KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); + *DeviceObject = PopSystemPowerDeviceNode->PhysicalDeviceObject; + KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); - return STATUS_SUCCESS; - } + return STATUS_SUCCESS; + } - return STATUS_UNSUCCESSFUL; + return STATUS_UNSUCCESSFUL; } USHORT NTAPI IopGetBusTypeGuidIndex(LPGUID BusTypeGuid) { - USHORT i = 0, FoundIndex = 0xFFFF; - ULONG NewSize; - PVOID NewList; + USHORT i = 0, FoundIndex = 0xFFFF; + ULONG NewSize; + PVOID NewList; - /* Acquire the lock */ - ExAcquireFastMutex(&PnpBusTypeGuidList->Lock); + /* Acquire the lock */ + ExAcquireFastMutex(&PnpBusTypeGuidList->Lock); - /* Loop all entries */ - while (i < PnpBusTypeGuidList->GuidCount) - { - /* Try to find a match */ - if (RtlCompareMemory(BusTypeGuid, - &PnpBusTypeGuidList->Guids[i], - sizeof(GUID)) == sizeof(GUID)) - { - /* Found it */ - FoundIndex = i; - goto Quickie; - } - i++; - } + /* Loop all entries */ + while (i < PnpBusTypeGuidList->GuidCount) + { + /* Try to find a match */ + if (RtlCompareMemory(BusTypeGuid, + &PnpBusTypeGuidList->Guids[i], + sizeof(GUID)) == sizeof(GUID)) + { + /* Found it */ + FoundIndex = i; + goto Quickie; + } + i++; + } - /* Check if we have to grow the list */ - if (PnpBusTypeGuidList->GuidCount) - { - /* Calculate the new size */ - NewSize = sizeof(IO_BUS_TYPE_GUID_LIST) + - (sizeof(GUID) * PnpBusTypeGuidList->GuidCount); + /* Check if we have to grow the list */ + if (PnpBusTypeGuidList->GuidCount) + { + /* Calculate the new size */ + NewSize = sizeof(IO_BUS_TYPE_GUID_LIST) + + (sizeof(GUID) * PnpBusTypeGuidList->GuidCount); - /* Allocate the new copy */ - NewList = ExAllocatePool(PagedPool, NewSize); + /* Allocate the new copy */ + NewList = ExAllocatePool(PagedPool, NewSize); - if (!NewList) { - /* Fail */ - ExFreePool(PnpBusTypeGuidList); - goto Quickie; - } + if (!NewList) + { + /* Fail */ + ExFreePool(PnpBusTypeGuidList); + goto Quickie; + } - /* Now copy them, decrease the size too */ - NewSize -= sizeof(GUID); - RtlCopyMemory(NewList, PnpBusTypeGuidList, NewSize); + /* Now copy them, decrease the size too */ + NewSize -= sizeof(GUID); + RtlCopyMemory(NewList, PnpBusTypeGuidList, NewSize); - /* Free the old list */ - ExFreePool(PnpBusTypeGuidList); + /* Free the old list */ + ExFreePool(PnpBusTypeGuidList); - /* Use the new buffer */ - PnpBusTypeGuidList = NewList; - } + /* Use the new buffer */ + PnpBusTypeGuidList = NewList; + } - /* Copy the new GUID */ - RtlCopyMemory(&PnpBusTypeGuidList->Guids[PnpBusTypeGuidList->GuidCount], - BusTypeGuid, - sizeof(GUID)); + /* Copy the new GUID */ + RtlCopyMemory(&PnpBusTypeGuidList->Guids[PnpBusTypeGuidList->GuidCount], + BusTypeGuid, + sizeof(GUID)); - /* The new entry is the index */ - FoundIndex = (USHORT)PnpBusTypeGuidList->GuidCount; - PnpBusTypeGuidList->GuidCount++; + /* The new entry is the index */ + FoundIndex = (USHORT)PnpBusTypeGuidList->GuidCount; + PnpBusTypeGuidList->GuidCount++; Quickie: - ExReleaseFastMutex(&PnpBusTypeGuidList->Lock); - return FoundIndex; + ExReleaseFastMutex(&PnpBusTypeGuidList->Lock); + return FoundIndex; } /* @@ -1040,136 +1041,136 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode, PUNICODE_STRING ServiceName, PDEVICE_NODE *DeviceNode) { - PDEVICE_NODE Node; - NTSTATUS Status; - KIRQL OldIrql; - UNICODE_STRING FullServiceName; - UNICODE_STRING LegacyPrefix = RTL_CONSTANT_STRING(L"LEGACY_"); - UNICODE_STRING UnknownDeviceName = RTL_CONSTANT_STRING(L"UNKNOWN"); - UNICODE_STRING KeyName, ClassName; - PUNICODE_STRING ServiceName1; - ULONG LegacyValue; - UNICODE_STRING ClassGUID; - HANDLE InstanceHandle; - - DPRINT("ParentNode 0x%p PhysicalDeviceObject 0x%p ServiceName %wZ\n", - ParentNode, PhysicalDeviceObject, ServiceName); - - Node = ExAllocatePoolWithTag(NonPagedPool, sizeof(DEVICE_NODE), TAG_IO_DEVNODE); - if (!Node) - { - return STATUS_INSUFFICIENT_RESOURCES; - } + PDEVICE_NODE Node; + NTSTATUS Status; + KIRQL OldIrql; + UNICODE_STRING FullServiceName; + UNICODE_STRING LegacyPrefix = RTL_CONSTANT_STRING(L"LEGACY_"); + UNICODE_STRING UnknownDeviceName = RTL_CONSTANT_STRING(L"UNKNOWN"); + UNICODE_STRING KeyName, ClassName; + PUNICODE_STRING ServiceName1; + ULONG LegacyValue; + UNICODE_STRING ClassGUID; + HANDLE InstanceHandle; + + DPRINT("ParentNode 0x%p PhysicalDeviceObject 0x%p ServiceName %wZ\n", + ParentNode, PhysicalDeviceObject, ServiceName); + + Node = ExAllocatePoolWithTag(NonPagedPool, sizeof(DEVICE_NODE), TAG_IO_DEVNODE); + if (!Node) + { + return STATUS_INSUFFICIENT_RESOURCES; + } - RtlZeroMemory(Node, sizeof(DEVICE_NODE)); + RtlZeroMemory(Node, sizeof(DEVICE_NODE)); - if (!ServiceName) - ServiceName1 = &UnknownDeviceName; - else - ServiceName1 = ServiceName; + if (!ServiceName) + ServiceName1 = &UnknownDeviceName; + else + ServiceName1 = ServiceName; - if (!PhysicalDeviceObject) - { - FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName1->Length + sizeof(UNICODE_NULL); - FullServiceName.Length = 0; - FullServiceName.Buffer = ExAllocatePool(PagedPool, FullServiceName.MaximumLength); - if (!FullServiceName.Buffer) - { - ExFreePoolWithTag(Node, TAG_IO_DEVNODE); - return STATUS_INSUFFICIENT_RESOURCES; - } + if (!PhysicalDeviceObject) + { + FullServiceName.MaximumLength = LegacyPrefix.Length + ServiceName1->Length + sizeof(UNICODE_NULL); + FullServiceName.Length = 0; + FullServiceName.Buffer = ExAllocatePool(PagedPool, FullServiceName.MaximumLength); + if (!FullServiceName.Buffer) + { + ExFreePoolWithTag(Node, TAG_IO_DEVNODE); + return STATUS_INSUFFICIENT_RESOURCES; + } - RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix); - RtlAppendUnicodeStringToString(&FullServiceName, ServiceName1); - RtlUpcaseUnicodeString(&FullServiceName, &FullServiceName, FALSE); + RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix); + RtlAppendUnicodeStringToString(&FullServiceName, ServiceName1); + RtlUpcaseUnicodeString(&FullServiceName, &FullServiceName, FALSE); - Status = PnpRootCreateDevice(&FullServiceName, NULL, &PhysicalDeviceObject, &Node->InstancePath); - if (!NT_SUCCESS(Status)) - { - DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status); - ExFreePool(FullServiceName.Buffer); - ExFreePoolWithTag(Node, TAG_IO_DEVNODE); - return Status; - } + Status = PnpRootCreateDevice(&FullServiceName, NULL, &PhysicalDeviceObject, &Node->InstancePath); + if (!NT_SUCCESS(Status)) + { + DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status); + ExFreePool(FullServiceName.Buffer); + ExFreePoolWithTag(Node, TAG_IO_DEVNODE); + return Status; + } - /* Create the device key for legacy drivers */ - Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle); - if (!NT_SUCCESS(Status)) - { - ExFreePool(FullServiceName.Buffer); - ExFreePoolWithTag(Node, TAG_IO_DEVNODE); - return Status; - } + /* Create the device key for legacy drivers */ + Status = IopCreateDeviceKeyPath(&Node->InstancePath, REG_OPTION_VOLATILE, &InstanceHandle); + if (!NT_SUCCESS(Status)) + { + ExFreePool(FullServiceName.Buffer); + ExFreePoolWithTag(Node, TAG_IO_DEVNODE); + return Status; + } - Node->ServiceName.MaximumLength = ServiceName1->Length + sizeof(UNICODE_NULL); - Node->ServiceName.Length = 0; - Node->ServiceName.Buffer = ExAllocatePool(PagedPool, Node->ServiceName.MaximumLength); - if (!Node->ServiceName.Buffer) - { - ZwClose(InstanceHandle); - ExFreePool(FullServiceName.Buffer); - ExFreePoolWithTag(Node, TAG_IO_DEVNODE); - return Status; - } + Node->ServiceName.MaximumLength = ServiceName1->Length + sizeof(UNICODE_NULL); + Node->ServiceName.Length = 0; + Node->ServiceName.Buffer = ExAllocatePool(PagedPool, Node->ServiceName.MaximumLength); + if (!Node->ServiceName.Buffer) + { + ZwClose(InstanceHandle); + ExFreePool(FullServiceName.Buffer); + ExFreePoolWithTag(Node, TAG_IO_DEVNODE); + return Status; + } - RtlCopyUnicodeString(&Node->ServiceName, ServiceName1); + RtlCopyUnicodeString(&Node->ServiceName, ServiceName1); - if (ServiceName) - { - RtlInitUnicodeString(&KeyName, L"Service"); - Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ServiceName->Buffer, ServiceName->Length + sizeof(UNICODE_NULL)); - } + if (ServiceName) + { + RtlInitUnicodeString(&KeyName, L"Service"); + Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ServiceName->Buffer, ServiceName->Length + sizeof(UNICODE_NULL)); + } - if (NT_SUCCESS(Status)) - { - RtlInitUnicodeString(&KeyName, L"Legacy"); - LegacyValue = 1; - Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue)); + if (NT_SUCCESS(Status)) + { + RtlInitUnicodeString(&KeyName, L"Legacy"); + LegacyValue = 1; + Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue)); - RtlInitUnicodeString(&KeyName, L"ConfigFlags"); - LegacyValue = 0; - ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue)); + RtlInitUnicodeString(&KeyName, L"ConfigFlags"); + LegacyValue = 0; + ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_DWORD, &LegacyValue, sizeof(LegacyValue)); - if (NT_SUCCESS(Status)) - { - RtlInitUnicodeString(&KeyName, L"Class"); - RtlInitUnicodeString(&ClassName, L"LegacyDriver"); - Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassName.Buffer, ClassName.Length + sizeof(UNICODE_NULL)); - if (NT_SUCCESS(Status)) - { - RtlInitUnicodeString(&KeyName, L"ClassGUID"); - RtlInitUnicodeString(&ClassGUID, L"{8ECC055D-047F-11D1-A537-0000F8753ED1}"); - Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassGUID.Buffer, ClassGUID.Length + sizeof(UNICODE_NULL)); - if (NT_SUCCESS(Status)) - { - // FIXME: Retrieve the real "description" by looking at the "DisplayName" string - // of the corresponding CurrentControlSet\Services\xxx entry for this driver. - RtlInitUnicodeString(&KeyName, L"DeviceDesc"); - Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ServiceName1->Buffer, ServiceName1->Length + sizeof(UNICODE_NULL)); - } - } - } - } + if (NT_SUCCESS(Status)) + { + RtlInitUnicodeString(&KeyName, L"Class"); + RtlInitUnicodeString(&ClassName, L"LegacyDriver"); + Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassName.Buffer, ClassName.Length + sizeof(UNICODE_NULL)); + if (NT_SUCCESS(Status)) + { + RtlInitUnicodeString(&KeyName, L"ClassGUID"); + RtlInitUnicodeString(&ClassGUID, L"{8ECC055D-047F-11D1-A537-0000F8753ED1}"); + Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ClassGUID.Buffer, ClassGUID.Length + sizeof(UNICODE_NULL)); + if (NT_SUCCESS(Status)) + { + // FIXME: Retrieve the real "description" by looking at the "DisplayName" string + // of the corresponding CurrentControlSet\Services\xxx entry for this driver. + RtlInitUnicodeString(&KeyName, L"DeviceDesc"); + Status = ZwSetValueKey(InstanceHandle, &KeyName, 0, REG_SZ, ServiceName1->Buffer, ServiceName1->Length + sizeof(UNICODE_NULL)); + } + } + } + } - ZwClose(InstanceHandle); - ExFreePool(FullServiceName.Buffer); + ZwClose(InstanceHandle); + ExFreePool(FullServiceName.Buffer); - if (!NT_SUCCESS(Status)) - { - ExFreePool(Node->ServiceName.Buffer); - ExFreePoolWithTag(Node, TAG_IO_DEVNODE); - return Status; - } + if (!NT_SUCCESS(Status)) + { + ExFreePool(Node->ServiceName.Buffer); + ExFreePoolWithTag(Node, TAG_IO_DEVNODE); + return Status; + } - IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER); - IopDeviceNodeSetFlag(Node, DNF_PROCESSED); - IopDeviceNodeSetFlag(Node, DNF_ADDED); - IopDeviceNodeSetFlag(Node, DNF_STARTED); - } + IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER); + IopDeviceNodeSetFlag(Node, DNF_PROCESSED); + IopDeviceNodeSetFlag(Node, DNF_ADDED); + IopDeviceNodeSetFlag(Node, DNF_STARTED); + } - Node->PhysicalDeviceObject = PhysicalDeviceObject; + Node->PhysicalDeviceObject = PhysicalDeviceObject; - ((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = Node; + ((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = Node; if (ParentNode) { @@ -1192,22 +1193,22 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode, PhysicalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; - *DeviceNode = Node; + *DeviceNode = Node; - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS IopFreeDeviceNode(PDEVICE_NODE DeviceNode) { - KIRQL OldIrql; - PDEVICE_NODE PrevSibling = NULL; + KIRQL OldIrql; + PDEVICE_NODE PrevSibling = NULL; - /* All children must be deleted before a parent is deleted */ - ASSERT(!DeviceNode->Child); - ASSERT(DeviceNode->PhysicalDeviceObject); + /* All children must be deleted before a parent is deleted */ + ASSERT(!DeviceNode->Child); + ASSERT(DeviceNode->PhysicalDeviceObject); - KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); + KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); /* Get previous sibling */ if (DeviceNode->Parent && DeviceNode->Parent->Child != DeviceNode) @@ -1234,36 +1235,36 @@ IopFreeDeviceNode(PDEVICE_NODE DeviceNode) if (PrevSibling) PrevSibling->Sibling = DeviceNode->Sibling; - KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); + KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); - RtlFreeUnicodeString(&DeviceNode->InstancePath); + RtlFreeUnicodeString(&DeviceNode->InstancePath); - RtlFreeUnicodeString(&DeviceNode->ServiceName); + RtlFreeUnicodeString(&DeviceNode->ServiceName); - if (DeviceNode->ResourceList) - { - ExFreePool(DeviceNode->ResourceList); - } + if (DeviceNode->ResourceList) + { + ExFreePool(DeviceNode->ResourceList); + } - if (DeviceNode->ResourceListTranslated) - { - ExFreePool(DeviceNode->ResourceListTranslated); - } + if (DeviceNode->ResourceListTranslated) + { + ExFreePool(DeviceNode->ResourceListTranslated); + } - if (DeviceNode->ResourceRequirements) - { - ExFreePool(DeviceNode->ResourceRequirements); - } + if (DeviceNode->ResourceRequirements) + { + ExFreePool(DeviceNode->ResourceRequirements); + } - if (DeviceNode->BootResources) - { - ExFreePool(DeviceNode->BootResources); - } + if (DeviceNode->BootResources) + { + ExFreePool(DeviceNode->BootResources); + } - ((PEXTENDED_DEVOBJ_EXTENSION)DeviceNode->PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = NULL; - ExFreePoolWithTag(DeviceNode, TAG_IO_DEVNODE); + ((PEXTENDED_DEVOBJ_EXTENSION)DeviceNode->PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode = NULL; + ExFreePoolWithTag(DeviceNode, TAG_IO_DEVNODE); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS @@ -1366,62 +1367,62 @@ IopInitiatePnpIrp(IN PDEVICE_OBJECT DeviceObject, NTSTATUS IopTraverseDeviceTreeNode(PDEVICETREE_TRAVERSE_CONTEXT Context) { - PDEVICE_NODE ParentDeviceNode; - PDEVICE_NODE ChildDeviceNode; - NTSTATUS Status; + PDEVICE_NODE ParentDeviceNode; + PDEVICE_NODE ChildDeviceNode; + NTSTATUS Status; - /* Copy context data so we don't overwrite it in subsequent calls to this function */ - ParentDeviceNode = Context->DeviceNode; + /* Copy context data so we don't overwrite it in subsequent calls to this function */ + ParentDeviceNode = Context->DeviceNode; - /* Call the action routine */ - Status = (Context->Action)(ParentDeviceNode, Context->Context); - if (!NT_SUCCESS(Status)) - { - return Status; - } + /* Call the action routine */ + Status = (Context->Action)(ParentDeviceNode, Context->Context); + if (!NT_SUCCESS(Status)) + { + return Status; + } - /* Traversal of all children nodes */ - for (ChildDeviceNode = ParentDeviceNode->Child; - ChildDeviceNode != NULL; - ChildDeviceNode = ChildDeviceNode->Sibling) - { - /* Pass the current device node to the action routine */ - Context->DeviceNode = ChildDeviceNode; + /* Traversal of all children nodes */ + for (ChildDeviceNode = ParentDeviceNode->Child; + ChildDeviceNode != NULL; + ChildDeviceNode = ChildDeviceNode->Sibling) + { + /* Pass the current device node to the action routine */ + Context->DeviceNode = ChildDeviceNode; - Status = IopTraverseDeviceTreeNode(Context); - if (!NT_SUCCESS(Status)) - { - return Status; - } - } + Status = IopTraverseDeviceTreeNode(Context); + if (!NT_SUCCESS(Status)) + { + return Status; + } + } - return Status; + return Status; } NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context) { - NTSTATUS Status; + NTSTATUS Status; - DPRINT("Context 0x%p\n", Context); + DPRINT("Context 0x%p\n", Context); - DPRINT("IopTraverseDeviceTree(DeviceNode 0x%p FirstDeviceNode 0x%p Action %p Context 0x%p)\n", - Context->DeviceNode, Context->FirstDeviceNode, Context->Action, Context->Context); + DPRINT("IopTraverseDeviceTree(DeviceNode 0x%p FirstDeviceNode 0x%p Action %p Context 0x%p)\n", + Context->DeviceNode, Context->FirstDeviceNode, Context->Action, Context->Context); - /* Start from the specified device node */ - Context->DeviceNode = Context->FirstDeviceNode; + /* Start from the specified device node */ + Context->DeviceNode = Context->FirstDeviceNode; - /* Recursively traverse the device tree */ - Status = IopTraverseDeviceTreeNode(Context); - if (Status == STATUS_UNSUCCESSFUL) - { - /* The action routine just wanted to terminate the traversal with status - code STATUS_SUCCESS */ - Status = STATUS_SUCCESS; - } + /* Recursively traverse the device tree */ + Status = IopTraverseDeviceTreeNode(Context); + if (Status == STATUS_UNSUCCESSFUL) + { + /* The action routine just wanted to terminate the traversal with status + code STATUS_SUCCESS */ + Status = STATUS_SUCCESS; + } - return Status; + return Status; } @@ -1533,99 +1534,99 @@ NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - HANDLE LogConfKey; - ULONG ResCount; - ULONG ResultLength; - NTSTATUS Status; - HANDLE ControlHandle; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + HANDLE LogConfKey; + ULONG ResCount; + ULONG ResultLength; + NTSTATUS Status; + HANDLE ControlHandle; - DPRINT("IopSetDeviceInstanceData() called\n"); + DPRINT("IopSetDeviceInstanceData() called\n"); - /* Create the 'LogConf' key */ - RtlInitUnicodeString(&KeyName, L"LogConf"); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, - InstanceKey, - NULL); - Status = ZwCreateKey(&LogConfKey, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_VOLATILE, - NULL); - if (NT_SUCCESS(Status)) - { - /* Set 'BootConfig' value */ - if (DeviceNode->BootResources != NULL) - { - ResCount = DeviceNode->BootResources->Count; - if (ResCount != 0) - { - RtlInitUnicodeString(&KeyName, L"BootConfig"); + /* Create the 'LogConf' key */ + RtlInitUnicodeString(&KeyName, L"LogConf"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + InstanceKey, + NULL); + Status = ZwCreateKey(&LogConfKey, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + NULL); + if (NT_SUCCESS(Status)) + { + /* Set 'BootConfig' value */ + if (DeviceNode->BootResources != NULL) + { + ResCount = DeviceNode->BootResources->Count; + if (ResCount != 0) + { + RtlInitUnicodeString(&KeyName, L"BootConfig"); + Status = ZwSetValueKey(LogConfKey, + &KeyName, + 0, + REG_RESOURCE_LIST, + DeviceNode->BootResources, + PnpDetermineResourceListSize(DeviceNode->BootResources)); + } + } + + /* Set 'BasicConfigVector' value */ + if (DeviceNode->ResourceRequirements != NULL && + DeviceNode->ResourceRequirements->ListSize != 0) + { + RtlInitUnicodeString(&KeyName, L"BasicConfigVector"); Status = ZwSetValueKey(LogConfKey, &KeyName, 0, - REG_RESOURCE_LIST, - DeviceNode->BootResources, - PnpDetermineResourceListSize(DeviceNode->BootResources)); - } - } - - /* Set 'BasicConfigVector' value */ - if (DeviceNode->ResourceRequirements != NULL && - DeviceNode->ResourceRequirements->ListSize != 0) - { - RtlInitUnicodeString(&KeyName, L"BasicConfigVector"); - Status = ZwSetValueKey(LogConfKey, - &KeyName, - 0, - REG_RESOURCE_REQUIREMENTS_LIST, - DeviceNode->ResourceRequirements, - DeviceNode->ResourceRequirements->ListSize); - } + REG_RESOURCE_REQUIREMENTS_LIST, + DeviceNode->ResourceRequirements, + DeviceNode->ResourceRequirements->ListSize); + } - ZwClose(LogConfKey); - } + ZwClose(LogConfKey); + } - /* Set the 'ConfigFlags' value */ - RtlInitUnicodeString(&KeyName, L"ConfigFlags"); - Status = ZwQueryValueKey(InstanceKey, - &KeyName, - KeyValueBasicInformation, - NULL, - 0, - &ResultLength); - if (Status == STATUS_OBJECT_NAME_NOT_FOUND) - { - /* Write the default value */ - ULONG DefaultConfigFlags = 0; - Status = ZwSetValueKey(InstanceKey, - &KeyName, - 0, - REG_DWORD, - &DefaultConfigFlags, - sizeof(DefaultConfigFlags)); - } + /* Set the 'ConfigFlags' value */ + RtlInitUnicodeString(&KeyName, L"ConfigFlags"); + Status = ZwQueryValueKey(InstanceKey, + &KeyName, + KeyValueBasicInformation, + NULL, + 0, + &ResultLength); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + /* Write the default value */ + ULONG DefaultConfigFlags = 0; + Status = ZwSetValueKey(InstanceKey, + &KeyName, + 0, + REG_DWORD, + &DefaultConfigFlags, + sizeof(DefaultConfigFlags)); + } - /* Create the 'Control' key */ - RtlInitUnicodeString(&KeyName, L"Control"); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, - InstanceKey, - NULL); - Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); + /* Create the 'Control' key */ + RtlInitUnicodeString(&KeyName, L"Control"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + InstanceKey, + NULL); + Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL); - if (NT_SUCCESS(Status)) - ZwClose(ControlHandle); + if (NT_SUCCESS(Status)) + ZwClose(ControlHandle); - DPRINT("IopSetDeviceInstanceData() done\n"); + DPRINT("IopSetDeviceInstanceData() done\n"); - return Status; + return Status; } /* @@ -1756,10 +1757,10 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode, cleanup: if (NT_SUCCESS(Status)) { - /* Duplicate the string to return it */ - Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, - &KeyValue, - ParentIdPrefix); + /* Duplicate the string to return it */ + Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, + &KeyValue, + ParentIdPrefix); } ExFreePoolWithTag(ParentIdPrefixInformation, TAG_IO); RtlFreeUnicodeString(&KeyName); @@ -1860,134 +1861,133 @@ ErrorExit: // FIXME logging return FALSE; } - + NTSTATUS IopQueryHardwareIds(PDEVICE_NODE DeviceNode, HANDLE InstanceKey) { - IO_STACK_LOCATION Stack; - IO_STATUS_BLOCK IoStatusBlock; - PWSTR Ptr; - UNICODE_STRING ValueName; - NTSTATUS Status; - ULONG Length, TotalLength; - BOOLEAN IsValidID; + IO_STACK_LOCATION Stack; + IO_STATUS_BLOCK IoStatusBlock; + PWSTR Ptr; + UNICODE_STRING ValueName; + NTSTATUS Status; + ULONG Length, TotalLength; + BOOLEAN IsValidID; - DPRINT("Sending IRP_MN_QUERY_ID.BusQueryHardwareIDs to device stack\n"); + DPRINT("Sending IRP_MN_QUERY_ID.BusQueryHardwareIDs to device stack\n"); - RtlZeroMemory(&Stack, sizeof(Stack)); - Stack.Parameters.QueryId.IdType = BusQueryHardwareIDs; - Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject, - &IoStatusBlock, - IRP_MN_QUERY_ID, - &Stack); - if (NT_SUCCESS(Status)) - { - IsValidID = IopValidateID((PWCHAR)IoStatusBlock.Information, BusQueryHardwareIDs); + RtlZeroMemory(&Stack, sizeof(Stack)); + Stack.Parameters.QueryId.IdType = BusQueryHardwareIDs; + Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject, + &IoStatusBlock, + IRP_MN_QUERY_ID, + &Stack); + if (NT_SUCCESS(Status)) + { + IsValidID = IopValidateID((PWCHAR)IoStatusBlock.Information, BusQueryHardwareIDs); - if (!IsValidID) - { - DPRINT1("Invalid HardwareIDs. DeviceNode - %p\n", DeviceNode); - } + if (!IsValidID) + { + DPRINT1("Invalid HardwareIDs. DeviceNode - %p\n", DeviceNode); + } - TotalLength = 0; + TotalLength = 0; - Ptr = (PWSTR)IoStatusBlock.Information; - DPRINT("Hardware IDs:\n"); - while (*Ptr) - { - DPRINT(" %S\n", Ptr); - Length = (ULONG)wcslen(Ptr) + 1; + Ptr = (PWSTR)IoStatusBlock.Information; + DPRINT("Hardware IDs:\n"); + while (*Ptr) + { + DPRINT(" %S\n", Ptr); + Length = (ULONG)wcslen(Ptr) + 1; - Ptr += Length; - TotalLength += Length; - } - DPRINT("TotalLength: %hu\n", TotalLength); - DPRINT("\n"); - - RtlInitUnicodeString(&ValueName, L"HardwareID"); - Status = ZwSetValueKey(InstanceKey, - &ValueName, - 0, - REG_MULTI_SZ, - (PVOID)IoStatusBlock.Information, - (TotalLength + 1) * sizeof(WCHAR)); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status); - } - } - else - { - DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); - } + Ptr += Length; + TotalLength += Length; + } + DPRINT("TotalLength: %hu\n", TotalLength); + DPRINT("\n"); - return Status; + RtlInitUnicodeString(&ValueName, L"HardwareID"); + Status = ZwSetValueKey(InstanceKey, + &ValueName, + 0, + REG_MULTI_SZ, + (PVOID)IoStatusBlock.Information, + (TotalLength + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status); + } + } + else + { + DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); + } + + return Status; } NTSTATUS IopQueryCompatibleIds(PDEVICE_NODE DeviceNode, HANDLE InstanceKey) { - IO_STACK_LOCATION Stack; - IO_STATUS_BLOCK IoStatusBlock; - PWSTR Ptr; - UNICODE_STRING ValueName; - NTSTATUS Status; - ULONG Length, TotalLength; - BOOLEAN IsValidID; - - DPRINT("Sending IRP_MN_QUERY_ID.BusQueryCompatibleIDs to device stack\n"); - - RtlZeroMemory(&Stack, sizeof(Stack)); - Stack.Parameters.QueryId.IdType = BusQueryCompatibleIDs; - Status = IopInitiatePnpIrp( - DeviceNode->PhysicalDeviceObject, - &IoStatusBlock, - IRP_MN_QUERY_ID, - &Stack); - if (NT_SUCCESS(Status) && IoStatusBlock.Information) - { - IsValidID = IopValidateID((PWCHAR)IoStatusBlock.Information, BusQueryCompatibleIDs); + IO_STACK_LOCATION Stack; + IO_STATUS_BLOCK IoStatusBlock; + PWSTR Ptr; + UNICODE_STRING ValueName; + NTSTATUS Status; + ULONG Length, TotalLength; + BOOLEAN IsValidID; - if (!IsValidID) - { - DPRINT1("Invalid CompatibleIDs. DeviceNode - %p\n", DeviceNode); - } + DPRINT("Sending IRP_MN_QUERY_ID.BusQueryCompatibleIDs to device stack\n"); - TotalLength = 0; + RtlZeroMemory(&Stack, sizeof(Stack)); + Stack.Parameters.QueryId.IdType = BusQueryCompatibleIDs; + Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject, + &IoStatusBlock, + IRP_MN_QUERY_ID, + &Stack); + if (NT_SUCCESS(Status) && IoStatusBlock.Information) + { + IsValidID = IopValidateID((PWCHAR)IoStatusBlock.Information, BusQueryCompatibleIDs); - Ptr = (PWSTR)IoStatusBlock.Information; - DPRINT("Compatible IDs:\n"); - while (*Ptr) - { - DPRINT(" %S\n", Ptr); - Length = (ULONG)wcslen(Ptr) + 1; + if (!IsValidID) + { + DPRINT1("Invalid CompatibleIDs. DeviceNode - %p\n", DeviceNode); + } - Ptr += Length; - TotalLength += Length; - } - DPRINT("TotalLength: %hu\n", TotalLength); - DPRINT("\n"); + TotalLength = 0; - RtlInitUnicodeString(&ValueName, L"CompatibleIDs"); - Status = ZwSetValueKey(InstanceKey, - &ValueName, - 0, - REG_MULTI_SZ, - (PVOID)IoStatusBlock.Information, - (TotalLength + 1) * sizeof(WCHAR)); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwSetValueKey() failed (Status %lx) or no Compatible ID returned\n", Status); - } - } - else - { - DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); - } + Ptr = (PWSTR)IoStatusBlock.Information; + DPRINT("Compatible IDs:\n"); + while (*Ptr) + { + DPRINT(" %S\n", Ptr); + Length = (ULONG)wcslen(Ptr) + 1; - return Status; + Ptr += Length; + TotalLength += Length; + } + DPRINT("TotalLength: %hu\n", TotalLength); + DPRINT("\n"); + + RtlInitUnicodeString(&ValueName, L"CompatibleIDs"); + Status = ZwSetValueKey(InstanceKey, + &ValueName, + 0, + REG_MULTI_SZ, + (PVOID)IoStatusBlock.Information, + (TotalLength + 1) * sizeof(WCHAR)); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwSetValueKey() failed (Status %lx) or no Compatible ID returned\n", Status); + } + } + else + { + DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); + } + + return Status; } NTSTATUS
6 years, 3 months
1
0
0
0
02/02: [KMTESTS:CC] Add tests for CcCopyRead that reproduce CORE-15067
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=351ae6b2b4a7d6b8aa0b6…
commit 351ae6b2b4a7d6b8aa0b6b03cf460aa078c5cdb4 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Sep 21 08:35:38 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Sep 21 08:37:20 2018 +0200 [KMTESTS:CC] Add tests for CcCopyRead that reproduce CORE-15067 CORE-15067 --- modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c | 19 +++++++++++++++++-- modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c | 12 ++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c b/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c index 142e996548..831bf5c252 100644 --- a/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c @@ -15,6 +15,7 @@ typedef struct _TEST_FCB FSRTL_ADVANCED_FCB_HEADER Header; SECTION_OBJECT_POINTERS SectionObjectPointers; FAST_MUTEX HeaderMutex; + BOOLEAN BigFile; } TEST_FCB, *PTEST_FCB; static PFILE_OBJECT TestFileObject; @@ -184,6 +185,7 @@ TestIrpHandler( RtlZeroMemory(Fcb, sizeof(*Fcb)); ExInitializeFastMutex(&Fcb->HeaderMutex); FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex); + Fcb->BigFile = FALSE; if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) && IoStack->FileObject->FileName.Buffer[1] == 'B') { @@ -205,6 +207,14 @@ TestIrpHandler( Fcb->Header.FileSize.QuadPart = 62; Fcb->Header.ValidDataLength.QuadPart = 62; } + else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) && + IoStack->FileObject->FileName.Buffer[1] == 'F') + { + Fcb->Header.AllocationSize.QuadPart = 4294967296; + Fcb->Header.FileSize.QuadPart = 4294967296; + Fcb->Header.ValidDataLength.QuadPart = 4294967296; + Fcb->BigFile = TRUE; + } else { Fcb->Header.AllocationSize.QuadPart = 512; @@ -239,8 +249,13 @@ TestIrpHandler( if (!FlagOn(Irp->Flags, IRP_NOCACHE)) { ok_irql(PASSIVE_LEVEL); - ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n", Offset.QuadPart); - ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length); + + /* We don't want to test alignement for big files (not the purpose of the test) */ + if (!Fcb->BigFile) + { + ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n", Offset.QuadPart); + ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length); + } Buffer = Irp->AssociatedIrp.SystemBuffer; ok(Buffer != NULL, "Null pointer!\n"); diff --git a/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c b/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c index 1dbc08a5ce..f29495b7a2 100644 --- a/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcCopyRead_user.c @@ -18,6 +18,7 @@ START_TEST(CcCopyRead) UNICODE_STRING BigAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\BigAlignmentTest"); UNICODE_STRING SmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\SmallAlignmentTest"); UNICODE_STRING ReallySmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\ReallySmallAlignmentTest"); + UNICODE_STRING FileBig = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\FileBig"); KmtLoadDriver(L"CcCopyRead", FALSE); KmtOpenDriver(); @@ -89,6 +90,17 @@ START_TEST(CcCopyRead) NtClose(Handle); + InitializeObjectAttributes(&ObjectAttributes, &FileBig, OBJ_CASE_INSENSITIVE, NULL, NULL); + Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT); + ok_eq_hex(Status, STATUS_SUCCESS); + + ByteOffset.QuadPart = 0; + Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 1024, &ByteOffset, NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA); + + NtClose(Handle); + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer); KmtCloseDriver(); KmtUnloadDriver();
6 years, 3 months
1
0
0
0
01/02: [NTOSKRNL] Avoid integer overflow when computing VACB read/write size
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=15a3ca08b045941efdb49…
commit 15a3ca08b045941efdb49f15ec71beb41eb777f2 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Sep 21 08:31:05 2018 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Fri Sep 21 08:37:20 2018 +0200 [NTOSKRNL] Avoid integer overflow when computing VACB read/write size This could be triggered when attempting to read/write to really big files. It was causing an attempt to read 0 bytes in Cc, leading to asserts failure in the kernel (and corrupted file). CORE-15067 --- ntoskrnl/cc/copy.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ntoskrnl/cc/copy.c b/ntoskrnl/cc/copy.c index a46ed96640..78c6553d8a 100644 --- a/ntoskrnl/cc/copy.c +++ b/ntoskrnl/cc/copy.c @@ -86,12 +86,14 @@ CcReadVirtualAddress ( NTSTATUS Status; IO_STATUS_BLOCK IoStatus; KEVENT Event; + ULARGE_INTEGER LargeSize; - Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart); - if (Size > VACB_MAPPING_GRANULARITY) + LargeSize.QuadPart = Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart; + if (LargeSize.QuadPart > VACB_MAPPING_GRANULARITY) { - Size = VACB_MAPPING_GRANULARITY; + LargeSize.QuadPart = VACB_MAPPING_GRANULARITY; } + Size = LargeSize.LowPart; Pages = BYTES_TO_PAGES(Size); ASSERT(Pages * PAGE_SIZE <= VACB_MAPPING_GRANULARITY); @@ -155,12 +157,14 @@ CcWriteVirtualAddress ( NTSTATUS Status; IO_STATUS_BLOCK IoStatus; KEVENT Event; + ULARGE_INTEGER LargeSize; - Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart); - if (Size > VACB_MAPPING_GRANULARITY) + LargeSize.QuadPart = Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart; + if (LargeSize.QuadPart > VACB_MAPPING_GRANULARITY) { - Size = VACB_MAPPING_GRANULARITY; + LargeSize.QuadPart = VACB_MAPPING_GRANULARITY; } + Size = LargeSize.LowPart; // // Nonpaged pool PDEs in ReactOS must actually be synchronized between the // MmGlobalPageDirectory and the real system PDE directory. What a mess...
6 years, 3 months
1
0
0
0
01/01: [WIN32K:NTUSER] Fix WIN32K BSOD mentioned in CORE-15027
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef016bfe0a9dc3cc79246…
commit ef016bfe0a9dc3cc7924671277b44884e39d89d5 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Fri Sep 21 03:04:31 2018 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Fri Sep 21 03:04:31 2018 +0200 [WIN32K:NTUSER] Fix WIN32K BSOD mentioned in CORE-15027 Fixes accessing nullptr / invalid handle in Window->SystemMenu I could trigger this occasionally when moving Opera 12.18 window in front of Spotify 1.0.29.92 window. Fix was: authored by Thomas Faber (Thank you!) tested by me reviewed by James Tabor --- win32ss/user/ntuser/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c index 1e29d1d178..48d9dcc169 100644 --- a/win32ss/user/ntuser/menu.c +++ b/win32ss/user/ntuser/menu.c @@ -5181,7 +5181,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert) else { Menu = Window->SystemMenu ? UserGetMenuObject(Window->SystemMenu) : NULL; - if ((!Window->SystemMenu || Menu->fFlags & MNF_SYSDESKMN) && Window->style & WS_SYSMENU) + if ((!Menu || Menu->fFlags & MNF_SYSDESKMN) && Window->style & WS_SYSMENU) { Menu = MENU_GetSystemMenu(Window, NULL); Window->SystemMenu = Menu ? UserHMGetHandle(Menu) : NULL;
6 years, 3 months
1
0
0
0
01/01: [BTHCI] Add a bluetooth class installer stub.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8f83d4d4d4b1ccb62a3b…
commit f8f83d4d4d4b1ccb62a3bdc931bc62466932d925 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Thu Sep 20 17:53:08 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Thu Sep 20 17:53:08 2018 +0200 [BTHCI] Add a bluetooth class installer stub. Now we really need a tango-compatible bluetooth icon! --- dll/win32/CMakeLists.txt | 1 + dll/win32/bthci/CMakeLists.txt | 11 +++++++++ dll/win32/bthci/bthci.c | 56 ++++++++++++++++++++++++++++++++++++++++++ dll/win32/bthci/bthci.rc | 23 +++++++++++++++++ dll/win32/bthci/bthci.spec | 1 + media/inf/bth.inf | 10 ++++++-- 6 files changed, 100 insertions(+), 2 deletions(-) diff --git a/dll/win32/CMakeLists.txt b/dll/win32/CMakeLists.txt index 91407c7d04..917c43d06d 100644 --- a/dll/win32/CMakeLists.txt +++ b/dll/win32/CMakeLists.txt @@ -16,6 +16,7 @@ add_subdirectory(batt) add_subdirectory(bcrypt) add_subdirectory(beepmidi) add_subdirectory(browseui) +add_subdirectory(bthci) add_subdirectory(cabinet) add_subdirectory(cards) add_subdirectory(cfgmgr32) diff --git a/dll/win32/bthci/CMakeLists.txt b/dll/win32/bthci/CMakeLists.txt new file mode 100644 index 0000000000..f8de46d10e --- /dev/null +++ b/dll/win32/bthci/CMakeLists.txt @@ -0,0 +1,11 @@ + +spec2def(bthci.dll bthci.spec) + +add_library(bthci SHARED + bthci.c + bthci.rc + ${CMAKE_CURRENT_BINARY_DIR}/bthci.def) + +set_module_type(bthci win32dll UNICODE) +add_importlibs(bthci msvcrt kernel32 ntdll) +add_cd_file(TARGET bthci DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/bthci/bthci.c b/dll/win32/bthci/bthci.c new file mode 100644 index 0000000000..f2e0bc48a3 --- /dev/null +++ b/dll/win32/bthci/bthci.c @@ -0,0 +1,56 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+
) + * PURPOSE: Bluetooth Class installer + * COPYRIGHT: Copyright 2018 Eric Kohl (eric.kohl(a)reactos.org) + */ + +#define WIN32_NO_STATUS +#include <stdarg.h> +#include <windef.h> +#include <winbase.h> +#include <winreg.h> +#include <winuser.h> +#include <setupapi.h> + +#define NDEBUG +#include <debug.h> + + +DWORD +WINAPI +BluetoothClassInstaller( + _In_ DI_FUNCTION InstallFunction, + _In_ HDEVINFO DeviceInfoSet, + _In_ PSP_DEVINFO_DATA DeviceInfoData OPTIONAL) +{ + switch (InstallFunction) + { + default: + DPRINT1("Install function %u\n", InstallFunction); + return ERROR_DI_DO_DEFAULT; + } +} + + +BOOL +WINAPI +DllMain( + _In_ HINSTANCE hinstDll, + _In_ DWORD dwReason, + _In_ LPVOID reserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDll); + break; + + case DLL_PROCESS_DETACH: + break; + } + + return TRUE; +} + +/* EOF */ diff --git a/dll/win32/bthci/bthci.rc b/dll/win32/bthci/bthci.rc new file mode 100644 index 0000000000..eaef1c4d08 --- /dev/null +++ b/dll/win32/bthci/bthci.rc @@ -0,0 +1,23 @@ +#include <windef.h> +#include <winuser.h> + +//#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Bluetooth Class Installer" +#define REACTOS_STR_INTERNAL_NAME "bthci" +#define REACTOS_STR_ORIGINAL_FILENAME "bthci.dll" + +#include <reactos/version.rc> +#include <reactos/manifest_dll.rc> + +//IDI_BLUETOOTH ICON "resources/bluetooth.ico" + +/* UTF-8 */ +#pragma code_page(65001) + +//#ifdef LANGUAGE_EN_US +// #include "lang/en-US.rc" +//#endif diff --git a/dll/win32/bthci/bthci.spec b/dll/win32/bthci/bthci.spec new file mode 100644 index 0000000000..988207133b --- /dev/null +++ b/dll/win32/bthci/bthci.spec @@ -0,0 +1 @@ +1 stdcall BluetoothClassInstaller(long ptr ptr) diff --git a/media/inf/bth.inf b/media/inf/bth.inf index 22960239c0..35f9be39cd 100644 --- a/media/inf/bth.inf +++ b/media/inf/bth.inf @@ -6,17 +6,23 @@ Provider=%ReactOS% DriverVer=03/27/2012,1.0.0 [DestinationDirs] -DefaultDestDir = 12 +DefaultDestDir = 11 +BluetoothClass.NT.Files = 11 +FreeBT.Files = 12 [ClassInstall32.NT] AddReg=BluetoothClass.NT.AddReg +CopyFiles=BluetoothClass.NT.Files [BluetoothClass.NT.AddReg] HKR, , , 0, %BluetoothClassName% HKR, , NoInstallClass, 0, 1 -;HKR,,Installer32,,"bthci.dll,BluetoothClassInstaller" +HKR, , Installer32, , "bthci.dll,BluetoothClassInstaller" ;HKR, , Icon, 0, "201" +[BluetoothClass.NT.Files] +bthci.dll + [Manufacturer] %ReactOS%=ReactOS
6 years, 3 months
1
0
0
0
01/01: [INF] Add german translation to the bluetooth class inf file.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1ac5f1ab8941b973fd3d3…
commit 1ac5f1ab8941b973fd3d308a95a77a724ceb943f Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Thu Sep 20 13:52:03 2018 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Thu Sep 20 13:52:03 2018 +0200 [INF] Add german translation to the bluetooth class inf file. --- media/inf/bth.inf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media/inf/bth.inf b/media/inf/bth.inf index 395587459d..22960239c0 100644 --- a/media/inf/bth.inf +++ b/media/inf/bth.inf @@ -60,6 +60,10 @@ BluetoothClassName="Bluetooth Radios" BTUSB.DeviceDesc="Obecný USB Bluetooth vysílač" BluetoothClassName="Bluetooth vysílače" +[Strings.0407] +BTUSB.DeviceDesc="USB-Treiber für Bluetooth-Funkgerät" +BluetoothClassName="Bluetooth Funkgeräte" + [Strings.0a] ReactOS = "Equipo de ReactOS" BTUSB.DeviceDesc="Radio Bluetooth USB genérica"
6 years, 3 months
1
0
0
0
01/01: [DWNL] forgot this file
by Robert Naumann
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3aeae65e083ba043e00d2…
commit 3aeae65e083ba043e00d2359e4fad2e97410ace7 Author: Robert Naumann <gonzomdx(a)gmail.com> AuthorDate: Thu Sep 20 09:20:14 2018 +0200 Commit: Robert Naumann <gonzomdx(a)gmail.com> CommitDate: Thu Sep 20 09:20:14 2018 +0200 [DWNL] forgot this file --- base/applications/network/dwnl/dwnl.rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/applications/network/dwnl/dwnl.rc b/base/applications/network/dwnl/dwnl.rc index 1981bc067b..5917869230 100644 --- a/base/applications/network/dwnl/dwnl.rc +++ b/base/applications/network/dwnl/dwnl.rc @@ -11,6 +11,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL /* UTF-8 */ #pragma code_page(65001) +#ifdef LANGUAGE_DE_DE + #include "lang/de-DE.rc" +#endif #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" #endif
6 years, 3 months
1
0
0
0
01/01: [DWNL] German translation
by Robert Naumann
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=abdd8bf2dfbe8affdda9a…
commit abdd8bf2dfbe8affdda9aef5a904e48733716b54 Author: Robert Naumann <gonzomdx(a)gmail.com> AuthorDate: Thu Sep 20 09:16:22 2018 +0200 Commit: Robert Naumann <gonzomdx(a)gmail.com> CommitDate: Thu Sep 20 09:16:22 2018 +0200 [DWNL] German translation --- base/applications/network/dwnl/lang/de-DE.rc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/base/applications/network/dwnl/lang/de-DE.rc b/base/applications/network/dwnl/lang/de-DE.rc new file mode 100644 index 0000000000..5ba7c2ea1c --- /dev/null +++ b/base/applications/network/dwnl/lang/de-DE.rc @@ -0,0 +1,25 @@ +LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_USAGE "Benutzung: dwnl URL [ZIEL]\n" + IDS_RESOLVING "Löst %s auf... " + IDS_DONE "erledigt.\n" + IDS_LENGTH_FULL "Länge: %I64u [%s]\n" + IDS_LENGTH "Länge: %I64u\n" + IDS_FILE_SAVED "\nDatei gespeichert.\n" + IDS_CONNECTING_TO_FULL "Verbindet mit %s [%s]... " + IDS_CONNECTING_TO "Verbindet mit %s... " + IDS_REDIRECTING_TO "Leitet an %s weiter... " + IDS_SEND_REQUEST "Sendet Anfrage... " + IDS_BYTES_DOWNLOADED "%I64u bytes heruntergeladen" + IDS_BYTES_DOWNLOADED_FULL "%2d%% (%I64u byte(s) heruntergeladen)" +END + +STRINGTABLE +BEGIN + IDS_ERROR_DOWNLOAD "\nFEHLER: Download fehlgeschlagen.\n" + IDS_ERROR_CODE "\nFEHLER: %u\n" + IDS_ERROR_FILENAME "\nFEHLER: Dateiname kann nicht ermittelt werden, bitte geben Sie einen Ziel-Dateinamen an.\n" + IDS_ERROR_PROTOCOL "\nFEHLER: Nicht unterstütztes Protokoll.\n" +END
6 years, 3 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
23
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
Results per page:
10
25
50
100
200