Author: akhaldi Date: Tue Sep 23 19:48:41 2014 New Revision: 64248
URL: http://svn.reactos.org/svn/reactos?rev=64248&view=rev Log: [MSPATCHA] * Import from Wine 1.7.27. CORE-8550 #comment mspatcha.dll added in r64248. CORE-8540
Added: trunk/reactos/dll/win32/mspatcha/ (with props) trunk/reactos/dll/win32/mspatcha/CMakeLists.txt (with props) trunk/reactos/dll/win32/mspatcha/mspatcha.spec (with props) trunk/reactos/dll/win32/mspatcha/mspatcha_main.c (with props) trunk/reactos/dll/win32/mspatcha/version.rc (with props) trunk/reactos/include/psdk/patchapi.h (with props) Modified: trunk/reactos/dll/win32/CMakeLists.txt trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?re... ============================================================================== --- trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -107,6 +107,7 @@ add_subdirectory(msisip) add_subdirectory(msisys.ocx) #add_subdirectory(msnet32) #to be deleted in trunk. +add_subdirectory(mspatcha) add_subdirectory(msports) add_subdirectory(msrle32) add_subdirectory(mssign32)
Propchange: trunk/reactos/dll/win32/mspatcha/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Sep 23 19:48:41 2014 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+)
Propchange: trunk/reactos/dll/win32/mspatcha/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/dll/win32/mspatcha/ ------------------------------------------------------------------------------ bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/mspatcha/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: trunk/reactos/dll/win32/mspatcha/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mspatcha/CMakeLis... ============================================================================== --- trunk/reactos/dll/win32/mspatcha/CMakeLists.txt (added) +++ trunk/reactos/dll/win32/mspatcha/CMakeLists.txt [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -0,0 +1,16 @@ + +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +add_definitions(-D__WINESRC__) + +spec2def(mspatcha.dll mspatcha.spec) + +list(APPEND SOURCE + mspatcha_main.c + ${CMAKE_CURRENT_BINARY_DIR}/mspatcha_stubs.c + ${CMAKE_CURRENT_BINARY_DIR}/mspatcha.def) + +add_library(mspatcha SHARED ${SOURCE} version.rc) +set_module_type(mspatcha win32dll) +target_link_libraries(mspatcha wine) +add_importlibs(mspatcha msvcrt kernel32 ntdll) +add_cd_file(TARGET mspatcha DESTINATION reactos/system32 FOR all)
Propchange: trunk/reactos/dll/win32/mspatcha/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/mspatcha/mspatcha.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mspatcha/mspatcha... ============================================================================== --- trunk/reactos/dll/win32/mspatcha/mspatcha.spec (added) +++ trunk/reactos/dll/win32/mspatcha/mspatcha.spec [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -0,0 +1,12 @@ +1 stdcall ApplyPatchToFileA(str str str long) +2 stub ApplyPatchToFileByHandles +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 +9 stdcall GetFilePatchSignatureW(wstr long ptr long ptr long ptr long ptr) +10 stub TestApplyPatchToFileA +11 stub TestApplyPatchToFileByHandles +12 stub TestApplyPatchToFileW
Propchange: trunk/reactos/dll/win32/mspatcha/mspatcha.spec ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/mspatcha/mspatcha_main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mspatcha/mspatcha... ============================================================================== --- trunk/reactos/dll/win32/mspatcha/mspatcha_main.c (added) +++ trunk/reactos/dll/win32/mspatcha/mspatcha_main.c [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -0,0 +1,128 @@ +/* + * PatchAPI + * + * Copyright 2011 David Hedberg for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <wine/config.h> + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> +#include <winnls.h> +#include <patchapi.h> + +#include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(mspatcha); + +/***************************************************** + * DllMain (MSPATCHA.@) + */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + } + + 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.1) + */ +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) + */ +BOOL WINAPI ApplyPatchToFileW(LPCWSTR patch_file, LPCWSTR old_file, LPCWSTR new_file, ULONG apply_flags) +{ + FIXME("stub - %s, %s, %s, %08x\n", debugstr_w(patch_file), debugstr_w(old_file), + debugstr_w(new_file), apply_flags); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/***************************************************** + * GetFilePatchSignatureA (MSPATCHA.7) + */ +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) +{ + 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); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/***************************************************** + * GetFilePatchSignatureW (MSPATCHA.9) + */ +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) +{ + 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); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +}
Propchange: trunk/reactos/dll/win32/mspatcha/mspatcha_main.c ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/mspatcha/version.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mspatcha/version.... ============================================================================== --- trunk/reactos/dll/win32/mspatcha/version.rc (added) +++ trunk/reactos/dll/win32/mspatcha/version.rc [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -0,0 +1,26 @@ +/* + * Copyright 2011 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine File Patch API" +#define WINE_FILENAME_STR "mspatcha.dll" +#define WINE_FILEVERSION 6,1,7600,16385 +#define WINE_FILEVERSION_STR "6.1.7600.16385" +#define WINE_PRODUCTVERSION 6,1,7600,16385 +#define WINE_PRODUCTVERSION_STR "6.1.7600.16385" + +#include "wine/wine_common_ver.rc"
Propchange: trunk/reactos/dll/win32/mspatcha/version.rc ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/include/psdk/patchapi.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/patchapi.h?rev... ============================================================================== --- trunk/reactos/include/psdk/patchapi.h (added) +++ trunk/reactos/include/psdk/patchapi.h [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -0,0 +1,52 @@ +/* + * Copyright 2011 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _PATCHAPI_H_ +#define _PATCHAPI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define APPLY_OPTION_FAIL_IF_EXACT 0x00000001 +#define APPLY_OPTION_FAIL_IF_CLOSE 0x00000002 +#define APPLY_OPTION_TEST_ONLY 0x00000004 +#define APPLY_OPTION_VALID_FLAGS 0x00000007 + +typedef struct _PATCH_IGNORE_RANGE +{ + ULONG OffsetInOldFile; + ULONG LengthInBytes; +} PATCH_IGNORE_RANGE, *PPATCH_IGNORE_RANGE; + +typedef struct _PATCH_RETAIN_RANGE +{ + ULONG OffsetInOldFile; + ULONG LengthInBytes; + ULONG OffsetInNewFile; +} PATCH_RETAIN_RANGE, *PPATCH_RETAIN_RANGE; + +BOOL WINAPI ApplyPatchToFileA(LPCSTR,LPCSTR,LPCSTR,ULONG); +BOOL WINAPI ApplyPatchToFileW(LPCWSTR,LPCWSTR,LPCWSTR,ULONG); +#define ApplyPatchToFile WINELIB_NAME_AW(ApplyPatchToFile) + +#ifdef __cplusplus +} +#endif + +#endif /* _PATCHAPI_H_ */
Propchange: trunk/reactos/include/psdk/patchapi.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=6... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Sep 23 19:48:41 2014 @@ -126,6 +126,7 @@ reactos/dll/win32/msisip # Synced to Wine-1.7.17 reactos/dll/win32/msisys.ocx # Synced to Wine-1.7.17 reactos/dll/win32/msnet32 # Synced to Wine-1.7.17 +reactos/dll/win32/mspatcha # Synced to Wine-1.7.27 reactos/dll/win32/msrle32 # Synced to Wine-1.7.17 reactos/dll/win32/mssign32 # Synced to Wine-1.7.17 reactos/dll/win32/mssip32 # Synced to Wine-1.7.17