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
ae6468c9
Commit
ae6468c9
authored
Jan 17, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Implement IWbemPath::SetClassName.
parent
23ae6e4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
5 deletions
+62
-5
path.c
dlls/wmiutils/path.c
+19
-5
path.c
dlls/wmiutils/tests/path.c
+43
-0
No files found.
dlls/wmiutils/path.c
View file @
ae6468c9
...
...
@@ -447,18 +447,21 @@ static HRESULT WINAPI path_SetServer(
static
const
ULONGLONG
flags
=
WBEMPATH_INFO_PATH_HAD_SERVER
|
WBEMPATH_INFO_V1_COMPLIANT
|
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
;
WCHAR
*
server
;
TRACE
(
"%p, %s
\n
"
,
iface
,
debugstr_w
(
name
));
heap_free
(
path
->
server
);
if
(
name
)
{
if
(
!
(
path
->
server
=
strdupW
(
name
)))
return
WBEM_E_OUT_OF_MEMORY
;
if
(
!
(
server
=
strdupW
(
name
)))
return
WBEM_E_OUT_OF_MEMORY
;
heap_free
(
path
->
server
);
path
->
server
=
server
;
path
->
len_server
=
strlenW
(
path
->
server
);
path
->
flags
|=
flags
;
}
else
{
heap_free
(
path
->
server
);
path
->
server
=
NULL
;
path
->
len_server
=
0
;
path
->
flags
&=
~
flags
;
...
...
@@ -593,10 +596,21 @@ static HRESULT WINAPI path_RemoveAllScopes(
static
HRESULT
WINAPI
path_SetClassName
(
IWbemPath
*
iface
,
LPCWSTR
N
ame
)
LPCWSTR
n
ame
)
{
FIXME
(
"%p, %s
\n
"
,
iface
,
debugstr_w
(
Name
));
return
E_NOTIMPL
;
struct
path
*
path
=
impl_from_IWbemPath
(
iface
);
WCHAR
*
class
;
TRACE
(
"%p, %s
\n
"
,
iface
,
debugstr_w
(
name
));
if
(
!
name
)
return
WBEM_E_INVALID_PARAMETER
;
if
(
!
(
class
=
strdupW
(
name
)))
return
WBEM_E_OUT_OF_MEMORY
;
heap_free
(
path
->
class
);
path
->
class
=
class
;
path
->
len_class
=
strlenW
(
path
->
class
);
path
->
flags
|=
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
;
return
S_OK
;
}
static
HRESULT
WINAPI
path_GetClassName
(
...
...
dlls/wmiutils/tests/path.c
View file @
ae6468c9
...
...
@@ -324,6 +324,44 @@ static void test_IWbemPath_GetClassName(void)
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_SetClassName
(
void
)
{
static
const
WCHAR
classW
[]
=
{
'c'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
IWbemPath
*
path
;
WCHAR
buf
[
16
];
ULONG
len
;
ULONGLONG
flags
;
HRESULT
hr
;
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_SetClassName
(
path
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_SetClassName
(
path
,
emptyW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_SetClassName
(
path
,
classW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
buf
[
0
]
=
0
;
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetClassName
(
path
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
classW
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
flags
=
0
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
&
flags
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
flags
==
(
WBEMPATH_INFO_ANON_LOCAL_MACHINE
|
WBEMPATH_INFO_IS_CLASS_REF
|
WBEMPATH_INFO_HAS_SUBSCOPES
|
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
flags
>>
32
),
(
unsigned
long
)
flags
);
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_GetServer
(
void
)
{
static
const
WCHAR
dotW
[]
=
{
'.'
,
0
};
...
...
@@ -438,6 +476,7 @@ static void test_IWbemPath_GetInfo(void)
static
void
test_IWbemPath_SetServer
(
void
)
{
static
const
WCHAR
serverW
[]
=
{
's'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
IWbemPath
*
path
;
WCHAR
buf
[
16
];
ULONG
len
;
...
...
@@ -453,6 +492,9 @@ static void test_IWbemPath_SetServer(void)
hr
=
IWbemPath_GetServer
(
path
,
&
len
,
buf
);
ok
(
hr
==
WBEM_E_NOT_AVAILABLE
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_SetServer
(
path
,
emptyW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_SetServer
(
path
,
serverW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -493,6 +535,7 @@ START_TEST (path)
test_IWbemPath_SetText
();
test_IWbemPath_GetText
();
test_IWbemPath_GetClassName
();
test_IWbemPath_SetClassName
();
test_IWbemPath_GetServer
();
test_IWbemPath_GetInfo
();
test_IWbemPath_SetServer
();
...
...
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