From bf3d21c835793558475c2f6e83ef04250457a5c0 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sat, 20 Nov 2021 03:45:05 +0100 Subject: [PATCH] add exports for game patching --- ddraw.def | 8 ++++++++ src/dllmain.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/ddraw.def b/ddraw.def index c1b0b64..3b4b6bb 100644 --- a/ddraw.def +++ b/ddraw.def @@ -18,5 +18,13 @@ EXPORTS DirectInputCreateW = fake_DirectInputCreateW DirectInputCreateEx = fake_DirectInputCreateEx DirectInput8Create = fake_DirectInput8Create + DDmemcpy + DDmemmove + DDmemset + DDZeroMemory + DDmemcpyStd + DDmemmoveStd + DDmemsetStd + DDZeroMemoryStd GameHandlesClose DATA pvBmpBits = FakePrimarySurface DATA diff --git a/src/dllmain.c b/src/dllmain.c index e33135a..86f1439 100644 --- a/src/dllmain.c +++ b/src/dllmain.c @@ -232,3 +232,45 @@ DWORD WINAPI DDInternalUnlock(DWORD a) TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); return ret; } + +/* Exports for game patching */ + +void* __cdecl DDmemcpy(void* _Dst, void const* _Src, size_t _Size) +{ + return memcpy(_Dst, _Src, _Size); +} + +void* __cdecl DDmemmove(void* _Dst, void const* _Src, size_t _Size) +{ + return memmove(_Dst, _Src, _Size); +} + +void* __cdecl DDmemset(void* _Dst, int _Val, size_t _Size) +{ + return memset(_Dst, _Val, _Size); +} + +void __cdecl DDZeroMemory(PVOID Destination, SIZE_T Length) +{ + memset(Destination, 0, Length); +} + +void* __stdcall DDmemcpyStd(void* _Dst, void const* _Src, size_t _Size) +{ + return memcpy(_Dst, _Src, _Size); +} + +void* __stdcall DDmemmoveStd(void* _Dst, void const* _Src, size_t _Size) +{ + return memmove(_Dst, _Src, _Size); +} + +void* __stdcall DDmemsetStd(void* _Dst, int _Val, size_t _Size) +{ + return memset(_Dst, _Val, _Size); +} + +void __stdcall DDZeroMemoryStd(PVOID Destination, SIZE_T Length) +{ + memset(Destination, 0, Length); +}