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
77ae1d0f
Commit
77ae1d0f
authored
Jan 16, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Implement IWbemPath::SetServer.
parent
bbb29e9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
7 deletions
+80
-7
path.c
dlls/wmiutils/path.c
+26
-7
path.c
dlls/wmiutils/tests/path.c
+54
-0
No files found.
dlls/wmiutils/path.c
View file @
77ae1d0f
...
...
@@ -441,10 +441,29 @@ static HRESULT WINAPI path_GetInfo(
static
HRESULT
WINAPI
path_SetServer
(
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
);
static
const
ULONGLONG
flags
=
WBEMPATH_INFO_PATH_HAD_SERVER
|
WBEMPATH_INFO_V1_COMPLIANT
|
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
;
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
;
path
->
len_server
=
strlenW
(
path
->
server
);
path
->
flags
|=
flags
;
}
else
{
path
->
server
=
NULL
;
path
->
len_server
=
0
;
path
->
flags
&=
~
flags
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
path_GetServer
(
...
...
@@ -457,7 +476,7 @@ static HRESULT WINAPI path_GetServer(
TRACE
(
"%p, %p, %p
\n
"
,
iface
,
len
,
name
);
if
(
!
len
||
(
*
len
&&
!
name
))
return
WBEM_E_INVALID_PARAMETER
;
if
(
!
path
->
class
)
return
WBEM_E_NOT_AVAILABLE
;
if
(
!
path
->
server
)
return
WBEM_E_NOT_AVAILABLE
;
if
(
*
len
>
path
->
len_server
)
strcpyW
(
name
,
path
->
server
);
*
len
=
path
->
len_server
+
1
;
return
S_OK
;
...
...
@@ -504,15 +523,15 @@ static HRESULT WINAPI path_RemoveNamespaceAt(
}
static
HRESULT
WINAPI
path_RemoveAllNamespaces
(
IWbemPath
*
iface
)
IWbemPath
*
iface
)
{
FIXME
(
"%p
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
path_GetScopeCount
(
IWbemPath
*
iface
,
ULONG
*
puCount
)
IWbemPath
*
iface
,
ULONG
*
puCount
)
{
FIXME
(
"%p, %p
\n
"
,
iface
,
puCount
);
return
E_NOTIMPL
;
...
...
dlls/wmiutils/tests/path.c
View file @
77ae1d0f
...
...
@@ -314,6 +314,7 @@ static void test_IWbemPath_GetClassName(void)
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
ok
(
len
==
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
"unexpected length %u
\n
"
,
len
);
buf
[
0
]
=
0
;
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetClassName
(
path
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -361,6 +362,7 @@ static void test_IWbemPath_GetServer(void)
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
ok
(
len
==
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
"unexpected length %u
\n
"
,
len
);
buf
[
0
]
=
0
;
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetServer
(
path
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -433,6 +435,57 @@ static void test_IWbemPath_GetInfo(void)
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_SetServer
(
void
)
{
static
const
WCHAR
serverW
[]
=
{
's'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
0
};
IWbemPath
*
path
;
WCHAR
buf
[
16
];
ULONG
len
;
ULONGLONG
flags
;
HRESULT
hr
;
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_SetServer
(
path
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetServer
(
path
,
&
len
,
buf
);
ok
(
hr
==
WBEM_E_NOT_AVAILABLE
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_SetServer
(
path
,
serverW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
buf
[
0
]
=
0
;
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetServer
(
path
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
serverW
),
"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_HAS_MACHINE_NAME
|
WBEMPATH_INFO_V1_COMPLIANT
|
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
|
WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
|
WBEMPATH_INFO_PATH_HAD_SERVER
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
flags
>>
32
),
(
unsigned
long
)
flags
);
hr
=
IWbemPath_SetServer
(
path
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetServer
(
path
,
&
len
,
buf
);
ok
(
hr
==
WBEM_E_NOT_AVAILABLE
,
"got %08x
\n
"
,
hr
);
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_SERVER_NAMESPACE_ONLY
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
flags
>>
32
),
(
unsigned
long
)
flags
);
IWbemPath_Release
(
path
);
}
START_TEST
(
path
)
{
CoInitialize
(
NULL
);
...
...
@@ -442,6 +495,7 @@ START_TEST (path)
test_IWbemPath_GetClassName
();
test_IWbemPath_GetServer
();
test_IWbemPath_GetInfo
();
test_IWbemPath_SetServer
();
CoUninitialize
();
}
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