ReactOS 0.4.16-dev-1946-g52006dd
ResourceNode.cpp
Go to the documentation of this file.
1/*
2* PROJECT: ReactOS Device Manager
3* LICENSE: GPL - See COPYING in the top level directory
4* FILE: dll/win32/devmgr/devmgmt/ResourceNode.cpp
5* PURPOSE: Class object for
6* COPYRIGHT: Copyright 2025 Eric Kohl <ekohl@reactos.org>
7*
8*/
9
10#include "precomp.h"
11#include "restypes.h"
12#include "devmgmt.h"
13#include "ResourceNode.h"
14
15
20 ) :
22{
23 WCHAR szDetail[200];
25 ULONG ulLength;
26
27 m_DeviceId = Node->GetDeviceId();
28 m_ClassImage = Node->GetClassImage();
29
30 ulLength = sizeof(szDescription);
33 NULL,
35 &ulLength,
36 0);
37
39 {
40 wsprintf(szDetail, L"(%s) 0x%08x (%d) %s",
41 (Descriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED) ? L"ISA" : L"PCI",
42 Descriptor->u.Interrupt.Level, Descriptor->u.Interrupt.Vector,
45 }
46 else if (Descriptor->Type == CmResourceTypePort)
47 {
48 wsprintf(szDetail, L"[%08lx - %08lx] %s",
49 Descriptor->u.Port.Start.LowPart, Descriptor->u.Port.Start.LowPart + Descriptor->u.Port.Length - 1,
52 }
53 else if (Descriptor->Type == CmResourceTypeMemory)
54 {
55 wsprintf(szDetail, L"[%08I64x - %08I64x] %s",
56 Descriptor->u.Memory.Start.QuadPart, Descriptor->u.Memory.Start.QuadPart + Descriptor->u.Memory.Length - 1,
59 }
60 else if (Descriptor->Type == CmResourceTypeDma)
61 {
62 wsprintf(szDetail, L"%08ld %s", Descriptor->u.Dma.Channel, szDescription);
64 }
65}
66
67
69{
70}
71
72
73bool
75{
76 return true;
77}
@ ResourceNode
Definition: Node.h:10
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW(_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
Definition: cfgmgr.c:3471
Definition: Node.h:15
LPWSTR m_DeviceId
Definition: Node.h:19
INT m_ClassImage
Definition: Node.h:22
WCHAR m_DisplayName[DISPLAY_NAME_LEN]
Definition: Node.h:20
CResourceNode(_In_ CDeviceNode *Node, _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _In_ PSP_CLASSIMAGELIST_DATA ImageListData)
virtual bool SetupNode()
#define NULL
Definition: types.h:112
static const WCHAR szDescription[]
Definition: provider.c:55
#define MAX_PATH
Definition: compat.h:34
#define L(x)
Definition: resources.c:13
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
#define _In_
Definition: no_sal2.h:158
#define CmResourceTypeMemory
Definition: restypes.h:106
#define CmResourceTypeDma
Definition: restypes.h:107
#define CmResourceTypePort
Definition: restypes.h:104
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: restypes.h:117
#define CmResourceTypeInterrupt
Definition: restypes.h:105
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
uint32_t ULONG
Definition: typedefs.h:59
Definition: dlist.c:348
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
#define wsprintf
Definition: winuser.h:5976
__wchar_t WCHAR
Definition: xmlstorage.h:180