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
b19690bf
Commit
b19690bf
authored
Apr 07, 2003
by
Rolf Kalbermatter
Committed by
Alexandre Julliard
Apr 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement SHLWAPI_269 and SHLWAPI_270.
Fix a 0 reference bug in SHLWAPI_436 and change its return value to what at least W2K does as well.
parent
5f4e4a50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
31 deletions
+66
-31
ordinal.c
dlls/shlwapi/ordinal.c
+62
-29
ordinal.h
dlls/shlwapi/ordinal.h
+2
-0
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
No files found.
dlls/shlwapi/ordinal.c
View file @
b19690bf
...
...
@@ -2705,45 +2705,78 @@ DWORD WINAPI SHLWAPI_431 (DWORD x)
}
/*************************************************************************
* @ [SHLWAPI.269]
*
* Convert an ASCII string CLSID into a CLSID.
*/
BOOL
WINAPI
SHLWAPI_269
(
LPCSTR
idstr
,
CLSID
*
id
)
{
WCHAR
wClsid
[
40
];
MultiByteToWideChar
(
CP_ACP
,
0
,
idstr
,
-
1
,
wClsid
,
sizeof
(
wClsid
)
/
sizeof
(
WCHAR
));
return
SUCCEEDED
(
SHLWAPI_436
(
wClsid
,
id
));
}
/*************************************************************************
* @ [SHLWAPI.270]
*
* Convert an Unicode string CLSID into a CLSID.
*/
BOOL
WINAPI
SHLWAPI_270
(
LPCWSTR
idstr
,
CLSID
*
id
)
{
return
SUCCEEDED
(
SHLWAPI_436
(
idstr
,
id
));
}
/*************************************************************************
* @ [SHLWAPI.436]
*
* Convert an Unicode string CLSID into a CLSID.
*
* PARAMS
* idstr [I] string containing a CLSID in text form
* id [O] CLSID extracted from the string
*
* RETURNS
* S_OK on success or E_INVALIDARG on failure
*
* NOTES
* This is really CLSIDFromString which is exported by ole32.dll,
* however the native shlwapi.dll does *not* import ole32. Nor does
* ole32.dll import this ordinal from shlwapi. Therefore we must conclude
* that MS duplicated the code for CLSIDFromString
.
*
* that MS duplicated the code for CLSIDFromString
, and yes they did, only
*
it returns an E_INVALIDARG error code on failure.
* This is a duplicate (with changes for UNICODE) of CLSIDFromString16
* in dlls/ole32/compobj.c
*/
DWORD
WINAPI
SHLWAPI_436
(
LP
WSTR
idstr
,
CLSID
*
id
)
HRESULT
WINAPI
SHLWAPI_436
(
LPC
WSTR
idstr
,
CLSID
*
id
)
{
LP
WSTR
s
=
idstr
;
BYTE
*
p
;
INT
i
;
WCHAR
table
[
256
];
LPC
WSTR
s
=
idstr
;
BYTE
*
p
;
INT
i
;
WCHAR
table
[
256
];
if
(
!
s
)
{
memset
(
s
,
0
,
sizeof
(
CLSID
));
return
S_OK
;
}
else
{
/* validate the CLSID string */
if
(
strlenW
(
s
)
!=
38
)
return
CO_E_CLASSSTRING
;
if
((
s
[
0
]
!=
L'{'
)
||
(
s
[
9
]
!=
L'-'
)
||
(
s
[
14
]
!=
L'-'
)
||
(
s
[
19
]
!=
L'-'
)
||
(
s
[
24
]
!=
L'-'
)
||
(
s
[
37
]
!=
L'}'
))
return
CO_E_CLASSSTRING
;
for
(
i
=
1
;
i
<
37
;
i
++
)
{
if
((
i
==
9
)
||
(
i
==
14
)
||
(
i
==
19
)
||
(
i
==
24
))
continue
;
if
(
!
(((
s
[
i
]
>=
L'0'
)
&&
(
s
[
i
]
<=
L'9'
))
||
((
s
[
i
]
>=
L'a'
)
&&
(
s
[
i
]
<=
L'f'
))
||
((
s
[
i
]
>=
L'A'
)
&&
(
s
[
i
]
<=
L'F'
)))
)
return
CO_E_CLASSSTRING
;
}
}
if
(
!
s
)
{
memset
(
id
,
0
,
sizeof
(
CLSID
));
return
S_OK
;
}
else
{
/* validate the CLSID string */
if
(
strlenW
(
s
)
!=
38
)
return
E_INVALIDARG
;
if
((
s
[
0
]
!=
L'{'
)
||
(
s
[
9
]
!=
L'-'
)
||
(
s
[
14
]
!=
L'-'
)
||
(
s
[
19
]
!=
L'-'
)
||
(
s
[
24
]
!=
L'-'
)
||
(
s
[
37
]
!=
L'}'
))
return
E_INVALIDARG
;
for
(
i
=
1
;
i
<
37
;
i
++
)
{
if
((
i
==
9
)
||
(
i
==
14
)
||
(
i
==
19
)
||
(
i
==
24
))
continue
;
if
(
!
(((
s
[
i
]
>=
L'0'
)
&&
(
s
[
i
]
<=
L'9'
))
||
((
s
[
i
]
>=
L'a'
)
&&
(
s
[
i
]
<=
L'f'
))
||
((
s
[
i
]
>=
L'A'
)
&&
(
s
[
i
]
<=
L'F'
)))
)
return
E_INVALIDARG
;
}
}
TRACE
(
"%s -> %p
\n
"
,
debugstr_w
(
s
),
id
);
...
...
dlls/shlwapi/ordinal.h
View file @
b19690bf
...
...
@@ -43,6 +43,8 @@ typedef struct {
DWORD
WINAPI
SHLWAPI_2
(
LPCWSTR
x
,
UNKNOWN_SHLWAPI_2
*
y
);
HRESULT
WINAPI
SHLWAPI_436
(
LPCWSTR
idstr
,
CLSID
*
id
);
/* Macro to get function pointer for a module*/
#define GET_FUNC(func, module, name, fail) \
do { \
...
...
dlls/shlwapi/shlwapi.spec
View file @
b19690bf
...
...
@@ -266,8 +266,8 @@
266 stdcall @(long wstr ptr ptr) SHLWAPI_266
267 stdcall @(long long long long) SHLWAPI_267
268 stdcall @(long long) SHLWAPI_268
269 st
ub @
270 st
ub @
269 st
dcall @(str ptr) SHLWAPI_269
270 st
dcall @(wstr ptr) SHLWAPI_270
271 stdcall @(wstr wstr wstr) SHLWAPI_271
272 stub @
273 stub @
...
...
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