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
|
//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992-2001.
//
// File: C O M M O N. H
//
// Contents: Common macros and declarations for the sample notify object.
//
// Notes:
//
// Author: Alok Sinha
//
//----------------------------------------------------------------------------
#ifndef COMMON_H_INCLUDED
#define COMMON_H_INCLUDED
#include <devguid.h>
#include <strsafe.h>
#define celems(_x) (sizeof(_x) / sizeof(_x[0]))
#define MAX_VIRTUAL_MP_PER_ADAPTER 64
enum ConfigAction {
eActUnknown,
eActInstall,
eActAdd,
eActRemove,
eActUpdate,
eActPropertyUIAdd,
eActPropertyUIRemove
};
//
// PnP ID, also referred to as Hardware ID, of the protocol interface.
//
const WCHAR c_szMuxProtocol[] = L"ms_muxp";
//
// PnP ID, also referred to as Hardware ID, of the Miniport interface.
//
const WCHAR c_szMuxMiniport[] = L"ms_muxmp";
//
// Name of the service as specified in the inf file in AddService directive.
//
const WCHAR c_szMuxService[] = L"muxp";
//
// Path to the config string where the virtual miniport instance names
// are stored.
//
const WCHAR c_szAdapterList[] =
L"System\\CurrentControlSet\\Services\\muxp\\Parameters\\Adapters";
//
// Value name in the registry where miniport device id is stored.
//
const WCHAR c_szUpperBindings[] = L"UpperBindings";
const WCHAR c_szDevicePrefix[] = L"\\Device\\";
#define ReleaseObj( x ) if ( x ) \
((IUnknown*)(x))->Release();
#if DBG
void TraceMsg ( _In_ LPWSTR szFormat, ...);
void DumpChangeFlag (DWORD dwChangeFlag);
void DumpBindingPath (INetCfgBindingPath* pncbp);
void DumpComponent (INetCfgComponent *pncc);
#else
#define TraceMsg
#define DumpChangeFlag( x )
#define DumpBindingPath( x )
#define DumpComponent( x )
#endif
HRESULT HrFindInstance (INetCfg *pnc,
GUID &guidInstance,
INetCfgComponent **ppnccMiniport);
LONG AddToMultiSzValue( HKEY hkeyAdapterGuid,
_In_ LPWSTR szMiniportGuid);
LONG DeleteFromMultiSzValue( HKEY hkeyAdapterGuid,
_In_ LPWSTR szMiniportGuid);
LPWSTR AddDevicePrefix ( _In_ LPWSTR lpStr);
LPWSTR RemoveDevicePrefix ( _In_ LPWSTR lpStr);
#endif // COMMON_H_INCLUDED
|