ReactOS 0.4.15-dev-7918-g2a2556c
CRootNode Class Reference

#include <RootNode.h>

Inheritance diagram for CRootNode:
Collaboration diagram for CRootNode:

Public Member Functions

 CRootNode (_In_ PSP_CLASSIMAGELIST_DATA ImageListData)
 
 ~CRootNode ()
 
virtual bool SetupNode ()
 
DEVINST GetDeviceInst ()
 
- Public Member Functions inherited from CNode
 CNode (_In_ NodeType Type, _In_ PSP_CLASSIMAGELIST_DATA ImageListData)
 
 CNode (_In_ const CNode &Node)
 
virtual ~CNode ()
 
virtual bool SetupNode ()=0
 
NodeType GetNodeType ()
 
LPGUID GetClassGuid ()
 
LPWSTR GetDisplayName ()
 
INT GetClassImage ()
 
LPWSTR GetDeviceId ()
 
bool HasProperties ()
 

Private Attributes

DEVINST m_DevInst
 

Additional Inherited Members

- Protected Attributes inherited from CNode
NodeType m_NodeType
 
PSP_CLASSIMAGELIST_DATA m_ImageListData
 
LPWSTR m_DeviceId
 
WCHAR m_DisplayName [DISPLAY_NAME_LEN]
 
GUID m_ClassGuid
 
INT m_ClassImage
 

Detailed Description

Definition at line 4 of file RootNode.h.

Constructor & Destructor Documentation

◆ CRootNode()

CRootNode::CRootNode ( _In_ PSP_CLASSIMAGELIST_DATA  ImageListData)

Definition at line 15 of file RootNode.cpp.

15 :
17{
18}
Definition: Node.h:13
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19

◆ ~CRootNode()

CRootNode::~CRootNode ( )

Definition at line 21 of file RootNode.cpp.

22{
23}

Member Function Documentation

◆ GetDeviceInst()

DEVINST CRootNode::GetDeviceInst ( )
inline

Definition at line 15 of file RootNode.h.

15{ return m_DevInst; }
DEVINST m_DevInst
Definition: RootNode.h:7

Referenced by CDeviceView::ListDevicesByConnection().

◆ SetupNode()

bool CRootNode::SetupNode ( )
virtual

Implements CNode.

Definition at line 27 of file RootNode.cpp.

28{
29
30 // Load the bitmap we'll be using as the root image
31 HBITMAP hRootImage;
32 hRootImage = LoadBitmapW(g_hThisInstance,
34 if (hRootImage == NULL)
35 return false;
36
37 // Add this bitmap to the device image list. This is a bit hacky, but it's safe
39 hRootImage,
40 NULL);
41 DeleteObject(hRootImage);
42
43
44 // Get the root instance
45 CONFIGRET cr;
47 NULL,
49 if (cr != CR_SUCCESS)
50 {
51 return false;
52 }
53
54 // The root name is the computer name
57
58 return true;
59}
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_LOCATE_DEVNODE_NORMAL
Definition: cfgmgr32.h:760
CONFIGRET WINAPI CM_Locate_DevNodeW(_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags)
Definition: cfgmgr.c:5862
INT m_ClassImage
Definition: Node.h:20
PSP_CLASSIMAGELIST_DATA m_ImageListData
Definition: Node.h:16
WCHAR m_DisplayName[DISPLAY_NAME_LEN]
Definition: Node.h:18
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
HINSTANCE g_hThisInstance
Definition: MainWindow.cpp:25
#define NULL
Definition: types.h:112
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
#define IDB_ROOT_IMAGE
Definition: resource.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
static HBITMAP
Definition: button.c:44
#define _countof(array)
Definition: sndvol32.h:68
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2163

Referenced by CDeviceView::Initialize(), and CDeviceView::RefreshDeviceList().

Member Data Documentation

◆ m_DevInst

DEVINST CRootNode::m_DevInst
private

Definition at line 7 of file RootNode.h.

Referenced by GetDeviceInst(), and SetupNode().


The documentation for this class was generated from the following files: