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
540370fb
Commit
540370fb
authored
Jun 07, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jun 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Fix parsing of relative paths.
parent
29c43e2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
8 deletions
+42
-8
path.c
dlls/wmiutils/path.c
+11
-8
path.c
dlls/wmiutils/tests/path.c
+31
-0
No files found.
dlls/wmiutils/path.c
View file @
540370fb
...
...
@@ -420,15 +420,18 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
path
->
flags
|=
WBEMPATH_INFO_PATH_HAD_SERVER
;
}
p
=
q
;
if
(
*
q
&&
*
q
!=
'\\'
&&
*
q
!=
'/'
&&
*
q
!=
':'
)
if
(
strchrW
(
p
,
'\\'
)
||
strchrW
(
p
,
'/'
)
)
{
path
->
num_namespaces
=
1
;
q
++
;
}
while
(
*
q
&&
*
q
!=
':'
)
{
if
(
*
q
==
'\\'
||
*
q
==
'/'
)
path
->
num_namespaces
++
;
q
++
;
if
(
*
q
!=
'\\'
&&
*
q
!=
'/'
&&
*
q
!=
':'
)
{
path
->
num_namespaces
=
1
;
q
++
;
}
while
(
*
q
&&
*
q
!=
':'
)
{
if
(
*
q
==
'\\'
||
*
q
==
'/'
)
path
->
num_namespaces
++
;
q
++
;
}
}
if
(
path
->
num_namespaces
)
{
...
...
dlls/wmiutils/tests/path.c
View file @
540370fb
...
...
@@ -161,6 +161,11 @@ static void test_IWbemPath_SetText(void)
static
void
test_IWbemPath_GetText
(
void
)
{
static
const
WCHAR
serviceW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'.'
,
'N'
,
'a'
,
'm'
,
'e'
,
'='
,
'\"'
,
'S'
,
'e'
,
'r'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\"'
,
0
};
static
const
WCHAR
classW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
0
};
static
const
WCHAR
expected1W
[]
=
{
'r'
,
'o'
,
'o'
,
't'
,
'\\'
,
'c'
,
'i'
,
'm'
,
'v'
,
'2'
,
':'
,
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'L'
,
'o'
,
'g'
,
'i'
,
'c'
,
'a'
,
'l'
,
'D'
,
'i'
,
's'
,
'k'
,
'.'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'd'
,
'='
,
...
...
@@ -329,6 +334,32 @@ static void test_IWbemPath_GetText(void)
ok
(
hr
==
WBEM_E_INVALID_PARAMETER
,
"got %08x
\n
"
,
hr
);
IWbemPath_Release
(
path
);
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
serviceW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
memset
(
buf
,
0x55
,
sizeof
(
buf
)
);
hr
=
IWbemPath_GetText
(
path
,
WBEMPATH_GET_RELATIVE_ONLY
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
serviceW
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
serviceW
)
+
1
,
"unexpected length %u
\n
"
,
len
);
IWbemPath_Release
(
path
);
if
(
!
(
path
=
create_path
()))
return
;
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
classW
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
len
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
memset
(
buf
,
0x55
,
sizeof
(
buf
)
);
hr
=
IWbemPath_GetText
(
path
,
WBEMPATH_GET_RELATIVE_ONLY
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
classW
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
classW
)
+
1
,
"unexpected length %u
\n
"
,
len
);
IWbemPath_Release
(
path
);
}
static
void
test_IWbemPath_GetClassName
(
void
)
...
...
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