18#define CLASS_NAME_LEN 256
19#define CLASS_DESC_LEN 256
20#define ROOT_NAME_SIZE MAX_COMPUTERNAME_LENGTH + 1
40 m_hPropertyDialog(
NULL),
218 _In_ bool ScanForChanges,
390 CNode *LastSelectedNode =
This->GetSelectedNode();
405 This->EmptyDeviceView();
408 if (
This->AddRootDevice() ==
false)
414 This->RefreshDeviceList();
418 switch (
This->m_ViewType)
425 (
VOID)
This->ListDevicesByConnection();
435 This->SelectNode(LastSelectedNode);
458 bClassSuccess =
GetNextClass(ClassIndex, &ClassGuid, &hDevInfo);
461 bool AddedParent =
false;
463 bool MoreItems =
false;
474 if (
IsEqualGUID(ClassGuid, GUID_DEVCLASS_LEGACYDRIVER) ||
521 if (AddedParent ==
false)
546 if (AddedParent ==
true)
556 }
while (bClassSuccess);
597 bool HasProblem =
false;
671 if (HasProblem ==
true)
688 _Out_ bool &NeedsReboot
702 Node->GetDisplayName(),
710 return Node->EnableDevice(
Enable, NeedsReboot);
715 _Out_ bool &NeedsReboot
745 Node->GetDisplayName(),
752 return Node->UninstallDevice();
766 "AddHardwareWizard");
767 if (pAddHardwareWizard ==
NULL)
812 lpLabel =
Node->GetDisplayName();
820 tvi.pszText = lpLabel;
821 tvi.cchTextMax =
wcslen(lpLabel);
823 tvi.iImage =
Node->GetClassImage();
824 tvi.iSelectedImage =
Node->GetClassImage();
836 tvins.hParent = hParent;
914 if ((
Node->GetNodeType() ==
RootNode) || (MainMenu ==
true))
923 if (
Node->HasProperties())
961 FoundNode =
reinterpret_cast<CNode *
>(tvItem.
lParam);
993 FoundNode =
reinterpret_cast<CNode *
>(tvItem.
lParam);
1117 return (
CNode *)TvItem->lParam;
1151 ULONG ClassIndex = 0;
VOID(WINAPI * PADDHARDWAREWIZARD)(HWND hwnd, LPWSTR lpName)
CONFIGRET WINAPI CM_Get_Child(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
CONFIGRET WINAPI CM_Enumerate_Classes(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags)
CONFIGRET WINAPI CM_Get_Sibling(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
CAtlList< CClassNode * > m_ClassNodeList
bool RunAddHardwareWizard()
void BuildActionMenuForNode(_In_ HMENU OwnerMenu, _In_ CNode *Node, _In_ bool MainMenu)
CNode * GetSelectedNode()
LRESULT OnSize(_In_ int x, _In_ int y, _In_ int cx, _In_ int cy)
bool RecurseChildDevices(_In_ DEVINST ParentDevice, _In_ HTREEITEM hParentTreeItem)
VOID DisplayPropertySheet()
bool EnableSelectedDevice(_In_ bool Enable, _Out_ bool &NeedsReboot)
HTREEITEM RecurseFindDevice(_In_ HTREEITEM hParentItem, _In_ CNode *Node)
CNode * GetNode(_In_ LPTV_ITEMW TvItem)
bool GetChildDevice(_In_ DEVINST ParentDevInst, _Out_ PDEVINST DevInst)
bool UninstallSelectedDevice()
void SelectNode(_In_ CNode *Node)
ViewType GetCurrentView()
bool GetNextClass(_In_ ULONG ClassIndex, _Out_ LPGUID ClassGuid, _Out_ HDEVINFO *hDevInfo)
CDeviceNode * GetDeviceNode(_In_ DEVINST Device)
CAtlList< CDeviceNode * > m_DeviceNodeList
HTREEITEM InsertIntoTreeView(_In_opt_ HTREEITEM hParent, _In_ CNode *Node)
bool GetSiblingDevice(_In_ DEVINST PrevDevice, _Out_ PDEVINST DevInst)
static unsigned int __stdcall RefreshThread(void *Param)
VOID Refresh(_In_ ViewType Type, _In_ bool ScanForChanges, _In_ bool UpdateView)
CClassNode * GetClassNode(_In_ LPGUID ClassGuid)
bool UpdateSelectedDevice(_Out_ bool &NeedsReboot)
CDeviceView(HWND hMainWnd)
LRESULT OnAction(UINT Action)
SP_CLASSIMAGELIST_DATA m_ImageListData
LRESULT OnRightClick(_In_ LPNMHDR NmHdr)
bool CreateActionMenu(_In_ HMENU OwnerMenu, _In_ bool MainMenu)
LRESULT OnContextMenu(_In_ LPARAM lParam)
LRESULT OnDoubleClick(_In_ LPNMHDR NmHdr)
bool ListDevicesByConnection()
HINSTANCE g_hThisInstance
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define ERROR_NO_MORE_ITEMS
INT_PTR WINAPI DevicePropertiesExW(IN HWND hWndParent OPTIONAL, IN LPCWSTR lpMachineName OPTIONAL, IN LPCWSTR lpDeviceID OPTIONAL, IN DWORD dwFlags OPTIONAL, IN BOOL bShowDevMgr)
BOOL WINAPI InstallDevInst(IN HWND hWndParent, IN LPCWSTR InstanceId, IN BOOL bUpdate, OUT LPDWORD lpReboot)
#define IDS_CONFIRM_DISABLE
#define IDM_SCAN_HARDWARE
#define IDS_MENU_PROPERTIES
#define IDM_UNINSTALL_DRV
#define IDS_MENU_UNINSTALL
#define IDS_CONFIRM_UNINSTALL
BOOL WINAPI SetupDiDestroyClassImageList(IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PCONFIGURATION_COMPONENT_DATA RootNode
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
_Out_opt_ int _Out_opt_ int * cy
#define TreeView_DeleteAllItems(hwnd)
#define TreeView_SelectItem(hwnd, hitem)
#define TreeView_Expand(hwnd, hitem, code)
#define TreeView_GetChild(hwnd, hitem)
#define TreeView_SortChildren(hwnd, hitem, recurse)
#define TVS_SHOWSELALWAYS
#define TreeView_GetSelection(hwnd)
#define TreeView_GetItem(hwnd, pitem)
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
#define TreeView_GetRoot(hwnd)
#define TreeView_GetNextSibling(hwnd, hitem)
#define INDEXTOOVERLAYMASK(i)
#define TreeView_SetImageList(hwnd, himl, iImage)
#define TreeView_HitTest(hwnd, lpht)
#define TreeView_InsertItem(hwnd, lpis)
#define TVIF_SELECTEDIMAGE
#define IsEqualGUID(rguid1, rguid2)
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct _SP_CLASSIMAGELIST_DATA SP_CLASSIMAGELIST_DATA
_In_opt_ PSP_DEVINFO_DATA DeviceInfoData
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
static void UpdateView(TreeListData *pData)
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_Must_inspect_result_ _In_ WDFDEVICE ParentDevice
DWORD WINAPI GetLastError(void)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
struct tagMENUITEMINFOW MENUITEMINFOW
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)