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
89548cd0
Commit
89548cd0
authored
Jan 28, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskschd: Add some useful inline helpers for memory management.
parent
463b1b64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
10 deletions
+39
-10
folder.c
dlls/taskschd/folder.c
+6
-6
folder_collection.c
dlls/taskschd/folder_collection.c
+2
-2
task.c
dlls/taskschd/task.c
+2
-2
taskschd_private.h
dlls/taskschd/taskschd_private.h
+29
-0
No files found.
dlls/taskschd/folder.c
View file @
89548cd0
...
...
@@ -60,8 +60,8 @@ static ULONG WINAPI TaskFolder_Release(ITaskFolder *iface)
if
(
!
ref
)
{
TRACE
(
"destroying %p
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
folder
->
path
);
HeapFree
(
GetProcessHeap
(),
0
,
folder
);
heap_free
(
folder
->
path
);
heap_free
(
folder
);
}
return
ref
;
...
...
@@ -374,7 +374,7 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
if
(
parent
)
len
+=
strlenW
(
parent
);
/* +1 if parent is not '\' terminated */
folder_path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
2
)
*
sizeof
(
WCHAR
));
folder_path
=
heap_alloc
(
(
len
+
2
)
*
sizeof
(
WCHAR
));
if
(
!
folder_path
)
return
E_OUTOFMEMORY
;
folder_path
[
0
]
=
0
;
...
...
@@ -399,16 +399,16 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **
hr
=
create
?
reg_create_folder
(
folder_path
,
&
hfolder
)
:
reg_open_folder
(
folder_path
,
&
hfolder
);
if
(
hr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
folder_path
);
heap_free
(
folder_path
);
return
hr
;
}
reg_close_folder
(
hfolder
);
folder
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
folder
));
folder
=
heap_alloc
(
sizeof
(
*
folder
));
if
(
!
folder
)
{
HeapFree
(
GetProcessHeap
(),
0
,
folder_path
);
heap_free
(
folder_path
);
return
E_OUTOFMEMORY
;
}
...
...
dlls/taskschd/folder_collection.c
View file @
89548cd0
...
...
@@ -56,7 +56,7 @@ static ULONG WINAPI folders_Release(ITaskFolderCollection *iface)
if
(
!
ref
)
{
TRACE
(
"destroying %p
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
folders
);
heap_free
(
folders
);
}
return
ref
;
...
...
@@ -144,7 +144,7 @@ HRESULT TaskFolderCollection_create(const WCHAR *path, ITaskFolderCollection **o
{
TaskFolderCollection
*
folders
;
folders
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
folders
));
folders
=
heap_alloc
(
sizeof
(
*
folders
));
if
(
!
folders
)
return
E_OUTOFMEMORY
;
folders
->
ITaskFolderCollection_iface
.
lpVtbl
=
&
TaskFolderCollection_vtbl
;
...
...
dlls/taskschd/task.c
View file @
89548cd0
...
...
@@ -59,7 +59,7 @@ static ULONG WINAPI TaskService_Release(ITaskService *iface)
if
(
!
ref
)
{
TRACE
(
"destroying %p
\n
"
,
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
task_svc
);
heap_free
(
task_svc
);
}
return
ref
;
...
...
@@ -254,7 +254,7 @@ HRESULT TaskService_create(void **obj)
{
TaskService
*
task_svc
;
task_svc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
task_svc
));
task_svc
=
heap_alloc
(
sizeof
(
*
task_svc
));
if
(
!
task_svc
)
return
E_OUTOFMEMORY
;
task_svc
->
ITaskService_iface
.
lpVtbl
=
&
TaskService_vtbl
;
...
...
dlls/taskschd/taskschd_private.h
View file @
89548cd0
...
...
@@ -16,8 +16,37 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/unicode.h"
HRESULT
TaskService_create
(
void
**
obj
)
DECLSPEC_HIDDEN
;
HRESULT
TaskFolder_create
(
const
WCHAR
*
parent
,
const
WCHAR
*
path
,
ITaskFolder
**
obj
,
BOOL
create
)
DECLSPEC_HIDDEN
;
HRESULT
TaskFolderCollection_create
(
const
WCHAR
*
path
,
ITaskFolderCollection
**
obj
)
DECLSPEC_HIDDEN
;
const
char
*
debugstr_variant
(
const
VARIANT
*
v
)
DECLSPEC_HIDDEN
;
static
void
*
heap_alloc
(
SIZE_T
size
)
__WINE_ALLOC_SIZE
(
1
);
static
inline
void
*
heap_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
static
void
*
heap_realloc
(
void
*
ptr
,
SIZE_T
size
)
__WINE_ALLOC_SIZE
(
2
);
static
inline
void
*
heap_realloc
(
void
*
ptr
,
SIZE_T
size
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
ptr
,
size
);
}
static
inline
BOOL
heap_free
(
void
*
ptr
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
static
inline
WCHAR
*
heap_strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
;
unsigned
len
;
if
(
!
src
)
return
NULL
;
len
=
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
);
if
((
dst
=
heap_alloc
(
len
)))
memcpy
(
dst
,
src
,
len
);
return
dst
;
}
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