Source code of Windows XP (NT5)
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.

68 lines
1.0 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <signal.h>
  6. #include <errno.h>
  7. #include <sys/wait.h>
  8. #include <unistd.h>
  9. #include <dirent.h>
  10. #include <fcntl.h>
  11. #include "tsttmp.h" // defines DbgPrint as printf
  12. extern int errno;
  13. VOID dir5(char *);
  14. int
  15. __cdecl
  16. main(int argc, char *argv[])
  17. {
  18. DbgPrint("argc = %d, argv[1] = %s\n", argc, argv[1]);
  19. if (argc != 2) {
  20. DbgPrint("Usage: 'tstexec basedirectory' (basedirectory is usually /psx/test)\n");
  21. return 1;
  22. }
  23. dir5(argv[1]);
  24. return 1;
  25. }
  26. VOID
  27. dir5(char *f)
  28. {
  29. int rc;
  30. char buf[256], *b;
  31. PCH Arg[3], Env[4];
  32. DbgPrint("dir5:++ %s\n",f);
  33. rc = chdir(f);
  34. ASSERT(rc==0);
  35. b = getcwd(buf,256);
  36. ASSERT(b);
  37. rc = chdir("/psx/test/tstdirs");
  38. ASSERT(rc==0);
  39. b = getcwd(buf,256);
  40. ASSERT(b);
  41. Arg[0]="tsthello.xxx";
  42. Arg[1]=(PCH)NULL;
  43. Env[0]="NTUSER=ELLENA";
  44. Env[1]=(PCH)NULL;
  45. execve("\\DosDevices\\D:\\PSX\\TSTHELLO.exe",Arg,Env);
  46. ASSERT(FALSE);
  47. DbgPrint("dir5:--\n");
  48. }