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.

51 lines
796 B

  1. /*++
  2. Copyright (c) 1989-2001 Microsoft Corporation
  3. Module Name:
  4. smbhelper.c
  5. Abstract:
  6. Author:
  7. Jiandong Ruan
  8. Revision History:
  9. --*/
  10. #include "precomp.h"
  11. void _cdecl main(void)
  12. {
  13. LPWSTR CommandLine;
  14. int ch;
  15. int num;
  16. int Argc;
  17. LPWSTR *Argv;
  18. setlocale(LC_ALL, "");
  19. SmbSetTraceRoutine(printf);
  20. CommandLine = GetCommandLineW();
  21. if (NULL == CommandLine) {
  22. exit (1);
  23. }
  24. Argv = CommandLineToArgvW(CommandLine, &Argc);
  25. num = 1;
  26. if (Argc >= 2) {
  27. num = _wtoi(Argv[1]);
  28. }
  29. if (SmbStartService(num, NULL) != ERROR_SUCCESS) {
  30. exit(1);
  31. }
  32. do {
  33. ch = getchar();
  34. } while (ch != 'q' && ch != EOF);
  35. SmbStopService(NULL);
  36. }