Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190#pragma once#include "DeviceNode.h"#include "ClassNode.h"#include "RootNode.h"#include "ResourceNode.h"#include "ResourceTypeNode.h"
enum ViewType{ DevicesByType, DevicesByConnection, ResourcesByType, ResourcesByConnection};
class CDeviceView{
HWND m_hMainWnd; HWND m_hTreeView; HWND m_hPropertyDialog; HMENU m_hMenu; ViewType m_ViewType; HTREEITEM m_hTreeRoot; bool m_ShowHidden;
CRootNode *m_RootNode; CAtlList<CClassNode *> m_ClassNodeList; CAtlList<CDeviceNode *> m_DeviceNodeList; SP_CLASSIMAGELIST_DATA m_ImageListData;
public: CDeviceView( HWND hMainWnd );
~CDeviceView(void);
bool Initialize(); bool Uninitialize();
LRESULT OnSize( _In_ int x, _In_ int y, _In_ int cx, _In_ int cy );
LRESULT OnDoubleClick( _In_ LPNMHDR NmHdr );
LRESULT OnRightClick( _In_ LPNMHDR NmHdr );
LRESULT OnContextMenu( _In_ LPARAM lParam );
LRESULT OnAction( UINT Action );
VOID Refresh( _In_ ViewType Type, _In_ bool ScanForChanges, _In_ bool UpdateView );
VOID DisplayPropertySheet(); VOID SetFocus();
VOID SetHiddenDevices(_In_ bool ShowHidden) { m_ShowHidden = ShowHidden; }
ViewType GetCurrentView() { return m_ViewType; }
bool CreateActionMenu( _In_ HMENU OwnerMenu, _In_ bool MainMenu );
CNode* GetSelectedNode( );
bool SelDeviceIsStarted(); bool SelDeviceIsInstalled();
private: bool AddRootDevice();
bool RefreshDeviceList();
static unsigned int __stdcall RefreshThread( void *Param );
bool ListDevicesByConnection( ); bool ListDevicesByType( ); bool ListResourcesByType( );
bool RecurseResources( _In_ DEVINST ParentDevice, _In_ HTREEITEM hMemoryTreeItem, _In_ HTREEITEM hPortTreeItem, _In_ HTREEITEM hDmaTreeItem, _In_ HTREEITEM hIrqTreeItem );
bool GetNextClass( _In_ ULONG ClassIndex, _Out_ LPGUID ClassGuid, _Out_ HDEVINFO *hDevInfo );
bool RecurseChildDevices( _In_ DEVINST ParentDevice, _In_ HTREEITEM hParentTreeItem );
bool EnableSelectedDevice( _In_ bool Enable, _Out_ bool &NeedsReboot );
bool UpdateSelectedDevice( _Out_ bool &NeedsReboot );
bool UninstallSelectedDevice( );
bool RunAddHardwareWizard( );
bool GetChildDevice( _In_ DEVINST ParentDevInst, _Out_ PDEVINST DevInst );
bool GetSiblingDevice( _In_ DEVINST PrevDevice, _Out_ PDEVINST DevInst );
HTREEITEM InsertIntoTreeView( _In_opt_ HTREEITEM hParent, _In_ CNode *Node );
void BuildActionMenuForNode( _In_ HMENU OwnerMenu, _In_ CNode *Node, _In_ bool MainMenu );
HTREEITEM RecurseFindDevice( _In_ HTREEITEM hParentItem, _In_ CNode *Node );
void SelectNode( _In_ CNode *Node );
void EmptyDeviceView( );
CNode* GetNode( _In_ LPTV_ITEMW TvItem );
CClassNode* GetClassNode( _In_ LPGUID ClassGuid ); CDeviceNode* GetDeviceNode( _In_ DEVINST Device ); void EmptyLists( );};