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
af84c4c7
Commit
af84c4c7
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::GetNamespaceAt.
parent
ae6468c9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5 deletions
+68
-5
path.c
dlls/wmiutils/path.c
+11
-5
path.c
dlls/wmiutils/tests/path.c
+57
-0
No files found.
dlls/wmiutils/path.c
View file @
af84c4c7
...
...
@@ -509,12 +509,18 @@ static HRESULT WINAPI path_SetNamespaceAt(
static
HRESULT
WINAPI
path_GetNamespaceAt
(
IWbemPath
*
iface
,
ULONG
uInde
x
,
ULONG
*
puNameBufLength
,
LPWSTR
pN
ame
)
ULONG
id
x
,
ULONG
*
len
,
LPWSTR
n
ame
)
{
FIXME
(
"%p, %u, %p, %p
\n
"
,
iface
,
uIndex
,
puNameBufLength
,
pName
);
return
E_NOTIMPL
;
struct
path
*
path
=
impl_from_IWbemPath
(
iface
);
TRACE
(
"%p, %u, %p, %p
\n
"
,
iface
,
idx
,
len
,
name
);
if
(
!
len
||
(
*
len
&&
!
name
)
||
idx
>=
path
->
num_namespaces
)
return
WBEM_E_INVALID_PARAMETER
;
if
(
*
len
>
path
->
len_namespaces
[
idx
])
strcpyW
(
name
,
path
->
namespaces
[
idx
]
);
*
len
=
path
->
len_namespaces
[
idx
]
+
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
path_RemoveNamespaceAt
(
...
...
dlls/wmiutils/tests/path.c
View file @
af84c4c7
...
...
@@ -528,6 +528,62 @@ static void test_IWbemPath_SetServer(void)
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_GetNamespaceAt
(
void
)
{
static
const
WCHAR
rootW
[]
=
{
'r'
,
'o'
,
'o'
,
't'
,
0
};
static
const
WCHAR
cimv2W
[]
=
{
'c'
,
'i'
,
'm'
,
'v'
,
'2'
,
0
};
IWbemPath
*
path
;
HRESULT
hr
;
WCHAR
buf
[
32
];
ULONG
len
;
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_GetNamespaceAt
(
path
,
0
,
NULL
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
len
=
0
;
hr
=
IWbemPath_GetNamespaceAt
(
path
,
0
,
&
len
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetNamespaceAt
(
path
,
0
,
&
len
,
buf
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetNamespaceAt
(
path
,
0
,
&
len
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
ok
(
len
==
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
"unexpected length %u
\n
"
,
len
);
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path17
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
len
=
0
;
hr
=
IWbemPath_GetNamespaceAt
(
path
,
2
,
&
len
,
NULL
);
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetNamespaceAt
(
path
,
0
,
&
len
,
NULL
);
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_GetNamespaceAt
(
path
,
0
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
rootW
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
rootW
)
+
1
,
"unexpected length %u
\n
"
,
len
);
buf
[
0
]
=
0
;
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
hr
=
IWbemPath_GetNamespaceAt
(
path
,
1
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
cimv2W
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
cimv2W
)
+
1
,
"unexpected length %u
\n
"
,
len
);
IWbemPath_Release
(
path
);
}
START_TEST
(
path
)
{
CoInitialize
(
NULL
);
...
...
@@ -539,6 +595,7 @@ START_TEST (path)
test_IWbemPath_GetServer
();
test_IWbemPath_GetInfo
();
test_IWbemPath_SetServer
();
test_IWbemPath_GetNamespaceAt
();
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