mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[HDAUDBUS] Build a device instance ID from Codec & node number. CORE-13702
This commit is contained in:
parent
96ee4509e5
commit
6ec38aa942
2 changed files with 13 additions and 6 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <initguid.h>
|
||||
#include <hdaudio.h>
|
||||
#include <stdio.h>
|
||||
#include <ntstrsafe.h>
|
||||
|
||||
#define TAG_HDA 'bADH'
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ HDA_PDOQueryId(
|
|||
PHDA_PDO_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG Length;
|
||||
LPWSTR Device;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* get device extension */
|
||||
DeviceExtension = (PHDA_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
|
@ -78,18 +79,23 @@ HDA_PDOQueryId(
|
|||
|
||||
if (IoStack->Parameters.QueryId.IdType == BusQueryInstanceID)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
|
||||
// FIXME
|
||||
swprintf(DeviceName, L"%08x", 1);
|
||||
Length = wcslen(DeviceName) + 20;
|
||||
Status = RtlStringCbPrintfW(DeviceName,
|
||||
sizeof(DeviceName),
|
||||
L"%02x%02x",
|
||||
DeviceExtension->Codec->Addr,
|
||||
DeviceExtension->AudioGroup->NodeId);
|
||||
NT_ASSERT(NT_SUCCESS(Status));
|
||||
Length = wcslen(DeviceName) + 1;
|
||||
|
||||
/* allocate result buffer*/
|
||||
Device = (LPWSTR)AllocateItem(PagedPool, Length * sizeof(WCHAR));
|
||||
if (!Device)
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
swprintf(Device, L"%08x", 1);
|
||||
Status = RtlStringCbCopyW(Device,
|
||||
Length * sizeof(WCHAR),
|
||||
DeviceName);
|
||||
NT_ASSERT(NT_SUCCESS(Status));
|
||||
|
||||
DPRINT1("ID: %S\n", Device);
|
||||
/* store result */
|
||||
|
|
Loading…
Reference in a new issue