Author: pschweitzer Date: Sat Aug 30 13:53:27 2008 New Revision: 35813
URL: http://svn.reactos.org/svn/reactos?rev=35813&view=rev Log: Primary implementation of sfc.dll. To have it "fully" working, sfc_os.dll is will be needed. It does nothing more. Don't shout, Fireball agreed for commit ;).
Added: trunk/reactos/dll/win32/sfc/ (with props) trunk/reactos/dll/win32/sfc/precomp.h (with props) trunk/reactos/dll/win32/sfc/sfc.c (with props) trunk/reactos/dll/win32/sfc/sfc.rbuild (with props) trunk/reactos/dll/win32/sfc/sfc.spec (with props) trunk/reactos/include/psdk/srrestoreptapi.h (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/dll/win32/win32.rbuild
Modified: trunk/reactos/baseaddress.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=3581... ============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -148,6 +148,7 @@ <property name="BASEADDRESS_RASDLG" value="0x768d0000" /> <property name="BASEADDRESS_GDIPLUS" value="0x76a00000" /> <property name="BASEADDRESS_ATL" value="0x76a80000" /> + <property name="BASEADDRESS_SFC" value="0x76b50000" /> <property name="BASEADDRESS_WINTRUST" value="0x76c30000" /> <property name="BASEADDRESS_IMAGEHLP" value="0x76c90000" /> <property name="BASEADDRESS_CLUSAPI" value="0x76d10000" />
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/reac... ============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -320,6 +320,7 @@ dll\win32\sensapi\sensapi.dll 1 dll\win32\serialui\serialui.dll 1 dll\win32\setupapi\setupapi.dll 1 +dll\win32\sfc\sfc.dll 1 dll\win32\shdocvw\shdocvw.dll 1 dll\win32\shell32\shell32.dll 1 dll\win32\shfolder\shfolder.dll 1
Propchange: trunk/reactos/dll/win32/sfc/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sat Aug 30 13:53:27 2008 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+)
Propchange: trunk/reactos/dll/win32/sfc/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/dll/win32/sfc/ ------------------------------------------------------------------------------ bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/win32/sfc/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: trunk/reactos/dll/win32/sfc/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc/precomp.h?rev... ============================================================================== --- trunk/reactos/dll/win32/sfc/precomp.h (added) +++ trunk/reactos/dll/win32/sfc/precomp.h [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -1,0 +1,14 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include <windows.h> +#include <sfc.h> +#include <srrestoreptapi.h> + +DWORD WINAPI sfc_8(); +DWORD WINAPI sfc_9(); + +typedef BOOL (WINAPI *PSRSRPA)(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); +typedef BOOL (WINAPI *PSRSRPW)(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); + +#endif
Propchange: trunk/reactos/dll/win32/sfc/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/sfc/sfc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc/sfc.c?rev=358... ============================================================================== --- trunk/reactos/dll/win32/sfc/sfc.c (added) +++ trunk/reactos/dll/win32/sfc/sfc.c [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -1,0 +1,130 @@ +/* + * System File Checker (Windows File Protection) + * + * Copyright 2008 Pierre Schweitzer + * + * 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 "precomp.h" + +HINSTANCE hLibModule; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + { + DisableThreadLibraryCalls(hinstDLL); + hLibModule = hinstDLL; + break; + } + case DLL_PROCESS_DETACH: + { + break; + } + } + + return TRUE; +} + +DWORD WINAPI sfc_8() +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + +DWORD WINAPI sfc_9() +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + +BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus) +{ + HMODULE hModule; + PSRSRPA pSRSRPA; + BOOL bStatus = FALSE; + LPCWSTR lpLibFileName = L"srclient.dll"; + LPCSTR lpProcName = "SRSetRestorePointA"; + + hModule = LoadLibraryW(lpLibFileName); + if (hModule) + { + pSRSRPA = (PSRSRPA)GetProcAddress(hModule, lpProcName); + if (pSRSRPA) + { + bStatus = pSRSRPA(pRestorePtSpec, pSMgrStatus); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + FreeLibrary(hModule); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + + return bStatus; +} + +BOOL WINAPI SRSetRestorePointW(PRESTOREPOINTINFOW pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus) +{ + HMODULE hModule; + PSRSRPW pSRSRPW; + BOOL bStatus = FALSE; + LPCWSTR lpLibFileName = L"srclient.dll"; + LPCSTR lpProcName = "SRSetRestorePointW"; + + hModule = LoadLibraryW(lpLibFileName); + if (hModule) + { + pSRSRPW = (PSRSRPW)GetProcAddress(hModule, lpProcName); + if (pSRSRPW) + { + bStatus = pSRSRPW(pRestorePtSpec, pSMgrStatus); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + FreeLibrary(hModule); + } + else + { + if (pSMgrStatus) + { + pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED; + } + } + + return bStatus; +} + +BOOL WINAPI SfpVerifyFile(LPCSTR pszFileName, LPSTR pszError, DWORD dwErrSize) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +}
Propchange: trunk/reactos/dll/win32/sfc/sfc.c ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/sfc/sfc.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc/sfc.rbuild?re... ============================================================================== --- trunk/reactos/dll/win32/sfc/sfc.rbuild (added) +++ trunk/reactos/dll/win32/sfc/sfc.rbuild [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -1,0 +1,8 @@ +<module name="sfc" type="win32dll" baseaddress="${BASEADDRESS_SFC}" installbase="system32" installname="sfc.dll" allowwarnings="yes"> + <importlibrary definition="sfc.spec.def" /> + <include base="sfc">.</include> + <library>kernel32</library> + <file>sfc.c</file> + <file>sfc.spec</file> + <pch>precomp.h</pch> +</module>
Propchange: trunk/reactos/dll/win32/sfc/sfc.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/reactos/dll/win32/sfc/sfc.spec URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sfc/sfc.spec?rev=... ============================================================================== --- trunk/reactos/dll/win32/sfc/sfc.spec (added) +++ trunk/reactos/dll/win32/sfc/sfc.spec [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -1,0 +1,18 @@ +@ stub sfc_1 +@ stub sfc_2 +@ stub sfc_3 +@ stub sfc_4 +@ stub sfc_5 +@ stub sfc_6 +@ stub sfc_7 +@ stdcall sfc_8 () +@ stdcall sfc_9 () +@ stdcall SRSetRestorePoint (ptr ptr) SRSetRestorePointA +@ stdcall SRSetRestorePointA (ptr ptr) +@ stdcall SRSetRestorePointW (ptr ptr) +@ stub SfcGetNextProtectedFile +@ stub SfcIsFileProtected +@ stub SfcWLEventLogoff +@ stub SfcWLEventLogon +@ stdcall SfpVerifyFile (ptr ptr long) +@ stdcall start (long long ptr) DllMain
Propchange: trunk/reactos/dll/win32/sfc/sfc.spec ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/dll/win32/win32.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev=... ============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -295,6 +295,9 @@ <directory name="setupapi"> <xi:include href="setupapi/setupapi.rbuild" /> </directory> +<directory name="sfc"> + <xi:include href="sfc/sfc.rbuild" /> +</directory> <directory name="shdocvw"> <xi:include href="shdocvw/shdocvw.rbuild" /> </directory>
Added: trunk/reactos/include/psdk/srrestoreptapi.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/srrestoreptapi... ============================================================================== --- trunk/reactos/include/psdk/srrestoreptapi.h (added) +++ trunk/reactos/include/psdk/srrestoreptapi.h [iso-8859-1] Sat Aug 30 13:53:27 2008 @@ -1,0 +1,64 @@ +/* + * Definitions for the System File Checker (Windows File Protection) + * + * Copyright 2008 Pierre Schweitzer + * + * 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 _SRRESTOREPTAPI_H +#define _SRRESTOREPTAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Defines */ + +#define MAX_DESC 64 +#define MAX_DESC_W 256 + +/* Types */ + +typedef struct _RESTOREPTINFOA { + DWORD dwEventType; + DWORD dwRestorePtType; + INT64 llSequenceNumber; + CHAR szDescription[MAX_DESC]; +} RESTOREPOINTINFOA, *PRESTOREPOINTINFOA; + +typedef struct _RESTOREPTINFOW { + DWORD dwEventType; + DWORD dwRestorePtType; + INT64 llSequenceNumber; + WCHAR szDescription[MAX_DESC_W]; +} RESTOREPOINTINFOW, *PRESTOREPOINTINFOW; + +typedef struct _SMGRSTATUS { + DWORD nStatus; + INT64 llSequenceNumber; +} STATEMGRSTATUS, *PSTATEMGRSTATUS; + +/* Functions */ + +BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); +BOOL WINAPI SRSetRestorePointW(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); +DWORD WINAPI SRRemoveRestorePoint(DWORD); + +#ifdef __cplusplus +} +#endif + +#endif
Propchange: trunk/reactos/include/psdk/srrestoreptapi.h ------------------------------------------------------------------------------ svn:eol-style = native