mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[HDAUDBUS] Build a device instance ID from Codec & node number. CORE-13702
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user