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.

72 lines
1.2 KiB

  1. /*
  2. * basic client for sumserve remote checksum server
  3. *
  4. *
  5. * sends a request over a named pipe for a list of files and checksums,
  6. * and printf's the returned list
  7. */
  8. #include <windows.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include "..\server\sumserve.h"
  12. #include "ssclient.h"
  13. extern int __argc;
  14. extern char ** __argv;
  15. /* program entry point
  16. *
  17. */
  18. int PASCAL
  19. WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdParam,
  20. int nCmdShow)
  21. {
  22. /* we expect two args: the server name, and the pathname */
  23. if (__argc != 4) {
  24. printf("usage: client <servername> <remotefile> <localfile>");
  25. return(1);
  26. }
  27. if (!ss_copy_reliable(__argv[1], __argv[2], __argv[3], NULL, NULL)) {
  28. printf("copy failed\n");
  29. return(1);
  30. } else {
  31. printf("copy succeeded\n");
  32. return(0);
  33. }
  34. }
  35. /* error output functions - called by the ssclient library functions
  36. *
  37. * defined here so the library can be called from cmdline and windows
  38. * programs.
  39. *
  40. */
  41. BOOL
  42. Trace_Error(LPSTR str, fCancel)
  43. {
  44. printf("%s\n", str);
  45. return(TRUE);
  46. }
  47. /*
  48. * output status messages
  49. */
  50. void
  51. Trace_Status(LPSTR str)
  52. {
  53. printf("%s\n", str);
  54. }