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
50110d4b
Commit
50110d4b
authored
Oct 04, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mspatcha: Forward ApplyPatchToFileA to ApplyPatchToFileW.
parent
e5f1ea57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
mspatcha.spec
dlls/mspatcha/mspatcha.spec
+1
-1
mspatcha_main.c
dlls/mspatcha/mspatcha_main.c
+41
-0
No files found.
dlls/mspatcha/mspatcha.spec
View file @
50110d4b
1 st
ub ApplyPatchToFileA
1 st
dcall ApplyPatchToFileA(str str str long)
2 stub ApplyPatchToFileByHandles
3 stub ApplyPatchToFileByHandlesEx
4 stub ApplyPatchToFileExA
...
...
dlls/mspatcha/mspatcha_main.c
View file @
50110d4b
...
...
@@ -24,6 +24,8 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "patchapi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mspatcha
);
...
...
@@ -49,6 +51,45 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return
TRUE
;
}
static
inline
WCHAR
*
strdupAW
(
const
char
*
src
)
{
WCHAR
*
dst
=
NULL
;
if
(
src
)
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
NULL
,
0
);
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
len
);
}
return
dst
;
}
/*****************************************************
* ApplyPatchToFileA (MSPATCHA.6)
*/
BOOL
WINAPI
ApplyPatchToFileA
(
LPCSTR
patch_file
,
LPCSTR
old_file
,
LPCSTR
new_file
,
ULONG
apply_flags
)
{
BOOL
ret
;
WCHAR
*
patch_fileW
,
*
new_fileW
,
*
old_fileW
=
NULL
;
if
(
!
(
patch_fileW
=
strdupAW
(
patch_file
)))
return
FALSE
;
if
(
old_file
&&
!
(
old_fileW
=
strdupAW
(
old_file
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
return
FALSE
;
}
if
(
!
(
new_fileW
=
strdupAW
(
new_file
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
HeapFree
(
GetProcessHeap
(),
0
,
old_fileW
);
return
FALSE
;
}
ret
=
ApplyPatchToFileW
(
patch_fileW
,
old_fileW
,
new_fileW
,
apply_flags
);
HeapFree
(
GetProcessHeap
(),
0
,
patch_fileW
);
HeapFree
(
GetProcessHeap
(),
0
,
old_fileW
);
HeapFree
(
GetProcessHeap
(),
0
,
new_fileW
);
return
ret
;
}
/*****************************************************
* ApplyPatchToFileW (MSPATCHA.6)
*/
...
...
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