-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathEnumDevicesDlg.h
193 lines (171 loc) · 7.73 KB
/
EnumDevicesDlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/* Copyright (C) 2012-2025 Stefan-Mihai MOGA
This file is part of IntelliTask application developed by Stefan-Mihai MOGA.
IntelliTask is an alternative Windows version to the famous Task Manager!
IntelliTask is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Open
Source Initiative, either version 3 of the License, or any later version.
IntelliTask is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
IntelliTask. If not, see <http://www.opensource.org/licenses/gpl-3.0.html>*/
#pragma once
#include <SetupAPI.h>
#include <cfgmgr32.h>
#include <newdev.h>
#include <setupapi.h>
#include "WndResizer.h"
#define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_READ_ONLY_DEVICE 0x00000002
#define FILE_FLOPPY_DISKETTE 0x00000004
#define FILE_WRITE_ONCE_MEDIA 0x00000008
#define FILE_REMOTE_DEVICE 0x00000010
#define FILE_DEVICE_IS_MOUNTED 0x00000020
#define FILE_VIRTUAL_VOLUME 0x00000040
#define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
#define FILE_DEVICE_SECURE_OPEN 0x00000100
#define FILE_DEVICE_BEEP 0x00000001
#define FILE_DEVICE_CD_ROM 0x00000002
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
#define FILE_DEVICE_CONTROLLER 0x00000004
#define FILE_DEVICE_DATALINK 0x00000005
#define FILE_DEVICE_DFS 0x00000006
#define FILE_DEVICE_DISK 0x00000007
#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
#define FILE_DEVICE_FILE_SYSTEM 0x00000009
#define FILE_DEVICE_INPORT_PORT 0x0000000a
#define FILE_DEVICE_KEYBOARD 0x0000000b
#define FILE_DEVICE_MAILSLOT 0x0000000c
#define FILE_DEVICE_MIDI_IN 0x0000000d
#define FILE_DEVICE_MIDI_OUT 0x0000000e
#define FILE_DEVICE_MOUSE 0x0000000f
#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
#define FILE_DEVICE_NAMED_PIPE 0x00000011
#define FILE_DEVICE_NETWORK 0x00000012
#define FILE_DEVICE_NETWORK_BROWSER 0x00000013
#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
#define FILE_DEVICE_NULL 0x00000015
#define FILE_DEVICE_PARALLEL_PORT 0x00000016
#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
#define FILE_DEVICE_PRINTER 0x00000018
#define FILE_DEVICE_SCANNER 0x00000019
#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
#define FILE_DEVICE_SERIAL_PORT 0x0000001b
#define FILE_DEVICE_SCREEN 0x0000001c
#define FILE_DEVICE_SOUND 0x0000001d
#define FILE_DEVICE_STREAMS 0x0000001e
#define FILE_DEVICE_TAPE 0x0000001f
#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
#define FILE_DEVICE_TRANSPORT 0x00000021
#define FILE_DEVICE_UNKNOWN 0x00000022
#define FILE_DEVICE_VIDEO 0x00000023
#define FILE_DEVICE_VIRTUAL_DISK 0x00000024
#define FILE_DEVICE_WAVE_IN 0x00000025
#define FILE_DEVICE_WAVE_OUT 0x00000026
#define FILE_DEVICE_8042_PORT 0x00000027
#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
#define FILE_DEVICE_BATTERY 0x00000029
#define FILE_DEVICE_BUS_EXTENDER 0x0000002a
#define FILE_DEVICE_MODEM 0x0000002b
#define FILE_DEVICE_VDM 0x0000002c
#define FILE_DEVICE_MASS_STORAGE 0x0000002d
#define FILE_DEVICE_SMB 0x0000002e
#define FILE_DEVICE_KS 0x0000002f
#define FILE_DEVICE_CHANGER 0x00000030
#define FILE_DEVICE_SMARTCARD 0x00000031
#define FILE_DEVICE_ACPI 0x00000032
#define FILE_DEVICE_DVD 0x00000033
#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
#define FILE_DEVICE_DFS_VOLUME 0x00000036
#define FILE_DEVICE_SERENUM 0x00000037
#define FILE_DEVICE_TERMSRV 0x00000038
#define FILE_DEVICE_KSEC 0x00000039
#define FILE_DEVICE_FIPS 0x0000003A
#define FILE_DEVICE_INFINIBAND 0x0000003B
#define FILE_DEVICE_VMBUS 0x0000003E
#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F
#define FILE_DEVICE_WPD 0x00000040
#define FILE_DEVICE_BLUETOOTH 0x00000041
#define FILE_DEVICE_MT_COMPOSITE 0x00000042
#define FILE_DEVICE_MT_TRANSPORT 0x00000043
#define FILE_DEVICE_BIOMETRIC 0x00000044
#define FILE_DEVICE_PMI 0x00000045
#define FILE_DEVICE_EHSTOR 0x00000046
#define FILE_DEVICE_DEVAPI 0x00000047
#define FILE_DEVICE_GPIO 0x00000048
#define FILE_DEVICE_USBEX 0x00000049
#define FILE_DEVICE_CONSOLE 0x00000050
#define FILE_DEVICE_NFP 0x00000051
#define FILE_DEVICE_SYSENV 0x00000052
#define FILE_DEVICE_VIRTUAL_BLOCK 0x00000053
#define FILE_DEVICE_POINT_OF_SERVICE 0x00000054
#define FILE_DEVICE_STORAGE_REPLICATION 0x00000055
#define FILE_DEVICE_TRUST_ENV 0x00000056
typedef struct _tagDEVICE_ORDER
{
TCHAR szDevName[LINE_LEN];
struct _tagDEVICE_ORDER* pNext;
} DEVICE_ORDER, * PDEVICE_ORDER;
//
typedef struct _tagDEVLIST
{
GUID guid;
DWORD wOrder;
DWORD wIndex;
TCHAR szInstallID[LINE_LEN];
TCHAR szName[MAX_PATH];
TCHAR szPath[MAX_PATH];
struct _tagDEVLIST* pNext;
}DEVICE_LIST, * PDEVICE_LIST;
void InitialImageData();
void ListImageDataInitial(const UINT);
char EnumWDMDriver(const UINT, const UINT);
// void GetDriverDetialInfo(HTREEITEM, const UINT, const TCHAR*, const int, const int);
void GetDeviceInstanceID(HDEVINFO, SP_DEVINFO_DATA*, TCHAR*, HWND hDlg);
void GetDeviceInterfaceInfo(HDEVINFO, SP_DEVINFO_DATA, TCHAR*, HWND hDlg);
void GetOtherInfo(GUID, const DWORD, const UINT, HWND hDlg);
void FindSpecResource(const DEVINST, const DWORD, const DWORD, const UINT, HWND hDlg);
HTREEITEM MakeRootTree();
char InitialDeviceOrder();
DEVICE_ORDER* AllocNewDeviceOrderNode();
char AddNewDeviceOrderNode(const char*);
DWORD FindDeviceOrder(const char*);
void FreeAllDeviceOrderNode();
char InitialDeviceList();
DEVICE_LIST* AllocNewDeviceNode(HWND hDlg);
char AddNewDeviceNode(const GUID, const char*, const char*,
const char*, const DWORD, const DWORD, HWND hDlg);
char FindDeviceName(const char*, const UINT, const UINT, HWND hDlg);
void GetDeviceDetailInfo(DEVICE_LIST*, HWND hDlg);
void DisplayDriverDetailInfo(HTREEITEM, const UINT,
const char*, const int, const int, HWND hDlg);
void FreeAllocDeviceNode();
void GetMemoryResource(MEM_DES*, const ULONG, const UINT, HWND hDlg);
void GetIOResource(IO_DES*, const ULONG, const UINT, HWND hDlg);
void GetDMAResource(DMA_DES*, const ULONG, const UINT, HWND hDlg);
void GetIRQResource(IRQ_DES*, const ULONG, const UINT, HWND hDlg);
void GetMoreInformation(HDEVINFO, SP_DEVINFO_DATA*, const UINT, HWND hDlg);
// CEnumDevicesDlg dialog
class CEnumDevicesDlg : public CDialogEx
{
DECLARE_DYNAMIC(CEnumDevicesDlg)
public:
CEnumDevicesDlg(CWnd* pParent = nullptr); // standard constructor
virtual ~CEnumDevicesDlg();
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ENUMDEVICES_DIALOG };
#endif
CWndResizer m_pWindowResizer;
CTreeCtrl m_ctrlDevices;
CListCtrl m_ctrlDetails;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
protected:
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
void EnumDevices();
afx_msg void OnSelchangedDevices(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
};