2 * Routines for the pnp (Plug and Play) MSRPC interface
3 * Copyright 2005 Jean-Baptiste Marchand <jbm@hsc.fr>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
16 #include "packet-dcerpc.h"
17 #include "packet-dcerpc-pnp.h"
19 void proto_register_dcerpc_pnp(void);
20 void proto_reg_handoff_dcerpc_pnp(void);
22 static int proto_dcerpc_pnp
;
24 static int hf_pnp_opnum
;
26 static int ett_dcerpc_pnp
;
29 * The pnp MSRPC interface is typically reached using the ncacn_np transport
30 * and \pipe\ntsvcs or \pipe\plugplay named pipes as endpoint.
33 static e_guid_t uuid_dcerpc_pnp
= {
34 0x8d9f4e40, 0xa03d, 0x11ce,
35 { 0x8f, 0x69, 0x08, 0x00, 0x3e, 0x30, 0x05, 0x1b }
38 static uint16_t ver_dcerpc_pnp
= 1;
41 static const dcerpc_sub_dissector dcerpc_pnp_dissectors
[] = {
42 { PNP_DISCONNECT
, "PNP_Disconnect", NULL
, NULL
},
43 { PNP_CONNECT
, "PNP_Connect", NULL
, NULL
},
44 { PNP_GET_VERSION
, "PNP_GetVersion", NULL
, NULL
},
45 { PNP_GET_GLOBAL_STATE
, "PNP_GetGlobalState", NULL
, NULL
},
46 { PNP_INIT_DETECTION
, "PNP_InitDetection", NULL
, NULL
},
47 { PNP_REPORT_LOGON
, "PNP_ReportLogOn", NULL
, NULL
},
48 { PNP_VALIDATE_DEVICE_INSTANCE
,
49 "PNP_ValidateDeviceInstance", NULL
, NULL
},
50 { PNP_GET_ROOT_DEVICE_INSTANCE
,
51 "PNP_GetRootDeviceInstance", NULL
, NULL
},
52 { PNP_GET_RELATED_DEVICE_INSTANCE
,
53 "PNP_GetRelatedDeviceInstance", NULL
, NULL
},
54 { PNP_ENUMERATE_SUB_KEYS
,
55 "PNP_EnumerateSubKeys", NULL
, NULL
},
56 { PNP_GET_DEVICE_LIST
,
57 "PNP_GetDeviceList", NULL
, NULL
},
58 { PNP_GET_DEVICE_LIST_SIZE
,
59 "PNP_GetDeviceListSize", NULL
, NULL
},
60 { PNP_GET_DEPTH
, "PNP_GetDepth", NULL
, NULL
},
61 { PNP_GET_DEVICE_REG_PROP
,
62 "PNP_GetDeviceRegProp", NULL
, NULL
},
63 { PNP_SET_DEVICE_REG_PROP
,
64 "PNP_SetDeviceRegProp", NULL
, NULL
},
65 { PNP_GET_CLASS_INSTANCE
,
66 "PNP_GetClassInstance", NULL
, NULL
},
67 { PNP_CREATE_KEY
, "PNP_CreateKey", NULL
, NULL
},
68 { PNP_DELETE_REGISTRY_KEY
,
69 "PNP_DeleteRegistryKey", NULL
, NULL
},
70 { PNP_GET_CLASS_COUNT
,
71 "PNP_GetClassCount", NULL
, NULL
},
73 "PNP_GetClassName", NULL
, NULL
},
74 { PNP_DELETE_CLASS_KEY
,
75 "PNP_DeleteClassKey", NULL
, NULL
},
76 { PNP_GET_INTERFACE_DEVICE_ALIAS
,
77 "PNP_GetInterfaceDeviceAlias", NULL
, NULL
},
78 { PNP_GET_INTERFACE_DEVICE_LIST
,
79 "PNP_GetInterfaceDeviceList", NULL
, NULL
},
80 { PNP_GET_INTERFACE_DEVICE_LIST_SIZE
,
81 "PNP_GetInterfaceDeviceListSize", NULL
, NULL
},
82 { PNP_REGISTER_DEVICE_CLASS_ASSOCIATION
,
83 "PNP_RegisterDeviceClassAssociation", NULL
, NULL
},
84 { PNP_UNREGISTER_DEVICE_CLASS_ASSOCIATION
,
85 "PNP_UnregisterDeviceClassAssociation", NULL
, NULL
},
86 { PNP_GET_CLASS_REG_PROP
,
87 "PNP_GetClassRegProp", NULL
, NULL
},
88 { PNP_SET_CLASS_REG_PROP
,
89 "PNP_SetClassRegProp", NULL
, NULL
},
90 { PNP_CREATE_DEV_INST
, "PNP_CreateDevInst", NULL
, NULL
},
91 { PNP_DEVICE_INSTANCE_ACTION
,
92 "PNP_DeviceInstanceAction", NULL
, NULL
},
93 { PNP_GET_DEVICE_STATUS
,
94 "PNP_GetDeviceStatus", NULL
, NULL
},
95 { PNP_SET_DEVICE_PROBLEM
,
96 "PNP_SetDeviceProblem", NULL
, NULL
},
97 { PNP_DISABLE_DEV_INST
,
98 "PNP_DisableDevInst", NULL
, NULL
},
99 { PNP_UNINSTALL_DEV_INST
,
100 "PNP_UninstallDevInst", NULL
, NULL
},
101 { PNP_ADD_ID
, "PNP_AddID", NULL
, NULL
},
102 { PNP_REGISTER_DRIVER
,
103 "PNP_RegisterDriver", NULL
, NULL
},
105 "PNP_QueryRemove", NULL
, NULL
},
106 { PNP_REQUEST_DEVICE_EJECT
,
107 "PNP_RequestDeviceEject", NULL
, NULL
},
108 { PNP_IS_DOCKSTATION_PRESENT
,
109 "PNP_IsDockStationPresent", NULL
, NULL
},
110 { PNP_REQUEST_EJECT_PC
,
111 "PNP_RequestEjectPC", NULL
, NULL
},
113 "PNP_HwProfFlags", NULL
, NULL
},
114 { PNP_GET_HW_PROT_INFO
,
115 "PNP_GetHwProfInfo", NULL
, NULL
},
116 { PNP_ADD_EMPTY_LOG_CONF
,
117 "PNP_AddEmptyLogConf", NULL
, NULL
},
119 "PNP_FreeLogConf", NULL
, NULL
},
120 { PNP_GET_FIRST_LOG_CONF
,
121 "PNP_GetFirstLogConf", NULL
, NULL
},
122 { PNP_GET_NEXT_LOG_CONF
,
123 "PNP_GetNextLogConf", NULL
, NULL
},
124 { PNP_GET_LOG_CONF_PRIORITY
,
125 "PNP_GetLogConfPriority", NULL
, NULL
},
126 { PNP_ADD_RES_DES
, "PNP_AddResDes", NULL
, NULL
},
127 { PNP_FREE_RES_DES
, "PNP_FreeResDes", NULL
, NULL
},
128 { PNP_GET_NEXT_RES_DES
, "PNP_GetNextResDes", NULL
, NULL
},
129 { PNP_GET_RES_DES_DATA
, "PNP_GetResDesData", NULL
, NULL
},
130 { PNP_GET_RES_DES_DATA_SIZE
, "PNP_GetResDesDataSize", NULL
, NULL
},
131 { PNP_MODIFY_RES_DES
, "PNP_ModifyResDes", NULL
, NULL
},
132 { PNP_DETECT_RESOURCE_CONFLICT
,
133 "PNP_DetectResourceConflict", NULL
, NULL
},
134 { PNP_QUERY_RES_CONFLICT
,
135 "PNP_QueryResConfList", NULL
, NULL
},
137 "PNP_SetHwProf", NULL
, NULL
},
138 { PNP_QUERY_ARBITRATOR_FREE_DATA
,
139 "PNP_QueryArbitratorFreeData", NULL
, NULL
},
140 { PNP_QUERY_ARBITRATOR_FREE_SIZE
,
141 "PNP_QueryArbitratorFreeSize", NULL
, NULL
},
143 "PNP_RunDetection", NULL
, NULL
},
144 { PNP_REGISTER_NOTIFICATION
,
145 "PNP_RegisterNotification", NULL
, NULL
},
146 { PNP_UNREGISTER_NOTIFICATION
,
147 "PNP_UnregisterNotification", NULL
, NULL
},
148 { PNP_GET_CUSTOM_DEV_PROP
,
149 "PNP_GetCustomDevProp", NULL
, NULL
},
150 { PNP_GET_VERSION_INTERNAL
,
151 "PNP_GetVersionInternal", NULL
, NULL
},
152 { PNP_GET_BLOCKED_DRIVER_INFO
,
153 "PNP_GetBlockedDriverInfo", NULL
, NULL
},
154 { PNP_GET_SERVER_SIDE_DEV_INSTALL_FLAGS
,
155 "PNP_GetServerSideDeviceInstallFlags", NULL
, NULL
},
156 { PNP_GET_OBJECT_PROP_KEYS
,
157 "PNP_GetObjectPropKeys", NULL
, NULL
},
158 { PNP_GET_OBJECT_PROP
,
159 "PNP_GetObjectProp", NULL
, NULL
},
160 { PNP_SET_OBJECT_PROP
,
161 "PNP_SetObjectProp", NULL
, NULL
},
162 { PNP_INSTALL_DEV_INST
,
163 "PNP_InstallDevInst", NULL
, NULL
},
164 { PNP_APPLY_POWER_SETTINGS
,
165 "PNP_ApplyPowerSettings", NULL
, NULL
},
166 { PNP_DRIVER_STORE_ADD_DRV_PKG
,
167 "PNP_DriverStoreAddDriverPackage", NULL
, NULL
},
168 { PNP_DRIVER_STORE_DEL_DRV_PKG
,
169 "PNP_DriverStoreDeleteDriverPackage", NULL
, NULL
},
170 { PNP_REGISTER_SRV_NOTIFICATION
,
171 "PNP_RegisterServiceNotification", NULL
, NULL
},
172 { PNP_SET_ACTIVE_SRV
,
173 "PNP_SetActiveService", NULL
, NULL
},
174 { PNP_DELETE_SERVICE_DEVICES
,
175 "PNP_DeleteServiceDevices", NULL
, NULL
},
176 { 0, NULL
, NULL
, NULL
}
181 proto_register_dcerpc_pnp(void)
184 static hf_register_info hf
[] = {
187 { "Operation", "pnp.opnum", FT_UINT16
, BASE_DEC
,
188 NULL
, 0x0, NULL
, HFILL
}},
192 static int *ett
[] = {
197 proto_dcerpc_pnp
= proto_register_protocol("Microsoft Plug and Play service", "PNP", "pnp");
199 proto_register_field_array(proto_dcerpc_pnp
, hf
, array_length(hf
));
201 proto_register_subtree_array(ett
, array_length(ett
));
207 proto_reg_handoff_dcerpc_pnp(void)
209 /* register protocol as dcerpc */
212 proto_dcerpc_pnp
, ett_dcerpc_pnp
, &uuid_dcerpc_pnp
,
213 ver_dcerpc_pnp
, dcerpc_pnp_dissectors
, hf_pnp_opnum
);
217 * Editor modelines - https://www.wireshark.org/tools/modelines.html
222 * indent-tabs-mode: t
225 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
226 * :indentSize=8:tabSize=8:noTabs=false: