ReactOS  0.4.14-dev-57-g333b8f1
patchapi.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Hans Leidekker for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #ifndef _PATCHAPI_H_
20 #define _PATCHAPI_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #define APPLY_OPTION_FAIL_IF_EXACT 0x00000001
27 #define APPLY_OPTION_FAIL_IF_CLOSE 0x00000002
28 #define APPLY_OPTION_TEST_ONLY 0x00000004
29 #define APPLY_OPTION_VALID_FLAGS 0x00000007
30 
31 
32 //
33 // apply error codes
34 //
35 #define ERROR_PATCH_DECODE_FAILURE 0xC00E4101
36 #define ERROR_PATCH_CORRUPT 0xC00E4102
37 #define ERROR_PATCH_NEWER_FORMAT 0xC00E4103
38 #define ERROR_PATCH_WRONG_FILE 0xC00E4104
39 #define ERROR_PATCH_NOT_NECESSARY 0xC00E4105
40 #define ERROR_PATCH_NOT_AVAILABLE 0xC00E4106
41 
42 
43 typedef struct _PATCH_IGNORE_RANGE
44 {
48 
49 typedef struct _PATCH_RETAIN_RANGE
50 {
55 
56 
58 typedef PATCH_PROGRESS_CALLBACK *PPATCH_PROGRESS_CALLBACK;
59 
60 
61 BOOL WINAPI TestApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, ULONG ApplyOptionFlags);
62 BOOL WINAPI TestApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, ULONG ApplyOptionFlags);
63 #define TestApplyPatchToFile WINELIB_NAME_AW(TestApplyPatchToFile)
64 BOOL WINAPI TestApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, ULONG ApplyOptionFlags);
65 
66 
67 BOOL WINAPI ApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, LPCSTR NewFileName, ULONG ApplyOptionFlags);
68 BOOL WINAPI ApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, LPCWSTR NewFileName, ULONG ApplyOptionFlags);
69 #define ApplyPatchToFile WINELIB_NAME_AW(ApplyPatchToFile)
70 BOOL WINAPI ApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, HANDLE NewFileHandle, ULONG ApplyOptionFlags);
71 
72 
73 BOOL WINAPI GetFilePatchSignatureA(LPCSTR FileName, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount,
74  PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount,
75  PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize,
76  PVOID SignatureBuffer);
77 BOOL WINAPI GetFilePatchSignatureW(LPCWSTR FileName, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount,
78  PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount,
79  PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize,
80  PVOID SignatureBuffer);
81 #define GetFilePatchSignature WINELIB_NAME_AW(GetFilePatchSignature)
82 BOOL WINAPI GetFilePatchSignatureByHandle(HANDLE FileHandle, ULONG OptionFlags, PVOID OptionData, ULONG IgnoreRangeCount,
83  PPATCH_IGNORE_RANGE IgnoreRangeArray, ULONG RetainRangeCount,
84  PPATCH_RETAIN_RANGE RetainRangeArray, ULONG SignatureBufferSize,
85  PVOID SignatureBuffer);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* _PATCHAPI_H_ */
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)
struct _PATCH_IGNORE_RANGE * PPATCH_IGNORE_RANGE
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:55
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
ULONG OffsetInNewFile
Definition: patchapi.h:53
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)
PATCH_PROGRESS_CALLBACK * PPATCH_PROGRESS_CALLBACK
Definition: patchapi.h:58
#define CALLBACK
Definition: compat.h:27
struct _PATCH_IGNORE_RANGE PATCH_IGNORE_RANGE
ULONG OffsetInOldFile
Definition: patchapi.h:51
ULONG OffsetInOldFile
Definition: patchapi.h:45
HANDLE FileHandle
Definition: stats.c:38
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)
unsigned int BOOL
Definition: ntddk_ex.h:94
ULONG CurrentPosition
Definition: patchapi.h:57
typedef WINBOOL(CALLBACK PATCH_PROGRESS_CALLBACK)(PVOID CallbackContext
const char * LPCSTR
Definition: xmlstorage.h:183
struct _PATCH_RETAIN_RANGE PATCH_RETAIN_RANGE
BOOL WINAPI ApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, LPCSTR NewFileName, ULONG ApplyOptionFlags)
#define WINAPI
Definition: msvc.h:8
BOOL WINAPI ApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, LPCWSTR NewFileName, ULONG ApplyOptionFlags)
BOOL WINAPI TestApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, ULONG ApplyOptionFlags)
BOOL WINAPI TestApplyPatchToFileW(LPCWSTR PatchFileName, LPCWSTR OldFileName, ULONG ApplyOptionFlags)
BOOL WINAPI TestApplyPatchToFileA(LPCSTR PatchFileName, LPCSTR OldFileName, ULONG ApplyOptionFlags)
unsigned int ULONG
Definition: retypes.h:1
struct _PATCH_RETAIN_RANGE * PPATCH_RETAIN_RANGE
ULONG ULONG MaximumPosition
Definition: patchapi.h:57
BOOL WINAPI ApplyPatchToFileByHandles(HANDLE PatchFileHandle, HANDLE OldFileHandle, HANDLE NewFileHandle, ULONG ApplyOptionFlags)