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.

81 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name :
  4. basefunc.cxx
  5. Abstract:
  6. This is the abstract base class that is used as the base for all
  7. the other functions
  8. Author:
  9. Christopher Achille (cachille)
  10. Project:
  11. Internet Services Setup
  12. Revision History:
  13. June 2001: Created
  14. --*/
  15. #include "stdafx.h"
  16. // function: VerifyParameters
  17. //
  18. // verify the parameters are correct
  19. //
  20. BOOL
  21. CBaseFunction::VerifyParameters(CItemList &ciParams)
  22. {
  23. // By default, do not check parameters
  24. return TRUE;
  25. }
  26. // function: LoadParams
  27. //
  28. // Load the parameters into the internal variable
  29. //
  30. BOOL
  31. CBaseFunction::LoadParams(CItemList &ciList, LPTSTR szParams)
  32. {
  33. return ciList.LoadList(szParams);
  34. }
  35. // function: DoWork
  36. //
  37. //
  38. // Parameters:
  39. // szParams - LPTSTR list of parameter seperated by '|'
  40. // dwFunctionId - Id of function, this is the oe that was set
  41. // in AddMethods
  42. //
  43. // Load the parameters, then call the function to verify the
  44. // parameters, then call the private function to do all the work
  45. //
  46. BOOL
  47. CBaseFunction::DoWork(LPTSTR szParams)
  48. {
  49. CItemList ciParams;
  50. if (!LoadParams(ciParams, szParams))
  51. {
  52. // We could not load the parameters
  53. return FALSE;
  54. }
  55. if (!VerifyParameters(ciParams))
  56. {
  57. // the parameters are not correct, return FALSE
  58. return FALSE;
  59. }
  60. return DoInternalWork(ciParams);
  61. }