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
c79678ed
Commit
c79678ed
authored
Sep 14, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Simplify GetDisplayName() for class moniker.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1f12b216
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
classmoniker.c
dlls/ole32/classmoniker.c
+13
-20
No files found.
dlls/ole32/classmoniker.c
View file @
c79678ed
...
...
@@ -510,37 +510,30 @@ static HRESULT WINAPI ClassMoniker_RelativePathTo(IMoniker* iface,IMoniker* pmOt
return
MK_E_NOTBINDABLE
;
}
/******************************************************************************
* ClassMoniker_GetDisplayName
******************************************************************************/
static
HRESULT
WINAPI
ClassMoniker_GetDisplayName
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
LPOLESTR
*
ppszDisplayName
)
static
HRESULT
WINAPI
ClassMoniker_GetDisplayName
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
LPOLESTR
*
name
)
{
ClassMoniker
*
This
=
impl_from_IMoniker
(
iface
);
static
const
WCHAR
wszClsidPrefix
[]
=
L"clsid:"
;
ClassMoniker
*
moniker
=
impl_from_IMoniker
(
iface
);
static
const
int
name_len
=
CHARS_IN_GUID
+
5
/* prefix */
;
const
GUID
*
guid
=
&
moniker
->
clsid
;
TRACE
(
"
(%p, %p, %p)
\n
"
,
pbc
,
pmkToLeft
,
ppszDisplayN
ame
);
TRACE
(
"
%p, %p, %p, %p.
\n
"
,
iface
,
pbc
,
pmkToLeft
,
n
ame
);
if
(
!
ppszDisplayN
ame
)
if
(
!
n
ame
)
return
E_POINTER
;
if
(
pmkToLeft
)
return
E_INVALIDARG
;
*
ppszDisplayName
=
CoTaskMemAlloc
(
sizeof
(
wszClsidPrefix
)
+
(
CHARS_IN_GUID
-
2
)
*
sizeof
(
WCHAR
));
StringFromGUID2
(
&
This
->
clsid
,
*
ppszDisplayName
+
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
,
CHARS_IN_GUID
);
if
(
!
(
*
name
=
CoTaskMemAlloc
(
name_len
*
sizeof
(
WCHAR
))))
return
E_OUTOFMEMORY
;
/* note: this overwrites the opening curly bracket of the CLSID string generated above */
memcpy
(
*
ppszDisplayName
,
wszClsidPrefix
,
sizeof
(
wszClsidPrefix
)
-
sizeof
(
WCHAR
));
swprintf
(
*
name
,
name_len
,
L"clsid:%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X:"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]);
/* note: this overwrites the closing curly bracket of the CLSID string generated above */
(
*
ppszDisplayName
)[
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
+
CHARS_IN_GUID
-
2
]
=
':'
;
(
*
ppszDisplayName
)[
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
+
CHARS_IN_GUID
-
1
]
=
'\0'
;
TRACE
(
"Returning %s
\n
"
,
debugstr_w
(
*
name
));
TRACE
(
"string is %s
\n
"
,
debugstr_w
(
*
ppszDisplayName
));
return
S_OK
;
}
...
...
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