OSDN Git Service

Make <winreg.h> header effectively self-contained.
[mingw/mingw-org-wsl.git] / w32api / include / dbt.h
1 /*
2  * dbt.h
3  *
4  * Device management API manifest constants and type definitions.
5  *
6  * $Id$
7  *
8  * Written by Anders Norlander <anorland@hem2.passagen.se>
9  * Copyright (C) 1998, 1999, 2002-2004, 2016, MinGW.org Project
10  *
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice (including the next
20  * paragraph) shall be included in all copies or substantial portions of the
21  * Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  *
31  */
32 #ifndef _DBT_H
33 #pragma GCC system_header
34
35 #ifndef __WINUSER_H_SOURCED__
36 /* Part of <dbt.h> is made available for selective inclusion by <winuser.h>;
37  * define the <dbt.h> multiple inclusion guard only when NOT included as an
38  * adjunct to <winuser.h>
39  */
40 #define _DBT_H
41
42 /* When including <dbt.h> in its own right, ensure that the standard set of
43  * W32API utility macros and data types is defined.
44  */
45 #include <windef.h>
46
47 _BEGIN_C_DECLS
48
49 #define DBT_NO_DISK_SPACE                                0x47
50 #define DBT_CONFIGMGPRIVATE                            0x7FFF
51 #define DBT_DEVICEARRIVAL                              0x8000
52 #define DBT_DEVICEQUERYREMOVE                          0x8001
53 #define DBT_DEVICEQUERYREMOVEFAILED                    0x8002
54 #define DBT_DEVICEREMOVEPENDING                        0x8003
55 #define DBT_DEVICEREMOVECOMPLETE                       0x8004
56 #define DBT_DEVICETYPESPECIFIC                         0x8005
57 #define DBT_DEVTYP_OEM                                      0
58 #define DBT_DEVTYP_DEVNODE                                  1
59 #define DBT_DEVTYP_VOLUME                                   2
60 #define DBT_DEVTYP_PORT                                     3
61 #define DBT_DEVTYP_NET                                      4
62
63 #if _WIN32_WINDOWS >= _WIN32_WINDOWS_98 || _WIN32_WINNT >= _WIN32_WINNT_WIN2K
64 #define DBT_DEVTYP_DEVICEINTERFACE                          5
65 #define DBT_DEVTYP_HANDLE                                   6
66 #endif  /* >= _WIN32_WINDOWS_98 || >= _WIN32_WINNT_WIN2K */
67
68 #define DBT_APPYBEGIN                                       0
69 #define DBT_APPYEND                                         1
70 #define DBT_DEVNODES_CHANGED                                7
71 #define DBT_QUERYCHANGECONFIG                            0x17
72 #define DBT_CONFIGCHANGED                                0x18
73 #define DBT_CONFIGCHANGECANCELED                         0x19
74 #define DBT_MONITORCHANGE                                0x1B
75 #define DBT_SHELLLOGGEDON                                  32
76 #define DBT_CONFIGMGAPI32                                  34
77 #define DBT_VXDINITCOMPLETE                                35
78 #define DBT_VOLLOCKQUERYLOCK                           0x8041
79 #define DBT_VOLLOCKLOCKTAKEN                           0x8042
80 #define DBT_VOLLOCKLOCKFAILED                          0x8043
81 #define DBT_VOLLOCKQUERYUNLOCK                         0x8044
82 #define DBT_VOLLOCKLOCKRELEASED                        0x8045
83 #define DBT_VOLLOCKUNLOCKFAILED                        0x8046
84 #define DBT_USERDEFINED                                0xFFFF
85 #define DBTF_MEDIA                                          1
86 #define DBTF_NET                                            2
87
88 #endif  /* !__WINUSER_H_SOURCED__ */
89 /* The following definitions are shared with <winuser.h>; thus, we
90  * ALWAYS define them, whether within the __WINUSER_H_SOURCED__ scope,
91  * or regular inclusion of <dbt.h>
92  */
93 #define BSM_ALLCOMPONENTS                                   0
94 #define BSM_APPLICATIONS                                    8
95 #define BSM_ALLDESKTOPS                                    16
96 #define BSM_INSTALLABLEDRIVERS                              4
97 #define BSM_NETDRIVER                                       2
98 #define BSM_VXDS                                            1
99 #define BSF_FLUSHDISK                              0x00000004
100 #define BSF_FORCEIFHUNG                            0x00000020
101 #define BSF_IGNORECURRENTTASK                      0x00000002
102 #define BSF_NOHANG                                 0x00000008
103 #define BSF_NOTIMEOUTIFNOTHUNG                     0x00000040
104 #define BSF_POSTMESSAGE                            0x00000010
105 #define BSF_QUERY                                  0x00000001
106
107 #if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
108 #define BSF_ALLOWSFW                               0x00000080
109 #define BSF_SENDNOTIFYMESSAGE                      0x00000100
110
111 #if _WIN32_WINNT >= _WIN32_WINNT_WINXP
112 #define BSF_LUID                                   0x00000400
113 #define BSF_RETURNHDESK                            0x00000200
114
115 #endif  /* >= _WIN32_WINNT_WINXP */
116 #endif  /* >= _WIN32_WINNT_WIN2K */
117
118 #ifndef __WINUSER_H_SOURCED__
119 /* The remaining definitions are NOT shared with <winuser.h>, so are
120  * NOT defined within the __WINUSER_H_SOURCED__ scope.
121  */
122 #define BSF_MSGSRV32ISOK_BIT                               31
123 #define BSF_MSGSRV32ISOK                           0x80000000
124
125 typedef struct _DEV_BROADCAST_HDR
126 { DWORD                         dbch_size;
127   DWORD                         dbch_devicetype;
128   DWORD                         dbch_reserved;
129 } DEV_BROADCAST_HDR, *PDEV_BROADCAST_HDR;
130
131 typedef struct _DEV_BROADCAST_OEM
132 { DWORD                         dbco_size;
133   DWORD                         dbco_devicetype;
134   DWORD                         dbco_reserved;
135   DWORD                         dbco_identifier;
136   DWORD                         dbco_suppfunc;
137 } DEV_BROADCAST_OEM, *PDEV_BROADCAST_OEM;
138
139 typedef struct _DEV_BROADCAST_PORT_A
140 { DWORD                         dbcp_size;
141   DWORD                         dbcp_devicetype;
142   DWORD                         dbcp_reserved;
143   char                          dbcp_name[1];
144 } DEV_BROADCAST_PORT_A, *PDEV_BROADCAST_PORT_A;
145
146 typedef struct _DEV_BROADCAST_PORT_W
147 { DWORD                         dbcp_size;
148   DWORD                         dbcp_devicetype;
149   DWORD                         dbcp_reserved;
150   wchar_t                       dbcp_name[1];
151 } DEV_BROADCAST_PORT_W, *PDEV_BROADCAST_PORT_W;
152
153 /* Map generic type name references for UNICODE/non-UNICODE usage
154  * of the preceding pair of structured data types.
155  */
156 typedef __AW_ALIAS_EX__(DEV_BROADCAST_PORT);
157 typedef __AW_ALIAS_EX__(PDEV_BROADCAST_PORT);
158
159 typedef struct _DEV_BROADCAST_USERDEFINED
160 { struct _DEV_BROADCAST_HDR     dbud_dbh;
161   char                          dbud_szName[1];
162 } DEV_BROADCAST_USERDEFINED;
163
164 typedef struct _DEV_BROADCAST_VOLUME
165 { DWORD                         dbcv_size;
166   DWORD                         dbcv_devicetype;
167   DWORD                         dbcv_reserved;
168   DWORD                         dbcv_unitmask;
169   WORD                          dbcv_flags;
170 } DEV_BROADCAST_VOLUME, *PDEV_BROADCAST_VOLUME;
171
172 #if _WIN32_WINDOWS >= _WIN32_WINDOWS_98 || _WIN32_WINNT >= _WIN32_WINNT_WIN2K
173
174 typedef struct _DEV_BROADCAST_DEVICEINTERFACE_A
175 { DWORD                         dbcc_size;
176   DWORD                         dbcc_devicetype;
177   DWORD                         dbcc_reserved;
178   GUID                          dbcc_classguid;
179   char                          dbcc_name[1];
180 } DEV_BROADCAST_DEVICEINTERFACE_A, *PDEV_BROADCAST_DEVICEINTERFACE_A;
181
182 typedef struct _DEV_BROADCAST_DEVICEINTERFACE_W
183 { DWORD                         dbcc_size;
184   DWORD                         dbcc_devicetype;
185   DWORD                         dbcc_reserved;
186   GUID                          dbcc_classguid;
187   wchar_t                       dbcc_name[1];
188 } DEV_BROADCAST_DEVICEINTERFACE_W, *PDEV_BROADCAST_DEVICEINTERFACE_W;
189
190 /* Map generic type name references for UNICODE/non-UNICODE usage
191  * of the preceding pair of structured data types.
192  */
193 typedef __AW_ALIAS_EX__(DEV_BROADCAST_DEVICEINTERFACE);
194 typedef __AW_ALIAS_EX__(PDEV_BROADCAST_DEVICEINTERFACE);
195
196 typedef struct _DEV_BROADCAST_HANDLE
197 { DWORD                         dbch_size;
198   DWORD                         dbch_devicetype;
199   DWORD                         dbch_reserved;
200   HANDLE                        dbch_handle;
201   DWORD                         dbch_hdevnotify;
202   GUID                          dbch_eventguid;
203   LONG                          dbch_nameoffset;
204   BYTE                          dbch_data[1];
205 } DEV_BROADCAST_HANDLE, *PDEV_BROADCAST_HANDLE;
206 #endif  /* >= _WIN32_WINDOWS_98 || >= _WIN32_WINNT_WIN2K */
207
208 _END_C_DECLS
209
210 #endif  /* !__WINUSER_H_SOURCED__ */
211 #endif  /* !_DBT_H: $RCSfile$: end of file */