1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _DBT_H 7 #define _DBT_H 8 #include <_mingw_unicode.h> 9 10 #define WM_DEVICECHANGE 0x0219 11 12 #ifdef IS_32 13 #define DBTFAR 14 #else 15 #define DBTFAR far 16 #endif 17 18 #ifndef _WCHAR_T_DEFINED 19 #define _WCHAR_T_DEFINED 20 typedef unsigned short wchar_t; 21 #endif 22 23 #include <guiddef.h> 24 25 #define BSF_QUERY 0x00000001 26 #define BSF_IGNORECURRENTTASK 0x00000002 27 #define BSF_FLUSHDISK 0x00000004 28 #define BSF_NOHANG 0x00000008 29 #define BSF_POSTMESSAGE 0x00000010 30 #define BSF_FORCEIFHUNG 0x00000020 31 #define BSF_NOTIMEOUTIFNOTHUNG 0x00000040 32 #define BSF_MSGSRV32ISOK 0x80000000 33 #define BSF_MSGSRV32ISOK_BIT 31 34 35 #define BSM_ALLCOMPONENTS 0x00000000 36 #define BSM_VXDS 0x00000001 37 #define BSM_NETDRIVER 0x00000002 38 #define BSM_INSTALLABLEDRIVERS 0x00000004 39 #define BSM_APPLICATIONS 0x00000008 40 41 #define DBT_APPYBEGIN 0x0000 42 #define DBT_APPYEND 0x0001 43 #define DBT_DEVNODES_CHANGED 0x0007 44 #define DBT_QUERYCHANGECONFIG 0x0017 45 #define DBT_CONFIGCHANGED 0x0018 46 #define DBT_CONFIGCHANGECANCELED 0x0019 47 #define DBT_MONITORCHANGE 0x001B 48 #define DBT_SHELLLOGGEDON 0x0020 49 #define DBT_CONFIGMGAPI32 0x0022 50 #define DBT_VXDINITCOMPLETE 0x0023 51 #define DBT_VOLLOCKQUERYLOCK 0x8041 52 #define DBT_VOLLOCKLOCKTAKEN 0x8042 53 #define DBT_VOLLOCKLOCKFAILED 0x8043 54 #define DBT_VOLLOCKQUERYUNLOCK 0x8044 55 #define DBT_VOLLOCKLOCKRELEASED 0x8045 56 #define DBT_VOLLOCKUNLOCKFAILED 0x8046 57 58 struct _DEV_BROADCAST_HDR { 59 DWORD dbch_size; 60 DWORD dbch_devicetype; 61 DWORD dbch_reserved; 62 }; 63 64 typedef struct _DEV_BROADCAST_HDR DEV_BROADCAST_HDR; 65 typedef DEV_BROADCAST_HDR DBTFAR *PDEV_BROADCAST_HDR; 66 typedef struct VolLockBroadcast VolLockBroadcast; 67 typedef VolLockBroadcast *pVolLockBroadcast; 68 69 struct VolLockBroadcast { 70 struct _DEV_BROADCAST_HDR vlb_dbh; 71 DWORD vlb_owner; 72 BYTE vlb_perms; 73 BYTE vlb_lockType; 74 BYTE vlb_drive; 75 BYTE vlb_flags; 76 }; 77 78 #define LOCKP_ALLOW_WRITES 0x01 79 #define LOCKP_FAIL_WRITES 0x00 80 #define LOCKP_FAIL_MEM_MAPPING 0x02 81 #define LOCKP_ALLOW_MEM_MAPPING 0x00 82 #define LOCKP_USER_MASK 0x03 83 #define LOCKP_LOCK_FOR_FORMAT 0x04 84 85 #define LOCKF_LOGICAL_LOCK 0x00 86 #define LOCKF_PHYSICAL_LOCK 0x01 87 88 #define DBT_NO_DISK_SPACE 0x0047 89 #define DBT_LOW_DISK_SPACE 0x0048 90 #define DBT_CONFIGMGPRIVATE 0x7FFF 91 #define DBT_DEVICEARRIVAL 0x8000 92 #define DBT_DEVICEQUERYREMOVE 0x8001 93 #define DBT_DEVICEQUERYREMOVEFAILED 0x8002 94 #define DBT_DEVICEREMOVEPENDING 0x8003 95 #define DBT_DEVICEREMOVECOMPLETE 0x8004 96 #define DBT_DEVICETYPESPECIFIC 0x8005 97 #define DBT_CUSTOMEVENT 0x8006 98 #define DBT_DEVTYP_OEM 0x00000000 99 #define DBT_DEVTYP_DEVNODE 0x00000001 100 #define DBT_DEVTYP_VOLUME 0x00000002 101 #define DBT_DEVTYP_PORT 0x00000003 102 #define DBT_DEVTYP_NET 0x00000004 103 #define DBT_DEVTYP_DEVICEINTERFACE 0x00000005 104 #define DBT_DEVTYP_HANDLE 0x00000006 105 106 struct _DEV_BROADCAST_HEADER { 107 DWORD dbcd_size; 108 DWORD dbcd_devicetype; 109 DWORD dbcd_reserved; 110 }; 111 112 struct _DEV_BROADCAST_OEM { 113 DWORD dbco_size; 114 DWORD dbco_devicetype; 115 DWORD dbco_reserved; 116 DWORD dbco_identifier; 117 DWORD dbco_suppfunc; 118 }; 119 120 typedef struct _DEV_BROADCAST_OEM DEV_BROADCAST_OEM; 121 typedef DEV_BROADCAST_OEM DBTFAR *PDEV_BROADCAST_OEM; 122 123 struct _DEV_BROADCAST_DEVNODE { 124 DWORD dbcd_size; 125 DWORD dbcd_devicetype; 126 DWORD dbcd_reserved; 127 DWORD dbcd_devnode; 128 }; 129 130 typedef struct _DEV_BROADCAST_DEVNODE DEV_BROADCAST_DEVNODE; 131 typedef DEV_BROADCAST_DEVNODE DBTFAR *PDEV_BROADCAST_DEVNODE; 132 133 struct _DEV_BROADCAST_VOLUME { 134 DWORD dbcv_size; 135 DWORD dbcv_devicetype; 136 DWORD dbcv_reserved; 137 DWORD dbcv_unitmask; 138 WORD dbcv_flags; 139 }; 140 141 typedef struct _DEV_BROADCAST_VOLUME DEV_BROADCAST_VOLUME; 142 typedef DEV_BROADCAST_VOLUME DBTFAR *PDEV_BROADCAST_VOLUME; 143 144 #define DBTF_MEDIA 0x0001 145 #define DBTF_NET 0x0002 146 147 typedef struct _DEV_BROADCAST_PORT_A { 148 DWORD dbcp_size; 149 DWORD dbcp_devicetype; 150 DWORD dbcp_reserved; 151 char dbcp_name[1]; 152 } DEV_BROADCAST_PORT_A,*PDEV_BROADCAST_PORT_A; 153 154 typedef struct _DEV_BROADCAST_PORT_W { 155 DWORD dbcp_size; 156 DWORD dbcp_devicetype; 157 DWORD dbcp_reserved; 158 wchar_t dbcp_name[1]; 159 } DEV_BROADCAST_PORT_W,DBTFAR *PDEV_BROADCAST_PORT_W; 160 161 __MINGW_TYPEDEF_UAW(DEV_BROADCAST_PORT) 162 __MINGW_TYPEDEF_UAW(PDEV_BROADCAST_PORT) 163 164 struct _DEV_BROADCAST_NET { 165 DWORD dbcn_size; 166 DWORD dbcn_devicetype; 167 DWORD dbcn_reserved; 168 DWORD dbcn_resource; 169 DWORD dbcn_flags; 170 }; 171 172 typedef struct _DEV_BROADCAST_NET DEV_BROADCAST_NET; 173 typedef DEV_BROADCAST_NET DBTFAR *PDEV_BROADCAST_NET; 174 175 typedef struct _DEV_BROADCAST_DEVICEINTERFACE_A { 176 DWORD dbcc_size; 177 DWORD dbcc_devicetype; 178 DWORD dbcc_reserved; 179 GUID dbcc_classguid; 180 char dbcc_name[1]; 181 } DEV_BROADCAST_DEVICEINTERFACE_A,*PDEV_BROADCAST_DEVICEINTERFACE_A; 182 183 typedef struct _DEV_BROADCAST_DEVICEINTERFACE_W { 184 DWORD dbcc_size; 185 DWORD dbcc_devicetype; 186 DWORD dbcc_reserved; 187 GUID dbcc_classguid; 188 wchar_t dbcc_name[1]; 189 } DEV_BROADCAST_DEVICEINTERFACE_W,*PDEV_BROADCAST_DEVICEINTERFACE_W; 190 191 __MINGW_TYPEDEF_UAW(DEV_BROADCAST_DEVICEINTERFACE) 192 __MINGW_TYPEDEF_UAW(PDEV_BROADCAST_DEVICEINTERFACE) 193 194 typedef struct _DEV_BROADCAST_HANDLE { 195 DWORD dbch_size; 196 DWORD dbch_devicetype; 197 DWORD dbch_reserved; 198 HANDLE dbch_handle; 199 HDEVNOTIFY dbch_hdevnotify; 200 201 GUID dbch_eventguid; 202 LONG dbch_nameoffset; 203 BYTE dbch_data[1]; 204 } DEV_BROADCAST_HANDLE,*PDEV_BROADCAST_HANDLE; 205 206 typedef struct _DEV_BROADCAST_HANDLE32 { 207 DWORD dbch_size; 208 DWORD dbch_devicetype; 209 DWORD dbch_reserved; 210 ULONG32 dbch_handle; 211 ULONG32 dbch_hdevnotify; 212 GUID dbch_eventguid; 213 LONG dbch_nameoffset; 214 BYTE dbch_data[1]; 215 } DEV_BROADCAST_HANDLE32,*PDEV_BROADCAST_HANDLE32; 216 217 typedef struct _DEV_BROADCAST_HANDLE64 { 218 DWORD dbch_size; 219 DWORD dbch_devicetype; 220 DWORD dbch_reserved; 221 ULONG64 dbch_handle; 222 ULONG64 dbch_hdevnotify; 223 GUID dbch_eventguid; 224 LONG dbch_nameoffset; 225 BYTE dbch_data[1]; 226 } DEV_BROADCAST_HANDLE64,*PDEV_BROADCAST_HANDLE64; 227 228 #define DBTF_RESOURCE 0x00000001 229 #define DBTF_XPORT 0x00000002 230 #define DBTF_SLOWNET 0x00000004 231 232 #define DBT_VPOWERDAPI 0x8100 233 234 #define DBT_USERDEFINED 0xFFFF 235 236 struct _DEV_BROADCAST_USERDEFINED { 237 struct _DEV_BROADCAST_HDR dbud_dbh; 238 char dbud_szName[1]; 239 }; 240 241 #endif 242