diff --git a/dll/win32/mspatcha/mspatcha.spec b/dll/win32/mspatcha/mspatcha.spec index cc8ca94fbde..08231e0d6f4 100644 --- a/dll/win32/mspatcha/mspatcha.spec +++ b/dll/win32/mspatcha/mspatcha.spec @@ -1,12 +1,12 @@ 1 stdcall ApplyPatchToFileA(str str str long) -2 stub ApplyPatchToFileByHandles +2 stdcall -stub ApplyPatchToFileByHandles(ptr ptr ptr long) 3 stub ApplyPatchToFileByHandlesEx 4 stub ApplyPatchToFileExA 5 stub ApplyPatchToFileExW 6 stdcall ApplyPatchToFileW(wstr wstr wstr long) 7 stdcall GetFilePatchSignatureA(str long ptr long ptr long ptr long ptr) -8 stub GetFilePatchSignatureByHandle +8 stdcall -stub GetFilePatchSignatureByHandle(ptr long ptr long ptr long ptr long ptr) 9 stdcall GetFilePatchSignatureW(wstr long ptr long ptr long ptr long ptr) -10 stub TestApplyPatchToFileA -11 stub TestApplyPatchToFileByHandles -12 stub TestApplyPatchToFileW +10 stdcall -stub TestApplyPatchToFileA(str str long) +11 stdcall -stub TestApplyPatchToFileByHandles(ptr ptr long) +12 stdcall -stub TestApplyPatchToFileW(wstr wstr long) diff --git a/dll/win32/mspatcha/mspatcha_main.c b/dll/win32/mspatcha/mspatcha_main.c index f78b8ab352d..8dc4403d13d 100644 --- a/dll/win32/mspatcha/mspatcha_main.c +++ b/dll/win32/mspatcha/mspatcha_main.c @@ -105,7 +105,7 @@ BOOL WINAPI ApplyPatchToFileW(LPCWSTR patch_file, LPCWSTR old_file, LPCWSTR new_ */ BOOL WINAPI GetFilePatchSignatureA(LPCSTR filename, ULONG flags, PVOID data, ULONG ignore_range_count, PPATCH_IGNORE_RANGE ignore_range, ULONG retain_range_count, - PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, LPSTR buffer) + PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, PVOID buffer) { FIXME("stub - %s, %x, %p, %u, %p, %u, %p, %u, %p\n", debugstr_a(filename), flags, data, ignore_range_count, ignore_range, retain_range_count, retain_range, bufsize, buffer); @@ -118,7 +118,7 @@ BOOL WINAPI GetFilePatchSignatureA(LPCSTR filename, ULONG flags, PVOID data, ULO */ BOOL WINAPI GetFilePatchSignatureW(LPCWSTR filename, ULONG flags, PVOID data, ULONG ignore_range_count, PPATCH_IGNORE_RANGE ignore_range, ULONG retain_range_count, - PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, LPWSTR buffer) + PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, PVOID buffer) { FIXME("stub - %s, %x, %p, %u, %p, %u, %p, %u, %p\n", debugstr_w(filename), flags, data, ignore_range_count, ignore_range, retain_range_count, retain_range, bufsize, buffer); diff --git a/sdk/include/psdk/patchapi.h b/sdk/include/psdk/patchapi.h index 9a62a0ff64e..03853283ac0 100644 --- a/sdk/include/psdk/patchapi.h +++ b/sdk/include/psdk/patchapi.h @@ -28,6 +28,13 @@ extern "C" { #define APPLY_OPTION_TEST_ONLY 0x00000004 #define APPLY_OPTION_VALID_FLAGS 0x00000007 + +// +// apply error codes +// +#define ERROR_PATCH_CORRUPT 0xC00E4102 +#define ERROR_PATCH_WRONG_FILE 0xC00E4104 + typedef struct _PATCH_IGNORE_RANGE { ULONG OffsetInOldFile; @@ -41,9 +48,36 @@ typedef struct _PATCH_RETAIN_RANGE ULONG OffsetInNewFile; } PATCH_RETAIN_RANGE, *PPATCH_RETAIN_RANGE; -BOOL WINAPI ApplyPatchToFileA(LPCSTR,LPCSTR,LPCSTR,ULONG); -BOOL WINAPI ApplyPatchToFileW(LPCWSTR,LPCWSTR,LPCWSTR,ULONG); + +typedef WINBOOL (CALLBACK PATCH_PROGRESS_CALLBACK)(PVOID CallbackContext, ULONG CurrentPosition, ULONG MaximumPosition); +typedef PATCH_PROGRESS_CALLBACK *PPATCH_PROGRESS_CALLBACK; + + +BOOL WINAPI TestApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, ULONG ApplyOptionFlags); +BOOL WINAPI TestApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, ULONG ApplyOptionFlags); +#define TestApplyPatchToFile WINELIB_NAME_AW(TestApplyPatchToFile) +BOOL WINAPI TestApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, ULONG ApplyOptionFlags); + + +BOOL WINAPI ApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, LPCSTR NewFileName, ULONG ApplyOptionFlags); +BOOL WINAPI ApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, LPCWSTR NewFileName, ULONG ApplyOptionFlags); #define ApplyPatchToFile WINELIB_NAME_AW(ApplyPatchToFile) +BOOL WINAPI ApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, HANDLE NewFileHandle, ULONG ApplyOptionFlags); + + +BOOL WINAPI GetFilePatchSignatureA(LPCSTR FileName, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount, + PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount, + PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize, + PVOID SignatureBuffer); +BOOL WINAPI GetFilePatchSignatureW(LPCWSTR FileName, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount, + PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount, + PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize, + PVOID SignatureBuffer); +#define GetFilePatchSignature WINELIB_NAME_AW(GetFilePatchSignature) +BOOL WINAPI GetFilePatchSignatureByHandle(HANDLE FileHandle, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount, + PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount, + PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize, + PVOID SignatureBuffer); #ifdef __cplusplus }