ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

sfc.c
Go to the documentation of this file.
00001 /*
00002  * System File Checker (Windows File Protection)
00003  *
00004  * Copyright 2008 Pierre Schweitzer
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #include "precomp.h"
00022 
00023 HINSTANCE hLibModule;
00024 
00025 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
00026 {
00027     switch (fdwReason)
00028     {
00029         case DLL_PROCESS_ATTACH:
00030         {
00031             DisableThreadLibraryCalls(hinstDLL);
00032             hLibModule = hinstDLL;
00033             break;
00034         }
00035         case DLL_PROCESS_DETACH:
00036         {
00037             break;
00038         }
00039     }
00040 
00041     return TRUE;
00042 }
00043 
00044 DWORD WINAPI sfc_8()
00045 {
00046     return ERROR_CALL_NOT_IMPLEMENTED;
00047 }
00048 
00049 DWORD WINAPI sfc_9()
00050 {
00051     return ERROR_CALL_NOT_IMPLEMENTED;
00052 }
00053 
00054 BOOL WINAPI SRSetRestorePointA(PRESTOREPOINTINFOA pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus)
00055 {
00056     HMODULE hModule;
00057     PSRSRPA pSRSRPA;
00058     BOOL bStatus = FALSE;
00059     LPCWSTR lpLibFileName = L"srclient.dll";
00060     LPCSTR lpProcName = "SRSetRestorePointA";
00061 
00062     hModule = LoadLibraryW(lpLibFileName);
00063     if (hModule)
00064     {
00065         pSRSRPA = (PSRSRPA)GetProcAddress(hModule, lpProcName);
00066         if (pSRSRPA)
00067         {
00068             bStatus = pSRSRPA(pRestorePtSpec, pSMgrStatus);
00069         }
00070         else
00071         {
00072             if (pSMgrStatus)
00073             {
00074                 pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED;
00075             }
00076         }
00077         FreeLibrary(hModule);
00078     }
00079     else
00080     {
00081         if (pSMgrStatus)
00082         {
00083             pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED;
00084         }
00085     }
00086 
00087     return bStatus;
00088 }
00089 
00090 BOOL WINAPI SRSetRestorePointW(PRESTOREPOINTINFOW pRestorePtSpec, PSTATEMGRSTATUS pSMgrStatus)
00091 {
00092     HMODULE hModule;
00093     PSRSRPW pSRSRPW;
00094     BOOL bStatus = FALSE;
00095     LPCWSTR lpLibFileName = L"srclient.dll";
00096     LPCSTR lpProcName = "SRSetRestorePointW";
00097 
00098     hModule = LoadLibraryW(lpLibFileName);
00099     if (hModule)
00100     {
00101         pSRSRPW = (PSRSRPW)GetProcAddress(hModule, lpProcName);
00102         if (pSRSRPW)
00103         {
00104             bStatus = pSRSRPW(pRestorePtSpec, pSMgrStatus);
00105         }
00106         else
00107         {
00108             if (pSMgrStatus)
00109             {
00110                 pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED;
00111             }
00112         }
00113         FreeLibrary(hModule);
00114     }
00115     else
00116     {
00117         if (pSMgrStatus)
00118         {
00119             pSMgrStatus->nStatus = ERROR_CALL_NOT_IMPLEMENTED;
00120         }
00121     }
00122 
00123     return bStatus;
00124 }
00125 
00126 BOOL WINAPI SfpVerifyFile(LPCSTR pszFileName, LPSTR pszError, DWORD dwErrSize)
00127 {
00128     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
00129     return FALSE;
00130 }

Generated on Sun May 27 2012 04:26:13 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.