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
7879326f
Commit
7879326f
authored
Oct 17, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Add tests for Win32_Service methods.
parent
d5cbcc1e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
query.c
dlls/wbemprox/tests/query.c
+88
-0
No files found.
dlls/wbemprox/tests/query.c
View file @
7879326f
...
...
@@ -125,6 +125,93 @@ static void test_select( IWbemServices *services )
SysFreeString
(
query
);
}
static
void
test_Win32_Service
(
IWbemServices
*
services
)
{
static
const
WCHAR
returnvalueW
[]
=
{
'R'
,
'e'
,
't'
,
'u'
,
'r'
,
'n'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
pauseserviceW
[]
=
{
'P'
,
'a'
,
'u'
,
's'
,
'e'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
resumeserviceW
[]
=
{
'R'
,
'e'
,
's'
,
'u'
,
'm'
,
'e'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
startserviceW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
stopserviceW
[]
=
{
'S'
,
't'
,
'o'
,
'p'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
stateW
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
stoppedW
[]
=
{
'S'
,
't'
,
'o'
,
'p'
,
'p'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
serviceW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'.'
,
'N'
,
'a'
,
'm'
,
'e'
,
'='
,
'"'
,
'S'
,
'p'
,
'o'
,
'o'
,
'l'
,
'e'
,
'r'
,
'"'
,
0
};
BSTR
class
=
SysAllocString
(
serviceW
),
method
;
IWbemClassObject
*
service
,
*
out
;
VARIANT
state
,
retval
;
CIMTYPE
type
;
HRESULT
hr
;
hr
=
IWbemServices_GetObject
(
services
,
class
,
0
,
NULL
,
&
service
,
NULL
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"Win32_Service not available
\n
"
);
return
;
}
type
=
0xdeadbeef
;
VariantInit
(
&
state
);
hr
=
IWbemClassObject_Get
(
service
,
stateW
,
0
,
&
state
,
&
type
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get service state %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
state
)
==
VT_BSTR
,
"unexpected variant type 0x%x
\n
"
,
V_VT
(
&
state
)
);
ok
(
type
==
CIM_STRING
,
"unexpected type 0x%x
\n
"
,
type
);
if
(
!
lstrcmpW
(
V_BSTR
(
&
state
),
stoppedW
))
{
out
=
NULL
;
method
=
SysAllocString
(
startserviceW
);
hr
=
IWbemServices_ExecMethod
(
services
,
class
,
method
,
0
,
NULL
,
NULL
,
&
out
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to execute method %08x
\n
"
,
hr
);
SysFreeString
(
method
);
VariantInit
(
&
retval
);
hr
=
IWbemClassObject_Get
(
out
,
returnvalueW
,
0
,
&
retval
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get return value %08x
\n
"
,
hr
);
ok
(
!
V_I4
(
&
retval
),
"unexpected error %u
\n
"
,
V_UI4
(
&
retval
)
);
IWbemClassObject_Release
(
out
);
}
out
=
NULL
;
method
=
SysAllocString
(
pauseserviceW
);
hr
=
IWbemServices_ExecMethod
(
services
,
class
,
method
,
0
,
NULL
,
NULL
,
&
out
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to execute method %08x
\n
"
,
hr
);
SysFreeString
(
method
);
VariantInit
(
&
retval
);
hr
=
IWbemClassObject_Get
(
out
,
returnvalueW
,
0
,
&
retval
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get return value %08x
\n
"
,
hr
);
ok
(
V_I4
(
&
retval
),
"unexpected success
\n
"
);
IWbemClassObject_Release
(
out
);
out
=
NULL
;
method
=
SysAllocString
(
resumeserviceW
);
hr
=
IWbemServices_ExecMethod
(
services
,
class
,
method
,
0
,
NULL
,
NULL
,
&
out
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to execute method %08x
\n
"
,
hr
);
SysFreeString
(
method
);
VariantInit
(
&
retval
);
hr
=
IWbemClassObject_Get
(
out
,
returnvalueW
,
0
,
&
retval
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get return value %08x
\n
"
,
hr
);
ok
(
V_I4
(
&
retval
),
"unexpected success
\n
"
);
IWbemClassObject_Release
(
out
);
if
(
!
lstrcmpW
(
V_BSTR
(
&
state
),
stoppedW
))
{
out
=
NULL
;
method
=
SysAllocString
(
stopserviceW
);
hr
=
IWbemServices_ExecMethod
(
services
,
class
,
method
,
0
,
NULL
,
NULL
,
&
out
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to execute method %08x
\n
"
,
hr
);
SysFreeString
(
method
);
VariantInit
(
&
retval
);
hr
=
IWbemClassObject_Get
(
out
,
returnvalueW
,
0
,
&
retval
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"failed to get return value %08x
\n
"
,
hr
);
ok
(
!
V_I4
(
&
retval
),
"unexpected error %u
\n
"
,
V_UI4
(
&
retval
)
);
IWbemClassObject_Release
(
out
);
}
VariantClear
(
&
state
);
IWbemClassObject_Release
(
service
);
SysFreeString
(
class
);
}
static
void
test_StdRegProv
(
IWbemServices
*
services
)
{
static
const
WCHAR
enumkeyW
[]
=
{
'E'
,
'n'
,
'u'
,
'm'
,
'K'
,
'e'
,
'y'
,
0
};
...
...
@@ -327,6 +414,7 @@ START_TEST(query)
ok
(
hr
==
S_OK
,
"failed to set proxy blanket %08x
\n
"
,
hr
);
test_select
(
services
);
test_Win32_Service
(
services
);
test_StdRegProv
(
services
);
SysFreeString
(
path
);
...
...
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