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
cc4669cc
Commit
cc4669cc
authored
Jan 09, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole: Remove __CLSIDFromStringA.
Move the ANSI implementation of CLSIDFromString to ole16.c and change CLSIDFromString to only deal with Unicode strings.
parent
1926b6da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
21 deletions
+61
-21
compobj.c
dlls/ole32/compobj.c
+5
-18
compobj_private.h
dlls/ole32/compobj_private.h
+0
-1
ole16.c
dlls/ole32/ole16.c
+56
-2
No files found.
dlls/ole32/compobj.c
View file @
cc4669cc
...
@@ -795,31 +795,23 @@ HRESULT WINAPI CoCreateGuid(GUID *pguid)
...
@@ -795,31 +795,23 @@ HRESULT WINAPI CoCreateGuid(GUID *pguid)
* S_OK on success
* S_OK on success
* CO_E_CLASSSTRING if idstr is not a valid CLSID
* CO_E_CLASSSTRING if idstr is not a valid CLSID
*
*
* BUGS
*
* In Windows, if idstr is not a valid CLSID string then it gets
* treated as a ProgID. Wine currently doesn't do this. If idstr is
* NULL it's treated as an all-zero GUID.
*
* SEE ALSO
* SEE ALSO
* StringFromCLSID
* StringFromCLSID
*/
*/
HRESULT
WINAPI
__CLSIDFromStringA
(
LPCSTR
idstr
,
CLSID
*
id
)
static
HRESULT
WINAPI
__CLSIDFromString
(
LPCWSTR
s
,
CLSID
*
id
)
{
{
const
BYTE
*
s
;
int
i
;
int
i
;
BYTE
table
[
256
];
BYTE
table
[
256
];
if
(
!
idstr
)
{
if
(
!
s
)
{
memset
(
id
,
0
,
sizeof
(
CLSID
)
);
memset
(
id
,
0
,
sizeof
(
CLSID
)
);
return
S_OK
;
return
S_OK
;
}
}
/* validate the CLSID string */
/* validate the CLSID string */
if
(
strlen
(
idstr
)
!=
38
)
if
(
strlen
W
(
s
)
!=
38
)
return
CO_E_CLASSSTRING
;
return
CO_E_CLASSSTRING
;
s
=
(
const
BYTE
*
)
idstr
;
if
((
s
[
0
]
!=
'{'
)
||
(
s
[
9
]
!=
'-'
)
||
(
s
[
14
]
!=
'-'
)
||
(
s
[
19
]
!=
'-'
)
||
(
s
[
24
]
!=
'-'
)
||
(
s
[
37
]
!=
'}'
))
if
((
s
[
0
]
!=
'{'
)
||
(
s
[
9
]
!=
'-'
)
||
(
s
[
14
]
!=
'-'
)
||
(
s
[
19
]
!=
'-'
)
||
(
s
[
24
]
!=
'-'
)
||
(
s
[
37
]
!=
'}'
))
return
CO_E_CLASSSTRING
;
return
CO_E_CLASSSTRING
;
...
@@ -831,7 +823,7 @@ HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id)
...
@@ -831,7 +823,7 @@ HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id)
return
CO_E_CLASSSTRING
;
return
CO_E_CLASSSTRING
;
}
}
TRACE
(
"%s -> %p
\n
"
,
s
,
id
);
TRACE
(
"%s -> %p
\n
"
,
debugstr_w
(
s
)
,
id
);
/* quick lookup table */
/* quick lookup table */
memset
(
table
,
0
,
256
);
memset
(
table
,
0
,
256
);
...
@@ -868,14 +860,9 @@ HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id)
...
@@ -868,14 +860,9 @@ HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id)
HRESULT
WINAPI
CLSIDFromString
(
LPOLESTR
idstr
,
CLSID
*
id
)
HRESULT
WINAPI
CLSIDFromString
(
LPOLESTR
idstr
,
CLSID
*
id
)
{
{
char
xid
[
40
];
HRESULT
ret
;
HRESULT
ret
;
if
(
!
WideCharToMultiByte
(
CP_ACP
,
0
,
idstr
,
-
1
,
xid
,
sizeof
(
xid
),
NULL
,
NULL
))
ret
=
__CLSIDFromString
(
idstr
,
id
);
return
CO_E_CLASSSTRING
;
ret
=
__CLSIDFromStringA
(
xid
,
id
);
if
(
ret
!=
S_OK
)
{
/* It appears a ProgID is also valid */
if
(
ret
!=
S_OK
)
{
/* It appears a ProgID is also valid */
ret
=
CLSIDFromProgID
(
idstr
,
id
);
ret
=
CLSIDFromProgID
(
idstr
,
id
);
}
}
...
...
dlls/ole32/compobj_private.h
View file @
cc4669cc
...
@@ -169,7 +169,6 @@ extern void* StdGlobalInterfaceTableInstance;
...
@@ -169,7 +169,6 @@ extern void* StdGlobalInterfaceTableInstance;
/* FIXME: these shouldn't be needed, except for 16-bit functions */
/* FIXME: these shouldn't be needed, except for 16-bit functions */
extern
HRESULT
WINE_StringFromCLSID
(
const
CLSID
*
id
,
LPSTR
idstr
);
extern
HRESULT
WINE_StringFromCLSID
(
const
CLSID
*
id
,
LPSTR
idstr
);
HRESULT
WINAPI
__CLSIDFromStringA
(
LPCSTR
idstr
,
CLSID
*
id
);
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
);
HRESULT
COM_OpenKeyForCLSID
(
REFCLSID
clsid
,
LPCWSTR
keyname
,
REGSAM
access
,
HKEY
*
key
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
HRESULT
MARSHAL_GetStandardMarshalCF
(
LPVOID
*
ppv
);
...
...
dlls/ole32/ole16.c
View file @
cc4669cc
...
@@ -284,8 +284,62 @@ HRESULT WINAPI CLSIDFromString16(
...
@@ -284,8 +284,62 @@ HRESULT WINAPI CLSIDFromString16(
LPCOLESTR16
idstr
,
/* [in] string representation of guid */
LPCOLESTR16
idstr
,
/* [in] string representation of guid */
CLSID
*
id
)
/* [out] GUID converted from string */
CLSID
*
id
)
/* [out] GUID converted from string */
{
{
const
BYTE
*
s
;
int
i
;
BYTE
table
[
256
];
return
__CLSIDFromStringA
(
idstr
,
id
);
if
(
!
idstr
)
{
memset
(
id
,
0
,
sizeof
(
CLSID
)
);
return
S_OK
;
}
/* validate the CLSID string */
if
(
strlen
(
idstr
)
!=
38
)
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
;
}
TRACE
(
"%s -> %p
\n
"
,
s
,
id
);
/* quick lookup table */
memset
(
table
,
0
,
256
);
for
(
i
=
0
;
i
<
10
;
i
++
)
{
table
[
'0'
+
i
]
=
i
;
}
for
(
i
=
0
;
i
<
6
;
i
++
)
{
table
[
'A'
+
i
]
=
i
+
10
;
table
[
'a'
+
i
]
=
i
+
10
;
}
/* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
id
->
Data1
=
(
table
[
s
[
1
]]
<<
28
|
table
[
s
[
2
]]
<<
24
|
table
[
s
[
3
]]
<<
20
|
table
[
s
[
4
]]
<<
16
|
table
[
s
[
5
]]
<<
12
|
table
[
s
[
6
]]
<<
8
|
table
[
s
[
7
]]
<<
4
|
table
[
s
[
8
]]);
id
->
Data2
=
table
[
s
[
10
]]
<<
12
|
table
[
s
[
11
]]
<<
8
|
table
[
s
[
12
]]
<<
4
|
table
[
s
[
13
]];
id
->
Data3
=
table
[
s
[
15
]]
<<
12
|
table
[
s
[
16
]]
<<
8
|
table
[
s
[
17
]]
<<
4
|
table
[
s
[
18
]];
/* these are just sequential bytes */
id
->
Data4
[
0
]
=
table
[
s
[
20
]]
<<
4
|
table
[
s
[
21
]];
id
->
Data4
[
1
]
=
table
[
s
[
22
]]
<<
4
|
table
[
s
[
23
]];
id
->
Data4
[
2
]
=
table
[
s
[
25
]]
<<
4
|
table
[
s
[
26
]];
id
->
Data4
[
3
]
=
table
[
s
[
27
]]
<<
4
|
table
[
s
[
28
]];
id
->
Data4
[
4
]
=
table
[
s
[
29
]]
<<
4
|
table
[
s
[
30
]];
id
->
Data4
[
5
]
=
table
[
s
[
31
]]
<<
4
|
table
[
s
[
32
]];
id
->
Data4
[
6
]
=
table
[
s
[
33
]]
<<
4
|
table
[
s
[
34
]];
id
->
Data4
[
7
]
=
table
[
s
[
35
]]
<<
4
|
table
[
s
[
36
]];
return
S_OK
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -556,7 +610,7 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid)
...
@@ -556,7 +610,7 @@ HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid)
return
CO_E_CLASSSTRING
;
return
CO_E_CLASSSTRING
;
}
}
RegCloseKey
(
xhkey
);
RegCloseKey
(
xhkey
);
return
__CLSIDFromStringA
(
buf2
,
riid
);
return
CLSIDFromString16
(
buf2
,
riid
);
}
}
/***********************************************************************
/***********************************************************************
...
...
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