Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
2.8 KiB

  1. // this is a common file used by both srrstr.dll (rstrcore directory) and
  2. // rstrui.exe (shell directory).
  3. DWORD hook_DisableSR(LPCWSTR pszDrive)
  4. {
  5. return ERROR_PROC_NOT_FOUND;
  6. }
  7. DWORD hook_EnableSR(LPCWSTR pszDrive)
  8. {
  9. return ERROR_PROC_NOT_FOUND;
  10. }
  11. DWORD hook_DisableFIFO( DWORD dwRPNum)
  12. {
  13. return ERROR_PROC_NOT_FOUND;
  14. }
  15. DWORD hook_EnableFIFO()
  16. {
  17. return ERROR_PROC_NOT_FOUND;
  18. }
  19. BOOL hook_SRSetRestorePointW( PRESTOREPOINTINFOW pRPInfoW,
  20. PSTATEMGRSTATUS pSMgrStatus)
  21. {
  22. return FALSE;
  23. }
  24. DWORD hook_SRRemoveRestorePoint( DWORD dwRPNum)
  25. {
  26. return ERROR_PROC_NOT_FOUND;
  27. }
  28. DWORD hook_EnableSREx(LPCWSTR pszDrive, BOOL fWait)
  29. {
  30. return ERROR_PROC_NOT_FOUND;
  31. }
  32. DWORD hook_SRUpdateDSSize(LPCWSTR pszDrive, UINT64 ullSizeLimit)
  33. {
  34. return ERROR_PROC_NOT_FOUND;
  35. }
  36. FARPROC WINAPI SystemRestore_DelayLoadFailureHook( UINT unReason, PDelayLoadInfo pDelayInfo )
  37. {
  38. if (unReason == dliFailLoadLib)
  39. {
  40. // Load SRClient
  41. if (TRUE == g_CSRClientLoader.LoadSrClient())
  42. {
  43. return (FARPROC) g_CSRClientLoader.m_hSRClient;
  44. }
  45. }
  46. // we are here because either unReason == dliFailLoadLib and srclient.dll
  47. // failed to load, or becuase a procedure could not be be found.
  48. //first make sure that it is srclient.dll we are talking about
  49. if(0!=lstrcmpiA( pDelayInfo->szDll, "srclient.dll" ))
  50. {
  51. return (FARPROC)NULL;
  52. }
  53. // check to see if the Import is by name or ordinal. If it is by
  54. // Ordinal, then it is not one of the functions we are interested
  55. // in.
  56. if(FALSE== pDelayInfo->dlp.fImportByName)
  57. {
  58. return (FARPROC)NULL;
  59. }
  60. if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "EnableSREx" ))
  61. {
  62. return (FARPROC)hook_EnableSREx;
  63. }
  64. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "EnableSR" ))
  65. {
  66. return (FARPROC)hook_EnableSR;
  67. }
  68. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "DisableFIFO" ))
  69. {
  70. return (FARPROC)hook_DisableFIFO;
  71. }
  72. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "EnableFIFO" ))
  73. {
  74. return (FARPROC)hook_EnableFIFO;
  75. }
  76. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "DisableSR" ))
  77. {
  78. return (FARPROC)hook_DisableSR;
  79. }
  80. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "SRSetRestorePointW" ))
  81. {
  82. return (FARPROC)hook_SRSetRestorePointW;
  83. }
  84. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "SRUpdateDSSize" ))
  85. {
  86. return (FARPROC)hook_SRUpdateDSSize;
  87. }
  88. else if(!lstrcmpiA( pDelayInfo->dlp.szProcName, "SRRemoveRestorePoint" ))
  89. {
  90. return (FARPROC)hook_SRRemoveRestorePoint;
  91. }
  92. return (FARPROC)NULL;
  93. }