Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
05cdc07d
Commit
05cdc07d
authored
Sep 28, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Implement StdRegProv.CreateKey.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6dd6c455
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
1 deletion
+111
-1
builtin.c
dlls/wbemprox/builtin.c
+6
-1
reg.c
dlls/wbemprox/reg.c
+61
-0
query.c
dlls/wbemprox/tests/query.c
+42
-0
wbemprox_private.h
dlls/wbemprox/wbemprox_private.h
+2
-0
No files found.
dlls/wbemprox/builtin.c
View file @
05cdc07d
...
...
@@ -712,6 +712,7 @@ static const struct column col_sounddevice[] =
};
static
const
struct
column
col_stdregprov
[]
=
{
{
method_createkeyW
,
CIM_FLAG_ARRAY
|
COL_FLAG_METHOD
},
{
method_enumkeyW
,
CIM_FLAG_ARRAY
|
COL_FLAG_METHOD
},
{
method_enumvaluesW
,
CIM_FLAG_ARRAY
|
COL_FLAG_METHOD
},
{
method_getstringvalueW
,
CIM_FLAG_ARRAY
|
COL_FLAG_METHOD
}
...
...
@@ -1135,6 +1136,7 @@ struct record_sounddevice
};
struct
record_stdregprov
{
class_method
*
createkey
;
class_method
*
enumkey
;
class_method
*
enumvalues
;
class_method
*
getstringvalue
;
...
...
@@ -1199,6 +1201,9 @@ static const struct record_param data_param[] =
{
class_serviceW
,
method_resumeserviceW
,
-
1
,
param_returnvalueW
,
CIM_UINT32
,
VT_I4
},
{
class_serviceW
,
method_startserviceW
,
-
1
,
param_returnvalueW
,
CIM_UINT32
,
VT_I4
},
{
class_serviceW
,
method_stopserviceW
,
-
1
,
param_returnvalueW
,
CIM_UINT32
,
VT_I4
},
{
class_stdregprovW
,
method_createkeyW
,
1
,
param_defkeyW
,
CIM_SINT32
,
0
,
0x80000002
},
{
class_stdregprovW
,
method_createkeyW
,
1
,
param_subkeynameW
,
CIM_STRING
},
{
class_stdregprovW
,
method_createkeyW
,
-
1
,
param_returnvalueW
,
CIM_UINT32
,
VT_I4
},
{
class_stdregprovW
,
method_enumkeyW
,
1
,
param_defkeyW
,
CIM_SINT32
,
0
,
0x80000002
},
{
class_stdregprovW
,
method_enumkeyW
,
1
,
param_subkeynameW
,
CIM_STRING
},
{
class_stdregprovW
,
method_enumkeyW
,
-
1
,
param_returnvalueW
,
CIM_UINT32
,
VT_I4
},
...
...
@@ -1237,7 +1242,7 @@ static const struct record_sounddevice data_sounddevice[] =
};
static
const
struct
record_stdregprov
data_stdregprov
[]
=
{
{
reg_enum_key
,
reg_enum_values
,
reg_get_stringvalue
}
{
reg_
create_key
,
reg_
enum_key
,
reg_enum_values
,
reg_get_stringvalue
}
};
static
UINT16
systemenclosure_chassistypes
[]
=
{
...
...
dlls/wbemprox/reg.c
View file @
05cdc07d
...
...
@@ -76,6 +76,67 @@ static HRESULT to_i4_array( DWORD *values, DWORD count, VARIANT *var )
return
S_OK
;
}
static
HRESULT
create_key
(
HKEY
root
,
const
WCHAR
*
subkey
,
VARIANT
*
retval
)
{
LONG
res
;
HKEY
hkey
;
TRACE
(
"%p, %s
\n
"
,
root
,
debugstr_w
(
subkey
));
res
=
RegCreateKeyExW
(
root
,
subkey
,
0
,
NULL
,
0
,
0
,
NULL
,
&
hkey
,
NULL
);
set_variant
(
VT_UI4
,
res
,
NULL
,
retval
);
if
(
!
res
)
{
RegCloseKey
(
hkey
);
return
S_OK
;
}
return
HRESULT_FROM_WIN32
(
res
);
}
HRESULT
reg_create_key
(
IWbemClassObject
*
obj
,
IWbemClassObject
*
in
,
IWbemClassObject
**
out
)
{
VARIANT
defkey
,
subkey
,
retval
;
IWbemClassObject
*
sig
,
*
out_params
=
NULL
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
in
,
out
);
hr
=
IWbemClassObject_Get
(
in
,
param_defkeyW
,
0
,
&
defkey
,
NULL
,
NULL
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
IWbemClassObject_Get
(
in
,
param_subkeynameW
,
0
,
&
subkey
,
NULL
,
NULL
);
if
(
hr
!=
S_OK
)
return
hr
;
hr
=
create_signature
(
class_stdregprovW
,
method_createkeyW
,
PARAM_OUT
,
&
sig
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
subkey
);
return
hr
;
}
if
(
out
)
{
hr
=
IWbemClassObject_SpawnInstance
(
sig
,
0
,
&
out_params
);
if
(
hr
!=
S_OK
)
{
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
return
hr
;
}
}
hr
=
create_key
(
(
HKEY
)(
INT_PTR
)
V_I4
(
&
defkey
),
V_BSTR
(
&
subkey
),
&
retval
);
if
(
hr
==
S_OK
&&
out_params
)
hr
=
IWbemClassObject_Put
(
out_params
,
param_returnvalueW
,
0
,
&
retval
,
CIM_UINT32
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
sig
);
if
(
hr
==
S_OK
&&
out
)
{
*
out
=
out_params
;
IWbemClassObject_AddRef
(
out_params
);
}
if
(
out_params
)
IWbemClassObject_Release
(
out_params
);
return
hr
;
}
static
HRESULT
enum_key
(
HKEY
root
,
const
WCHAR
*
subkey
,
VARIANT
*
names
,
VARIANT
*
retval
)
{
HKEY
hkey
;
...
...
dlls/wbemprox/tests/query.c
View file @
05cdc07d
...
...
@@ -704,6 +704,7 @@ static void test_Win32_SystemEnclosure( IWbemServices *services )
static
void
test_StdRegProv
(
IWbemServices
*
services
)
{
static
const
WCHAR
createkeyW
[]
=
{
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
enumkeyW
[]
=
{
'E'
,
'n'
,
'u'
,
'm'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
enumvaluesW
[]
=
{
'E'
,
'n'
,
'u'
,
'm'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
's'
,
0
};
static
const
WCHAR
getstringvalueW
[]
=
{
'G'
,
'e'
,
't'
,
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
...
...
@@ -719,11 +720,14 @@ static void test_StdRegProv( IWbemServices *services )
static
const
WCHAR
windowsW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
regtestW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'S'
,
't'
,
'd'
,
'R'
,
'e'
,
'g'
,
'P'
,
'r'
,
'o'
,
'v'
,
'T'
,
'e'
,
's'
,
't'
,
0
};
BSTR
class
=
SysAllocString
(
stdregprovW
),
method
;
IWbemClassObject
*
reg
,
*
sig_in
,
*
in
,
*
out
;
VARIANT
defkey
,
subkey
,
retval
,
names
,
types
,
value
,
valuename
;
CIMTYPE
type
;
HRESULT
hr
;
LONG
res
;
hr
=
IWbemServices_GetObject
(
services
,
class
,
0
,
NULL
,
&
reg
,
NULL
);
if
(
hr
!=
S_OK
)
...
...
@@ -731,6 +735,44 @@ static void test_StdRegProv( IWbemServices *services )
win_skip
(
"StdRegProv not available
\n
"
);
return
;
}
hr
=
IWbemClassObject_GetMethod
(
reg
,
createkeyW
,
0
,
&
sig_in
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get CreateKey method %08x
\n
"
,
hr
);
hr
=
IWbemClassObject_SpawnInstance
(
sig_in
,
0
,
&
in
);
ok
(
hr
==
S_OK
,
"failed to spawn instance %08x
\n
"
,
hr
);
V_VT
(
&
defkey
)
=
VT_I4
;
V_I4
(
&
defkey
)
=
0x80000001
;
hr
=
IWbemClassObject_Put
(
in
,
defkeyW
,
0
,
&
defkey
,
0
);
ok
(
hr
==
S_OK
,
"failed to set root %08x
\n
"
,
hr
);
V_VT
(
&
subkey
)
=
VT_BSTR
;
V_BSTR
(
&
subkey
)
=
SysAllocString
(
regtestW
);
hr
=
IWbemClassObject_Put
(
in
,
subkeynameW
,
0
,
&
subkey
,
0
);
ok
(
hr
==
S_OK
,
"failed to set subkey %08x
\n
"
,
hr
);
out
=
NULL
;
method
=
SysAllocString
(
createkeyW
);
hr
=
IWbemServices_ExecMethod
(
services
,
class
,
method
,
0
,
NULL
,
in
,
&
out
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to execute method %08x
\n
"
,
hr
);
SysFreeString
(
method
);
type
=
0xdeadbeef
;
VariantInit
(
&
retval
);
hr
=
IWbemClassObject_Get
(
out
,
returnvalueW
,
0
,
&
retval
,
&
type
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get return value %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
retval
)
==
VT_I4
,
"unexpected variant type 0x%x
\n
"
,
V_VT
(
&
retval
)
);
ok
(
!
V_I4
(
&
retval
),
"unexpected error %u
\n
"
,
V_UI4
(
&
retval
)
);
ok
(
type
==
CIM_UINT32
,
"unexpected type 0x%x
\n
"
,
type
);
res
=
RegDeleteKeyW
(
HKEY_CURRENT_USER
,
regtestW
);
ok
(
!
res
,
"got %d
\n
"
,
res
);
VariantClear
(
&
subkey
);
IWbemClassObject_Release
(
in
);
IWbemClassObject_Release
(
out
);
IWbemClassObject_Release
(
sig_in
);
hr
=
IWbemClassObject_GetMethod
(
reg
,
enumkeyW
,
0
,
&
sig_in
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get EnumKey method %08x
\n
"
,
hr
);
...
...
dlls/wbemprox/wbemprox_private.h
View file @
05cdc07d
...
...
@@ -218,6 +218,7 @@ HRESULT EnumWbemClassObject_create(struct query *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT
WbemQualifierSet_create
(
const
WCHAR
*
,
const
WCHAR
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
process_get_owner
(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
reg_create_key
(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
reg_enum_key
(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
reg_enum_values
(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
reg_get_stringvalue
(
IWbemClassObject
*
,
IWbemClassObject
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
...
...
@@ -243,6 +244,7 @@ static const WCHAR class_systemsecurityW[] = {'_','_','S','y','s','t','e','m','S
static
const
WCHAR
prop_nameW
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
method_createkeyW
[]
=
{
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
method_enumkeyW
[]
=
{
'E'
,
'n'
,
'u'
,
'm'
,
'K'
,
'e'
,
'y'
,
0
};
static
const
WCHAR
method_enumvaluesW
[]
=
{
'E'
,
'n'
,
'u'
,
'm'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
's'
,
0
};
static
const
WCHAR
method_getownerW
[]
=
{
'G'
,
'e'
,
't'
,
'O'
,
'w'
,
'n'
,
'e'
,
'r'
,
0
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment