mirror of https://github.com/tongzx/nt5src
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
68 lines
1.0 KiB
#include <nt.h>
|
|
#include <ntrtl.h>
|
|
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <signal.h>
|
|
#include <errno.h>
|
|
#include <sys/wait.h>
|
|
#include <unistd.h>
|
|
#include <dirent.h>
|
|
#include <fcntl.h>
|
|
|
|
#include "tsttmp.h" // defines DbgPrint as printf
|
|
|
|
extern int errno;
|
|
VOID dir5(char *);
|
|
|
|
|
|
int
|
|
__cdecl
|
|
main(int argc, char *argv[])
|
|
{
|
|
|
|
DbgPrint("argc = %d, argv[1] = %s\n", argc, argv[1]);
|
|
|
|
if (argc != 2) {
|
|
|
|
DbgPrint("Usage: 'tstexec basedirectory' (basedirectory is usually /psx/test)\n");
|
|
return 1;
|
|
}
|
|
|
|
dir5(argv[1]);
|
|
|
|
return 1;
|
|
}
|
|
|
|
VOID
|
|
dir5(char *f)
|
|
{
|
|
int rc;
|
|
char buf[256], *b;
|
|
PCH Arg[3], Env[4];
|
|
|
|
DbgPrint("dir5:++ %s\n",f);
|
|
|
|
rc = chdir(f);
|
|
ASSERT(rc==0);
|
|
|
|
b = getcwd(buf,256);
|
|
ASSERT(b);
|
|
|
|
rc = chdir("/psx/test/tstdirs");
|
|
ASSERT(rc==0);
|
|
|
|
b = getcwd(buf,256);
|
|
ASSERT(b);
|
|
|
|
Arg[0]="tsthello.xxx";
|
|
Arg[1]=(PCH)NULL;
|
|
Env[0]="NTUSER=ELLENA";
|
|
Env[1]=(PCH)NULL;
|
|
|
|
execve("\\DosDevices\\D:\\PSX\\TSTHELLO.exe",Arg,Env);
|
|
|
|
ASSERT(FALSE);
|
|
|
|
DbgPrint("dir5:--\n");
|
|
}
|