Author: janderwald
Date: Sun Nov 17 14:51:06 2013
New Revision: 61017
URL: http://svn.reactos.org/svn/reactos?rev=61017&view=rev
Log:
- stop enumeration of mixer controls when there is more than one item
- fixes vmware audio driver hangs
- needs more work
- patch by David Quintana
CORE-7488 #resolve #comment thanks for the patch
Modified:
trunk/reactos/lib/drivers/sound/mmixer/controls.c
Modified: trunk/reactos/lib/drivers/sound/mmixer/controls.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] Sun Nov 17 14:51:06 2013
@@ -513,8 +513,12 @@
/* get next nodes upstream */
MMixerGetNextNodesFromNodeIndex(MixerContext, Topology, NodeIndex, bUpStream, &NodesCount, Nodes);
- /* assume there is a node connected */
- ASSERT(NodesCount != 0);
+ if (NodesCount != 1)
+ {
+ DPRINT("PinId %lu bInputMixer %lu bUpStream %lu NodeIndex %lu is not connected", PinId, bInputMixer, bUpStream, NodeIndex);
+ break;
+ }
+
ASSERT(NodesCount == 1);
/* use first index */
Author: tkreuzer
Date: Sat Nov 16 18:27:26 2013
New Revision: 61011
URL: http://svn.reactos.org/svn/reactos?rev=61011&view=rev
Log:
[RTL]
Fix RtlWriteRegistryValue, it closed the handle passed to it instead of checking for RTL_REGISTRY_HANDLE flag.
[NTOSKRNL]
Fix PnpRootCreateDevice, which was relying on the broken RtlWriteRegistryValue by aborting, when it *succeeded* to create a registry key, instead of when it failed.
Also use kernel handles and ObCloseHandle.
Modified:
trunk/reactos/lib/rtl/registry.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
Modified: trunk/reactos/lib/rtl/registry.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/registry.c?rev=610…
==============================================================================
--- trunk/reactos/lib/rtl/registry.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/registry.c [iso-8859-1] Sat Nov 16 18:27:26 2013
@@ -661,8 +661,13 @@
ValueData,
ValueLength);
- /* All went well, close the handle and return status */
- ZwClose(KeyHandle);
+ /* Did the caller pass a key handle? */
+ if (!(RelativeTo & RTL_REGISTRY_HANDLE))
+ {
+ /* We opened the key in RtlpGetRegistryHandle, so close it now */
+ ZwClose(KeyHandle);
+ }
+
return 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] Sat Nov 16 18:27:26 2013
@@ -227,9 +227,13 @@
Status = IopOpenRegistryKeyEx(&EnumHandle, NULL, &EnumKeyName, KEY_READ);
if (NT_SUCCESS(Status))
{
- InitializeObjectAttributes(&ObjectAttributes, &Device->DeviceID, OBJ_CASE_INSENSITIVE, EnumHandle, NULL);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Device->DeviceID,
+ OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
+ EnumHandle,
+ NULL);
Status = ZwCreateKey(&DeviceKeyHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
- ZwClose(EnumHandle);
+ ObCloseHandle(EnumHandle, KernelMode);
}
if (!NT_SUCCESS(Status))
@@ -298,16 +302,20 @@
}
/* Finish creating the instance path in the registry */
- InitializeObjectAttributes(&ObjectAttributes, &Device->InstanceID, OBJ_CASE_INSENSITIVE, DeviceKeyHandle, NULL);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &Device->InstanceID,
+ OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
+ DeviceKeyHandle,
+ NULL);
Status = ZwCreateKey(&InstanceKeyHandle, KEY_QUERY_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
- if (NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to create instance path (0x%x)\n", Status);
goto cleanup;
}
/* Just close the handle */
- ZwClose(InstanceKeyHandle);
+ ObCloseHandle(InstanceKeyHandle, KernelMode);
if (FullInstancePath)
{
@@ -370,7 +378,7 @@
ExFreePoolWithTag(Device, TAG_PNP_ROOT);
}
if (DeviceKeyHandle != INVALID_HANDLE_VALUE)
- ZwClose(DeviceKeyHandle);
+ ObCloseHandle(DeviceKeyHandle, KernelMode);
return Status;
}