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
472ef288
Commit
472ef288
authored
Nov 02, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mspatcha: Use CRT allocation functions.
parent
a76bf99e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
lzxd_dec.c
dlls/mspatcha/lzxd_dec.c
+2
-3
mspatcha_main.c
dlls/mspatcha/mspatcha_main.c
+7
-7
pa19.c
dlls/mspatcha/pa19.c
+2
-8
No files found.
dlls/mspatcha/lzxd_dec.c
View file @
472ef288
...
...
@@ -25,7 +25,6 @@
#include <assert.h>
#include "windef.h"
#include "wine/heap.h"
#include "wine/debug.h"
#include "patchapi.h"
...
...
@@ -683,7 +682,7 @@ DWORD decode_lzxd_stream(const BYTE *src, const size_t input_size,
if
(
progress_fn
!=
NULL
&&
!
progress_fn
(
progress_ctx
,
0
,
(
ULONG
)
output_size
))
return
ERROR_CANCELLED
;
dec
=
heap_
alloc
(
sizeof
(
*
dec
));
dec
=
m
alloc
(
sizeof
(
*
dec
));
if
(
dec
==
NULL
)
return
ERROR_OUTOFMEMORY
;
...
...
@@ -765,7 +764,7 @@ DWORD decode_lzxd_stream(const BYTE *src, const size_t input_size,
reverse_e8_transform
(
dst
+
predef_size
,
output_size
,
e8_file_size
);
free_dec:
heap_
free
(
dec
);
free
(
dec
);
return
err
;
}
dlls/mspatcha/mspatcha_main.c
View file @
472ef288
...
...
@@ -48,7 +48,7 @@ static WCHAR *strdupAW(const char *src)
if
(
src
)
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
))))
if
((
dst
=
malloc
(
len
*
sizeof
(
WCHAR
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
}
return
dst
;
...
...
@@ -65,12 +65,12 @@ BOOL WINAPI TestApplyPatchToFileA(LPCSTR patch_file, LPCSTR old_file, ULONG appl
if
(
!
(
patch_fileW
=
strdupAW
(
patch_file
)))
return
FALSE
;
if
(
old_file
&&
!
(
old_fileW
=
strdupAW
(
old_file
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
free
(
patch_fileW
);
return
FALSE
;
}
ret
=
apply_patch_to_file
(
patch_fileW
,
old_fileW
,
NULL
,
apply_flags
,
NULL
,
NULL
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
HeapFree
(
GetProcessHeap
(),
0
,
old_fileW
);
free
(
patch_fileW
);
free
(
old_fileW
);
return
ret
;
}
...
...
@@ -123,10 +123,10 @@ BOOL WINAPI ApplyPatchToFileExA(LPCSTR patch_file, LPCSTR old_file, LPCSTR new_f
ret
=
apply_patch_to_file
(
patch_fileW
,
old_fileW
,
new_fileW
,
apply_flags
,
progress_fn
,
progress_ctx
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
new_fileW
);
free
(
new_fileW
);
free_wstrs:
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
HeapFree
(
GetProcessHeap
(),
0
,
old_fileW
);
free
(
patch_fileW
);
free
(
old_fileW
);
return
ret
;
}
...
...
dlls/mspatcha/pa19.c
View file @
472ef288
...
...
@@ -37,7 +37,6 @@
#include "windef.h"
#include "winternl.h"
#include "wine/heap.h"
#include "wine/debug.h"
#include "patchapi.h"
...
...
@@ -319,7 +318,7 @@ static int read_header(struct patch_file_header *ph, const BYTE *buf, size_t siz
if
(
ph
->
err
!=
ERROR_SUCCESS
)
return
-
1
;
ph
->
file_table
=
heap_
calloc
(
ph
->
input_file_count
,
sizeof
(
struct
input_file_info
));
ph
->
file_table
=
calloc
(
ph
->
input_file_count
,
sizeof
(
struct
input_file_info
));
if
(
ph
->
file_table
==
NULL
)
{
ph
->
err
=
ERROR_OUTOFMEMORY
;
...
...
@@ -436,11 +435,6 @@ static int read_header(struct patch_file_header *ph, const BYTE *buf, size_t siz
return
(
ph
->
err
==
ERROR_SUCCESS
)
?
0
:
-
1
;
}
static
void
free_header
(
struct
patch_file_header
*
ph
)
{
heap_free
(
ph
->
file_table
);
}
#define TICKS_PER_SEC 10000000
#define SEC_TO_UNIX_EPOCH ((369 * 365 + 89) * (ULONGLONG)86400)
...
...
@@ -787,7 +781,7 @@ free_decode_buf:
VirtualFree
(
decode_buf
,
0
,
MEM_RELEASE
);
free_patch_header:
free
_header
(
&
ph
);
free
(
ph
.
file_table
);
return
err
;
}
...
...
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