ReactOS 0.4.15-dev-8109-gd7be748
RootNode.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/RootNode.cpp
5* PURPOSE: Root object for
6* COPYRIGHT: Copyright 2015 Ged Murphy <gedmurphy@reactos.org>
7*
8*/
9
10#include "precomp.h"
11#include "devmgmt.h"
12#include "RootNode.h"
13
14
17{
18}
19
20
22{
23}
24
25
26bool
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
Definition: Node.h:13
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
virtual bool SetupNode()
Definition: RootNode.cpp:27
~CRootNode()
Definition: RootNode.cpp:21
CRootNode(_In_ PSP_CLASSIMAGELIST_DATA ImageListData)
Definition: RootNode.cpp:15
DEVINST m_DevInst
Definition: RootNode.h:7
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()
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19
static HBITMAP
Definition: button.c:44
#define _In_
Definition: ms_sal.h:308
#define _countof(array)
Definition: sndvol32.h:70
_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:2194