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.

50 lines
1.3 KiB

  1. /*++
  2. Copyright (C) 2000 Microsoft Corporation
  3. Module Name:
  4. test.c
  5. Abstract:
  6. helps test the import and export functionality.
  7. usage: test import filename { ALL or <scope_address> <scope_address> .. }
  8. test export filename { ditto }
  9. --*/
  10. #include <precomp.h>
  11. void _cdecl main(void) {
  12. LPWSTR CmdLine, *Args;
  13. ULONG nArgs, Error;
  14. CmdLine = GetCommandLineW();
  15. Args = CommandLineToArgvW(CmdLine, &nArgs );
  16. if( NULL == Args ) {
  17. printf("Error : %ld\n", GetLastError());
  18. return;
  19. }
  20. if( nArgs < 3 ) {
  21. Error = ERROR_BAD_ARGUMENTS;
  22. } else if( _wcsicmp(Args[1], L"export" ) == 0 ) {
  23. Error = CmdLineDoExport( &Args[2], nArgs - 2 );
  24. } else if( _wcsicmp(Args[1], L"Import" ) == 0 ) {
  25. Error = CmdLineDoImport( &Args[2], nArgs - 2 );
  26. } else {
  27. Error = ERROR_BAD_ARGUMENTS;
  28. }
  29. if( ERROR_BAD_ARGUMENTS == Error ) {
  30. printf("Usage: \n\t%s import filename <scope-list>"
  31. "\n\t%s export filename <scope-list>\n"
  32. "\t\t where <scope-list> is \"all\" or "
  33. "a list of subnet-addresses\n", Args[0], Args[0] );
  34. } else if( NO_ERROR != Error ) {
  35. printf("Failed error: %ld\n", Error );
  36. }
  37. }