1 /*****************************************************************************
2  *
3  *  (C) Copyright MICROSOFT Corp., 1993-1999
4  *
5  *  Title:          DBT.H - Equates for WM_DEVICECHANGE and BroadcastSystemMessage
6  *
7  *  Version:      4.00
8  *
9  *  Date:           24-May-1993
10  *
11  *----------------------------------------------------------------------------
12  *
13  *  Change log:
14  *
15  *        DATE        REV                            DESCRIPTION
16  *  ----------- --- ----------------------------------------------------------
17  *
18  *****************************************************************************/
19
20 #ifndef _DBT_H
21 #define _DBT_H
22
23 #if _MSC_VER > 1000
24 #pragma once
25 #endif
26
27 /*
28  * BroadcastSpecialMessage constants.
29  */
30 #define WM_DEVICECHANGE               0x0219
31
32 /* XLATOFF */
33 #ifdef  IS_32
34 #define DBTFAR
35 #else
36 #define DBTFAR  far
37 #endif
38 /* XLATON */
39
40 #if !defined(_WCHAR_T_DEFINED) && !defined(_NATIVE_WCHAR_T_DEFINED)
41 typedef unsigned short wchar_t;
42 #define _WCHAR_T_DEFINED
43 #endif
44
45 #ifndef GUID_DEFINED
46 #include <guiddef.h>
47 #endif // !defined(GUID_DEFINED)
48
49 /*
50  * Broadcast message and receipient flags.
51  *
52  * Note that there is a third "flag". If the wParam has:
53  *
54  * bit 15 on:     lparam is a pointer and bit 14 is meaningfull.
55  * bit 15 off:  lparam is just a UNLONG data type.
56  *
57  * bit 14 on:     lparam is a pointer to an ASCIIZ string.
58  * bit 14 off:  lparam is a pointer to a binary struture starting with
59  *                       a dword describing the length of the structure.
60  */
61 #define BSF_QUERY                         0x00000001
62 #define BSF_IGNORECURRENTTASK     0x00000002          /* Meaningless for VxDs */
63 #define BSF_FLUSHDISK                  0x00000004          /* Shouldn't be used by VxDs */
64 #define BSF_NOHANG                       0x00000008
65 #define BSF_POSTMESSAGE               0x00000010
66 #define BSF_FORCEIFHUNG               0x00000020
67 #define BSF_NOTIMEOUTIFNOTHUNG  0x00000040
68 #define BSF_MSGSRV32ISOK             0x80000000          /* Called synchronously from PM API */
69 #define BSF_MSGSRV32ISOK_BIT      31                       /* Called synchronously from PM API */
70
71 #define BSM_ALLCOMPONENTS           0x00000000
72 #define BSM_VXDS                          0x00000001
73 #define BSM_NETDRIVER                  0x00000002
74 #define BSM_INSTALLABLEDRIVERS  0x00000004
75 #define BSM_APPLICATIONS             0x00000008
76
77 /*
78  * Message = WM_DEVICECHANGE
79  * wParam  = DBT_APPYBEGIN
80  * lParam  = (not used)
81  *
82  *          'Appy-time is now available.  This message is itself sent
83  *          at 'Appy-time.
84  *
85  * Message = WM_DEVICECHANGE
86  * wParam  = DBT_APPYEND
87  * lParam  = (not used)
88  *
89  *          'Appy-time is no longer available.  This message is *NOT* sent
90  *          at 'Appy-time.  (It cannot be, because 'Appy-time is gone.)
91  *
92  * NOTE!  It is possible for DBT_APPYBEGIN and DBT_APPYEND to be sent
Lines 93 ... 436 are skipped.
437       ULONG64        dbch_hdevnotify;
438       GUID             dbch_eventguid;
439       LONG             dbch_nameoffset;
440       BYTE             dbch_data[1];
441 } DEV_BROADCAST_HANDLE64, *PDEV_BROADCAST_HANDLE64;
442
443 #endif /* WINVER >= 0x0501 */
444
445 #endif /* WINVER >= 0x040A */
446
447 #define DBTF_RESOURCE     0x00000001          // network resource
448 #define DBTF_XPORT          0x00000002          // new transport coming or going
449 #define DBTF_SLOWNET      0x00000004          // new incoming transport is slow
450                                                                   // (dbcn_resource undefined for now)
451
452 #define DBT_VPOWERDAPI  0x8100                // VPOWERD API for Win95
453
454 /*
455  *  User-defined message types all use wParam = 0xFFFF with the
456  *  lParam a pointer to the structure below.
457  *
458  *  dbud_dbh - DEV_BROADCAST_HEADER must be filled in as usual.
459  *
460  *  dbud_szName contains a case-sensitive ASCIIZ name which names the
461  *  message.  The message name consists of the vendor name, a backslash,
462  *  then arbitrary user-defined ASCIIZ text.  For example:
463  *
464  *          "WidgetWare\QueryScannerShutdown"
465  *          "WidgetWare\Video Q39S\AdapterReady"
466  *
467  *  After the ASCIIZ name, arbitrary information may be provided.
468  *  Make sure that dbud_dbh.dbch_size is big enough to encompass
469  *  all the data.  And remember that nothing in the structure may
470  *  contain pointers.
471  */
472
473 #define DBT_USERDEFINED 0xFFFF
474
475 struct _DEV_BROADCAST_USERDEFINED { /* */
476       struct _DEV_BROADCAST_HDR dbud_dbh;
477       char             dbud_szName[1];        /* ASCIIZ name */
478 /*  BYTE             dbud_rgbUserDefined[];*/ /* User-defined contents */
479 };
480
481
482 #endif  // _DBT_H
483
484
485