#include "hotplug.h"
#include <initguid.h>
#include <devguid.h>
Go to the source code of this file.
|
static VOID | GetDeviceDisplayInfo (_In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData, _Out_writes_z_(cchDesc) LPWSTR pszDesc, _In_ ULONG cchDesc, _Out_ PINT pImageIndex) |
|
static HTREEITEM | InsertDeviceTreeItem (_In_ HTREEITEM hParent, _In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData) |
|
static VOID | DevTreeRecursiveInsertSubDevices (_In_ HTREEITEM hParentItem, _In_ DEVINST ParentDevInst, _In_ PHOTPLUG_DATA pHotplugData) |
|
VOID | EnumHotpluggedDevices (_In_ PHOTPLUG_DATA pHotplugData) |
|
static VOID | InsertConfirmDeviceListItem (_In_ HWND hwndCfmDeviceList, _In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData) |
|
static VOID | CfmListRecursiveInsertSubDevices (_In_ HWND hwndCfmDeviceList, _In_ DEVINST ParentDevInst, _In_ PHOTPLUG_DATA pHotplugData) |
|
VOID | CfmListEnumDevices (_In_ HWND hwndCfmDeviceList, _In_ PHOTPLUG_DATA pHotplugData) |
|
◆ MAX_DEVICE_DISPLAYNAME_LEN
#define MAX_DEVICE_DISPLAYNAME_LEN 256 |
◆ CfmListEnumDevices()
Definition at line 272 of file enum.c.
275{
277
279 if (DevInst != 0)
280 {
283 }
284}
static VOID InsertConfirmDeviceListItem(_In_ HWND hwndCfmDeviceList, _In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData)
static VOID CfmListRecursiveInsertSubDevices(_In_ HWND hwndCfmDeviceList, _In_ DEVINST ParentDevInst, _In_ PHOTPLUG_DATA pHotplugData)
DEVINST GetDeviceInstForRemoval(_In_ PHOTPLUG_DATA pHotplugData)
Referenced by FillConfirmDeviceList().
◆ CfmListRecursiveInsertSubDevices()
Definition at line 245 of file enum.c.
249{
252
255 return;
256
259
260 for (;;)
261 {
264 return;
265
268 }
269}
CONFIGRET WINAPI CM_Get_Child(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
CONFIGRET WINAPI CM_Get_Sibling(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
Referenced by CfmListEnumDevices(), and CfmListRecursiveInsertSubDevices().
◆ DevTreeRecursiveInsertSubDevices()
Definition at line 108 of file enum.c.
112{
116
119 return;
120
122 ChildDevInst,
123 pHotplugData);
124 if (hTreeItem !=
NULL)
125 {
127 ChildDevInst,
128 pHotplugData);
129 }
130
131 for (;;)
132 {
135 return;
136
138 ChildDevInst,
139 pHotplugData);
140 if (hTreeItem !=
NULL)
141 {
143 ChildDevInst,
144 pHotplugData);
145 }
146 }
147}
static HTREEITEM InsertDeviceTreeItem(_In_ HTREEITEM hParent, _In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData)
static VOID DevTreeRecursiveInsertSubDevices(_In_ HTREEITEM hParentItem, _In_ DEVINST ParentDevInst, _In_ PHOTPLUG_DATA pHotplugData)
Referenced by DevTreeRecursiveInsertSubDevices(), and EnumHotpluggedDevices().
◆ EnumHotpluggedDevices()
Definition at line 150 of file enum.c.
152{
155 int idev;
157 ULONG ulStatus, ulProblem;
160
162
165 return;
166
168
169
171 {
172 ulStatus = 0;
173 ulProblem = 0;
174
176 &ulProblem,
178 0);
180 continue;
181
182 dwCapabilities = 0,
183 dwSize =
sizeof(dwCapabilities);
187 &dwCapabilities,
189 0);
191 continue;
192
193
198 ulProblem == 0)
199 {
202 pHotplugData);
203
205 {
208 pHotplugData);
209 }
210 }
211 }
212
214}
#define CM_DEVCAP_EJECTSUPPORTED
#define CM_DRP_CAPABILITIES
#define CM_Get_DevNode_Registry_Property
#define CM_DEVCAP_SURPRISEREMOVALOK
#define CM_DEVCAP_DOCKDEVICE
#define CM_DEVCAP_REMOVABLE
CONFIGRET WINAPI CM_Get_DevNode_Status(_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
#define INVALID_HANDLE_VALUE
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
#define HOTPLUG_DISPLAY_DEVICE_COMPONENTS
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define TreeView_DeleteAllItems(hwnd)
#define SetupDiGetClassDevs
Referenced by SafeRemovalDlgProc().
◆ GetDeviceDisplayInfo()
Definition at line 18 of file enum.c.
24{
29
30
31 ulSize = cchDesc *
sizeof(
WCHAR);
35 pszDesc,
36 &ulSize,
37 0);
39 {
40 ulSize = cchDesc *
sizeof(
WCHAR);
44 pszDesc,
45 &ulSize,
46 0);
49 }
50
51
52 ulSize = sizeof(szGuidString);
56 szGuidString,
57 &ulSize,
58 0);
60 {
62 }
63 else
64 {
65 ClassGuid = GUID_DEVCLASS_UNKNOWN;
66 }
67
68
70 &ClassGuid,
71 pImageIndex);
72}
#define CM_DRP_DEVICEDESC
#define CM_DRP_FRIENDLYNAME
CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW(_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
#define MAX_GUID_STRING_LEN
#define IDS_UNKNOWN_DEVICE
DWORD WINAPI pSetupGuidFromString(PCWSTR pString, LPGUID lpGUID)
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
BOOL WINAPI SetupDiGetClassImageIndex(IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
Referenced by InsertConfirmDeviceListItem(), and InsertDeviceTreeItem().
◆ InsertConfirmDeviceListItem()
Definition at line 218 of file enum.c.
222{
226
228 pHotplugData,
229 szDisplayName,
231 &nClassImage);
232
236 lvItem.
pszText = szDisplayName;
237 lvItem.
iImage = nClassImage;
239
241}
static VOID GetDeviceDisplayInfo(_In_ DEVINST DevInst, _In_ PHOTPLUG_DATA pHotplugData, _Out_writes_z_(cchDesc) LPWSTR pszDesc, _In_ ULONG cchDesc, _Out_ PINT pImageIndex)
#define MAX_DEVICE_DISPLAYNAME_LEN
#define ListView_InsertItem(hwnd, pitem)
#define ListView_GetItemCount(hwnd)
Referenced by CfmListEnumDevices(), and CfmListRecursiveInsertSubDevices().
◆ InsertDeviceTreeItem()