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
bdd7d8bc
Commit
bdd7d8bc
authored
Jul 16, 2002
by
Juergen Schmied
Committed by
Alexandre Julliard
Jul 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed two leaks in file- and itemmoniker.
parent
2c5a41b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
36 deletions
+29
-36
filemoniker.c
dlls/ole32/filemoniker.c
+8
-11
itemmoniker.c
dlls/ole32/itemmoniker.c
+21
-25
No files found.
dlls/ole32/filemoniker.c
View file @
bdd7d8bc
...
...
@@ -870,21 +870,18 @@ HRESULT WINAPI FileMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker
IMoniker_GetClassID
(
pmkOtherMoniker
,
&
clsid
);
if
(
!
IsEqualCLSID
(
&
clsid
,
&
CLSID_FileMoniker
))
return
S_FALSE
;
res
=
CreateBindCtx
(
0
,
&
bind
);
if
(
FAILED
(
res
))
return
res
;
IMoniker_GetDisplayName
(
pmkOtherMoniker
,
bind
,
NULL
,
&
filePath
);
res
=
CreateBindCtx
(
0
,
&
bind
);
if
(
FAILED
(
res
))
return
res
;
if
(
lstrcmpiW
(
filePath
,
This
->
filePathName
)
!=
0
)
return
S_FALSE
;
if
(
SUCCEEDED
(
IMoniker_GetDisplayName
(
pmkOtherMoniker
,
bind
,
NULL
,
&
filePath
)))
{
int
result
=
lstrcmpiW
(
filePath
,
This
->
filePathName
);
CoTaskMemFree
(
filePath
);
if
(
result
==
0
)
return
S_OK
;
}
return
S_FALSE
;
return
S_OK
;
}
/******************************************************************************
...
...
dlls/ole32/itemmoniker.c
View file @
bdd7d8bc
...
...
@@ -387,20 +387,20 @@ HRESULT WINAPI ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR lpszDe
This
->
itemName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
sizeStr1
+
1
));
if
(
!
This
->
itemName
)
return
E_OUTOFMEMORY
;
strcpyW
(
This
->
itemName
,
lpszItem
);
l
strcpyW
(
This
->
itemName
,
lpszItem
);
if
(
!
lpszDelim
)
FIXME
(
"lpszDelim is NULL. Using empty string which is possibly wrong.
\n
"
);
delim
=
lpszDelim
?
lpszDelim
:
emptystr
;
sizeStr2
=
strlenW
(
delim
);
sizeStr2
=
l
strlenW
(
delim
);
This
->
itemDelimiter
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
(
sizeStr2
+
1
));
if
(
!
This
->
itemDelimiter
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
itemName
);
return
E_OUTOFMEMORY
;
}
strcpyW
(
This
->
itemDelimiter
,
delim
);
l
strcpyW
(
This
->
itemDelimiter
,
delim
);
return
S_OK
;
}
...
...
@@ -611,32 +611,28 @@ HRESULT WINAPI ItemMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker
CLSID
clsid
;
LPOLESTR
dispName1
,
dispName2
;
IBindCtx
*
bind
;
HRESULT
res
;
HRESULT
res
=
S_FALSE
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pmkOtherMoniker
);
if
(
pmkOtherMoniker
==
NULL
)
return
S_FALSE
;
/* This method returns S_OK if both monikers are item monikers and their display names are */
/* identical (using a case-insensitive comparison); otherwise, the method returns S_FALSE. */
IMoniker_GetClassID
(
pmkOtherMoniker
,
&
clsid
);
if
(
!
IsEqualCLSID
(
&
clsid
,
&
CLSID_ItemMoniker
))
return
S_FALSE
;
res
=
CreateBindCtx
(
0
,
&
bind
);
if
(
FAILED
(
res
))
return
res
;
if
(
!
pmkOtherMoniker
)
return
S_FALSE
;
IMoniker_GetDisplayName
(
iface
,
bind
,
NULL
,
&
dispName1
);
IMoniker_GetDisplayName
(
pmkOtherMoniker
,
bind
,
NULL
,
&
dispName2
);
if
(
lstrcmpW
(
dispName1
,
dispName2
)
!=
0
)
return
S_FALSE
;
/* check if both are ItemMoniker */
if
(
FAILED
(
IMoniker_GetClassID
(
pmkOtherMoniker
,
&
clsid
)))
return
S_FALSE
;
if
(
!
IsEqualCLSID
(
&
clsid
,
&
CLSID_ItemMoniker
))
return
S_FALSE
;
return
S_OK
;
/* check if both displaynames are the same */
if
(
SUCCEEDED
((
res
=
CreateBindCtx
(
0
,
&
bind
))))
{
if
(
SUCCEEDED
(
IMoniker_GetDisplayName
(
iface
,
bind
,
NULL
,
&
dispName1
)))
{
if
(
SUCCEEDED
(
IMoniker_GetDisplayName
(
pmkOtherMoniker
,
bind
,
NULL
,
&
dispName2
)))
{
if
(
lstrcmpW
(
dispName1
,
dispName2
)
==
0
)
res
=
S_OK
;
CoTaskMemFree
(
dispName2
);
}
CoTaskMemFree
(
dispName1
);
}
}
return
res
;
}
/******************************************************************************
...
...
@@ -842,8 +838,8 @@ HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface,
if
(
*
ppszDisplayName
==
NULL
)
return
E_OUTOFMEMORY
;
strcpyW
(
*
ppszDisplayName
,
This
->
itemDelimiter
);
strcatW
(
*
ppszDisplayName
,
This
->
itemName
);
l
strcpyW
(
*
ppszDisplayName
,
This
->
itemDelimiter
);
l
strcatW
(
*
ppszDisplayName
,
This
->
itemName
);
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