Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/cfgmgr32/cfgmgr32_private.h
12343 views
1
/*
2
* Copyright (C) 2023 Mohamad Al-Jaf
3
* Copyright (C) 2025 Vibhav Pant
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18
*/
19
20
#include <stddef.h>
21
#include <stdarg.h>
22
#include <assert.h>
23
24
#include "windef.h"
25
#include "winbase.h"
26
#include "winreg.h"
27
#include "winternl.h"
28
#include "winuser.h"
29
30
#include "cfgmgr32.h"
31
#include "setupapi.h"
32
#include "dbt.h"
33
#include "devfiltertypes.h"
34
#include "devquery.h"
35
36
#include "wine/plugplay.h"
37
#include "wine/rbtree.h"
38
#include "wine/debug.h"
39
40
static inline const char *debugstr_DEVPROPKEY( const DEVPROPKEY *key )
41
{
42
if (!key) return "(null)";
43
return wine_dbg_sprintf( "{%s, %04lx}", debugstr_guid( &key->fmtid ), key->pid );
44
}
45
46
static inline const char *debugstr_DEVPROPCOMPKEY( const DEVPROPCOMPKEY *key )
47
{
48
if (!key) return "(null)";
49
return wine_dbg_sprintf( "{%s, %d, %s}", debugstr_DEVPROPKEY( &key->Key ), key->Store,
50
debugstr_w( key->LocaleName ) );
51
}
52
53
struct property
54
{
55
BOOL ansi;
56
DEVPROPKEY key;
57
DEVPROPTYPE *type;
58
DWORD *reg_type;
59
void *buffer;
60
DWORD *size;
61
};
62
63
extern LSTATUS init_property( struct property *prop, const DEVPROPKEY *key, DEVPROPTYPE *type, void *buffer, DWORD *size );
64
65
struct device_interface
66
{
67
GUID class_guid;
68
WCHAR class[39];
69
WCHAR name[MAX_PATH];
70
WCHAR refstr[MAX_PATH];
71
};
72
73
static inline const char *debugstr_device_interface( const struct device_interface *iface )
74
{
75
return wine_dbg_sprintf( "{%s %s %s}", debugstr_w(iface->class), debugstr_w(iface->name), debugstr_w(iface->refstr) );
76
}
77
78
typedef LSTATUS (*enum_objects_cb)( HKEY hkey, const void *object, const WCHAR *path, UINT path_len, void *context );
79
extern LSTATUS enum_device_interfaces( BOOL all, enum_objects_cb callback, void *context );
80
81
extern LSTATUS init_device_interface( struct device_interface *iface, const WCHAR *name );
82
extern LSTATUS open_device_interface_key( const struct device_interface *iface, REGSAM access, BOOL open, HKEY *hkey );
83
extern LSTATUS enum_device_interface_property_keys( HKEY hkey, const struct device_interface *iface, DEVPROPKEY *buffer, ULONG *size );
84
extern LSTATUS query_device_interface_property( HKEY hkey, const struct device_interface *iface, struct property *prop );
85
86