From: Vibhav Pant vibhavp@gmail.com
--- include/Makefile.in | 1 + include/devpropdef.h | 22 +++++++++++ include/devquerydef.h | 90 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 include/devquerydef.h
diff --git a/include/Makefile.in b/include/Makefile.in index 650d69815f8..cdc9bf29784 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -234,6 +234,7 @@ SOURCES = \ devicetopology.idl \ devpkey.h \ devpropdef.h \ + devquerydef.h \ dhcpcsdk.h \ dhtmldid.h \ dhtmled.idl \ diff --git a/include/devpropdef.h b/include/devpropdef.h index 94046f5bce0..de82648e661 100644 --- a/include/devpropdef.h +++ b/include/devpropdef.h @@ -100,4 +100,26 @@ typedef struct _DEVPROPKEY { #else #define IsEqualDevPropKey(a,b) (((a).pid == (b).pid) && IsEqualIID(&(a).fmtid,&(b).fmtid)) #endif + +typedef enum _DEVPROPSTORE +{ + DEVPROP_STORE_SYSTEM, + DEVPROP_STORE_USER, +} DEVPROPSTORE, *PDEVPROPSTORE; + +typedef struct _DEVPROPCOMPKEY +{ + DEVPROPKEY Key; + DEVPROPSTORE Store; + PCWSTR LocaleName; +} DEVPROPCOMPKEY, *PDEVPROPCOMPKEY; + +typedef struct _DEVPROPERTY +{ + DEVPROPCOMPKEY CompKey; + DEVPROPTYPE Type; + ULONG BufferSize; + void *Buffer; +} DEVPROPERTY, *PDEVPROPERTY; + #endif diff --git a/include/devquerydef.h b/include/devquerydef.h new file mode 100644 index 00000000000..5ad01205a16 --- /dev/null +++ b/include/devquerydef.h @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Vibhav Pant + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __DEVQUERYDEF_H__ +#define __DEVQUERYDEF_H__ + +typedef enum _DEV_OBJECT_TYPE +{ + DevObjectTypeUnknown, + DevObjectTypeDeviceInterface, + DevObjectTypeDeviceContainer, + DevObjectTypeDevice, + DevObjectTypeDeviceInterfaceClass, + DevObjectTypeAEP, + DevObjectTypeAEPContainer, + DevObjectTypeDeviceInstallerClass, + DevObjectTypeDeviceInterfaceDisplay, + DevObjectTypeDeviceContainerDisplay, + DevObjectTypeAEPService, + DevObjectTypeDevicePanel, + DevObjectTypeAEPProtocol, +} DEV_OBJECT_TYPE, *PDEV_OBJECT_TYPE; + +typedef enum _DEV_QUERY_FLAGS +{ + DevQueryFlagNone = 0x0, + DevQueryFlagUpdateResults = 0x1, + DevQueryFlagAllProperties = 0x2, + DevQueryFlagLocalize = 0x4, + DevQueryFlagAsyncClose = 0x8, +} DEV_QUERY_FLAGS, *PDEV_QUERY_FLAGS; + +typedef enum _DEV_QUERY_STATE +{ + DevQueryStateInitialized, + DevQueryStateEnumCompleted, + DevQueryStateAborted, + DevQueryStateClosed, +} DEV_QUERY_STATE, *PDEV_QUERY_STATE; + +typedef enum _DEV_QUERY_RESULT_ACTION +{ + DevQueryResultStateChange, + DevQueryResultAdd, + DevQueryResultUpdate, + DevQueryResultRemove, +} DEV_QUERY_RESULT_ACTION, *PDEV_QUERY_RESULT_ACTION; + +typedef struct _DEV_OBJECT +{ + DEV_OBJECT_TYPE ObjectType; + PCWSTR pszObjectId; + ULONG cPropertyCount; + const DEVPROPERTY *pProperties; +} DEV_OBJECT, *PDEV_OBJECT; + +typedef struct _DEV_QUERY_RESULT_ACTION_DATA +{ + DEV_QUERY_RESULT_ACTION Action; + union + { + DEV_QUERY_STATE State; + DEV_OBJECT DeviceObject; + } Data; +} DEV_QUERY_RESULT_ACTION_DATA, *PDEV_QUERY_RESULT_ACTION_DATA; + +typedef struct _DEV_QUERY_PARAMETER +{ + DEVPROPKEY Key; + DEVPROPTYPE Type; + ULONG BufferSize; + void *Buffer; +} DEV_QUERY_PARAMETER, *PDEV_QUERY_PARAMETER; + +#endif /* __DEVQUERYDEF_H__ */