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
d816192e
Commit
d816192e
authored
May 14, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
May 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Accept namespaces without a leading slash.
parent
c476d178
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
path.c
dlls/wmiutils/path.c
+17
-0
path.c
dlls/wmiutils/tests/path.c
+14
-1
No files found.
dlls/wmiutils/path.c
View file @
d816192e
...
...
@@ -420,6 +420,11 @@ 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
!=
':'
)
{
path
->
num_namespaces
=
1
;
q
++
;
}
while
(
*
q
&&
*
q
!=
':'
)
{
if
(
*
q
==
'\\'
||
*
q
==
'/'
)
path
->
num_namespaces
++
;
...
...
@@ -432,6 +437,18 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
i
=
0
;
q
=
p
;
if
(
*
q
&&
*
q
!=
'\\'
&&
*
q
!=
'/'
&&
*
q
!=
':'
)
{
p
=
q
;
while
(
*
p
&&
*
p
!=
'\\'
&&
*
p
!=
'/'
&&
*
p
!=
':'
)
p
++
;
len
=
p
-
q
;
if
(
!
(
path
->
namespaces
[
i
]
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
goto
done
;
memcpy
(
path
->
namespaces
[
i
],
q
,
len
*
sizeof
(
WCHAR
)
);
path
->
namespaces
[
i
][
len
]
=
0
;
path
->
len_namespaces
[
i
]
=
len
;
q
=
p
;
i
++
;
}
while
(
*
q
&&
*
q
!=
':'
)
{
if
(
*
q
==
'\\'
||
*
q
==
'/'
)
...
...
dlls/wmiutils/tests/path.c
View file @
d816192e
...
...
@@ -122,7 +122,8 @@ static void test_IWbemPath_SetText(void)
{
path8
,
WBEMPATH_TREAT_SINGLE_IDENT_AS_NS
+
1
,
S_OK
},
{
path9
,
WBEMPATH_CREATE_ACCEPT_ABSOLUTE
,
S_OK
},
{
path10
,
WBEMPATH_CREATE_ACCEPT_ABSOLUTE
,
WBEM_E_INVALID_PARAMETER
,
1
},
{
path11
,
WBEMPATH_CREATE_ACCEPT_ABSOLUTE
,
S_OK
}
{
path11
,
WBEMPATH_CREATE_ACCEPT_ABSOLUTE
,
S_OK
},
{
path15
,
WBEMPATH_CREATE_ACCEPT_ALL
,
S_OK
}
};
IWbemPath
*
path
;
HRESULT
hr
;
...
...
@@ -167,6 +168,8 @@ static void test_IWbemPath_GetText(void)
static
const
WCHAR
expected2W
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'L'
,
'o'
,
'g'
,
'i'
,
'c'
,
'a'
,
'l'
,
'D'
,
'i'
,
's'
,
'k'
,
'.'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'd'
,
'='
,
'"'
,
'C'
,
':'
,
'"'
,
0
};
static
const
WCHAR
expected3W
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'r'
,
'o'
,
'o'
,
't'
,
'\\'
,
'c'
,
'i'
,
'm'
,
'v'
,
'2'
,
0
};
WCHAR
buf
[
128
];
ULONG
len
,
count
;
IWbemPath
*
path
;
...
...
@@ -306,6 +309,16 @@ static void test_IWbemPath_GetText(void)
ok
(
!
lstrcmpW
(
buf
,
expected2W
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
expected2W
)
+
1
,
"unexpected length %u
\n
"
,
len
);
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path15
);
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_SERVER_TOO
,
&
len
,
buf
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
buf
,
expected3W
),
"unexpected buffer contents %s
\n
"
,
wine_dbgstr_w
(
buf
)
);
ok
(
len
==
lstrlenW
(
expected3W
)
+
1
,
"unexpected length %u
\n
"
,
len
);
hr
=
IWbemPath_SetText
(
path
,
WBEMPATH_CREATE_ACCEPT_ALL
,
path18
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
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