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
47e9ffa7
Commit
47e9ffa7
authored
Jan 15, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Implement IWbemPath::GetInfo.
parent
a7f4ac28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
14 deletions
+128
-14
path.c
dlls/wmiutils/path.c
+42
-14
path.c
dlls/wmiutils/tests/path.c
+64
-0
wmiutils.idl
include/wmiutils.idl
+22
-0
No files found.
dlls/wmiutils/path.c
View file @
47e9ffa7
...
...
@@ -35,16 +35,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmiutils);
struct
path
{
IWbemPath
IWbemPath_iface
;
LONG
refs
;
WCHAR
*
text
;
int
len_text
;
WCHAR
*
server
;
int
len_server
;
WCHAR
**
namespaces
;
int
*
len_namespaces
;
int
num_namespaces
;
WCHAR
*
class
;
int
len_class
;
LONG
refs
;
WCHAR
*
text
;
int
len_text
;
WCHAR
*
server
;
int
len_server
;
WCHAR
**
namespaces
;
int
*
len_namespaces
;
int
num_namespaces
;
WCHAR
*
class
;
int
len_class
;
ULONGLONG
flags
;
};
static
void
init_path
(
struct
path
*
path
)
...
...
@@ -58,6 +59,7 @@ static void init_path( struct path *path )
path
->
num_namespaces
=
0
;
path
->
class
=
NULL
;
path
->
len_class
=
0
;
path
->
flags
=
0
;
}
static
void
clear_path
(
struct
path
*
path
)
...
...
@@ -136,6 +138,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
memcpy
(
path
->
server
,
p
,
len
*
sizeof
(
WCHAR
)
);
path
->
server
[
len
]
=
0
;
path
->
len_server
=
len
;
path
->
flags
|=
WBEMPATH_INFO_PATH_HAD_SERVER
;
}
p
=
q
;
while
(
*
q
&&
*
q
!=
':'
)
...
...
@@ -180,6 +183,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
done:
if
(
hr
!=
S_OK
)
clear_path
(
path
);
else
path
->
flags
|=
WBEMPATH_INFO_CIM_COMPLIANT
|
WBEMPATH_INFO_V2_COMPLIANT
;
return
hr
;
}
...
...
@@ -197,6 +201,7 @@ static HRESULT WINAPI path_SetText(
if
(
!
uMode
||
!
pszPath
)
return
WBEM_E_INVALID_PARAMETER
;
clear_path
(
path
);
if
(
!
pszPath
[
0
])
return
S_OK
;
if
((
hr
=
parse_text
(
path
,
uMode
,
pszPath
))
!=
S_OK
)
return
hr
;
len
=
strlenW
(
pszPath
);
...
...
@@ -404,11 +409,34 @@ static HRESULT WINAPI path_GetText(
static
HRESULT
WINAPI
path_GetInfo
(
IWbemPath
*
iface
,
ULONG
uRequestedI
nfo
,
ULONGLONG
*
puR
esponse
)
ULONG
i
nfo
,
ULONGLONG
*
r
esponse
)
{
FIXME
(
"%p, %d, %p
\n
"
,
iface
,
uRequestedInfo
,
puResponse
);
return
E_NOTIMPL
;
struct
path
*
path
=
impl_from_IWbemPath
(
iface
);
TRACE
(
"%p, %u, %p
\n
"
,
iface
,
info
,
response
);
if
(
info
||
!
response
)
return
WBEM_E_INVALID_PARAMETER
;
FIXME
(
"some flags are not implemented
\n
"
);
*
response
=
path
->
flags
;
if
(
!
path
->
server
||
(
path
->
len_server
==
1
&&
path
->
server
[
0
]
==
'.'
))
*
response
|=
WBEMPATH_INFO_ANON_LOCAL_MACHINE
;
else
*
response
|=
WBEMPATH_INFO_HAS_MACHINE_NAME
;
if
(
!
path
->
class
)
*
response
|=
WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
;
else
{
*
response
|=
WBEMPATH_INFO_HAS_SUBSCOPES
;
if
(
path
->
text
&&
strchrW
(
path
->
text
,
'='
))
/* FIXME */
*
response
|=
WBEMPATH_INFO_IS_INST_REF
;
else
*
response
|=
WBEMPATH_INFO_IS_CLASS_REF
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
path_SetServer
(
...
...
dlls/wmiutils/tests/path.c
View file @
47e9ffa7
...
...
@@ -370,6 +370,69 @@ static void test_IWbemPath_GetServer(void)
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_GetInfo
(
void
)
{
IWbemPath
*
path
;
HRESULT
hr
;
ULONGLONG
resp
;
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_GetInfo
(
path
,
1
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
resp
=
0xdeadbeef
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
&
resp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
resp
==
(
WBEMPATH_INFO_ANON_LOCAL_MACHINE
|
WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
resp
>>
32
),
(
unsigned
long
)
resp
);
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path17
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_GetInfo
(
path
,
0
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
hr
=
IWbemPath_GetInfo
(
path
,
1
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
resp
=
0xdeadbeef
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
&
resp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
resp
==
(
WBEMPATH_INFO_ANON_LOCAL_MACHINE
|
WBEMPATH_INFO_IS_INST_REF
|
WBEMPATH_INFO_HAS_SUBSCOPES
|
WBEMPATH_INFO_V2_COMPLIANT
|
WBEMPATH_INFO_CIM_COMPLIANT
|
WBEMPATH_INFO_PATH_HAD_SERVER
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
resp
>>
32
),
(
unsigned
long
)
resp
);
IWbemPath_Release
(
path
);
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path12
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
resp
=
0xdeadbeef
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
&
resp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
resp
==
(
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
)(
resp
>>
32
),
(
unsigned
long
)
resp
);
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path1
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
resp
=
0xdeadbeef
;
hr
=
IWbemPath_GetInfo
(
path
,
0
,
&
resp
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
resp
==
(
WBEMPATH_INFO_ANON_LOCAL_MACHINE
|
WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
),
"got %lx%08lx
\n
"
,
(
unsigned
long
)(
resp
>>
32
),
(
unsigned
long
)
resp
);
IWbemPath_Release
(
path
);
}
START_TEST
(
path
)
{
CoInitialize
(
NULL
);
...
...
@@ -378,6 +441,7 @@ START_TEST (path)
test_IWbemPath_GetText
();
test_IWbemPath_GetClassName
();
test_IWbemPath_GetServer
();
test_IWbemPath_GetInfo
();
CoUninitialize
();
}
include/wmiutils.idl
View file @
47e9ffa7
...
...
@@ -21,6 +21,28 @@ import "oaidl.idl";
interface
IWbemPath
;
interface
IWbemPathKeyList
;
typedef
[
v1_enum
]
enum
tag_WBEM_PATH_STATUS_FLAG
{
WBEMPATH_INFO_ANON_LOCAL_MACHINE
=
0
x1
,
WBEMPATH_INFO_HAS_MACHINE_NAME
=
0
x2
,
WBEMPATH_INFO_IS_CLASS_REF
=
0
x4
,
WBEMPATH_INFO_IS_INST_REF
=
0
x8
,
WBEMPATH_INFO_HAS_SUBSCOPES
=
0
x10
,
WBEMPATH_INFO_IS_COMPOUND
=
0
x20
,
WBEMPATH_INFO_HAS_V2_REF_PATHS
=
0
x40
,
WBEMPATH_INFO_HAS_IMPLIED_KEY
=
0
x80
,
WBEMPATH_INFO_CONTAINS_SINGLETON
=
0
x100
,
WBEMPATH_INFO_V1_COMPLIANT
=
0
x200
,
WBEMPATH_INFO_V2_COMPLIANT
=
0
x400
,
WBEMPATH_INFO_CIM_COMPLIANT
=
0
x800
,
WBEMPATH_INFO_IS_SINGLETON
=
0
x1000
,
WBEMPATH_INFO_IS_PARENT
=
0
x2000
,
WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
=
0
x4000
,
WBEMPATH_INFO_NATIVE_PATH
=
0
x8000
,
WBEMPATH_INFO_WMI_PATH
=
0
x10000
,
WBEMPATH_INFO_PATH_HAD_SERVER
=
0
x20000
}
tag_WBEM_PATH_STATUS_FLAG
;
typedef
[
v1_enum
]
enum
tag_WBEM_PATH_CREATE_FLAG
{
WBEMPATH_CREATE_ACCEPT_RELATIVE
=
0
x1
,
...
...
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