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.

75 lines
1.5 KiB

  1. /*
  2. **++
  3. **
  4. ** Copyright (c) 2000-2001 Microsoft Corporation
  5. **
  6. **
  7. ** Module Name:
  8. **
  9. ** main.cpp
  10. **
  11. **
  12. ** Abstract:
  13. **
  14. ** Sample program to
  15. ** - obtain and display the Writer metadata.
  16. ** - create a snapshot set
  17. **
  18. ** Author:
  19. **
  20. ** Adi Oltean [aoltean] 05-Dec-2000
  21. **
  22. ** The sample is based on the Metasnap test program written by Michael C. Johnson.
  23. **
  24. **
  25. ** Revision History:
  26. **
  27. **--
  28. */
  29. ///////////////////////////////////////////////////////////////////////////////
  30. // Includes
  31. #include "vsreq.h"
  32. ///////////////////////////////////////////////////////////////////////////////
  33. // Main functions
  34. extern "C" __cdecl wmain(int argc, WCHAR **argv)
  35. {
  36. INT nReturnCode = 0;
  37. try
  38. {
  39. CVssSampleRequestor requestor;
  40. // Parsing the command line
  41. // Eliminate the first argument (program name)
  42. requestor.ParseCommandLine( argc-1, argv+1 );
  43. // Initialize internal objects
  44. requestor.Initialize();
  45. // Gather writer status
  46. requestor.GatherWriterMetadata();
  47. // Create snapshot set, if needed
  48. requestor.CreateSnapshotSet();
  49. // Wait for user input
  50. wprintf(L"\nPress <Enter> to continue...\n");
  51. getwchar();
  52. // Complete the backup
  53. requestor.BackupComplete();
  54. }
  55. catch(INT nCatchedReturnCode)
  56. {
  57. nReturnCode = nCatchedReturnCode;
  58. }
  59. return (nReturnCode);
  60. }