diff --git a/reactos/baseaddress.rbuild b/reactos/baseaddress.rbuild index f2cb3154735..d826b3ec2ef 100644 --- a/reactos/baseaddress.rbuild +++ b/reactos/baseaddress.rbuild @@ -148,6 +148,7 @@ + diff --git a/reactos/boot/bootdata/packages/reactos.dff b/reactos/boot/bootdata/packages/reactos.dff index b6a9cb01bf8..e6c973dfca5 100644 --- a/reactos/boot/bootdata/packages/reactos.dff +++ b/reactos/boot/bootdata/packages/reactos.dff @@ -320,6 +320,7 @@ dll\win32\security\security.dll 1 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 diff --git a/reactos/dll/win32/sfc/precomp.h b/reactos/dll/win32/sfc/precomp.h new file mode 100644 index 00000000000..2801b0ffdbd --- /dev/null +++ b/reactos/dll/win32/sfc/precomp.h @@ -0,0 +1,14 @@ +#ifndef _PRECOMP_H__ +#define _PRECOMP_H__ + +#include +#include +#include + +DWORD WINAPI sfc_8(); +DWORD WINAPI sfc_9(); + +typedef BOOL (WINAPI *PSRSRPA)(PRESTOREPOINTINFOA, PSTATEMGRSTATUS); +typedef BOOL (WINAPI *PSRSRPW)(PRESTOREPOINTINFOW, PSTATEMGRSTATUS); + +#endif diff --git a/reactos/dll/win32/sfc/sfc.c b/reactos/dll/win32/sfc/sfc.c new file mode 100644 index 00000000000..ed180e199d2 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.c @@ -0,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; +} diff --git a/reactos/dll/win32/sfc/sfc.rbuild b/reactos/dll/win32/sfc/sfc.rbuild new file mode 100644 index 00000000000..d3ad6561cb4 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.rbuild @@ -0,0 +1,8 @@ + + + . + kernel32 + sfc.c + sfc.spec + precomp.h + diff --git a/reactos/dll/win32/sfc/sfc.spec b/reactos/dll/win32/sfc/sfc.spec new file mode 100644 index 00000000000..dbfea33c6f6 --- /dev/null +++ b/reactos/dll/win32/sfc/sfc.spec @@ -0,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 \ No newline at end of file diff --git a/reactos/dll/win32/win32.rbuild b/reactos/dll/win32/win32.rbuild index 5be582cddd6..1b9714b873d 100644 --- a/reactos/dll/win32/win32.rbuild +++ b/reactos/dll/win32/win32.rbuild @@ -295,6 +295,9 @@ + + + diff --git a/reactos/include/psdk/srrestoreptapi.h b/reactos/include/psdk/srrestoreptapi.h new file mode 100644 index 00000000000..456186c4094 --- /dev/null +++ b/reactos/include/psdk/srrestoreptapi.h @@ -0,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