Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
00291118
Commit
00291118
authored
Apr 07, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmp: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0448e1f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
48 deletions
+29
-48
events.c
dlls/wmp/events.c
+7
-8
oleobj.c
dlls/wmp/oleobj.c
+2
-3
player.c
dlls/wmp/player.c
+20
-20
wmp_private.h
dlls/wmp/wmp_private.h
+0
-17
No files found.
dlls/wmp/events.c
View file @
00291118
...
...
@@ -152,7 +152,7 @@ static ULONG WINAPI EnumConnections_Release(IEnumConnections *iface)
if
(
!
ref
)
{
IConnectionPoint_Release
(
&
This
->
cp
->
IConnectionPoint_iface
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -296,10 +296,9 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
}
if
(
i
==
This
->
sinks_size
)
This
->
sinks
=
heap_realloc
(
This
->
sinks
,
(
++
This
->
sinks_size
)
*
sizeof
(
*
This
->
sinks
));
This
->
sinks
=
realloc
(
This
->
sinks
,
(
++
This
->
sinks_size
)
*
sizeof
(
*
This
->
sinks
));
}
else
{
This
->
sinks
=
heap_
alloc
(
sizeof
(
*
This
->
sinks
));
This
->
sinks
=
m
alloc
(
sizeof
(
*
This
->
sinks
));
This
->
sinks_size
=
1
;
i
=
0
;
}
...
...
@@ -333,7 +332,7 @@ static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface,
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
ppEnum
);
ret
=
heap_
alloc
(
sizeof
(
*
ret
));
ret
=
m
alloc
(
sizeof
(
*
ret
));
if
(
!
ret
)
return
E_OUTOFMEMORY
;
...
...
@@ -370,14 +369,14 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This)
IDispatch_Release
(
This
->
sinks
[
i
]);
}
heap_
free
(
This
->
sinks
);
heap_
free
(
This
);
free
(
This
->
sinks
);
free
(
This
);
}
static
void
ConnectionPoint_Create
(
REFIID
riid
,
ConnectionPoint
**
cp
,
IConnectionPointContainer
*
container
)
{
ConnectionPoint
*
ret
=
heap_
alloc
(
sizeof
(
ConnectionPoint
));
ConnectionPoint
*
ret
=
m
alloc
(
sizeof
(
ConnectionPoint
));
ret
->
IConnectionPoint_iface
.
lpVtbl
=
&
ConnectionPointVtbl
;
...
...
dlls/wmp/oleobj.c
View file @
00291118
...
...
@@ -20,7 +20,6 @@
#include "olectl.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wmp
);
...
...
@@ -307,7 +306,7 @@ static ULONG WINAPI OleObject_Release(IOleObject *iface)
release_client_site
(
This
);
destroy_player
(
This
);
ConnectionPointContainer_Destroy
(
This
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -890,7 +889,7 @@ HRESULT WINAPI WMPFactory_CreateInstance(IClassFactory *iface, IUnknown *outer,
TRACE
(
"(%p %s %p)
\n
"
,
outer
,
debugstr_guid
(
riid
),
ppv
);
wmp
=
heap_alloc_zero
(
sizeof
(
*
wmp
));
wmp
=
calloc
(
1
,
sizeof
(
*
wmp
));
if
(
!
wmp
)
return
E_OUTOFMEMORY
;
...
...
dlls/wmp/player.c
View file @
00291118
...
...
@@ -1741,9 +1741,9 @@ static ULONG WINAPI WMPMedia_Release(IWMPMedia *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
heap_
free
(
This
->
url
);
heap_
free
(
This
->
name
);
heap_
free
(
This
);
free
(
This
->
url
);
free
(
This
->
name
);
free
(
This
);
}
return
ref
;
...
...
@@ -1815,8 +1815,8 @@ static HRESULT WINAPI WMPMedia_put_name(IWMPMedia *iface, BSTR name)
if
(
!
name
)
return
E_POINTER
;
heap_
free
(
This
->
name
);
This
->
name
=
heap_strdupW
(
name
);
free
(
This
->
name
);
This
->
name
=
wcsdup
(
name
);
return
S_OK
;
}
...
...
@@ -1990,9 +1990,9 @@ static ULONG WINAPI WMPPlaylist_Release(IWMPPlaylist *iface)
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
heap_
free
(
This
->
url
);
heap_
free
(
This
->
name
);
heap_
free
(
This
);
free
(
This
->
url
);
free
(
This
->
name
);
free
(
This
);
}
return
ref
;
...
...
@@ -2060,8 +2060,8 @@ static HRESULT WINAPI WMPPlaylist_put_name(IWMPPlaylist *iface, BSTR name)
if
(
!
name
)
return
E_POINTER
;
heap_
free
(
This
->
name
);
This
->
name
=
heap_strdupW
(
name
);
free
(
This
->
name
);
This
->
name
=
wcsdup
(
name
);
return
S_OK
;
}
...
...
@@ -2282,7 +2282,7 @@ HRESULT create_media_from_url(BSTR url, double duration, IWMPMedia **ppMedia)
HRESULT
hr
;
WCHAR
*
name_dup
;
media
=
heap_alloc_zero
(
sizeof
(
*
media
));
media
=
calloc
(
1
,
sizeof
(
*
media
));
if
(
!
media
)
return
E_OUTOFMEMORY
;
...
...
@@ -2290,20 +2290,20 @@ HRESULT create_media_from_url(BSTR url, double duration, IWMPMedia **ppMedia)
if
(
url
)
{
media
->
url
=
heap_strdupW
(
url
);
name_dup
=
heap_strdupW
(
url
);
media
->
url
=
wcsdup
(
url
);
name_dup
=
wcsdup
(
url
);
hr
=
CreateUri
(
name_dup
,
Uri_CREATE_ALLOW_RELATIVE
|
Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME
,
0
,
&
uri
);
if
(
FAILED
(
hr
))
{
heap_
free
(
name_dup
);
free
(
name_dup
);
IWMPMedia_Release
(
&
media
->
IWMPMedia_iface
);
return
hr
;
}
hr
=
IUri_GetPath
(
uri
,
&
path
);
if
(
hr
!=
S_OK
)
{
heap_
free
(
name_dup
);
free
(
name_dup
);
IUri_Release
(
uri
);
IWMPMedia_Release
(
&
media
->
IWMPMedia_iface
);
return
hr
;
...
...
@@ -2323,8 +2323,8 @@ HRESULT create_media_from_url(BSTR url, double duration, IWMPMedia **ppMedia)
}
else
{
media
->
url
=
heap_strdupW
(
L""
);
media
->
name
=
heap_strdupW
(
L""
);
media
->
url
=
wcsdup
(
L""
);
media
->
name
=
wcsdup
(
L""
);
}
media
->
duration
=
duration
;
...
...
@@ -2343,13 +2343,13 @@ HRESULT create_playlist(BSTR name, BSTR url, LONG count, IWMPPlaylist **ppPlayli
{
WMPPlaylist
*
playlist
;
playlist
=
heap_alloc_zero
(
sizeof
(
*
playlist
));
playlist
=
calloc
(
1
,
sizeof
(
*
playlist
));
if
(
!
playlist
)
return
E_OUTOFMEMORY
;
playlist
->
IWMPPlaylist_iface
.
lpVtbl
=
&
WMPPlaylistVtbl
;
playlist
->
url
=
heap_strdupW
(
url
?
url
:
L""
);
playlist
->
name
=
heap_strdupW
(
name
?
name
:
L""
);
playlist
->
url
=
wcsdup
(
url
?
url
:
L""
);
playlist
->
name
=
wcsdup
(
name
?
name
:
L""
);
playlist
->
ref
=
1
;
playlist
->
count
=
count
;
...
...
dlls/wmp/wmp_private.h
View file @
00291118
...
...
@@ -19,7 +19,6 @@
#define COBJMACROS
#include "windows.h"
#include "wine/heap.h"
#include "ole2.h"
#include "dshow.h"
#include "wmp.h"
...
...
@@ -129,22 +128,6 @@ void unregister_player_msg_class(void) DECLSPEC_HIDDEN;
extern
HINSTANCE
wmp_instance
DECLSPEC_HIDDEN
;
static
inline
WCHAR
*
heap_strdupW
(
const
WCHAR
*
str
)
{
WCHAR
*
ret
;
if
(
str
)
{
size_t
size
=
lstrlenW
(
str
)
+
1
;
ret
=
heap_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
ret
)
memcpy
(
ret
,
str
,
size
*
sizeof
(
WCHAR
));
}
else
{
ret
=
NULL
;
}
return
ret
;
}
static
inline
HRESULT
return_bstr
(
const
WCHAR
*
value
,
BSTR
*
p
)
{
if
(
!
p
)
...
...
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