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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
4 deletions
+118
-4
path.c
dlls/wmiutils/path.c
+32
-4
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
...
@@ -45,6 +45,7 @@ struct path
...
@@ -45,6 +45,7 @@ struct path
int
num_namespaces
;
int
num_namespaces
;
WCHAR
*
class
;
WCHAR
*
class
;
int
len_class
;
int
len_class
;
ULONGLONG
flags
;
};
};
static
void
init_path
(
struct
path
*
path
)
static
void
init_path
(
struct
path
*
path
)
...
@@ -58,6 +59,7 @@ static void init_path( struct path *path )
...
@@ -58,6 +59,7 @@ static void init_path( struct path *path )
path
->
num_namespaces
=
0
;
path
->
num_namespaces
=
0
;
path
->
class
=
NULL
;
path
->
class
=
NULL
;
path
->
len_class
=
0
;
path
->
len_class
=
0
;
path
->
flags
=
0
;
}
}
static
void
clear_path
(
struct
path
*
path
)
static
void
clear_path
(
struct
path
*
path
)
...
@@ -136,6 +138,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
...
@@ -136,6 +138,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
memcpy
(
path
->
server
,
p
,
len
*
sizeof
(
WCHAR
)
);
memcpy
(
path
->
server
,
p
,
len
*
sizeof
(
WCHAR
)
);
path
->
server
[
len
]
=
0
;
path
->
server
[
len
]
=
0
;
path
->
len_server
=
len
;
path
->
len_server
=
len
;
path
->
flags
|=
WBEMPATH_INFO_PATH_HAD_SERVER
;
}
}
p
=
q
;
p
=
q
;
while
(
*
q
&&
*
q
!=
':'
)
while
(
*
q
&&
*
q
!=
':'
)
...
@@ -180,6 +183,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
...
@@ -180,6 +183,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
done:
done:
if
(
hr
!=
S_OK
)
clear_path
(
path
);
if
(
hr
!=
S_OK
)
clear_path
(
path
);
else
path
->
flags
|=
WBEMPATH_INFO_CIM_COMPLIANT
|
WBEMPATH_INFO_V2_COMPLIANT
;
return
hr
;
return
hr
;
}
}
...
@@ -197,6 +201,7 @@ static HRESULT WINAPI path_SetText(
...
@@ -197,6 +201,7 @@ static HRESULT WINAPI path_SetText(
if
(
!
uMode
||
!
pszPath
)
return
WBEM_E_INVALID_PARAMETER
;
if
(
!
uMode
||
!
pszPath
)
return
WBEM_E_INVALID_PARAMETER
;
clear_path
(
path
);
clear_path
(
path
);
if
(
!
pszPath
[
0
])
return
S_OK
;
if
((
hr
=
parse_text
(
path
,
uMode
,
pszPath
))
!=
S_OK
)
return
hr
;
if
((
hr
=
parse_text
(
path
,
uMode
,
pszPath
))
!=
S_OK
)
return
hr
;
len
=
strlenW
(
pszPath
);
len
=
strlenW
(
pszPath
);
...
@@ -404,11 +409,34 @@ static HRESULT WINAPI path_GetText(
...
@@ -404,11 +409,34 @@ static HRESULT WINAPI path_GetText(
static
HRESULT
WINAPI
path_GetInfo
(
static
HRESULT
WINAPI
path_GetInfo
(
IWbemPath
*
iface
,
IWbemPath
*
iface
,
ULONG
uRequestedI
nfo
,
ULONG
i
nfo
,
ULONGLONG
*
puR
esponse
)
ULONGLONG
*
r
esponse
)
{
{
FIXME
(
"%p, %d, %p
\n
"
,
iface
,
uRequestedInfo
,
puResponse
);
struct
path
*
path
=
impl_from_IWbemPath
(
iface
);
return
E_NOTIMPL
;
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
(
static
HRESULT
WINAPI
path_SetServer
(
...
...
dlls/wmiutils/tests/path.c
View file @
47e9ffa7
...
@@ -370,6 +370,69 @@ static void test_IWbemPath_GetServer(void)
...
@@ -370,6 +370,69 @@ static void test_IWbemPath_GetServer(void)
IWbemPath_Release
(
path
);
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
)
START_TEST
(
path
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -378,6 +441,7 @@ START_TEST (path)
...
@@ -378,6 +441,7 @@ START_TEST (path)
test_IWbemPath_GetText
();
test_IWbemPath_GetText
();
test_IWbemPath_GetClassName
();
test_IWbemPath_GetClassName
();
test_IWbemPath_GetServer
();
test_IWbemPath_GetServer
();
test_IWbemPath_GetInfo
();
CoUninitialize
();
CoUninitialize
();
}
}
include/wmiutils.idl
View file @
47e9ffa7
...
@@ -21,6 +21,28 @@ import "oaidl.idl";
...
@@ -21,6 +21,28 @@ import "oaidl.idl";
interface
IWbemPath
;
interface
IWbemPath
;
interface
IWbemPathKeyList
;
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
typedef
[
v1_enum
]
enum
tag_WBEM_PATH_CREATE_FLAG
{
{
WBEMPATH_CREATE_ACCEPT_RELATIVE
=
0
x1
,
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