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
6c8527c3
Commit
6c8527c3
authored
Aug 22, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- return a precomputed result for a NULL string
- pass strlen an LPSTR to eliminate a sign warning
parent
6bb46e31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
compobj.c
dlls/ole32/compobj.c
+17
-15
No files found.
dlls/ole32/compobj.c
View file @
6c8527c3
...
...
@@ -813,27 +813,29 @@ HRESULT WINAPI CoCreateGuid(GUID *pguid)
*/
HRESULT
WINAPI
__CLSIDFromStringA
(
LPCSTR
idstr
,
CLSID
*
id
)
{
const
BYTE
*
s
=
(
const
BYTE
*
)
idstr
;
const
BYTE
*
s
;
int
i
;
BYTE
table
[
256
];
if
(
!
s
)
s
=
"{00000000-0000-0000-0000-000000000000}"
;
else
{
/* validate the CLSID string */
if
(
!
idstr
)
{
memset
(
id
,
0
,
sizeof
(
CLSID
)
);
return
S_OK
;
}
if
(
strlen
(
s
)
!=
38
)
return
CO_E_CLASSSTRING
;
/* validate the CLSID string */
if
(
strlen
(
idstr
)
!=
38
)
return
CO_E_CLASSSTRING
;
if
((
s
[
0
]
!=
'{'
)
||
(
s
[
9
]
!=
'-'
)
||
(
s
[
14
]
!=
'-'
)
||
(
s
[
19
]
!=
'-'
)
||
(
s
[
24
]
!=
'-'
)
||
(
s
[
37
]
!=
'}'
))
return
CO_E_CLASSSTRING
;
s
=
(
const
BYTE
*
)
idstr
;
if
((
s
[
0
]
!=
'{'
)
||
(
s
[
9
]
!=
'-'
)
||
(
s
[
14
]
!=
'-'
)
||
(
s
[
19
]
!=
'-'
)
||
(
s
[
24
]
!=
'-'
)
||
(
s
[
37
]
!=
'}'
))
return
CO_E_CLASSSTRING
;
for
(
i
=
1
;
i
<
37
;
i
++
)
{
if
((
i
==
9
)
||
(
i
==
14
)
||
(
i
==
19
)
||
(
i
==
24
))
continue
;
if
(
!
(((
s
[
i
]
>=
'0'
)
&&
(
s
[
i
]
<=
'9'
))
||
((
s
[
i
]
>=
'a'
)
&&
(
s
[
i
]
<=
'f'
))
||
((
s
[
i
]
>=
'A'
)
&&
(
s
[
i
]
<=
'F'
))))
return
CO_E_CLASSSTRING
;
}
for
(
i
=
1
;
i
<
37
;
i
++
)
{
if
((
i
==
9
)
||
(
i
==
14
)
||
(
i
==
19
)
||
(
i
==
24
))
continue
;
if
(
!
(((
s
[
i
]
>=
'0'
)
&&
(
s
[
i
]
<=
'9'
))
||
((
s
[
i
]
>=
'a'
)
&&
(
s
[
i
]
<=
'f'
))
||
((
s
[
i
]
>=
'A'
)
&&
(
s
[
i
]
<=
'F'
))))
return
CO_E_CLASSSTRING
;
}
TRACE
(
"%s -> %p
\n
"
,
s
,
id
);
...
...
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