mirror of
https://github.com/reactos/reactos
synced 2025-10-08 17:32:43 +02:00
Compare commits
8 Commits
backups/xm
...
backups/ex
Author | SHA1 | Date | |
---|---|---|---|
|
9e0b1f1383 | ||
|
b0891d210c | ||
|
aa898e0ba2 | ||
|
68e05d3a8e | ||
|
19a3f56aa7 | ||
|
bebd1855ee | ||
|
395064be78 | ||
|
d31a52e423 |
@@ -7,72 +7,67 @@ ReactOS from http://www.reactos.com.
|
||||
|
||||
2. Building ReactOS
|
||||
|
||||
2.1 Building the binaries
|
||||
|
||||
To build ReactOS run 'make' (wihout the quotes) if you are building on Linux
|
||||
or 'mingw32-make' if you are building on Windows (or ReactOS) from the top
|
||||
directory.
|
||||
|
||||
|
||||
2.2 Building a bootable CD image
|
||||
|
||||
To build a bootable CD image run 'make bootcd' (wihout the quotes) if you are
|
||||
building on Linux or 'mingw32-make bootcd' if you are building on Windows (or
|
||||
ReactOS) from the top directory. This will create a CD image with a filename,
|
||||
ReactOS.iso, in the top directory.
|
||||
To build from Windows run 'make' (wihout the quotes) from the top directory.
|
||||
To build from unix, edit rules.mak and change the PREFIX variable to the
|
||||
correct value for your cross-compiler. Run 'export HOST=mingw32-linux' to
|
||||
tell the ReactOS build system that it is building ReactOS on a linux machine.
|
||||
Now run 'make'.
|
||||
|
||||
|
||||
3. Installation
|
||||
|
||||
ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
|
||||
as the active (bootable) partition. The partition on which ReactOS is to be
|
||||
installed (which may or may not be the bootable partition) must also be
|
||||
formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
|
||||
needed.
|
||||
The system can only be installed on the first partition on the first harddisk.
|
||||
The partition must be formatted as FAT16 or FAT32. The system can only be
|
||||
started from DOS and not from a Windows DOS-prompt.
|
||||
|
||||
ReactOS can be installed from the source distribution or from the bootable CD
|
||||
ReactOS can be installed from the source distribution or from the binary
|
||||
distribution. The two ways to install ReactOS are explained below.
|
||||
|
||||
|
||||
3.1 Installation from sources
|
||||
|
||||
If you don't have an existing ReactOS installation you want to upgrade, then
|
||||
build a bootable CD as described above. Burn the CD image, boot from it, and
|
||||
follow the instructions to install ReactOS.
|
||||
To install ReactOS after building it, type 'make install'. This will create
|
||||
the directory 'reactos' in the top directory. Copy this directory to the root
|
||||
of your first partition on your first harddisk. This is usually c:\ on a
|
||||
Windows machine.
|
||||
|
||||
If you have an existing ReactOS installation you want to upgrade, then to
|
||||
install ReactOS after building it, type 'make install' or
|
||||
'mingw32-make install'. This will create the directory 'reactos' in the top
|
||||
directory. Copy the contents of this directory over the existing installation.
|
||||
If you don't want to copy the files manually every time you run a 'make install',
|
||||
you can specify the directory where the files are to be copied to during
|
||||
installation.
|
||||
|
||||
If you don't want to copy the files manually every time you run a
|
||||
'make install' or 'mingw32-make install', then you can specify the directory
|
||||
where the files are to be copied to during installation.
|
||||
In rules.mak find the variable INSTALL_DIR and change the assigned value to the
|
||||
name of the directory where the files are to be copied to. If you are using
|
||||
Windows this could be:
|
||||
|
||||
Set the ROS_INSTALL environment variable. If you are on Windows this could be
|
||||
done by:
|
||||
INSTALL_DIR = c:\reactos
|
||||
|
||||
set ROS_INSTALL=c:\reactos
|
||||
If you are on linux this could be:
|
||||
|
||||
If you are on Linux this could be done by:
|
||||
INSTALL_DIR = /mnt/windows/reactos
|
||||
|
||||
export ROS_INSTALL=/mnt/windows/reactos
|
||||
|
||||
Now run 'make install' or 'mingw32-make install' to install the files to the
|
||||
new location.
|
||||
Save the changes to rules.mak and run 'make install' to install the files to
|
||||
the new location. If you don't want to change rules.mak, you can specify the
|
||||
installtion directory when invoking make. Run
|
||||
'make INSTALL_DIR=c:\reactos install' to install to c:\reactos.
|
||||
|
||||
|
||||
3.2 Installation from bootable CD distribution
|
||||
3.2 Installation from binany distribution
|
||||
|
||||
To install ReactOS from the bootable CD distribution, extract the archive
|
||||
contents. Then burn the CD image, boot from it, and follow instructions.
|
||||
To install ReactOS from the binary distribution, extract the archive contents
|
||||
to c:\reactos. Remember to extract the files with full paths.
|
||||
|
||||
|
||||
4. Booting ReactOS
|
||||
|
||||
Startup in DOS mode. 'cd' to c:\reactos and type 'boot' and press <enter>.
|
||||
A simple shell is started where you can use simple commands like 'cd' and 'dir'.
|
||||
|
||||
|
||||
5. Help
|
||||
|
||||
If you run into problems or have suggestions for making ReactOS better, please
|
||||
visit the address below and subscribe to one or more of the mailing lists.
|
||||
surf to the address below and subscribe to one or more of the mailing lists.
|
||||
|
||||
http://www.reactos.com/en/content/view/full/66
|
||||
http://www.reactos.com/index.php?tab=discussion§ion=lists
|
||||
|
||||
ReactOS Development Team
|
||||
|
5
reactos/Jamfile
Normal file
5
reactos/Jamfile
Normal file
@@ -0,0 +1,5 @@
|
||||
# Main jamfile for ReactOS
|
||||
|
||||
SubDir ROS_TOP ;
|
||||
|
||||
SubInclude ROS_TOP Lib ;
|
54
reactos/Jamrules
Normal file
54
reactos/Jamrules
Normal file
@@ -0,0 +1,54 @@
|
||||
# customization for ReactOS goes here
|
||||
|
||||
# The SharedLibrary and SharedLibraryFromObjects rules were
|
||||
# borrowed from here:
|
||||
# http://www.differentpla.net/~roger/devel/jam/tutorial/shared_lib/index.html
|
||||
|
||||
SUFSHR = .dll ;
|
||||
RM = rm ; # rm comes with MinGW, and the default del doesn't work in some cases
|
||||
|
||||
rule SharedLibrary
|
||||
{
|
||||
SharedLibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
|
||||
Objects $(>) ;
|
||||
}
|
||||
|
||||
rule SharedLibraryFromObjects
|
||||
{
|
||||
local _s _t ;
|
||||
|
||||
# Add grist to file names
|
||||
# Add suffix to dll
|
||||
|
||||
_s = [ FGristFiles $(>) ] ;
|
||||
_t = [ FAppendSuffix $(<) : $(SUFSHR) ] ;
|
||||
|
||||
if $(_t) != $(<)
|
||||
{
|
||||
DEPENDS $(<) : $(_t) ;
|
||||
NOTFILE $(<) ;
|
||||
}
|
||||
|
||||
# make compiled sources a dependency of target
|
||||
|
||||
DEPENDS exe : $(_t) ;
|
||||
DEPENDS $(_t) : $(_s) ;
|
||||
MakeLocate $(_t) : $(LOCATE_TARGET) ;
|
||||
|
||||
Clean clean : $(_t) ;
|
||||
|
||||
Link $(_t) : $(_s) ;
|
||||
}
|
||||
|
||||
# nasm needs to know the output file first, or it doesn't
|
||||
# recognize -I :(
|
||||
actions As
|
||||
{
|
||||
$(AS) -o $(<) $(ASFLAGS) -I$(HDRS) $(>)
|
||||
}
|
||||
|
||||
AS = nasm ;
|
||||
|
||||
# why isn't DEFINES working? :(
|
||||
#DEFINES += _M_IX86 ;
|
||||
CCFLAGS += -D_M_IX86 ;
|
1274
reactos/Makefile
1274
reactos/Makefile
File diff suppressed because it is too large
Load Diff
@@ -1,68 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
||||
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="config.xml">
|
||||
<xi:fallback>
|
||||
<xi:include href="config.template.xml" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
|
||||
<xi:include href="baseaddress.xml" />
|
||||
|
||||
<define name="_M_IX86" />
|
||||
<if property="DBG" value="1">
|
||||
<define name="DBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
<if property="DBG" value="0">
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-ftracer</compilerflag>
|
||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<if property="KDBG" value="1">
|
||||
<define name="KDBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
|
||||
<include>include</include>
|
||||
<include>w32api/include</include>
|
||||
<include>w32api/include/ddk</include>
|
||||
|
||||
<directory name="apps">
|
||||
<xi:include href="apps/directory.xml" />
|
||||
</directory>
|
||||
<directory name="boot">
|
||||
<xi:include href="boot/boot.xml" />
|
||||
</directory>
|
||||
<directory name="bootdata">
|
||||
<xi:include href="bootdata/bootdata.xml" />
|
||||
</directory>
|
||||
<directory name="drivers">
|
||||
<xi:include href="drivers/directory.xml" />
|
||||
</directory>
|
||||
<directory name="hal">
|
||||
<xi:include href="hal/directory.xml" />
|
||||
</directory>
|
||||
<directory name="include">
|
||||
<xi:include href="include/directory.xml" />
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<xi:include href="lib/directory.xml" />
|
||||
</directory>
|
||||
<directory name="media">
|
||||
<xi:include href="media/directory.xml" />
|
||||
</directory>
|
||||
<directory name="ntoskrnl">
|
||||
<xi:include href="ntoskrnl/ntoskrnl.xml" />
|
||||
</directory>
|
||||
<directory name="regtests">
|
||||
<xi:include href="regtests/directory.xml" />
|
||||
</directory>
|
||||
<directory name="services">
|
||||
<xi:include href="services/directory.xml" />
|
||||
</directory>
|
||||
<directory name="subsys">
|
||||
<xi:include href="subsys/directory.xml" />
|
||||
</directory>
|
||||
</project>
|
@@ -1,3 +0,0 @@
|
||||
<directory name="utils">
|
||||
<xi:include href="utils/directory.xml" />
|
||||
</directory>
|
@@ -11,7 +11,7 @@ TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = loadlib
|
||||
|
||||
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE
|
||||
TARGET_CFLAGS = -Wall -Werror -D_USE_W32API -DUNICODE -D_UNICODE
|
||||
|
||||
TARGET_SDKLIBS = kernel32.a ntdll.a
|
||||
|
||||
|
@@ -9,7 +9,7 @@ include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
# Console system utilities
|
||||
# cabman cat net objdir partinfo pice ps sc stats
|
||||
UTIL_APPS = cat objdir pnpdump sc shutdown stats tickcount ps
|
||||
UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount consw rundll32 ps
|
||||
|
||||
UTIL_NET_APPS = arp finger ftp ipconfig netstat ping route telnet whois
|
||||
|
||||
|
@@ -1,21 +0,0 @@
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = binpatch
|
||||
|
||||
TARGET_SDKLIBS =
|
||||
|
||||
TARGET_OBJECTS = patch.o
|
||||
|
||||
TARGET_CFLAGS += -Wall -Werror
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
@@ -1,615 +0,0 @@
|
||||
#include <conio.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/** DEFINES *******************************************************************/
|
||||
|
||||
#define PATCH_BUFFER_SIZE 4096 /* Maximum size of a patch */
|
||||
#define PATCH_BUFFER_MAGIC "\xde\xad\xbe\xef MaGiC MaRk "
|
||||
#define SIZEOF_PATCH_BUFFER_MAGIC (sizeof (PATCH_BUFFER_MAGIC) - 1)
|
||||
|
||||
/** TYPES *********************************************************************/
|
||||
|
||||
typedef struct _PatchedByte
|
||||
{
|
||||
int offset; /*!< File offset of the patched byte. */
|
||||
unsigned char expected; /*!< Expected (original) value of the byte. */
|
||||
unsigned char patched; /*!< Patched (new) value for the byte. */
|
||||
} PatchedByte;
|
||||
|
||||
typedef struct _PatchedFile
|
||||
{
|
||||
const char *name; /*!< Name of the file to be patched. */
|
||||
int fileSize; /*!< Size of the file in bytes. */
|
||||
int patchCount; /*!< Number of patches for the file. */
|
||||
PatchedByte *patches; /*!< Patches for the file. */
|
||||
} PatchedFile;
|
||||
|
||||
typedef struct _Patch
|
||||
{
|
||||
const char *name; /*!< Name of the patch. */
|
||||
int fileCount; /*!< Number of files in the patch. */
|
||||
PatchedFile *files; /*!< Files for the patch. */
|
||||
} Patch;
|
||||
|
||||
/** FUNCTION PROTOTYPES *******************************************************/
|
||||
|
||||
static void printUsage();
|
||||
|
||||
/** GLOBALS *******************************************************************/
|
||||
|
||||
static Patch m_patch = { NULL, 0, NULL };
|
||||
static int m_argc = 0;
|
||||
static char **m_argv = NULL;
|
||||
|
||||
/* patch buffer where we put the patch info into */
|
||||
static unsigned char m_patchBuffer[SIZEOF_PATCH_BUFFER_MAGIC + PATCH_BUFFER_SIZE] =
|
||||
PATCH_BUFFER_MAGIC;
|
||||
|
||||
/** HELPER FUNCTIONS **********************************************************/
|
||||
|
||||
static void *
|
||||
loadFile(const char *fileName, int *fileSize_)
|
||||
{
|
||||
FILE *f;
|
||||
struct stat sb;
|
||||
int fileSize;
|
||||
void *p;
|
||||
|
||||
/* Open the file */
|
||||
f = fopen(fileName, "rb");
|
||||
if (f == NULL)
|
||||
{
|
||||
printf("Couldn't open file %s for reading!\n", fileName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Get file size */
|
||||
if (fstat(fileno(f), &sb) < 0)
|
||||
{
|
||||
fclose(f);
|
||||
printf("Couldn't get size of file %s!\n", fileName);
|
||||
return NULL;
|
||||
}
|
||||
fileSize = sb.st_size;
|
||||
|
||||
/* Load file */
|
||||
p = malloc(fileSize);
|
||||
if (p == NULL)
|
||||
{
|
||||
fclose(f);
|
||||
printf("Couldn't allocate %d bytes for file %s!\n", fileSize, fileName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fread(p, fileSize, 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
free(p);
|
||||
printf("Couldn't read file %s into memory!\n", fileName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Close file */
|
||||
fclose(f);
|
||||
|
||||
*fileSize_ = fileSize;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
saveFile(const char *fileName, void *file, int fileSize)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
/* Open the file */
|
||||
f = fopen(fileName, "wb");
|
||||
if (f == NULL)
|
||||
{
|
||||
printf("Couldn't open file %s for writing!\n", fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Write file */
|
||||
if (fwrite(file, fileSize, 1, f) != 1)
|
||||
{
|
||||
fclose(f);
|
||||
printf("Couldn't write file %s!\n", fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Close file */
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
compareFiles(
|
||||
PatchedFile *patchedFile,
|
||||
const char *originalFileName)
|
||||
{
|
||||
const char *patchedFileName = patchedFile->name;
|
||||
unsigned char *origChunk, *patchedChunk;
|
||||
int origSize, patchedSize, i, patchCount;
|
||||
PatchedByte *patches = NULL;
|
||||
int patchesArrayCount = 0;
|
||||
|
||||
/* Load both files */
|
||||
origChunk = loadFile(originalFileName, &origSize);
|
||||
if (origChunk == NULL)
|
||||
return -1;
|
||||
patchedChunk = loadFile(patchedFileName, &patchedSize);
|
||||
if (patchedChunk == NULL)
|
||||
{
|
||||
free(origChunk);
|
||||
return -1;
|
||||
}
|
||||
if (origSize != patchedSize)
|
||||
{
|
||||
free(origChunk);
|
||||
free(patchedChunk);
|
||||
printf("File size of %s and %s differs (%d != %d)\n",
|
||||
originalFileName, patchedFileName,
|
||||
origSize, patchedSize);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Compare the files and record any differences */
|
||||
printf("Comparing %s to %s", originalFileName, patchedFileName);
|
||||
for (i = 0, patchCount = 0; i < origSize; i++)
|
||||
{
|
||||
if (origChunk[i] != patchedChunk[i])
|
||||
{
|
||||
patchCount++;
|
||||
|
||||
/* Resize patches array if needed */
|
||||
if (patchesArrayCount < patchCount)
|
||||
{
|
||||
PatchedByte *newPatches;
|
||||
newPatches = realloc(patches, patchCount * sizeof (PatchedByte));
|
||||
if (newPatches == NULL)
|
||||
{
|
||||
if (patches != NULL)
|
||||
free(patches);
|
||||
free(origChunk);
|
||||
free(patchedChunk);
|
||||
printf("\nOut of memory (tried to allocated %d bytes)\n",
|
||||
patchCount * sizeof (PatchedByte));
|
||||
return -1;
|
||||
}
|
||||
patches = newPatches;
|
||||
}
|
||||
|
||||
/* Fill in patch info */
|
||||
patches[patchCount - 1].offset = i;
|
||||
patches[patchCount - 1].expected = origChunk[i];
|
||||
patches[patchCount - 1].patched = patchedChunk[i];
|
||||
}
|
||||
if ((i % (origSize / 40)) == 0)
|
||||
printf(".");
|
||||
}
|
||||
printf(" %d changed bytes found.\n", patchCount);
|
||||
|
||||
/* Unload the files */
|
||||
free(origChunk);
|
||||
free(patchedChunk);
|
||||
|
||||
/* Save patch info */
|
||||
patchedFile->fileSize = patchedSize;
|
||||
patchedFile->patchCount = patchCount;
|
||||
patchedFile->patches = patches;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
outputPatch(const char *outputFileName)
|
||||
{
|
||||
unsigned char *patchExe, *patchBuffer;
|
||||
int i, size, patchExeSize, patchSize, stringSize, stringOffset, patchOffset;
|
||||
Patch *patch;
|
||||
PatchedFile *files;
|
||||
|
||||
printf("Putting patch into %s...\n", outputFileName);
|
||||
|
||||
/* Calculate size of the patch */
|
||||
patchSize = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount;
|
||||
stringSize = strlen(m_patch.name) + 1;
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
stringSize += strlen(m_patch.files[i].name) + 1;
|
||||
patchSize += sizeof (PatchedByte) * m_patch.files[i].patchCount;
|
||||
}
|
||||
if ((stringSize + patchSize) > PATCH_BUFFER_SIZE)
|
||||
{
|
||||
printf("Patch is too big - %d bytes maximum, %d bytes needed\n",
|
||||
PATCH_BUFFER_SIZE, stringSize + patchSize);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Load patch.exe file into memory... */
|
||||
patchExe = loadFile(m_argv[0], &patchExeSize);
|
||||
if (patchExe == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Try to find the magic mark for the patch buffer */
|
||||
for (i = 0; i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC); i++)
|
||||
{
|
||||
if (memcmp(patchExe + i, m_patchBuffer, SIZEOF_PATCH_BUFFER_MAGIC) == 0)
|
||||
{
|
||||
patchBuffer = patchExe + i + SIZEOF_PATCH_BUFFER_MAGIC;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!(i < (patchExeSize - SIZEOF_PATCH_BUFFER_MAGIC)))
|
||||
{
|
||||
free(patchExe);
|
||||
printf("Couldn't find patch buffer magic in file %s - this shouldn't happen!!!\n", m_argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Pack patch together and replace string pointers by offsets */
|
||||
patch = (Patch *)patchBuffer;
|
||||
files = (PatchedFile *)(patchBuffer + sizeof (Patch));
|
||||
patchOffset = sizeof (Patch) + sizeof (PatchedFile) * m_patch.fileCount;
|
||||
stringOffset = patchSize;
|
||||
|
||||
patch->fileCount = m_patch.fileCount;
|
||||
patch->files = (PatchedFile *)sizeof (Patch);
|
||||
|
||||
patch->name = (const char *)stringOffset;
|
||||
strcpy(patchBuffer + stringOffset, m_patch.name);
|
||||
stringOffset += strlen(m_patch.name) + 1;
|
||||
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
files[i].fileSize = m_patch.files[i].fileSize;
|
||||
files[i].patchCount = m_patch.files[i].patchCount;
|
||||
|
||||
files[i].name = (const char *)stringOffset;
|
||||
strcpy(patchBuffer + stringOffset, m_patch.files[i].name);
|
||||
stringOffset += strlen(m_patch.files[i].name) + 1;
|
||||
|
||||
size = files[i].patchCount * sizeof (PatchedByte);
|
||||
files[i].patches = (PatchedByte *)patchOffset;
|
||||
memcpy(patchBuffer + patchOffset, m_patch.files[i].patches, size);
|
||||
patchOffset += size;
|
||||
}
|
||||
size = patchSize + stringSize;
|
||||
memset(patchBuffer + size, 0, PATCH_BUFFER_SIZE - size);
|
||||
|
||||
/* Save file */
|
||||
if (saveFile(outputFileName, patchExe, patchExeSize) < 0)
|
||||
{
|
||||
free(patchExe);
|
||||
return -1;
|
||||
}
|
||||
free(patchExe);
|
||||
|
||||
printf("Patch saved!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
loadPatch()
|
||||
{
|
||||
char *p;
|
||||
Patch *patch;
|
||||
int i;
|
||||
|
||||
p = m_patchBuffer + SIZEOF_PATCH_BUFFER_MAGIC;
|
||||
patch = (Patch *)p;
|
||||
|
||||
if (patch->name == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_patch.name = p + (int)patch->name;
|
||||
m_patch.fileCount = patch->fileCount;
|
||||
m_patch.files = (PatchedFile *)(p + (int)patch->files);
|
||||
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
m_patch.files[i].name = p + (int)m_patch.files[i].name;
|
||||
m_patch.files[i].patches = (PatchedByte *)(p + (int)m_patch.files[i].patches);
|
||||
}
|
||||
|
||||
printf("Patch %s loaded...\n", m_patch.name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** MAIN FUNCTIONS ************************************************************/
|
||||
|
||||
static int
|
||||
createPatch()
|
||||
{
|
||||
int i, status;
|
||||
const char *outputFileName;
|
||||
|
||||
/* Check argument count */
|
||||
if (m_argc < 6 || (m_argc % 2) != 0)
|
||||
{
|
||||
printUsage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
outputFileName = m_argv[3];
|
||||
m_patch.name = m_argv[2];
|
||||
|
||||
/* Allocate PatchedFiles array */
|
||||
m_patch.fileCount = (m_argc - 4) / 2;
|
||||
m_patch.files = malloc(m_patch.fileCount * sizeof (PatchedFile));
|
||||
if (m_patch.files == NULL)
|
||||
{
|
||||
printf("Out of memory!\n");
|
||||
return -1;
|
||||
}
|
||||
memset(m_patch.files, 0, m_patch.fileCount * sizeof (PatchedFile));
|
||||
|
||||
/* Compare original to patched files and fill m_patch.files array */
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
m_patch.files[i].name = m_argv[4 + (i * 2) + 1];
|
||||
status = compareFiles(m_patch.files + i, m_argv[4 + (i * 2) + 0]);
|
||||
if (status < 0)
|
||||
{
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
if (m_patch.files[i].patches != NULL)
|
||||
free(m_patch.files[i].patches);
|
||||
}
|
||||
free(m_patch.files);
|
||||
m_patch.files = NULL;
|
||||
m_patch.fileCount = 0;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
/* Output patch */
|
||||
return outputPatch(outputFileName);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
applyPatch()
|
||||
{
|
||||
int c, i, j, fileSize, makeBackup;
|
||||
unsigned char *file;
|
||||
char *p;
|
||||
const char *fileName;
|
||||
char buffer[MAX_PATH];
|
||||
|
||||
|
||||
if (m_argc > 1 && strcmp(m_argv[1], "-d") != 0)
|
||||
{
|
||||
printUsage();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Load patch */
|
||||
if (loadPatch() < 0)
|
||||
{
|
||||
printf("This executable doesn't contain a patch, use -c to create one.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (m_argc > 1)
|
||||
{
|
||||
/* Dump patch */
|
||||
printf("Patch name: %s\n", m_patch.name);
|
||||
printf("File count: %d\n", m_patch.fileCount);
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
printf("----------------------\n"
|
||||
"File name: %s\n"
|
||||
"File size: %d bytes\n",
|
||||
m_patch.files[i].name, m_patch.files[i].fileSize);
|
||||
printf("Patch count: %d\n", m_patch.files[i].patchCount);
|
||||
for (j = 0; j < m_patch.files[i].patchCount; j++)
|
||||
{
|
||||
printf(" Offset 0x%x 0x%02x -> 0x%02x\n",
|
||||
m_patch.files[i].patches[j].offset,
|
||||
m_patch.files[i].patches[j].expected,
|
||||
m_patch.files[i].patches[j].patched);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Apply patch */
|
||||
printf("Applying patch...\n");
|
||||
for (i = 0; i < m_patch.fileCount; i++)
|
||||
{
|
||||
/* Load original file */
|
||||
fileName = m_patch.files[i].name;
|
||||
applyPatch_retry_file:
|
||||
file = loadFile(fileName, &fileSize);
|
||||
if (file == NULL)
|
||||
{
|
||||
printf("File %s not found! ", fileName);
|
||||
applyPatch_file_open_error:
|
||||
printf("(S)kip, (R)etry, (A)bort, (M)anually enter filename");
|
||||
do
|
||||
{
|
||||
c = getch();
|
||||
}
|
||||
while (c != 's' && c != 'r' && c != 'a' && c != 'm');
|
||||
printf("\n");
|
||||
if (c == 's')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (c == 'r')
|
||||
{
|
||||
goto applyPatch_retry_file;
|
||||
}
|
||||
else if (c == 'a')
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (c == 'm')
|
||||
{
|
||||
if (fgets(buffer, sizeof (buffer), stdin) == NULL)
|
||||
{
|
||||
printf("fgets() failed!\n");
|
||||
return -1;
|
||||
}
|
||||
p = strchr(buffer, '\r');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
p = strchr(buffer, '\n');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
|
||||
fileName = buffer;
|
||||
goto applyPatch_retry_file;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check file size */
|
||||
if (fileSize != m_patch.files[i].fileSize)
|
||||
{
|
||||
free(file);
|
||||
printf("File %s has unexpected filesize of %d bytes (%d bytes expected)\n",
|
||||
fileName, fileSize, m_patch.files[i].fileSize);
|
||||
if (fileName != m_patch.files[i].name) /* manually entered filename */
|
||||
{
|
||||
goto applyPatch_file_open_error;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Ask for backup */
|
||||
printf("Do you want to make a backup of %s? (Y)es, (N)o, (A)bort", fileName);
|
||||
do
|
||||
{
|
||||
c = getch();
|
||||
}
|
||||
while (c != 'y' && c != 'n' && c != 'a');
|
||||
printf("\n");
|
||||
if (c == 'y')
|
||||
{
|
||||
char buffer[MAX_PATH];
|
||||
snprintf(buffer, MAX_PATH, "%s.bak", fileName);
|
||||
buffer[MAX_PATH-1] = '\0';
|
||||
makeBackup = 1;
|
||||
if (access(buffer, 0) >= 0) /* file exists */
|
||||
{
|
||||
printf("File %s already exists, overwrite? (Y)es, (N)o, (A)bort", buffer);
|
||||
do
|
||||
{
|
||||
c = getch();
|
||||
}
|
||||
while (c != 'y' && c != 'n' && c != 'a');
|
||||
printf("\n");
|
||||
if (c == 'n')
|
||||
makeBackup = 0;
|
||||
else if (c == 'a')
|
||||
{
|
||||
free(file);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (makeBackup && saveFile(buffer, file, fileSize) < 0)
|
||||
{
|
||||
free(file);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (c == 'a')
|
||||
{
|
||||
free(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Patch file */
|
||||
for (j = 0; j < m_patch.files[i].patchCount; j++)
|
||||
{
|
||||
int offset = m_patch.files[i].patches[j].offset;
|
||||
if (file[offset] != m_patch.files[i].patches[j].expected)
|
||||
{
|
||||
printf("Unexpected value in file %s at offset 0x%x: expected = 0x%02x, found = 0x%02x\n",
|
||||
fileName, offset, m_patch.files[i].patches[j].expected, file[offset]);
|
||||
free(file);
|
||||
return -1;
|
||||
}
|
||||
file[offset] = m_patch.files[i].patches[j].patched;
|
||||
}
|
||||
|
||||
/* Save file */
|
||||
if (saveFile(fileName, file, fileSize) < 0)
|
||||
{
|
||||
free(file);
|
||||
return -1;
|
||||
}
|
||||
free(file);
|
||||
}
|
||||
|
||||
printf("Patch applied sucessfully!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
printUsage()
|
||||
{
|
||||
printf("Usage:\n"
|
||||
"%s -c - Create patch\n"
|
||||
"%s -d - Dump patch\n"
|
||||
"%s - Apply patch\n"
|
||||
"\n"
|
||||
"A patch can be created like this:\n"
|
||||
"%s -c \"patch name\" output.exe file1.orig file1.patched[ file2.orig file2.patched[ ...]]\n",
|
||||
m_argv[0], m_argv[0], m_argv[0], m_argv[0]);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *argv[])
|
||||
{
|
||||
m_argc = argc;
|
||||
m_argv = argv;
|
||||
|
||||
if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0))
|
||||
{
|
||||
printUsage();
|
||||
return 0;
|
||||
}
|
||||
else if (argc >= 2 && argv[1][0] == '-')
|
||||
{
|
||||
if (strcmp(argv[1], "-c") == 0)
|
||||
{
|
||||
return createPatch();
|
||||
}
|
||||
else if (strcmp(argv[1], "-d") == 0)
|
||||
{
|
||||
return applyPatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unknown option: %s\n"
|
||||
"Use -h for help.\n",
|
||||
argv[1]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return applyPatch();
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ int main(int argc, char* argv[])
|
||||
int i;
|
||||
FILE* in;
|
||||
char ch;
|
||||
|
||||
|
||||
for (i=1; i<argc; i++)
|
||||
{
|
||||
in = fopen(argv[i],"r");
|
||||
@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
|
||||
printf("Failed to open file %s\n", argv[i]);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
while ((ch = fgetc(in)) != EOF)
|
||||
{
|
||||
putchar(ch);
|
||||
|
30
reactos/apps/utils/consw/consw.c
Normal file
30
reactos/apps/utils/consw/consw.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* $Id$
|
||||
*
|
||||
* DESCRIPTION: Console mode switcher
|
||||
* PROGRAMMER: Art Yerkes
|
||||
* REVISIONS
|
||||
* 2003-07-26 (arty)
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void STDCALL SetConsoleHardwareState( HANDLE conhandle,
|
||||
DWORD flags,
|
||||
DWORD state );
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if( argc > 1 ) {
|
||||
SetConsoleHardwareState( GetStdHandle( STD_INPUT_HANDLE ),
|
||||
0,
|
||||
!strcmp( argv[1], "hw" ) );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
23
reactos/apps/utils/consw/makefile
Normal file
23
reactos/apps/utils/consw/makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
# $Id$
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = consw
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a kernel32.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
TARGET_CFLAGS = -Wall -Werror
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
5
reactos/apps/utils/consw/runprg.bat
Normal file
5
reactos/apps/utils/consw/runprg.bat
Normal file
@@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
rem Turn off cosole, run a program, turn console on
|
||||
\reactos\bin\consw sw
|
||||
"%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
|
||||
\reactos\bin\consw hw
|
@@ -1,3 +0,0 @@
|
||||
<directory name="net">
|
||||
<xi:include href="net/directory.xml" />
|
||||
</directory>
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Load a device driver
|
||||
*/
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <ntos/zw.h>
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Unload a device driver
|
||||
*/
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <ntos/zw.h>
|
||||
|
||||
|
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
DWORD dwUptime = SnmpSvcGetUptime();
|
||||
|
||||
_tprintf(_T("SNMP uptime: %ld\n"), dwUptime);
|
||||
_tprintf(_T("SNMP uptime: %d\n"), dwUptime);
|
||||
|
||||
SnmpUtilMemFree(pCache);
|
||||
} else {
|
||||
|
@@ -1,9 +0,0 @@
|
||||
<module name="arp" type="win32cui" installbase="system32" installname="arp.exe">
|
||||
<include base="arp">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>snmpapi</library>
|
||||
<file>arp.c</file>
|
||||
<file>arp.rc</file>
|
||||
</module>
|
19
reactos/apps/utils/net/arp/makefile
Normal file
19
reactos/apps/utils/net/arp/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = arp
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API
|
||||
|
||||
TARGET_SDKLIBS = user32.a snmpapi.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Diagnostic Trace
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
@@ -1,27 +0,0 @@
|
||||
<directory name="arp">
|
||||
<xi:include href="arp/arp.xml" />
|
||||
</directory>
|
||||
<directory name="finger">
|
||||
<xi:include href="finger/finger.xml" />
|
||||
</directory>
|
||||
<directory name="ftp">
|
||||
<xi:include href="ftp/ftp.xml" />
|
||||
</directory>
|
||||
<directory name="ipconfig">
|
||||
<xi:include href="ipconfig/ipconfig.xml" />
|
||||
</directory>
|
||||
<directory name="netstat">
|
||||
<xi:include href="netstat/netstat.xml" />
|
||||
</directory>
|
||||
<directory name="ping">
|
||||
<xi:include href="ping/ping.xml" />
|
||||
</directory>
|
||||
<directory name="route">
|
||||
<xi:include href="route/route.xml" />
|
||||
</directory>
|
||||
<directory name="telnet">
|
||||
<xi:include href="telnet/telnet.xml" />
|
||||
</directory>
|
||||
<directory name="whois">
|
||||
<xi:include href="whois/whois.xml" />
|
||||
</directory>
|
@@ -41,6 +41,16 @@
|
||||
* Had to remove local handling. Otherwise, same as whois.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)finger.c 8.5 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
* Finger prints out information about users. It is not portable since
|
||||
* certain fields (e.g. the full user name, office, and phone numbers) are
|
||||
@@ -151,10 +161,10 @@ userlist(int argc, char **argv)
|
||||
fprintf(stderr, "Warning: Can't do local finger\n");
|
||||
}
|
||||
|
||||
/* Start winsock */
|
||||
/* Start winsock */
|
||||
wVersionRequested = MAKEWORD( 1, 1 );
|
||||
iErr = WSAStartup( wVersionRequested, &wsaData );
|
||||
if ( iErr != 0 )
|
||||
if ( iErr != 0 )
|
||||
{
|
||||
/* Tell the user that we couldn't find a usable */
|
||||
/* WinSock DLL. */
|
||||
|
@@ -1,11 +0,0 @@
|
||||
<module name="finger" type="win32cui" installbase="system32" installname="finger.exe">
|
||||
<include base="finger">.</include>
|
||||
<define name="__USE_W32_SOCKETS" />
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<file>finger.c</file>
|
||||
<file>err.c</file>
|
||||
<file>getopt.c</file>
|
||||
<file>net.c</file>
|
||||
<file>finger.rc</file>
|
||||
</module>
|
24
reactos/apps/utils/net/finger/makefile
Normal file
24
reactos/apps/utils/net/finger/makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = finger
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32_SOCKETS
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o \
|
||||
err.o \
|
||||
getopt.o \
|
||||
net.o
|
||||
|
||||
TARGET_GCCLIBS = iberty
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -33,6 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)net.c 8.4 (Berkeley) 4/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <winsock2.h>
|
||||
#include "unistd.h"
|
||||
@@ -51,14 +56,14 @@ netfinger(char *name)
|
||||
struct hostent *hp, def;
|
||||
struct servent *sp;
|
||||
struct sockaddr_in sin;
|
||||
SOCKET s;
|
||||
int s;
|
||||
char *alist[1], *host;
|
||||
|
||||
/* If this is a local request */
|
||||
if (!(host = rindex(name, '@')))
|
||||
return;
|
||||
|
||||
*host++ = '\0';
|
||||
*host++ = NULL;
|
||||
if (isdigit(*host) && (defaddr.s_addr = inet_addr(host)) != -1) {
|
||||
def.h_name = host;
|
||||
def.h_addr_list = alist;
|
||||
@@ -79,7 +84,7 @@ netfinger(char *name)
|
||||
sin.sin_family = hp->h_addrtype;
|
||||
bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
|
||||
sin.sin_port = sp->s_port;
|
||||
if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) == INVALID_SOCKET) {
|
||||
if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
|
||||
perror("finger: socket");
|
||||
return;
|
||||
}
|
||||
@@ -110,7 +115,7 @@ netfinger(char *name)
|
||||
* Otherwise, all high bits are stripped; if it isn't printable and
|
||||
* it isn't a space, we can simply set the 7th bit. Every ASCII
|
||||
* character with bit 7 set is printable.
|
||||
*/
|
||||
*/
|
||||
lastc = 0;
|
||||
while (recv(s, &c, 1, 0) == 1) {
|
||||
c &= 0x7f;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
static char sccsid[] = "@(#)domacro.c 1.6 (Berkeley) 2/28/89";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "ftp_var.h"
|
||||
#include "ftp_var.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
@@ -1,344 +1,344 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <winsock.h>
|
||||
#include "prototypes.h"
|
||||
|
||||
#define MAX_ASCII 100
|
||||
|
||||
int checkRecv(SOCKET s);
|
||||
|
||||
int checkRecv(SOCKET s)
|
||||
{
|
||||
int testVal;
|
||||
fd_set sSet;
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 60;
|
||||
|
||||
FD_ZERO(&sSet);
|
||||
|
||||
FD_SET(s, &sSet);
|
||||
|
||||
testVal = select(0, &sSet, NULL, NULL, &timeout);
|
||||
|
||||
if (testVal == SOCKET_ERROR)
|
||||
fprintf(stderr, "Socket Error");
|
||||
|
||||
return testVal;
|
||||
}
|
||||
|
||||
void blkfree(char **av0)
|
||||
{
|
||||
register char **av = av0;
|
||||
|
||||
while (*av)
|
||||
free(*av++);
|
||||
}
|
||||
|
||||
char *glob(register char *v)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int sleep(int time)
|
||||
{
|
||||
return time;
|
||||
}
|
||||
|
||||
int herror(char *string)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
|
||||
int gettimeofday(struct timeval *timenow,
|
||||
struct timezone *zone)
|
||||
{
|
||||
time_t t;
|
||||
|
||||
t = clock();
|
||||
|
||||
timenow->tv_usec = t;
|
||||
timenow->tv_sec = t / CLK_TCK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fgetcSocket(int s)
|
||||
{
|
||||
int c;
|
||||
char buffer[10];
|
||||
|
||||
// checkRecv(s);
|
||||
|
||||
c = recv(s, buffer, 1, 0);
|
||||
|
||||
#ifdef DEBUG_IN
|
||||
printf("%c", buffer[0]);
|
||||
#endif
|
||||
|
||||
if (c == INVALID_SOCKET)
|
||||
return c;
|
||||
|
||||
if (c == 0)
|
||||
return EOF;
|
||||
|
||||
return buffer[0];
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int fgetcSocket(int s)
|
||||
{
|
||||
static int index = 0;
|
||||
static int total = 0;
|
||||
static char buffer[4096];
|
||||
|
||||
if (index == total)
|
||||
{
|
||||
index = 0;
|
||||
total = recv(s, buffer, sizeof(buffer), 0);
|
||||
|
||||
if (total == INVALID_SOCKET)
|
||||
{
|
||||
total = 0;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (total == 0)
|
||||
return EOF;
|
||||
}
|
||||
return buffer[index++];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
char *fprintfSocket(int s, char *format, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char buffer[10009];
|
||||
|
||||
va_start(argptr, format);
|
||||
vsprintf(buffer, format, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
send(s, buffer, strlen(buffer), 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *fputsSocket(char *format, int s)
|
||||
{
|
||||
send(s, format, strlen(format), 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int fputcSocket(int s, char putChar)
|
||||
{
|
||||
char buffer[2];
|
||||
|
||||
buffer[0] = putChar;
|
||||
buffer[1] = '\0';
|
||||
|
||||
if(SOCKET_ERROR==send(s, buffer, 1, 0)) {
|
||||
int iret=WSAGetLastError ();
|
||||
fprintf(stdout,"fputcSocket: %d\n",iret);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return putChar;
|
||||
}
|
||||
}
|
||||
int fputSocket(int s, char *buffer, int len)
|
||||
{
|
||||
int iret;
|
||||
while(len) {
|
||||
if(SOCKET_ERROR==(iret=send(s, buffer, len, 0)))
|
||||
{
|
||||
iret=WSAGetLastError ();
|
||||
fprintf(stdout,"fputcSocket: %d\n",iret);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return len-=iret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *fgetsSocket(int s, char *string)
|
||||
{
|
||||
char buffer[2] = {0};
|
||||
int i, count;
|
||||
|
||||
for (i = 0, count = 1; count != 0 && buffer[0] != '\n'; i++)
|
||||
{
|
||||
checkRecv(s);
|
||||
|
||||
count = recv(s, buffer, 1, 0);
|
||||
|
||||
if (count == SOCKET_ERROR)
|
||||
{
|
||||
printf("Error in fgetssocket");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
string[i] = buffer[0];
|
||||
|
||||
if (i == MAX_ASCII - 3)
|
||||
{
|
||||
count = 0;
|
||||
string[++i] = '\n';
|
||||
string[++i] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == 0)
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
string[i] = '\n';
|
||||
string[i + 1] = '\0'; // This is risky
|
||||
return string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
string[i] = '\0';
|
||||
|
||||
#ifdef DEBUG_IN
|
||||
printf("%s", string);
|
||||
#endif
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
char *getpass(const char *prompt)
|
||||
{
|
||||
static char string[64];
|
||||
|
||||
printf("%s", prompt);
|
||||
|
||||
gets(string);
|
||||
|
||||
return string;
|
||||
}
|
||||
#endif
|
||||
char *getpass (const char * prompt)
|
||||
{
|
||||
static char input[256];
|
||||
HANDLE in;
|
||||
HANDLE err;
|
||||
DWORD count;
|
||||
|
||||
in = GetStdHandle (STD_INPUT_HANDLE);
|
||||
err = GetStdHandle (STD_ERROR_HANDLE);
|
||||
|
||||
if (in == INVALID_HANDLE_VALUE || err == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
|
||||
if (WriteFile (err, prompt, strlen (prompt), &count, NULL))
|
||||
{
|
||||
int istty = (GetFileType (in) == FILE_TYPE_CHAR);
|
||||
DWORD old_flags;
|
||||
int rc;
|
||||
|
||||
if (istty)
|
||||
{
|
||||
if (GetConsoleMode (in, &old_flags))
|
||||
SetConsoleMode (in, ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT);
|
||||
else
|
||||
istty = 0;
|
||||
}
|
||||
/* Need to read line one byte at time to avoid blocking, if not a
|
||||
tty, so always do it this way. */
|
||||
count = 0;
|
||||
while (1)
|
||||
{
|
||||
DWORD dummy;
|
||||
char one_char;
|
||||
|
||||
rc = ReadFile (in, &one_char, 1, &dummy, NULL);
|
||||
if (rc == 0)
|
||||
break;
|
||||
if (one_char == '\r')
|
||||
{
|
||||
/* CR is always followed by LF if reading from tty. */
|
||||
if (istty)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (one_char == '\n')
|
||||
break;
|
||||
/* Silently truncate password string if overly long. */
|
||||
if (count < sizeof (input) - 1)
|
||||
input[count++] = one_char;
|
||||
}
|
||||
input[count] = '\0';
|
||||
|
||||
WriteFile (err, "\r\n", 2, &count, NULL);
|
||||
if (istty)
|
||||
SetConsoleMode (in, old_flags);
|
||||
if (rc)
|
||||
return input;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Stubbed out here. Should be changed in Source code...
|
||||
int access(const char *filename, int accessmethod)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define EPOCHFILETIME (116444736000000000i64)
|
||||
#else
|
||||
#define EPOCHFILETIME (116444736000000000LL)
|
||||
#endif
|
||||
|
||||
struct timezone {
|
||||
int tz_minuteswest; /* minutes W of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
|
||||
__inline int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
LARGE_INTEGER li;
|
||||
__int64 t;
|
||||
static int tzflag;
|
||||
|
||||
if (tv)
|
||||
{
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
//li.LowPart = ft.dwLowDateTime;
|
||||
//li.HighPart = ft.dwHighDateTime;
|
||||
t = li.QuadPart; /* In 100-nanosecond intervals */
|
||||
t -= EPOCHFILETIME; /* Offset to the Epoch time */
|
||||
t /= 10; /* In microseconds */
|
||||
tv->tv_sec = (long)(t / 1000000);
|
||||
tv->tv_usec = (long)(t % 1000000);
|
||||
}
|
||||
|
||||
if (tz)
|
||||
{
|
||||
if (!tzflag)
|
||||
{
|
||||
_tzset();
|
||||
tzflag++;
|
||||
}
|
||||
tz->tz_minuteswest = _timezone / 60;
|
||||
tz->tz_dsttime = _daylight;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <winsock.h>
|
||||
#include "prototypes.h"
|
||||
|
||||
#define MAX_ASCII 100
|
||||
|
||||
int checkRecv(SOCKET s);
|
||||
|
||||
int checkRecv(SOCKET s)
|
||||
{
|
||||
int testVal;
|
||||
fd_set sSet;
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 60;
|
||||
|
||||
FD_ZERO(&sSet);
|
||||
|
||||
FD_SET(s, &sSet);
|
||||
|
||||
testVal = select(0, &sSet, NULL, NULL, &timeout);
|
||||
|
||||
if (testVal == SOCKET_ERROR)
|
||||
fprintf(stderr, "Socket Error");
|
||||
|
||||
return testVal;
|
||||
}
|
||||
|
||||
void blkfree(char **av0)
|
||||
{
|
||||
register char **av = av0;
|
||||
|
||||
while (*av)
|
||||
free(*av++);
|
||||
}
|
||||
|
||||
char *glob(register char *v)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int sleep(int time)
|
||||
{
|
||||
return time;
|
||||
}
|
||||
|
||||
int herror(char *string)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#if 0
|
||||
|
||||
int gettimeofday(struct timeval *timenow,
|
||||
struct timezone *zone)
|
||||
{
|
||||
time_t t;
|
||||
|
||||
t = clock();
|
||||
|
||||
timenow->tv_usec = t;
|
||||
timenow->tv_sec = t / CLK_TCK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fgetcSocket(int s)
|
||||
{
|
||||
int c;
|
||||
char buffer[10];
|
||||
|
||||
// checkRecv(s);
|
||||
|
||||
c = recv(s, buffer, 1, 0);
|
||||
|
||||
#ifdef DEBUG_IN
|
||||
printf("%c", buffer[0]);
|
||||
#endif
|
||||
|
||||
if (c == INVALID_SOCKET)
|
||||
return c;
|
||||
|
||||
if (c == 0)
|
||||
return EOF;
|
||||
|
||||
return buffer[0];
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int fgetcSocket(int s)
|
||||
{
|
||||
static int index = 0;
|
||||
static int total = 0;
|
||||
static unsigned char buffer[4096];
|
||||
|
||||
if (index == total)
|
||||
{
|
||||
index = 0;
|
||||
total = recv(s, buffer, sizeof(buffer), 0);
|
||||
|
||||
if (total == INVALID_SOCKET)
|
||||
{
|
||||
total = 0;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (total == 0)
|
||||
return EOF;
|
||||
}
|
||||
return buffer[index++];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
char *fprintfSocket(int s, char *format, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char buffer[10009];
|
||||
|
||||
va_start(argptr, format);
|
||||
vsprintf(buffer, format, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
send(s, buffer, strlen(buffer), 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *fputsSocket(char *format, int s)
|
||||
{
|
||||
send(s, format, strlen(format), 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int fputcSocket(int s, char putChar)
|
||||
{
|
||||
char buffer[2];
|
||||
|
||||
buffer[0] = putChar;
|
||||
buffer[1] = '\0';
|
||||
|
||||
if(SOCKET_ERROR==send(s, buffer, 1, 0)) {
|
||||
int iret=WSAGetLastError ();
|
||||
fprintf(stdout,"fputcSocket: %d\n",iret);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return putChar;
|
||||
}
|
||||
}
|
||||
int fputSocket(int s, char *buffer, int len)
|
||||
{
|
||||
int iret;
|
||||
while(len) {
|
||||
if(SOCKET_ERROR==(iret=send(s, buffer, len, 0)))
|
||||
{
|
||||
iret=WSAGetLastError ();
|
||||
fprintf(stdout,"fputcSocket: %d\n",iret);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return len-=iret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *fgetsSocket(int s, char *string)
|
||||
{
|
||||
char buffer[2] = {0};
|
||||
int i, count;
|
||||
|
||||
for (i = 0, count = 1; count != 0 && buffer[0] != '\n'; i++)
|
||||
{
|
||||
checkRecv(s);
|
||||
|
||||
count = recv(s, buffer, 1, 0);
|
||||
|
||||
if (count == SOCKET_ERROR)
|
||||
{
|
||||
printf("Error in fgetssocket");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
string[i] = buffer[0];
|
||||
|
||||
if (i == MAX_ASCII - 3)
|
||||
{
|
||||
count = 0;
|
||||
string[++i] = '\n';
|
||||
string[++i] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == 0)
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
string[i] = '\n';
|
||||
string[i + 1] = '\0'; // This is risky
|
||||
return string;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
string[i] = '\0';
|
||||
|
||||
#ifdef DEBUG_IN
|
||||
printf("%s", string);
|
||||
#endif
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
char *getpass(const char *prompt)
|
||||
{
|
||||
static char string[64];
|
||||
|
||||
printf("%s", prompt);
|
||||
|
||||
gets(string);
|
||||
|
||||
return string;
|
||||
}
|
||||
#endif
|
||||
char *getpass (const char * prompt)
|
||||
{
|
||||
static char input[256];
|
||||
HANDLE in;
|
||||
HANDLE err;
|
||||
int count;
|
||||
|
||||
in = GetStdHandle (STD_INPUT_HANDLE);
|
||||
err = GetStdHandle (STD_ERROR_HANDLE);
|
||||
|
||||
if (in == INVALID_HANDLE_VALUE || err == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
|
||||
if (WriteFile (err, prompt, strlen (prompt), &count, NULL))
|
||||
{
|
||||
int istty = (GetFileType (in) == FILE_TYPE_CHAR);
|
||||
DWORD old_flags;
|
||||
int rc;
|
||||
|
||||
if (istty)
|
||||
{
|
||||
if (GetConsoleMode (in, &old_flags))
|
||||
SetConsoleMode (in, ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT);
|
||||
else
|
||||
istty = 0;
|
||||
}
|
||||
/* Need to read line one byte at time to avoid blocking, if not a
|
||||
tty, so always do it this way. */
|
||||
count = 0;
|
||||
while (1)
|
||||
{
|
||||
DWORD dummy;
|
||||
char one_char;
|
||||
|
||||
rc = ReadFile (in, &one_char, 1, &dummy, NULL);
|
||||
if (rc == 0)
|
||||
break;
|
||||
if (one_char == '\r')
|
||||
{
|
||||
/* CR is always followed by LF if reading from tty. */
|
||||
if (istty)
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (one_char == '\n')
|
||||
break;
|
||||
/* Silently truncate password string if overly long. */
|
||||
if (count < sizeof (input) - 1)
|
||||
input[count++] = one_char;
|
||||
}
|
||||
input[count] = '\0';
|
||||
|
||||
WriteFile (err, "\r\n", 2, &count, NULL);
|
||||
if (istty)
|
||||
SetConsoleMode (in, old_flags);
|
||||
if (rc)
|
||||
return input;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Stubbed out here. Should be changed in Source code...
|
||||
int access(const char *filename, int accessmethod)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define EPOCHFILETIME (116444736000000000i64)
|
||||
#else
|
||||
#define EPOCHFILETIME (116444736000000000LL)
|
||||
#endif
|
||||
|
||||
struct timezone {
|
||||
int tz_minuteswest; /* minutes W of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction */
|
||||
};
|
||||
|
||||
__inline int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
LARGE_INTEGER li;
|
||||
__int64 t;
|
||||
static int tzflag;
|
||||
|
||||
if (tv)
|
||||
{
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
//li.LowPart = ft.dwLowDateTime;
|
||||
//li.HighPart = ft.dwHighDateTime;
|
||||
t = li.QuadPart; /* In 100-nanosecond intervals */
|
||||
t -= EPOCHFILETIME; /* Offset to the Epoch time */
|
||||
t /= 10; /* In microseconds */
|
||||
tv->tv_sec = (long)(t / 1000000);
|
||||
tv->tv_usec = (long)(t % 1000000);
|
||||
}
|
||||
|
||||
if (tz)
|
||||
{
|
||||
if (!tzflag)
|
||||
{
|
||||
_tzset();
|
||||
tzflag++;
|
||||
}
|
||||
tz->tz_minuteswest = _timezone / 60;
|
||||
tz->tz_dsttime = _daylight;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#define bcopy(s,d,l) memcpy((d),(s),(l))
|
||||
#define bzero(cp,l) memset((cp),0,(l))
|
||||
|
||||
#define rindex strrchr
|
||||
#define index strchr
|
||||
|
||||
#define getwd getcwd
|
||||
|
||||
#define strcasecmp strcmp
|
||||
#define strncasecmp strnicmp
|
||||
#define bcopy(s,d,l) memcpy((d),(s),(l))
|
||||
#define bzero(cp,l) memset((cp),0,(l))
|
||||
|
||||
#define rindex strrchr
|
||||
#define index strchr
|
||||
|
||||
#define getwd getcwd
|
||||
|
||||
#define strcasecmp strcmp
|
||||
#define strncasecmp strnicmp
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,372 +1,372 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ftp.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftp - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftp - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftp - Win32 Release" && "$(CFG)" != "ftp - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc*.idb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.pch"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" \
|
||||
/D "HAVE_TIMEVAL" /Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD\
|
||||
/c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /machine:I386 /out:"$(OUTDIR)\ftp.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Release\ftp.exe
|
||||
InputPath=.\Release\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc*.idb"
|
||||
-@erase "$(INTDIR)\vc*.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.ilk"
|
||||
-@erase "$(OUTDIR)\ftp.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.pch"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"\
|
||||
/Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
CPP_OBJS=.\Debug/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ftp.exe"\
|
||||
/pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Debug\ftp.exe
|
||||
InputPath=.\Debug\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release" || "$(CFG)" == "ftp - Win32 Debug"
|
||||
SOURCE=.\cmds.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\cmdtab.c
|
||||
DEP_CPP_CMDTA=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmdtab.obj" : $(SOURCE) $(DEP_CPP_CMDTA) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\domacro.c
|
||||
DEP_CPP_DOMAC=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\domacro.obj" : $(SOURCE) $(DEP_CPP_DOMAC) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\fake.c
|
||||
DEP_CPP_FAKE_=\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\fake.obj" : $(SOURCE) $(DEP_CPP_FAKE_) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ftp.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\main.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\ruserpass.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ftp.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftp - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftp - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftp - Win32 Release" && "$(CFG)" != "ftp - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc*.idb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.pch"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" \
|
||||
/D "HAVE_TIMEVAL" /Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD\
|
||||
/c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /machine:I386 /out:"$(OUTDIR)\ftp.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Release\ftp.exe
|
||||
InputPath=.\Release\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc*.idb"
|
||||
-@erase "$(INTDIR)\vc*.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.ilk"
|
||||
-@erase "$(OUTDIR)\ftp.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.pch"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"\
|
||||
/Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
CPP_OBJS=.\Debug/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib wsock32.lib /nologo /subsystem:console /incremental:yes\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ftp.exe"\
|
||||
/pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Debug\ftp.exe
|
||||
InputPath=.\Debug\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release" || "$(CFG)" == "ftp - Win32 Debug"
|
||||
SOURCE=.\cmds.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\cmdtab.c
|
||||
DEP_CPP_CMDTA=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmdtab.obj" : $(SOURCE) $(DEP_CPP_CMDTA) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\domacro.c
|
||||
DEP_CPP_DOMAC=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\domacro.obj" : $(SOURCE) $(DEP_CPP_DOMAC) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\fake.c
|
||||
DEP_CPP_FAKE_=\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\fake.obj" : $(SOURCE) $(DEP_CPP_FAKE_) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ftp.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\main.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\ruserpass.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
@@ -1,400 +1,400 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ftp.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftp - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftp - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftp - Win32 Release" && "$(CFG)" != "ftp - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "C:\emacs-19.34\nt\inc" /I\
|
||||
"C:\emacs-19.34\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D\
|
||||
"HAVE_TIMEVAL" /Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD\
|
||||
/c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /machine:I386 /out:"$(OUTDIR)\ftp.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj" \
|
||||
"d:\Program Files\DevStudio\VC\lib\WSOCK32.LIB"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Release\ftp.exe
|
||||
InputPath=.\Release\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
"\emacs-19.34\bin\ftp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
# copy $(TargetPath) \emacs-19.34\bin
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(INTDIR)\vc50.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.ilk"
|
||||
-@erase "$(OUTDIR)\ftp.pdb"
|
||||
-@erase "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "C:\emacs-19.34\nt\inc" /I\
|
||||
"C:\emacs-19.34\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"\
|
||||
/Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
CPP_OBJS=.\Debug/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:console /incremental:yes\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ftp.exe"\
|
||||
/pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj" \
|
||||
"d:\Program Files\DevStudio\VC\lib\WSOCK32.LIB"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Debug\ftp.exe
|
||||
InputPath=.\Debug\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
"\emacs-19.34\bin\ftp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
# copy $(TargetPath) \emacs-19.34\bin
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release" || "$(CFG)" == "ftp - Win32 Debug"
|
||||
SOURCE=.\cmds.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\netinet\in.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\cmdtab.c
|
||||
DEP_CPP_CMDTA=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmdtab.obj" : $(SOURCE) $(DEP_CPP_CMDTA) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\domacro.c
|
||||
DEP_CPP_DOMAC=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\domacro.obj" : $(SOURCE) $(DEP_CPP_DOMAC) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\fake.c
|
||||
DEP_CPP_FAKE_=\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\fake.obj" : $(SOURCE) $(DEP_CPP_FAKE_) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ftp.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\netinet\in.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\pwd.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\file.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\ioctl.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\param.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\time.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\main.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\pwd.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\ioctl.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\ruserpass.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ftp.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftp - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftp - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftp - Win32 Release" && "$(CFG)" != "ftp - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "C:\emacs-19.34\nt\inc" /I\
|
||||
"C:\emacs-19.34\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D\
|
||||
"HAVE_TIMEVAL" /Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD\
|
||||
/c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:console /incremental:no\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /machine:I386 /out:"$(OUTDIR)\ftp.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj" \
|
||||
"d:\Program Files\DevStudio\VC\lib\WSOCK32.LIB"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Release\ftp.exe
|
||||
InputPath=.\Release\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
"\emacs-19.34\bin\ftp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
# copy $(TargetPath) \emacs-19.34\bin
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
!IF "$(RECURSE)" == "0"
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ELSE
|
||||
|
||||
ALL : "$(OUTDIR)\ftp.exe" "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
!ENDIF
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\cmds.obj"
|
||||
-@erase "$(INTDIR)\cmdtab.obj"
|
||||
-@erase "$(INTDIR)\domacro.obj"
|
||||
-@erase "$(INTDIR)\fake.obj"
|
||||
-@erase "$(INTDIR)\ftp.obj"
|
||||
-@erase "$(INTDIR)\main.obj"
|
||||
-@erase "$(INTDIR)\ruserpass.obj"
|
||||
-@erase "$(INTDIR)\vc50.idb"
|
||||
-@erase "$(INTDIR)\vc50.pdb"
|
||||
-@erase "$(OUTDIR)\ftp.exe"
|
||||
-@erase "$(OUTDIR)\ftp.ilk"
|
||||
-@erase "$(OUTDIR)\ftp.pdb"
|
||||
-@erase "\emacs-19.34\bin\ftp.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "C:\emacs-19.34\nt\inc" /I\
|
||||
"C:\emacs-19.34\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"\
|
||||
/Fp"$(INTDIR)\ftp.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
CPP_OBJS=.\Debug/
|
||||
CPP_SBRS=.
|
||||
|
||||
.c{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ftp.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib /nologo /subsystem:console /incremental:yes\
|
||||
/pdb:"$(OUTDIR)\ftp.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ftp.exe"\
|
||||
/pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\cmds.obj" \
|
||||
"$(INTDIR)\cmdtab.obj" \
|
||||
"$(INTDIR)\domacro.obj" \
|
||||
"$(INTDIR)\fake.obj" \
|
||||
"$(INTDIR)\ftp.obj" \
|
||||
"$(INTDIR)\main.obj" \
|
||||
"$(INTDIR)\ruserpass.obj" \
|
||||
"d:\Program Files\DevStudio\VC\lib\WSOCK32.LIB"
|
||||
|
||||
"$(OUTDIR)\ftp.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
TargetPath=.\Debug\ftp.exe
|
||||
InputPath=.\Debug\ftp.exe
|
||||
SOURCE=$(InputPath)
|
||||
|
||||
"\emacs-19.34\bin\ftp.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
# copy $(TargetPath) \emacs-19.34\bin
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release" || "$(CFG)" == "ftp - Win32 Debug"
|
||||
SOURCE=.\cmds.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_CMDS_=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\netinet\in.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\pathnames.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmds.obj" : $(SOURCE) $(DEP_CPP_CMDS_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\cmdtab.c
|
||||
DEP_CPP_CMDTA=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\cmdtab.obj" : $(SOURCE) $(DEP_CPP_CMDTA) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\domacro.c
|
||||
DEP_CPP_DOMAC=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\domacro.obj" : $(SOURCE) $(DEP_CPP_DOMAC) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\fake.c
|
||||
DEP_CPP_FAKE_=\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\fake.obj" : $(SOURCE) $(DEP_CPP_FAKE_) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\ftp.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTP_C=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\netinet\in.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\pwd.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\file.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\ioctl.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\param.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\time.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\main.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_MAIN_=\
|
||||
"..\..\..\emacs-19.34\nt\inc\netdb.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\pwd.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\ioctl.h"\
|
||||
"..\..\..\emacs-19.34\nt\inc\sys\socket.h"\
|
||||
"..\..\..\emacs-19.34\src\nt.h"\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\main.obj" : $(SOURCE) $(DEP_CPP_MAIN_) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\ruserpass.c
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
DEP_CPP_RUSER=\
|
||||
".\fake.h"\
|
||||
".\ftp_var.h"\
|
||||
".\prototypes.h"\
|
||||
{$(INCLUDE)}"sys\stat.h"\
|
||||
{$(INCLUDE)}"sys\types.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\ruserpass.obj" : $(SOURCE) $(DEP_CPP_RUSER) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
@@ -1,15 +0,0 @@
|
||||
<module name="ftp" type="win32cui" installbase="system32" installname="ftp.exe" warnings="true">
|
||||
<include base="ftp">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<library>iphlpapi</library>
|
||||
<file>cmds.c</file>
|
||||
<file>cmdtab.c</file>
|
||||
<file>domacro.c</file>
|
||||
<file>fake.c</file>
|
||||
<file>ftp.c</file>
|
||||
<file>main.c</file>
|
||||
<file>ruserpass.c</file>
|
||||
<file>ftp.rc</file>
|
||||
</module>
|
@@ -1,181 +1,181 @@
|
||||
#include "fake.h"
|
||||
#include <winsock.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
//typedef void (*Sig_t)(int);
|
||||
|
||||
int fgetcSocket(int s);
|
||||
char *fputsSocket(char *format, int s);
|
||||
|
||||
char *fprintfSocket(int s, char *format, ...);
|
||||
|
||||
int fputcSocket(int s, char putChar);
|
||||
int fputSocket(int s, char *putChar, int len);
|
||||
char *fgetsSocket(int s, char *string);
|
||||
|
||||
/* The following defines are from ftp.h and telnet.h from bsd.h */
|
||||
/* All relevent copyrights below apply. */
|
||||
|
||||
#define IAC 255
|
||||
#define DONT 254
|
||||
#define DO 253
|
||||
#define WONT 252
|
||||
#define WILL 251
|
||||
#define SB 250
|
||||
#define GA 249
|
||||
#define EL 248
|
||||
#define EC 247
|
||||
#define AYT 246
|
||||
#define AO 245
|
||||
#define IP 244
|
||||
#define BREAK 243
|
||||
#define DM 242
|
||||
#define NOP 241
|
||||
#define SE 240
|
||||
#define EOR 239
|
||||
#define ABORT 238
|
||||
#define SUSP 237
|
||||
#define xEOF 236
|
||||
|
||||
|
||||
#define MAXPATHLEN 255
|
||||
#define TYPE_A 'A'
|
||||
#define TYPE_I 'I'
|
||||
#define TYPE_E 'E'
|
||||
#define TYPE_L 'L'
|
||||
|
||||
#define PRELIM 1
|
||||
#define COMPLETE 2
|
||||
#define CONTINUE 3
|
||||
#define TRANSIENT 4
|
||||
|
||||
#define MODE_S 1
|
||||
#define MODE_B 2
|
||||
#define MODE_C 3
|
||||
|
||||
#define STRU_F 1
|
||||
#define STRU_R 2
|
||||
#define STRU_P 3
|
||||
|
||||
#define SIGQUIT 1
|
||||
#define SIGPIPE 2
|
||||
#define SIGALRM 3
|
||||
|
||||
|
||||
#define FORM_N 1
|
||||
#define FORM_T 2
|
||||
#define FORM_C 3
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the University of California, Berkeley. The name of the
|
||||
* University may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#)ftp_var.h 5.5 (Berkeley) 6/29/88
|
||||
*/
|
||||
|
||||
/*
|
||||
* FTP global variables.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Options and other state info.
|
||||
*/
|
||||
extern int trace; /* trace packets exchanged */
|
||||
extern int hash; /* print # for each buffer transferred */
|
||||
extern int sendport; /* use PORT cmd for each data connection */
|
||||
extern int verbose; /* print messages coming back from server */
|
||||
extern int connected; /* connected to server */
|
||||
extern int fromatty; /* input is from a terminal */
|
||||
extern int interactive; /* interactively prompt on m* cmds */
|
||||
extern int debug; /* debugging level */
|
||||
extern int bell; /* ring bell on cmd completion */
|
||||
extern int doglob; /* glob local file names */
|
||||
extern int proxy; /* proxy server connection active */
|
||||
extern int proxflag; /* proxy connection exists */
|
||||
extern int sunique; /* store files on server with unique name */
|
||||
extern int runique; /* store local files with unique name */
|
||||
extern int mcase; /* map upper to lower case for mget names */
|
||||
extern int ntflag; /* use ntin ntout tables for name translation */
|
||||
extern int mapflag; /* use mapin mapout templates on file names */
|
||||
extern int code; /* return/reply code for ftp command */
|
||||
extern int crflag; /* if 1, strip car. rets. on ascii gets */
|
||||
extern char pasv[64]; /* passive port for proxy data connection */
|
||||
extern int passivemode; /* passive mode enabled */
|
||||
extern char *altarg; /* argv[1] with no shell-like preprocessing */
|
||||
extern char ntin[17]; /* input translation table */
|
||||
extern char ntout[17]; /* output translation table */
|
||||
|
||||
extern char mapin[MAXPATHLEN]; /* input map template */
|
||||
extern char mapout[MAXPATHLEN]; /* output map template */
|
||||
extern char typename[32]; /* name of file transfer type */
|
||||
extern int type; /* file transfer type */
|
||||
extern char structname[32]; /* name of file transfer structure */
|
||||
extern int stru; /* file transfer structure */
|
||||
extern char formname[32]; /* name of file transfer format */
|
||||
extern int form; /* file transfer format */
|
||||
extern char modename[32]; /* name of file transfer mode */
|
||||
extern int mode; /* file transfer mode */
|
||||
extern char bytename[32]; /* local byte size in ascii */
|
||||
extern int bytesize; /* local byte size in binary */
|
||||
|
||||
extern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
|
||||
|
||||
extern char line[200]; /* input line buffer */
|
||||
extern char *stringbase; /* current scan point in line buffer */
|
||||
extern char argbuf[200]; /* argument storage buffer */
|
||||
extern char *argbase; /* current storage point in arg buffer */
|
||||
extern int margc; /* count of arguments on input line */
|
||||
extern char *margv[20]; /* args parsed from input line */
|
||||
extern int cpend; /* flag: if != 0, then pending server reply */
|
||||
extern int mflag; /* flag: if != 0, then active multi command */
|
||||
|
||||
extern int options; /* used during socket creation */
|
||||
|
||||
/*
|
||||
* Format of command table.
|
||||
*/
|
||||
struct cmd {
|
||||
char *c_name; /* name of command */
|
||||
char *c_help; /* help string */
|
||||
char c_bell; /* give bell when command completes */
|
||||
char c_conn; /* must be connected to use command */
|
||||
char c_proxy; /* proxy server may execute */
|
||||
int (*c_handler)(); /* function to call */
|
||||
};
|
||||
|
||||
struct macel {
|
||||
char mac_name[9]; /* macro name */
|
||||
char *mac_start; /* start of macro in macbuf */
|
||||
char *mac_end; /* end of macro in macbuf */
|
||||
};
|
||||
|
||||
int macnum; /* number of defined macros */
|
||||
struct macel macros[16];
|
||||
char macbuf[4096];
|
||||
|
||||
extern char *tail();
|
||||
extern char *remglob();
|
||||
extern int errno;
|
||||
extern char *mktemp();
|
||||
|
||||
#if defined(__ANSI__) || defined(sparc)
|
||||
typedef void sig_t;
|
||||
#else
|
||||
typedef int sig_t;
|
||||
#endif
|
||||
|
||||
typedef int uid_t;
|
||||
int herror(char *s);
|
||||
#include "fake.h"
|
||||
#include <winsock.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
//typedef void (*Sig_t)(int);
|
||||
|
||||
int fgetcSocket(int s);
|
||||
char *fputsSocket(char *format, int s);
|
||||
|
||||
char *fprintfSocket(int s, char *format, ...);
|
||||
|
||||
int fputcSocket(int s, char putChar);
|
||||
int fputSocket(int s, char *putChar, int len);
|
||||
char *fgetsSocket(int s, char *string);
|
||||
|
||||
/* The following defines are from ftp.h and telnet.h from bsd.h */
|
||||
/* All relevent copyrights below apply. */
|
||||
|
||||
#define IAC 255
|
||||
#define DONT 254
|
||||
#define DO 253
|
||||
#define WONT 252
|
||||
#define WILL 251
|
||||
#define SB 250
|
||||
#define GA 249
|
||||
#define EL 248
|
||||
#define EC 247
|
||||
#define AYT 246
|
||||
#define AO 245
|
||||
#define IP 244
|
||||
#define BREAK 243
|
||||
#define DM 242
|
||||
#define NOP 241
|
||||
#define SE 240
|
||||
#define EOR 239
|
||||
#define ABORT 238
|
||||
#define SUSP 237
|
||||
#define xEOF 236
|
||||
|
||||
|
||||
#define MAXPATHLEN 255
|
||||
#define TYPE_A 'A'
|
||||
#define TYPE_I 'I'
|
||||
#define TYPE_E 'E'
|
||||
#define TYPE_L 'L'
|
||||
|
||||
#define PRELIM 1
|
||||
#define COMPLETE 2
|
||||
#define CONTINUE 3
|
||||
#define TRANSIENT 4
|
||||
|
||||
#define MODE_S 1
|
||||
#define MODE_B 2
|
||||
#define MODE_C 3
|
||||
|
||||
#define STRU_F 1
|
||||
#define STRU_R 2
|
||||
#define STRU_P 3
|
||||
|
||||
#define SIGQUIT 1
|
||||
#define SIGPIPE 2
|
||||
#define SIGALRM 3
|
||||
|
||||
|
||||
#define FORM_N 1
|
||||
#define FORM_T 2
|
||||
#define FORM_C 3
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the University of California, Berkeley. The name of the
|
||||
* University may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* @(#)ftp_var.h 5.5 (Berkeley) 6/29/88
|
||||
*/
|
||||
|
||||
/*
|
||||
* FTP global variables.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Options and other state info.
|
||||
*/
|
||||
extern int trace; /* trace packets exchanged */
|
||||
extern int hash; /* print # for each buffer transferred */
|
||||
extern int sendport; /* use PORT cmd for each data connection */
|
||||
extern int verbose; /* print messages coming back from server */
|
||||
extern int connected; /* connected to server */
|
||||
extern int fromatty; /* input is from a terminal */
|
||||
extern int interactive; /* interactively prompt on m* cmds */
|
||||
extern int debug; /* debugging level */
|
||||
extern int bell; /* ring bell on cmd completion */
|
||||
extern int doglob; /* glob local file names */
|
||||
extern int proxy; /* proxy server connection active */
|
||||
extern int proxflag; /* proxy connection exists */
|
||||
extern int sunique; /* store files on server with unique name */
|
||||
extern int runique; /* store local files with unique name */
|
||||
extern int mcase; /* map upper to lower case for mget names */
|
||||
extern int ntflag; /* use ntin ntout tables for name translation */
|
||||
extern int mapflag; /* use mapin mapout templates on file names */
|
||||
extern int code; /* return/reply code for ftp command */
|
||||
extern int crflag; /* if 1, strip car. rets. on ascii gets */
|
||||
extern char pasv[64]; /* passive port for proxy data connection */
|
||||
extern int passivemode; /* passive mode enabled */
|
||||
extern char *altarg; /* argv[1] with no shell-like preprocessing */
|
||||
extern char ntin[17]; /* input translation table */
|
||||
extern char ntout[17]; /* output translation table */
|
||||
|
||||
extern char mapin[MAXPATHLEN]; /* input map template */
|
||||
extern char mapout[MAXPATHLEN]; /* output map template */
|
||||
extern char typename[32]; /* name of file transfer type */
|
||||
extern int type; /* file transfer type */
|
||||
extern char structname[32]; /* name of file transfer structure */
|
||||
extern int stru; /* file transfer structure */
|
||||
extern char formname[32]; /* name of file transfer format */
|
||||
extern int form; /* file transfer format */
|
||||
extern char modename[32]; /* name of file transfer mode */
|
||||
extern int mode; /* file transfer mode */
|
||||
extern char bytename[32]; /* local byte size in ascii */
|
||||
extern int bytesize; /* local byte size in binary */
|
||||
|
||||
extern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
|
||||
|
||||
extern char line[200]; /* input line buffer */
|
||||
extern char *stringbase; /* current scan point in line buffer */
|
||||
extern char argbuf[200]; /* argument storage buffer */
|
||||
extern char *argbase; /* current storage point in arg buffer */
|
||||
extern int margc; /* count of arguments on input line */
|
||||
extern char *margv[20]; /* args parsed from input line */
|
||||
extern int cpend; /* flag: if != 0, then pending server reply */
|
||||
extern int mflag; /* flag: if != 0, then active multi command */
|
||||
|
||||
extern int options; /* used during socket creation */
|
||||
|
||||
/*
|
||||
* Format of command table.
|
||||
*/
|
||||
struct cmd {
|
||||
char *c_name; /* name of command */
|
||||
char *c_help; /* help string */
|
||||
char c_bell; /* give bell when command completes */
|
||||
char c_conn; /* must be connected to use command */
|
||||
char c_proxy; /* proxy server may execute */
|
||||
int (*c_handler)(); /* function to call */
|
||||
};
|
||||
|
||||
struct macel {
|
||||
char mac_name[9]; /* macro name */
|
||||
char *mac_start; /* start of macro in macbuf */
|
||||
char *mac_end; /* end of macro in macbuf */
|
||||
};
|
||||
|
||||
int macnum; /* number of defined macros */
|
||||
struct macel macros[16];
|
||||
char macbuf[4096];
|
||||
|
||||
extern char *tail();
|
||||
extern char *remglob();
|
||||
extern int errno;
|
||||
extern char *mktemp();
|
||||
|
||||
#if defined(__ANSI__) || defined(sparc)
|
||||
typedef void sig_t;
|
||||
#else
|
||||
typedef int sig_t;
|
||||
#endif
|
||||
|
||||
typedef int uid_t;
|
||||
int herror(char *s);
|
||||
|
File diff suppressed because it is too large
Load Diff
26
reactos/apps/utils/net/ftp/makefile
Normal file
26
reactos/apps/utils/net/ftp/makefile
Normal file
@@ -0,0 +1,26 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = ftp
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a iphlpapi.a ntdll.a
|
||||
|
||||
TARGET_OBJECTS = \
|
||||
cmds.o \
|
||||
cmdtab.o \
|
||||
domacro.o \
|
||||
fake.o \
|
||||
ftp.o \
|
||||
main.o \
|
||||
ruserpass.o
|
||||
|
||||
TARGET_GCCLIBS =
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -1,32 +1,32 @@
|
||||
|
||||
int getreply(int expecteof);
|
||||
int ruserpass(char *host, char **aname, char **apass, char **aacct);
|
||||
char *getpass(const char *prompt);
|
||||
void makeargv(void);
|
||||
void domacro(int argc, char *argv[]);
|
||||
void proxtrans(char *cmd, char *local, char *remote);
|
||||
int null(void);
|
||||
int initconn(void);
|
||||
void disconnect(void);
|
||||
void ptransfer(char *direction, long bytes, struct timeval *t0, struct timeval *t1);
|
||||
void setascii(void);
|
||||
void setbinary(void);
|
||||
void setebcdic(void);
|
||||
void settenex(void);
|
||||
void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0);
|
||||
void setpassive(int argc, char *argv[]);
|
||||
void setpeer(int argc, char *argv[]);
|
||||
void cmdscanner(int top);
|
||||
void pswitch(int flag);
|
||||
void quit(void);
|
||||
int login(char *host);
|
||||
int command(char *fmt, ...);
|
||||
int globulize(char **cpp);
|
||||
void sendrequest(char *cmd, char *local, char *remote, int printnames);
|
||||
void recvrequest(char *cmd, char *local, char *remote, char *mode,
|
||||
int printnames);
|
||||
int confirm(char *cmd, char *file);
|
||||
void blkfree(char **av0);
|
||||
int getit(int argc, char *argv[], int restartit, char *mode);
|
||||
static int token(void);
|
||||
int sleep(int time);
|
||||
|
||||
int getreply(int expecteof);
|
||||
int ruserpass(char *host, char **aname, char **apass, char **aacct);
|
||||
char *getpass(const char *prompt);
|
||||
void makeargv(void);
|
||||
void domacro(int argc, char *argv[]);
|
||||
void proxtrans(char *cmd, char *local, char *remote);
|
||||
int null(void);
|
||||
int initconn(void);
|
||||
void disconnect(void);
|
||||
void ptransfer(char *direction, long bytes, struct timeval *t0, struct timeval *t1);
|
||||
void setascii(void);
|
||||
void setbinary(void);
|
||||
void setebcdic(void);
|
||||
void settenex(void);
|
||||
void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0);
|
||||
void setpassive(int argc, char *argv[]);
|
||||
void setpeer(int argc, char *argv[]);
|
||||
void cmdscanner(int top);
|
||||
void pswitch(int flag);
|
||||
void quit(void);
|
||||
int login(char *host);
|
||||
int command(char *fmt, ...);
|
||||
int globulize(char **cpp);
|
||||
void sendrequest(char *cmd, char *local, char *remote, int printnames);
|
||||
void recvrequest(char *cmd, char *local, char *remote, char *mode,
|
||||
int printnames);
|
||||
int confirm(char *cmd, char *file);
|
||||
void blkfree(char **av0);
|
||||
int getit(int argc, char *argv[], int restartit, char *mode);
|
||||
static int token(void);
|
||||
int sleep(int time);
|
||||
|
@@ -1,271 +1,271 @@
|
||||
/*
|
||||
* Copyright (c) 1985 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the University of California, Berkeley. The name of the
|
||||
* University may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ruserpass.c 5.1 (Berkeley) 3/1/89";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
//#include <utmp.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include "ftp_var.h"
|
||||
#include "prototypes.h"
|
||||
#include <winsock.h>
|
||||
|
||||
char *renvlook(), *index(), *getenv(), *getpass(), *getlogin();
|
||||
void *malloc();
|
||||
char *strcpy();
|
||||
struct utmp *getutmp();
|
||||
static FILE *cfile;
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 64
|
||||
#endif
|
||||
|
||||
#define DEFAULT 1
|
||||
#define LOGIN 2
|
||||
#define PASSWD 3
|
||||
#define ACCOUNT 4
|
||||
#define MACDEF 5
|
||||
#define ID 10
|
||||
#define MACH 11
|
||||
|
||||
static char tokval[100];
|
||||
|
||||
static struct toktab {
|
||||
char *tokstr;
|
||||
int tval;
|
||||
} toktab[]= {
|
||||
"default", DEFAULT,
|
||||
"login", LOGIN,
|
||||
"password", PASSWD,
|
||||
"passwd", PASSWD,
|
||||
"account", ACCOUNT,
|
||||
"machine", MACH,
|
||||
"macdef", MACDEF,
|
||||
0, 0
|
||||
};
|
||||
|
||||
extern char *hostname;
|
||||
|
||||
int ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char myname[MAXHOSTNAMELEN], *mydomain;
|
||||
int t, i, c, usedefault = 0;
|
||||
struct stat stb;
|
||||
extern int errno;
|
||||
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
(void) sprintf(buf, "%s/.netrc", hdir);
|
||||
cfile = fopen(buf, "r");
|
||||
if (cfile == NULL) {
|
||||
if (errno != ENOENT)
|
||||
perror(buf);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
if (gethostname(myname, sizeof(myname)) < 0)
|
||||
myname[0] = '\0';
|
||||
if ((mydomain = index(myname, '.')) == NULL)
|
||||
mydomain = "";
|
||||
next:
|
||||
while ((t = token())) switch(t) {
|
||||
|
||||
case DEFAULT:
|
||||
usedefault = 1;
|
||||
/* FALL THROUGH */
|
||||
|
||||
case MACH:
|
||||
if (!usedefault) {
|
||||
if (token() != ID)
|
||||
continue;
|
||||
/*
|
||||
* Allow match either for user's input host name
|
||||
* or official hostname. Also allow match of
|
||||
* incompletely-specified host in local domain.
|
||||
*/
|
||||
if (strcasecmp(host, tokval) == 0)
|
||||
goto match;
|
||||
if (strcasecmp(hostname, tokval) == 0)
|
||||
goto match;
|
||||
if ((tmp = index(hostname, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(hostname, tokval, tmp - hostname) == 0 &&
|
||||
tokval[tmp - hostname] == '\0')
|
||||
goto match;
|
||||
if ((tmp = index(host, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(host, tokval, tmp - host) == 0 &&
|
||||
tokval[tmp - host] == '\0')
|
||||
goto match;
|
||||
continue;
|
||||
}
|
||||
match:
|
||||
while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
|
||||
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aname, tokval);
|
||||
} else {
|
||||
if (strcmp(*aname, tokval))
|
||||
goto next;
|
||||
}
|
||||
break;
|
||||
case PASSWD:
|
||||
if (strcmp(*aname, "anonymous") &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
fprintf(stderr, "Error - .netrc file not correct mode.\n");
|
||||
fprintf(stderr, "Remove password or correct mode.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
*apass = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*apass, tokval);
|
||||
}
|
||||
break;
|
||||
case ACCOUNT:
|
||||
if (fstat(fileno(cfile), &stb) >= 0
|
||||
&& (stb.st_mode & 077) != 0) {
|
||||
fprintf(stderr, "Error - .netrc file not correct mode.\n");
|
||||
fprintf(stderr, "Remove account or correct mode.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *aacct == 0) {
|
||||
*aacct = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aacct, tokval);
|
||||
}
|
||||
break;
|
||||
case MACDEF:
|
||||
if (proxy) {
|
||||
(void) fclose(cfile);
|
||||
return(0);
|
||||
}
|
||||
while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t');
|
||||
if (c == EOF || c == '\n') {
|
||||
printf("Missing macdef name argument.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (macnum == 16) {
|
||||
printf("Limit of 16 macros have already been defined\n");
|
||||
goto bad;
|
||||
}
|
||||
tmp = macros[macnum].mac_name;
|
||||
*tmp++ = c;
|
||||
for (i=0; i < 8 && (c=getc(cfile)) != EOF &&
|
||||
!isspace(c); ++i) {
|
||||
*tmp++ = c;
|
||||
}
|
||||
if (c == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
*tmp = '\0';
|
||||
if (c != '\n') {
|
||||
while ((c=getc(cfile)) != EOF && c != '\n');
|
||||
}
|
||||
if (c == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (macnum == 0) {
|
||||
macros[macnum].mac_start = macbuf;
|
||||
}
|
||||
else {
|
||||
macros[macnum].mac_start = macros[macnum-1].mac_end + 1;
|
||||
}
|
||||
tmp = macros[macnum].mac_start;
|
||||
while (tmp != macbuf + 4096) {
|
||||
if ((c=getc(cfile)) == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
*tmp = c;
|
||||
if (*tmp == '\n') {
|
||||
if (*(tmp-1) == '\0') {
|
||||
macros[macnum++].mac_end = tmp - 1;
|
||||
break;
|
||||
}
|
||||
*tmp = '\0';
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
if (tmp == macbuf + 4096) {
|
||||
printf("4K macro buffer exceeded\n");
|
||||
goto bad;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown .netrc keyword %s\n", tokval);
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
done:
|
||||
(void) fclose(cfile);
|
||||
return(0);
|
||||
bad:
|
||||
(void) fclose(cfile);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
static int token(void)
|
||||
{
|
||||
char *cp;
|
||||
int c;
|
||||
struct toktab *t;
|
||||
|
||||
if (feof(cfile))
|
||||
return (0);
|
||||
while ((c = getc(cfile)) != EOF &&
|
||||
(c == '\r' || c == '\n' || c == '\t' || c == ' ' || c == ','))
|
||||
continue;
|
||||
if (c == EOF)
|
||||
return (0);
|
||||
cp = tokval;
|
||||
if (c == '"') {
|
||||
while ((c = getc(cfile)) != EOF && c != '"') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
*cp++ = c;
|
||||
}
|
||||
} else {
|
||||
*cp++ = c;
|
||||
while ((c = getc(cfile)) != EOF
|
||||
&& c != '\n' && c != '\t' && c != ' ' && c != ',' && c != '\r') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
*cp++ = c;
|
||||
}
|
||||
}
|
||||
*cp = 0;
|
||||
if (tokval[0] == 0)
|
||||
return (0);
|
||||
for (t = toktab; t->tokstr; t++)
|
||||
if (!strcmp(t->tokstr, tokval))
|
||||
return (t->tval);
|
||||
return (ID);
|
||||
}
|
||||
/*
|
||||
* Copyright (c) 1985 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms are permitted
|
||||
* provided that the above copyright notice and this paragraph are
|
||||
* duplicated in all such forms and that any documentation,
|
||||
* advertising materials, and other materials related to such
|
||||
* distribution and use acknowledge that the software was developed
|
||||
* by the University of California, Berkeley. The name of the
|
||||
* University may not be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ruserpass.c 5.1 (Berkeley) 3/1/89";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
//#include <utmp.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include "ftp_var.h"
|
||||
#include "prototypes.h"
|
||||
#include <winsock.h>
|
||||
|
||||
char *renvlook(), *index(), *getenv(), *getpass(), *getlogin();
|
||||
void *malloc();
|
||||
char *strcpy();
|
||||
struct utmp *getutmp();
|
||||
static FILE *cfile;
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 64
|
||||
#endif
|
||||
|
||||
#define DEFAULT 1
|
||||
#define LOGIN 2
|
||||
#define PASSWD 3
|
||||
#define ACCOUNT 4
|
||||
#define MACDEF 5
|
||||
#define ID 10
|
||||
#define MACH 11
|
||||
|
||||
static char tokval[100];
|
||||
|
||||
static struct toktab {
|
||||
char *tokstr;
|
||||
int tval;
|
||||
} toktab[]= {
|
||||
"default", DEFAULT,
|
||||
"login", LOGIN,
|
||||
"password", PASSWD,
|
||||
"passwd", PASSWD,
|
||||
"account", ACCOUNT,
|
||||
"machine", MACH,
|
||||
"macdef", MACDEF,
|
||||
0, 0
|
||||
};
|
||||
|
||||
extern char *hostname;
|
||||
|
||||
int ruserpass(char *host, char **aname, char **apass, char **aacct)
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char myname[MAXHOSTNAMELEN], *mydomain;
|
||||
int t, i, c, usedefault = 0;
|
||||
struct stat stb;
|
||||
extern int errno;
|
||||
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
(void) sprintf(buf, "%s/.netrc", hdir);
|
||||
cfile = fopen(buf, "r");
|
||||
if (cfile == NULL) {
|
||||
if (errno != ENOENT)
|
||||
perror(buf);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
if (gethostname(myname, sizeof(myname)) < 0)
|
||||
myname[0] = '\0';
|
||||
if ((mydomain = index(myname, '.')) == NULL)
|
||||
mydomain = "";
|
||||
next:
|
||||
while ((t = token())) switch(t) {
|
||||
|
||||
case DEFAULT:
|
||||
usedefault = 1;
|
||||
/* FALL THROUGH */
|
||||
|
||||
case MACH:
|
||||
if (!usedefault) {
|
||||
if (token() != ID)
|
||||
continue;
|
||||
/*
|
||||
* Allow match either for user's input host name
|
||||
* or official hostname. Also allow match of
|
||||
* incompletely-specified host in local domain.
|
||||
*/
|
||||
if (strcasecmp(host, tokval) == 0)
|
||||
goto match;
|
||||
if (strcasecmp(hostname, tokval) == 0)
|
||||
goto match;
|
||||
if ((tmp = index(hostname, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(hostname, tokval, tmp - hostname) == 0 &&
|
||||
tokval[tmp - hostname] == '\0')
|
||||
goto match;
|
||||
if ((tmp = index(host, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(host, tokval, tmp - host) == 0 &&
|
||||
tokval[tmp - host] == '\0')
|
||||
goto match;
|
||||
continue;
|
||||
}
|
||||
match:
|
||||
while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
|
||||
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aname, tokval);
|
||||
} else {
|
||||
if (strcmp(*aname, tokval))
|
||||
goto next;
|
||||
}
|
||||
break;
|
||||
case PASSWD:
|
||||
if (strcmp(*aname, "anonymous") &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
fprintf(stderr, "Error - .netrc file not correct mode.\n");
|
||||
fprintf(stderr, "Remove password or correct mode.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
*apass = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*apass, tokval);
|
||||
}
|
||||
break;
|
||||
case ACCOUNT:
|
||||
if (fstat(fileno(cfile), &stb) >= 0
|
||||
&& (stb.st_mode & 077) != 0) {
|
||||
fprintf(stderr, "Error - .netrc file not correct mode.\n");
|
||||
fprintf(stderr, "Remove account or correct mode.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *aacct == 0) {
|
||||
*aacct = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aacct, tokval);
|
||||
}
|
||||
break;
|
||||
case MACDEF:
|
||||
if (proxy) {
|
||||
(void) fclose(cfile);
|
||||
return(0);
|
||||
}
|
||||
while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t');
|
||||
if (c == EOF || c == '\n') {
|
||||
printf("Missing macdef name argument.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (macnum == 16) {
|
||||
printf("Limit of 16 macros have already been defined\n");
|
||||
goto bad;
|
||||
}
|
||||
tmp = macros[macnum].mac_name;
|
||||
*tmp++ = c;
|
||||
for (i=0; i < 8 && (c=getc(cfile)) != EOF &&
|
||||
!isspace(c); ++i) {
|
||||
*tmp++ = c;
|
||||
}
|
||||
if (c == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
*tmp = '\0';
|
||||
if (c != '\n') {
|
||||
while ((c=getc(cfile)) != EOF && c != '\n');
|
||||
}
|
||||
if (c == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
if (macnum == 0) {
|
||||
macros[macnum].mac_start = macbuf;
|
||||
}
|
||||
else {
|
||||
macros[macnum].mac_start = macros[macnum-1].mac_end + 1;
|
||||
}
|
||||
tmp = macros[macnum].mac_start;
|
||||
while (tmp != macbuf + 4096) {
|
||||
if ((c=getc(cfile)) == EOF) {
|
||||
printf("Macro definition missing null line terminator.\n");
|
||||
goto bad;
|
||||
}
|
||||
*tmp = c;
|
||||
if (*tmp == '\n') {
|
||||
if (*(tmp-1) == '\0') {
|
||||
macros[macnum++].mac_end = tmp - 1;
|
||||
break;
|
||||
}
|
||||
*tmp = '\0';
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
if (tmp == macbuf + 4096) {
|
||||
printf("4K macro buffer exceeded\n");
|
||||
goto bad;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown .netrc keyword %s\n", tokval);
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
done:
|
||||
(void) fclose(cfile);
|
||||
return(0);
|
||||
bad:
|
||||
(void) fclose(cfile);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
static int token(void)
|
||||
{
|
||||
char *cp;
|
||||
int c;
|
||||
struct toktab *t;
|
||||
|
||||
if (feof(cfile))
|
||||
return (0);
|
||||
while ((c = getc(cfile)) != EOF &&
|
||||
(c == '\r' || c == '\n' || c == '\t' || c == ' ' || c == ','))
|
||||
continue;
|
||||
if (c == EOF)
|
||||
return (0);
|
||||
cp = tokval;
|
||||
if (c == '"') {
|
||||
while ((c = getc(cfile)) != EOF && c != '"') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
*cp++ = c;
|
||||
}
|
||||
} else {
|
||||
*cp++ = c;
|
||||
while ((c = getc(cfile)) != EOF
|
||||
&& c != '\n' && c != '\t' && c != ' ' && c != ',' && c != '\r') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
*cp++ = c;
|
||||
}
|
||||
}
|
||||
*cp = 0;
|
||||
if (tokval[0] == 0)
|
||||
return (0);
|
||||
for (t = toktab; t->tokstr; t++)
|
||||
if (!strcmp(t->tokstr, tokval))
|
||||
return (t->tval);
|
||||
return (ID);
|
||||
}
|
||||
|
@@ -132,13 +132,13 @@ static void ShowNetworkInterfaces()
|
||||
}
|
||||
/*
|
||||
typedef struct _IP_ADAPTER_INDEX_MAP {
|
||||
ULONG Index; // adapter index
|
||||
WCHAR Name[MAX_ADAPTER_NAME]; // name of the adapter
|
||||
ULONG Index; // adapter index
|
||||
WCHAR Name[MAX_ADAPTER_NAME]; // name of the adapter
|
||||
} IP_ADAPTER_INDEX_MAP, * PIP_ADAPTER_INDEX_MAP;
|
||||
|
||||
typedef struct _IP_INTERFACE_INFO {
|
||||
LONG NumAdapters; // number of adapters in array
|
||||
IP_ADAPTER_INDEX_MAP Adapter[1]; // adapter indices and names
|
||||
LONG NumAdapters; // number of adapters in array
|
||||
IP_ADAPTER_INDEX_MAP Adapter[1]; // adapter indices and names
|
||||
} IP_INTERFACE_INFO,*PIP_INTERFACE_INFO;
|
||||
*/
|
||||
result = GetInterfaceInfo(pIfTable, &dwOutBufLen);
|
||||
@@ -194,7 +194,7 @@ typedef struct _IP_ADAPTER_INFO {
|
||||
IP_ADDR_STRING PrimaryWinsServer;
|
||||
IP_ADDR_STRING SecondaryWinsServer;
|
||||
a time_t LeaseObtained;
|
||||
b time_t LeaseExpires;
|
||||
b time_t LeaseExpires;
|
||||
} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
|
||||
*/
|
||||
/*
|
||||
|
@@ -1,10 +0,0 @@
|
||||
<module name="ipconfig" type="win32cui" installbase="system32" installname="ipconfig.exe" warnings="true">
|
||||
<include base="ipconfig">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>iphlpapi</library>
|
||||
<file>ipconfig.c</file>
|
||||
<file>trace.c</file>
|
||||
<file>ipconfig.rc</file>
|
||||
</module>
|
19
reactos/apps/utils/net/ipconfig/makefile
Normal file
19
reactos/apps/utils/net/ipconfig/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = ipconfig
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API
|
||||
|
||||
TARGET_SDKLIBS = user32.a iphlpapi.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Diagnostic Trace
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
22
reactos/apps/utils/net/netstat/makefile
Normal file
22
reactos/apps/utils/net/netstat/makefile
Normal file
@@ -0,0 +1,22 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = netstat
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_CFLAGS = \
|
||||
-D__USE_W32API \
|
||||
-D_WIN32_IE=0x600 \
|
||||
-D_WIN32_WINNT=0x501
|
||||
|
||||
TARGET_SDKLIBS = user32.a snmpapi.a iphlpapi.a ws2_32.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -52,7 +52,7 @@ static char TcpState[][32] = {
|
||||
VOID PrintError(DWORD ErrorCode)
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMsgBuf, 0, NULL);
|
||||
@@ -66,21 +66,21 @@ static void ShowTcpStatistics()
|
||||
GetTcpStatistics(&TcpStatsMIB);
|
||||
|
||||
_tprintf(_T("TCP/IP Statistics\t\n"));
|
||||
_tprintf(_T(" time-out algorithm:\t\t%d\n"), TcpStatsMIB.dwRtoAlgorithm);
|
||||
_tprintf(_T(" minimum time-out:\t\t%d\n"), TcpStatsMIB.dwRtoMin);
|
||||
_tprintf(_T(" maximum time-out:\t\t%d\n"), TcpStatsMIB.dwRtoMax);
|
||||
_tprintf(_T(" maximum connections:\t\t%d\n"), TcpStatsMIB.dwMaxConn);
|
||||
_tprintf(_T(" active opens:\t\t\t%d\n"), TcpStatsMIB.dwActiveOpens);
|
||||
_tprintf(_T(" passive opens:\t\t\t%d\n"), TcpStatsMIB.dwPassiveOpens);
|
||||
_tprintf(_T(" failed attempts:\t\t%d\n"), TcpStatsMIB.dwAttemptFails);
|
||||
_tprintf(_T(" established connections reset:\t%d\n"), TcpStatsMIB.dwEstabResets);
|
||||
_tprintf(_T(" established connections:\t%d\n"), TcpStatsMIB.dwCurrEstab);
|
||||
_tprintf(_T(" segments received:\t\t%d\n"), TcpStatsMIB.dwInSegs);
|
||||
_tprintf(_T(" segment sent:\t\t\t%d\n"), TcpStatsMIB.dwOutSegs);
|
||||
_tprintf(_T(" segments retransmitted:\t\t%d\n"), TcpStatsMIB.dwRetransSegs);
|
||||
_tprintf(_T(" incoming errors:\t\t%d\n"), TcpStatsMIB.dwInErrs);
|
||||
_tprintf(_T(" outgoing resets:\t\t%d\n"), TcpStatsMIB.dwOutRsts);
|
||||
_tprintf(_T(" cumulative connections:\t\t%d\n"), TcpStatsMIB.dwNumConns);
|
||||
_tprintf(_T(" time-out algorithm:\t\t%d\n"), TcpStatsMIB.dwRtoAlgorithm);
|
||||
_tprintf(_T(" minimum time-out:\t\t%d\n"), TcpStatsMIB.dwRtoMin);
|
||||
_tprintf(_T(" maximum time-out:\t\t%d\n"), TcpStatsMIB.dwRtoMax);
|
||||
_tprintf(_T(" maximum connections:\t\t%d\n"), TcpStatsMIB.dwMaxConn);
|
||||
_tprintf(_T(" active opens:\t\t\t%d\n"), TcpStatsMIB.dwActiveOpens);
|
||||
_tprintf(_T(" passive opens:\t\t\t%d\n"), TcpStatsMIB.dwPassiveOpens);
|
||||
_tprintf(_T(" failed attempts:\t\t%d\n"), TcpStatsMIB.dwAttemptFails);
|
||||
_tprintf(_T(" established connections reset:\t%d\n"), TcpStatsMIB.dwEstabResets);
|
||||
_tprintf(_T(" established connections:\t%d\n"), TcpStatsMIB.dwCurrEstab);
|
||||
_tprintf(_T(" segments received:\t\t%d\n"), TcpStatsMIB.dwInSegs);
|
||||
_tprintf(_T(" segment sent:\t\t\t%d\n"), TcpStatsMIB.dwOutSegs);
|
||||
_tprintf(_T(" segments retransmitted:\t\t%d\n"), TcpStatsMIB.dwRetransSegs);
|
||||
_tprintf(_T(" incoming errors:\t\t%d\n"), TcpStatsMIB.dwInErrs);
|
||||
_tprintf(_T(" outgoing resets:\t\t%d\n"), TcpStatsMIB.dwOutRsts);
|
||||
_tprintf(_T(" cumulative connections:\t\t%d\n"), TcpStatsMIB.dwNumConns);
|
||||
}
|
||||
|
||||
static void ShowUdpStatistics()
|
||||
@@ -90,7 +90,7 @@ static void ShowUdpStatistics()
|
||||
|
||||
_tprintf(_T("UDP Statistics\t\n"));
|
||||
_tprintf(_T(" received datagrams:\t\t\t%d\n"), UDPStatsMIB.dwInDatagrams);
|
||||
_tprintf(_T(" datagrams for which no port exists:\t%d\n"), UDPStatsMIB.dwNoPorts);
|
||||
_tprintf(_T(" datagrams for which no port exists:\t%d\n"), UDPStatsMIB.dwNoPorts);
|
||||
_tprintf(_T(" errors on received datagrams:\t\t%d\n"), UDPStatsMIB.dwInErrors);
|
||||
_tprintf(_T(" sent datagrams:\t\t\t\t%d\n"), UDPStatsMIB.dwOutDatagrams);
|
||||
_tprintf(_T(" number of entries in listener table:\t%d\n"), UDPStatsMIB.dwNumAddrs);
|
||||
@@ -102,27 +102,27 @@ static void ShowIpStatistics()
|
||||
GetIpStatistics(&IPStatsMIB);
|
||||
|
||||
_tprintf(_T("IP Statistics\t\n"));
|
||||
_tprintf(_T(" IP forwarding enabled or disabled:\t%d\n"), IPStatsMIB.dwForwarding);
|
||||
_tprintf(_T(" default time-to-live:\t\t\t%d\n"), IPStatsMIB.dwDefaultTTL);
|
||||
_tprintf(_T(" datagrams received:\t\t\t%d\n"), IPStatsMIB.dwInReceives);
|
||||
_tprintf(_T(" received header errors:\t\t\t%d\n"), IPStatsMIB.dwInHdrErrors);
|
||||
_tprintf(_T(" received address errors:\t\t%d\n"), IPStatsMIB.dwInAddrErrors);
|
||||
_tprintf(_T(" datagrams forwarded:\t\t\t%d\n"), IPStatsMIB.dwForwDatagrams);
|
||||
_tprintf(_T(" datagrams with unknown protocol:\t%d\n"), IPStatsMIB.dwInUnknownProtos);
|
||||
_tprintf(_T(" received datagrams discarded:\t\t%d\n"), IPStatsMIB.dwInDiscards);
|
||||
_tprintf(_T(" received datagrams delivered:\t\t%d\n"), IPStatsMIB.dwInDelivers);
|
||||
_tprintf(_T(" sent datagrams discarded:\t\t%d\n"), IPStatsMIB.dwOutDiscards);
|
||||
_tprintf(_T(" datagrams for which no route exists:\t%d\n"), IPStatsMIB.dwOutNoRoutes);
|
||||
_tprintf(_T(" datagrams for which frags didn't arrive:%d\n"), IPStatsMIB.dwReasmTimeout);
|
||||
_tprintf(_T(" datagrams requiring reassembly:\t\t%d\n"), IPStatsMIB.dwReasmReqds);
|
||||
_tprintf(_T(" successful reassemblies:\t\t%d\n"), IPStatsMIB.dwReasmOks);
|
||||
_tprintf(_T(" failed reassemblies:\t\t\t%d\n"), IPStatsMIB.dwReasmFails);
|
||||
_tprintf(_T(" successful fragmentations:\t\t%d\n"), IPStatsMIB.dwFragOks);
|
||||
_tprintf(_T(" failed fragmentations:\t\t\t%d\n"), IPStatsMIB.dwFragFails);
|
||||
_tprintf(_T(" datagrams fragmented:\t\t\t%d\n"), IPStatsMIB.dwFragCreates);
|
||||
_tprintf(_T(" number of interfaces on computer:\t%d\n"), IPStatsMIB.dwNumIf);
|
||||
_tprintf(_T(" number of IP address on computer:\t%d\n"), IPStatsMIB.dwNumAddr);
|
||||
_tprintf(_T(" number of routes in routing table:\t%d\n"), IPStatsMIB.dwNumRoutes);
|
||||
_tprintf(_T(" IP forwarding enabled or disabled:\t%d\n"), IPStatsMIB.dwForwarding);
|
||||
_tprintf(_T(" default time-to-live:\t\t\t%d\n"), IPStatsMIB.dwDefaultTTL);
|
||||
_tprintf(_T(" datagrams received:\t\t\t%d\n"), IPStatsMIB.dwInReceives);
|
||||
_tprintf(_T(" received header errors:\t\t\t%d\n"), IPStatsMIB.dwInHdrErrors);
|
||||
_tprintf(_T(" received address errors:\t\t%d\n"), IPStatsMIB.dwInAddrErrors);
|
||||
_tprintf(_T(" datagrams forwarded:\t\t\t%d\n"), IPStatsMIB.dwForwDatagrams);
|
||||
_tprintf(_T(" datagrams with unknown protocol:\t%d\n"), IPStatsMIB.dwInUnknownProtos);
|
||||
_tprintf(_T(" received datagrams discarded:\t\t%d\n"), IPStatsMIB.dwInDiscards);
|
||||
_tprintf(_T(" received datagrams delivered:\t\t%d\n"), IPStatsMIB.dwInDelivers);
|
||||
_tprintf(_T(" sent datagrams discarded:\t\t%d\n"), IPStatsMIB.dwOutDiscards);
|
||||
_tprintf(_T(" datagrams for which no route exists:\t%d\n"), IPStatsMIB.dwOutNoRoutes);
|
||||
_tprintf(_T(" datagrams for which frags didn't arrive:%d\n"), IPStatsMIB.dwReasmTimeout);
|
||||
_tprintf(_T(" datagrams requiring reassembly:\t\t%d\n"), IPStatsMIB.dwReasmReqds);
|
||||
_tprintf(_T(" successful reassemblies:\t\t%d\n"), IPStatsMIB.dwReasmOks);
|
||||
_tprintf(_T(" failed reassemblies:\t\t\t%d\n"), IPStatsMIB.dwReasmFails);
|
||||
_tprintf(_T(" successful fragmentations:\t\t%d\n"), IPStatsMIB.dwFragOks);
|
||||
_tprintf(_T(" failed fragmentations:\t\t\t%d\n"), IPStatsMIB.dwFragFails);
|
||||
_tprintf(_T(" datagrams fragmented:\t\t\t%d\n"), IPStatsMIB.dwFragCreates);
|
||||
_tprintf(_T(" number of interfaces on computer:\t%d\n"), IPStatsMIB.dwNumIf);
|
||||
_tprintf(_T(" number of IP address on computer:\t%d\n"), IPStatsMIB.dwNumAddr);
|
||||
_tprintf(_T(" number of routes in routing table:\t%d\n"), IPStatsMIB.dwNumRoutes);
|
||||
}
|
||||
|
||||
static void ShowNetworkParams()
|
||||
@@ -262,20 +262,20 @@ typedef struct {
|
||||
// Translate port numbers into their text equivalent if there is one
|
||||
//
|
||||
PCHAR
|
||||
GetPortName(DWORD Flags, UINT port, PCHAR proto, PCHAR name, int namelen)
|
||||
GetPortName(DWORD Flags, UINT port, PCHAR proto, PCHAR name, int namelen)
|
||||
{
|
||||
struct servent *psrvent;
|
||||
|
||||
if (Flags & FLAG_SHOW_NUMBERS) {
|
||||
sprintf(name, "%d", htons((WORD)port));
|
||||
return name;
|
||||
}
|
||||
}
|
||||
// Try to translate to a name
|
||||
if (psrvent = getservbyport(port, proto)) {
|
||||
strcpy(name, psrvent->s_name );
|
||||
} else {
|
||||
sprintf(name, "%d", htons((WORD)port));
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ GetPortName(DWORD Flags, UINT port, PCHAR proto, PCHAR name, int namelen)
|
||||
// Translate IP addresses into their name-resolved form if possible.
|
||||
//
|
||||
PCHAR
|
||||
GetIpHostName(DWORD Flags, BOOL local, UINT ipaddr, PCHAR name, int namelen)
|
||||
GetIpHostName(DWORD Flags, BOOL local, UINT ipaddr, PCHAR name, int namelen)
|
||||
{
|
||||
// struct hostent *phostent;
|
||||
UINT nipaddr;
|
||||
@@ -294,7 +294,7 @@ GetIpHostName(DWORD Flags, BOOL local, UINT ipaddr, PCHAR name, int namelen)
|
||||
// Does the user want raw numbers?
|
||||
nipaddr = htonl(ipaddr);
|
||||
if (Flags & FLAG_SHOW_NUMBERS ) {
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
(nipaddr >> 24) & 0xFF,
|
||||
(nipaddr >> 16) & 0xFF,
|
||||
(nipaddr >> 8) & 0xFF,
|
||||
@@ -307,7 +307,7 @@ GetIpHostName(DWORD Flags, BOOL local, UINT ipaddr, PCHAR name, int namelen)
|
||||
// Try to translate to a name
|
||||
if (!ipaddr) {
|
||||
if (!local) {
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
(nipaddr >> 24) & 0xFF,
|
||||
(nipaddr >> 16) & 0xFF,
|
||||
(nipaddr >> 8) & 0xFF,
|
||||
@@ -339,7 +339,7 @@ GetIpHostName(DWORD Flags, BOOL local, UINT ipaddr, PCHAR name, int namelen)
|
||||
|
||||
sprintf(name, "%d.%d.%d.%d", i1,i2,i3,i4);
|
||||
#else
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
sprintf(name, "%d.%d.%d.%d",
|
||||
((nipaddr >> 24) & 0x000000FF),
|
||||
((nipaddr >> 16) & 0x000000FF),
|
||||
((nipaddr >> 8) & 0x000000FF),
|
||||
@@ -360,10 +360,10 @@ BOOLEAN usage(void)
|
||||
|
||||
//
|
||||
// GetOptions
|
||||
//
|
||||
//
|
||||
// Parses the command line arguments.
|
||||
//
|
||||
BOOLEAN
|
||||
BOOLEAN
|
||||
GetOptions(int argc, char *argv[], PDWORD pFlags)
|
||||
{
|
||||
int i, j;
|
||||
@@ -466,12 +466,12 @@ int main(int argc, char *argv[])
|
||||
for (i = 0; i < tcpTable->dwNumEntries; i++) {
|
||||
if (flags & FLAG_SHOW_ALL_ENDPOINTS ||
|
||||
tcpTable->table[i].dwState == MIB_TCP_STATE_ESTAB) {
|
||||
sprintf(localaddr, "%s:%s",
|
||||
GetIpHostName(flags, TRUE, tcpTable->table[i].dwLocalAddr, localname, HOSTNAMELEN),
|
||||
sprintf(localaddr, "%s:%s",
|
||||
GetIpHostName(flags, TRUE, tcpTable->table[i].dwLocalAddr, localname, HOSTNAMELEN),
|
||||
GetPortName(flags, tcpTable->table[i].dwLocalPort, "tcp", localport, PORTNAMELEN));
|
||||
sprintf(remoteaddr, "%s:%s",
|
||||
GetIpHostName(flags, FALSE, tcpTable->table[i].dwRemoteAddr, remotename, HOSTNAMELEN),
|
||||
tcpTable->table[i].dwRemoteAddr ?
|
||||
GetIpHostName(flags, FALSE, tcpTable->table[i].dwRemoteAddr, remotename, HOSTNAMELEN),
|
||||
tcpTable->table[i].dwRemoteAddr ?
|
||||
GetPortName(flags, tcpTable->table[i].dwRemotePort, "tcp", remoteport, PORTNAMELEN):
|
||||
"0");
|
||||
printf("%4s\tState: %s\n", "[TCP]", TcpState[tcpTable->table[i].dwState]);
|
||||
@@ -481,14 +481,14 @@ int main(int argc, char *argv[])
|
||||
// Dump the UDP table
|
||||
if (flags & FLAG_SHOW_ALL_ENDPOINTS) {
|
||||
for (i = 0; i < udpTable->dwNumEntries; i++) {
|
||||
sprintf(localaddr, "%s:%s",
|
||||
GetIpHostName(flags, TRUE, udpTable->table[i].dwLocalAddr, localname, HOSTNAMELEN),
|
||||
sprintf(localaddr, "%s:%s",
|
||||
GetIpHostName(flags, TRUE, udpTable->table[i].dwLocalAddr, localname, HOSTNAMELEN),
|
||||
GetPortName(flags, udpTable->table[i].dwLocalPort, "tcp", localport, PORTNAMELEN));
|
||||
printf("%4s", "[UDP]");
|
||||
printf(" Local: %s\n Remote: %s\n", localaddr, "*.*.*.*:*");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,14 +0,0 @@
|
||||
<module name="netstat" type="win32cui" installbase="system32" installname="netstat.exe" warnings="true">
|
||||
<include base="netstat">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x600</define>
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>ws2_32</library>
|
||||
<library>snmpapi</library>
|
||||
<library>iphlpapi</library>
|
||||
<file>netstat.c</file>
|
||||
<file>trace.c</file>
|
||||
<file>netstat.rc</file>
|
||||
</module>
|
@@ -1,7 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Diagnostic Trace
|
||||
//
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
19
reactos/apps/utils/net/ping/makefile
Normal file
19
reactos/apps/utils/net/ping/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = ping
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32_SOCKETS
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -113,7 +113,7 @@ VOID DisplayBuffer(
|
||||
UINT i;
|
||||
PCHAR p;
|
||||
|
||||
printf("Buffer (0x%p) Size (0x%lX).\n", Buffer, Size);
|
||||
printf("Buffer (0x%X) Size (0x%X).\n", Buffer, Size);
|
||||
|
||||
p = (PCHAR)Buffer;
|
||||
for (i = 0; i < Size; i++) {
|
||||
@@ -306,10 +306,10 @@ BOOL Setup(VOID)
|
||||
PHOSTENT phe;
|
||||
|
||||
wVersionRequested = MAKEWORD(2, 2);
|
||||
|
||||
|
||||
Status = WSAStartup(wVersionRequested, &WsaData);
|
||||
if (Status != 0) {
|
||||
printf("Could not initialize winsock dll.\n");
|
||||
printf("Could not initialize winsock dll.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -327,11 +327,11 @@ BOOL Setup(VOID)
|
||||
if (phe == NULL) {
|
||||
printf("Unknown host %s.\n", TargetName);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (phe != NULL) {
|
||||
CopyMemory(&Target.sin_addr, phe->h_addr, phe->h_length);
|
||||
CopyMemory(&Target.sin_addr, phe->h_addr_list, phe->h_length);
|
||||
} else {
|
||||
Target.sin_addr.s_addr = Addr;
|
||||
}
|
||||
@@ -341,7 +341,7 @@ BOOL Setup(VOID)
|
||||
} else {
|
||||
Target.sin_family = AF_INET;
|
||||
}
|
||||
|
||||
|
||||
TargetIP = inet_ntoa(Target.sin_addr);
|
||||
CurrentSeqNum = 0;
|
||||
SentCount = 0;
|
||||
@@ -386,13 +386,24 @@ VOID QueryTime(PLARGE_INTEGER Time)
|
||||
|
||||
VOID TimeToMsString(LPSTR String, LARGE_INTEGER Time)
|
||||
{
|
||||
UINT i, Length;
|
||||
CHAR Convstr[40];
|
||||
LARGE_INTEGER LargeTime;
|
||||
|
||||
LargeTime.QuadPart = Time.QuadPart / TicksPerMs.QuadPart;
|
||||
|
||||
_i64toa(LargeTime.QuadPart, Convstr, 10);
|
||||
strcpy(String, Convstr);
|
||||
strcat(String, ",");
|
||||
|
||||
LargeTime.QuadPart = (Time.QuadPart % TicksPerMs.QuadPart) / TicksPerUs.QuadPart;
|
||||
_i64toa(LargeTime.QuadPart, Convstr, 10);
|
||||
Length = strlen(Convstr);
|
||||
if (Length < 4) {
|
||||
for (i = 0; i < 4 - Length; i++)
|
||||
strcat(String, "0");
|
||||
}
|
||||
|
||||
strcat(String, Convstr);
|
||||
strcat(String, "ms");
|
||||
}
|
||||
|
||||
@@ -406,7 +417,6 @@ BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
|
||||
CHAR Time[100];
|
||||
LARGE_INTEGER RelativeTime;
|
||||
LARGE_INTEGER LargeTime;
|
||||
CHAR Sign[1];
|
||||
|
||||
IpHeader = (PIPv4_HEADER)buffer;
|
||||
|
||||
@@ -439,17 +449,10 @@ BOOL DecodeResponse(PCHAR buffer, UINT size, PSOCKADDR_IN from)
|
||||
|
||||
RelativeTime.QuadPart = (LargeTime.QuadPart - Icmp->Timestamp.QuadPart);
|
||||
|
||||
if ((RelativeTime.QuadPart / TicksPerMs.QuadPart) < 1) {
|
||||
strcpy(Sign, "<");
|
||||
strcpy(Time, "1ms");
|
||||
} else {
|
||||
strcpy(Sign, "=");
|
||||
TimeToMsString(Time, RelativeTime);
|
||||
}
|
||||
TimeToMsString(Time, RelativeTime);
|
||||
|
||||
|
||||
printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr),
|
||||
size - IphLength - sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL);
|
||||
printf("Reply from %s: bytes=%d time=%s TTL=%d\n", inet_ntoa(from->sin_addr),
|
||||
size - IphLength - sizeof(ICMP_ECHO_PACKET), Time, IpHeader->TTL);
|
||||
if (RelativeTime.QuadPart < MinRTT.QuadPart) {
|
||||
MinRTT.QuadPart = RelativeTime.QuadPart;
|
||||
MinRTTSet = TRUE;
|
||||
@@ -466,7 +469,7 @@ BOOL Ping(VOID)
|
||||
{
|
||||
INT Status;
|
||||
SOCKADDR From;
|
||||
INT Length;
|
||||
UINT Length;
|
||||
PVOID Buffer;
|
||||
UINT Size;
|
||||
PICMP_ECHO_PACKET Packet;
|
||||
@@ -585,7 +588,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
printf("\nPinging %s [%s] with %d bytes of data:\n\n",
|
||||
TargetName, TargetIP, DataSize);
|
||||
|
||||
|
||||
Count = 0;
|
||||
while ((NeverStop) || (Count < PingCount)) {
|
||||
Ping();
|
||||
|
@@ -1,11 +0,0 @@
|
||||
<module name="ping" type="win32cui" installbase="system32" installname="ping.exe">
|
||||
<include base="ping">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="__USE_W32_SOCKETS" />
|
||||
<define name="_WIN32_IE">0x600</define>
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<file>ping.c</file>
|
||||
<file>ping.rc</file>
|
||||
</module>
|
@@ -25,7 +25,7 @@ public:
|
||||
CListNode *GetPrev();
|
||||
private:
|
||||
PVOID Element;
|
||||
CListNode *Next;
|
||||
CListNode *Next;
|
||||
CListNode *Prev;
|
||||
static HANDLE hHeap;
|
||||
static INT nRef;
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
CList();
|
||||
~CList();
|
||||
CList& operator=(CList&);
|
||||
|
||||
|
||||
CIterator<Item> *CreateIterator() const;
|
||||
LONG Count() const;
|
||||
Item& Get(const LONG index) const;
|
||||
@@ -82,7 +82,7 @@ CList<Item>::CList()
|
||||
// Default destructor
|
||||
template <class Item>
|
||||
CList<Item>::~CList()
|
||||
{
|
||||
{
|
||||
RemoveAll();
|
||||
delete Trailer;
|
||||
delete Header;
|
||||
@@ -157,7 +157,7 @@ VOID CList<Item>::RemoveAll()
|
||||
tmp = node->GetNext();
|
||||
delete node;
|
||||
node = tmp;
|
||||
}
|
||||
}
|
||||
Header->SetNext(Trailer);
|
||||
Trailer->SetPrev(Header);
|
||||
NodeCount = 0;
|
||||
|
19
reactos/apps/utils/net/route/makefile
Normal file
19
reactos/apps/utils/net/route/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = route
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a iphlpapi.a ntdll.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
TARGET_GCCLIBS =
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -20,7 +20,7 @@
|
||||
#define IN_ADDR_OF(x) *((struct in_addr *)&(x))
|
||||
|
||||
int usage() {
|
||||
fprintf( stderr,
|
||||
fprintf( stderr,
|
||||
"route usage:\n"
|
||||
"route print\n"
|
||||
" prints the route table\n"
|
||||
@@ -35,7 +35,8 @@ int print_routes() {
|
||||
PMIB_IPFORWARDTABLE IpForwardTable;
|
||||
DWORD Error;
|
||||
ULONG Size = 0;
|
||||
char Destination[IPBUF], Gateway[IPBUF], Netmask[IPBUF];
|
||||
char Destination[IPBUF], Gateway[IPBUF], Netmask[IPBUF],
|
||||
Index[IPBUF], Metric[IPBUF];
|
||||
int i;
|
||||
|
||||
if( (Error = GetIpForwardTable( NULL, &Size, TRUE )) ==
|
||||
@@ -45,7 +46,7 @@ int print_routes() {
|
||||
}
|
||||
|
||||
if( Error == ERROR_SUCCESS ) {
|
||||
printf( "%-16s%-16s%-16s%-10s%-10s\n",
|
||||
printf( "%-16s%-16s%-16s%-10s%-10s\n",
|
||||
"Destination",
|
||||
"Netmask",
|
||||
"Gateway",
|
||||
@@ -62,7 +63,7 @@ int print_routes() {
|
||||
inet_ntoa( IN_ADDR_OF(IpForwardTable->table[i].
|
||||
dwForwardNextHop) ) );
|
||||
|
||||
printf( "%-16s%-16s%-16s%-10ld%-10ld\n",
|
||||
printf( "%-16s%-16s%-16s%-10d%-10d\n",
|
||||
Destination,
|
||||
Netmask,
|
||||
Gateway,
|
||||
@@ -79,7 +80,7 @@ int print_routes() {
|
||||
}
|
||||
}
|
||||
|
||||
int convert_add_cmd_line( PMIB_IPFORWARDROW RowToAdd,
|
||||
int convert_add_cmd_line( PMIB_IPFORWARDROW RowToAdd,
|
||||
int argc, char **argv ) {
|
||||
int i;
|
||||
|
||||
@@ -105,7 +106,7 @@ int add_route( int argc, char **argv ) {
|
||||
DWORD Error;
|
||||
|
||||
if( argc < 2 || !convert_add_cmd_line( &RowToAdd, argc, argv ) ) {
|
||||
fprintf( stderr,
|
||||
fprintf( stderr,
|
||||
"route add usage:\n"
|
||||
"route add <target> [mask <mask>] <gw> [metric <m>]\n"
|
||||
" Adds a route to the IP route table.\n"
|
||||
@@ -115,10 +116,10 @@ int add_route( int argc, char **argv ) {
|
||||
" <m> is the metric to use (lower is preferred)\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( (Error = CreateIpForwardEntry( &RowToAdd )) == ERROR_SUCCESS )
|
||||
|
||||
if( (Error = CreateIpForwardEntry( &RowToAdd )) == ERROR_SUCCESS )
|
||||
return 0;
|
||||
|
||||
|
||||
fprintf( stderr, "Route addition failed\n" );
|
||||
return Error;
|
||||
}
|
||||
@@ -128,7 +129,7 @@ int del_route( int argc, char **argv ) {
|
||||
DWORD Error;
|
||||
|
||||
if( argc < 2 || !convert_add_cmd_line( &RowToDel, argc, argv ) ) {
|
||||
fprintf( stderr,
|
||||
fprintf( stderr,
|
||||
"route delete usage:\n"
|
||||
"route delete <target> <gw>\n"
|
||||
" Removes a route from the IP route table.\n"
|
||||
@@ -136,21 +137,21 @@ int del_route( int argc, char **argv ) {
|
||||
" <gw> is the gateway to remove the route from.\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( (Error = DeleteIpForwardEntry( &RowToDel )) == ERROR_SUCCESS )
|
||||
|
||||
if( (Error = DeleteIpForwardEntry( &RowToDel )) == ERROR_SUCCESS )
|
||||
return 0;
|
||||
|
||||
|
||||
fprintf( stderr, "Route addition failed\n" );
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
if( argc < 2 ) return usage();
|
||||
else if( !strcasecmp( argv[1], "print" ) )
|
||||
else if( !strcasecmp( argv[1], "print" ) )
|
||||
return print_routes();
|
||||
else if( !strcasecmp( argv[1], "add" ) )
|
||||
else if( !strcasecmp( argv[1], "add" ) )
|
||||
return add_route( argc-2, argv+2 );
|
||||
else if( !strcasecmp( argv[1], "delete" ) )
|
||||
else if( !strcasecmp( argv[1], "delete" ) )
|
||||
return del_route( argc-2, argv+2 );
|
||||
else return usage();
|
||||
}
|
||||
|
@@ -1,9 +0,0 @@
|
||||
<module name="route" type="win32cui" warnings="true">
|
||||
<include base="route">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<library>iphlpapi</library>
|
||||
<file>route.c</file>
|
||||
<file>route.rc</file>
|
||||
</module>
|
41
reactos/apps/utils/net/telnet/Makefile
Normal file
41
reactos/apps/utils/net/telnet/Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = telnet
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a
|
||||
|
||||
TARGET_CPPFLAGS = -D__REACTOS__ -D__USE_W32API -Wall
|
||||
|
||||
TARGET_GCCLIBS = stdc++
|
||||
|
||||
TARGET_OBJECTS = \
|
||||
src/ansiprsr.o \
|
||||
src/keytrans.o \
|
||||
src/tcharmap.o \
|
||||
src/tconsole.o \
|
||||
src/tkeydef.o \
|
||||
src/tkeymap.o \
|
||||
src/tmapldr.o \
|
||||
src/tmouse.o \
|
||||
src/tnclass.o \
|
||||
src/tnclip.o \
|
||||
src/tncon.o \
|
||||
src/tnconfig.o \
|
||||
src/tnerror.o \
|
||||
src/tnetwork.o \
|
||||
src/tnmain.o \
|
||||
src/tnmisc.o \
|
||||
src/tscript.o \
|
||||
src/tscroll.o \
|
||||
src/ttelhndl.o
|
||||
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -97,7 +97,7 @@
|
||||
#define MSG_WSANO_DATA 0x2AFC
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
|
@@ -53,8 +53,6 @@
|
||||
#include <string.h>
|
||||
#include "ansiprsr.h"
|
||||
|
||||
const int ANSIColors[] = {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE};
|
||||
|
||||
// The constructor now takes different arguments and initializes different
|
||||
// variables (Paul Brannan 6/15/98)
|
||||
TANSIParser::TANSIParser(TConsole &RefConsole, KeyTranslator &RefKeyTrans,
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
// added this color table to make things go faster (Paul Branann 5/8/98)
|
||||
enum Colors {BLACK=0, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE};
|
||||
extern const int ANSIColors[];
|
||||
static const int ANSIColors[] = {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE};
|
||||
|
||||
// This should be greater than the largest conceivable window size
|
||||
// 200 should suffice
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
void SaveCurY(int iY);
|
||||
|
||||
void resetTabStops();
|
||||
|
||||
|
||||
int iSavedCurX;
|
||||
int iSavedCurY;
|
||||
unsigned char iSavedAttributes;
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
TANSIParser(TConsole &Console, KeyTranslator &RefKeyTrans,
|
||||
TScroller &RefScroller, TNetwork &NetHandler, TCharmap &RefCharmap);
|
||||
~TANSIParser();
|
||||
|
||||
|
||||
char* ParseBuffer(char* pszBuffer, char* pszBufferEnd);
|
||||
static int StripBuffer(char* pszBuffer, char* pszBufferEnd, int width);
|
||||
};
|
||||
|
@@ -93,5 +93,5 @@ private:
|
||||
int currentKeyMap, mainKeyMap; // AVS
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __KEYTRANS_H
|
||||
|
@@ -29,36 +29,36 @@ public:
|
||||
growable(delta),
|
||||
lowerbound(lower)
|
||||
{ vector<T>::reserve(upper-lower + 1);}
|
||||
|
||||
|
||||
~TArrayAsVector( )
|
||||
{ // This call is unnecessary? (Paul Brannan 5/7/98)
|
||||
// vector<T>::~vector( );
|
||||
}
|
||||
|
||||
|
||||
int Add(const T& item)
|
||||
{ if(!growable && vector<T>::size( ) == vector<T>::capacity( ))
|
||||
return 0;
|
||||
else
|
||||
insert(vector<T>::end( ), item);
|
||||
return 1; }
|
||||
|
||||
|
||||
int AddAt(const T& item, size_type index)
|
||||
{ if(!growable &&
|
||||
((vector<T>::size( ) == vector<T>::capacity( )) ||
|
||||
(ZeroBase(index > vector<T>::capacity( )) )))
|
||||
return 0;
|
||||
if(ZeroBase(index) > vector<T>::capacity( )) // out of bounds
|
||||
{ insert(vector<T>::end( ),
|
||||
{ insert(vector<T>::end( ),
|
||||
ZeroBase(index) - vector<T>::size( ), T( ));
|
||||
insert(vector<T>::end( ), item); }
|
||||
else
|
||||
{ insert(vector<T>::begin( ) + ZeroBase(index), item); }
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
size_type ArraySize( )
|
||||
{ return vector<T>::capacity( ); }
|
||||
|
||||
|
||||
size_type BoundBase(size_type location) const
|
||||
{ if(location == UINT_MAX)
|
||||
return INT_MAX;
|
||||
@@ -66,44 +66,44 @@ public:
|
||||
return location + lowerbound; }
|
||||
void Detach(size_type index)
|
||||
{ erase(vector<T>::begin( ) + ZeroBase(index)); }
|
||||
|
||||
|
||||
void Detach(const T& item)
|
||||
{ Destroy(Find(item)); }
|
||||
|
||||
|
||||
void Destroy(size_type index)
|
||||
{ erase(vector<T>::begin( ) + ZeroBase(index)); }
|
||||
|
||||
|
||||
void Destroy(const T& item)
|
||||
{ Destroy(Find(item)); }
|
||||
|
||||
|
||||
size_type Find(const T& item) const
|
||||
{ const_iterator location = find(vector<T>::begin( ),
|
||||
{ const_iterator location = find(vector<T>::begin( ),
|
||||
vector<T>::end( ), item);
|
||||
if(location != vector<T>::end( ))
|
||||
return BoundBase(size_type(location -
|
||||
return BoundBase(size_type(location -
|
||||
vector<T>::begin( )));
|
||||
else
|
||||
return INT_MAX; }
|
||||
|
||||
|
||||
size_type GetItemsInContainer( )
|
||||
{ return vector<T>::size( ); }
|
||||
|
||||
|
||||
void Grow(size_type index)
|
||||
{ if( index < lowerbound )
|
||||
Reallocate(ArraySize( ) + (index -
|
||||
Reallocate(ArraySize( ) + (index -
|
||||
lowerbound));
|
||||
else if( index >= BoundBase(vector<T>::size( )))
|
||||
Reallocate(ZeroBase(index) ); }
|
||||
|
||||
|
||||
int HasMember(const T& item)
|
||||
{ if(Find(item) != INT_MAX)
|
||||
return 1;
|
||||
else
|
||||
return 0; }
|
||||
|
||||
|
||||
int IsEmpty( )
|
||||
{ return vector<T>::empty( ); }
|
||||
|
||||
|
||||
int IsFull( )
|
||||
{ if(growable)
|
||||
return 0;
|
||||
@@ -111,42 +111,42 @@ public:
|
||||
return 1;
|
||||
else
|
||||
return 0; }
|
||||
|
||||
|
||||
size_type LowerBound( )
|
||||
{ return lowerbound; }
|
||||
|
||||
|
||||
T& operator[] (size_type index)
|
||||
{ return vector<T>::
|
||||
operator[](ZeroBase(index)); }
|
||||
|
||||
|
||||
const T& operator[] (size_type index) const
|
||||
{ return vector<T>::
|
||||
operator[](ZeroBase(index)); }
|
||||
|
||||
|
||||
void Flush( )
|
||||
{
|
||||
vector<T>::clear();
|
||||
}
|
||||
|
||||
void Reallocate(size_type sz,
|
||||
|
||||
void Reallocate(size_type sz,
|
||||
size_type offset = 0)
|
||||
{ if(offset)
|
||||
insert(vector<T>::begin( ), offset, T( ));
|
||||
vector<T>::reserve(sz);
|
||||
erase(vector<T>::end( ) - offset, vector<T>::end( )); }
|
||||
|
||||
|
||||
void RemoveEntry(size_type index)
|
||||
{ Detach(index); }
|
||||
|
||||
|
||||
void SetData(size_type index, const T& item)
|
||||
{ (*this)[index] = item; }
|
||||
|
||||
|
||||
size_type UpperBound( )
|
||||
{ return BoundBase(vector<T>::capacity( )) - 1; }
|
||||
|
||||
|
||||
size_type ZeroBase(size_type index) const
|
||||
{ return index - lowerbound; }
|
||||
|
||||
|
||||
// The assignment operator is not inherited (Paul Brannan 5/25/98)
|
||||
TArrayAsVector& operator=(const TArrayAsVector& v) {
|
||||
vector<T>::operator=(v);
|
||||
|
@@ -25,9 +25,9 @@
|
||||
* | . | | |
|
||||
* | . | <-- OR --> | |
|
||||
* | . | | |
|
||||
* CON_LEFT | . | CON_RIGHT |
|
||||
* CON_LEFT | . | CON_RIGHT |
|
||||
* (=0) | . | (=CON_ | CON_LINES
|
||||
* |..............* | WIDTH) |
|
||||
* |..............* | WIDTH) |
|
||||
* | (CON_CUR_X, | | |
|
||||
* | CON_CUR_Y) | | |
|
||||
* | | | |
|
||||
@@ -77,15 +77,15 @@ public:
|
||||
void SetCursorPosition(int x, int y);
|
||||
void SetCursorSize(int pct);
|
||||
void MoveCursorPosition(int x, int y);
|
||||
|
||||
|
||||
// Screen mode/size routines
|
||||
int GetWidth() {return CON_COLS;}
|
||||
int GetHeight() {return CON_LINES;}
|
||||
void SetExtendedMode(int iFunction, BOOL bEnable);
|
||||
void SetWindowSize(int width, int height); // Set the size of the window,
|
||||
// but not the buffer
|
||||
|
||||
// Color/attribute routines
|
||||
|
||||
// Color/attribute routines
|
||||
void SetAttrib(unsigned char wAttr) {wAttributes = wAttr;}
|
||||
unsigned char GetAttrib() {return wAttributes;}
|
||||
void Normal(); // Reset all attributes
|
||||
@@ -130,13 +130,13 @@ public:
|
||||
void index();
|
||||
void reverse_index();
|
||||
void setLineWrap(bool bEnabled){
|
||||
if(!ini.get_lock_linewrap())
|
||||
if(!ini.get_lock_linewrap())
|
||||
ini.set_value("Wrap_Line", bEnabled ? "true" : "false");
|
||||
}
|
||||
bool getLineWrap() {return ini.get_wrapline();}
|
||||
|
||||
// Insert/delete characters/lines
|
||||
void InsertLine(int numlines); // Added by Titus von Boxberg 30/3/97
|
||||
void InsertLine(int numlines); // Added by Titus von Boxberg 30/3/97
|
||||
void InsertCharacter(int numchar); // "
|
||||
void DeleteCharacter(int numchar); // "
|
||||
void InsertMode(int i) {insert_mode = i;}
|
||||
@@ -148,7 +148,7 @@ protected:
|
||||
HANDLE hConsole;
|
||||
|
||||
CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo;
|
||||
|
||||
|
||||
unsigned char wAttributes;
|
||||
unsigned char fg, bg;
|
||||
unsigned char defaultfg, defaultbg;
|
||||
@@ -157,7 +157,7 @@ protected:
|
||||
bool blink;
|
||||
bool underline;
|
||||
bool reverse;
|
||||
|
||||
|
||||
int iScrollStart;
|
||||
int iScrollEnd;
|
||||
int insert_mode;
|
||||
|
@@ -39,20 +39,20 @@ private:
|
||||
KeyDefType uKeyDef;
|
||||
DWORD vk_code;
|
||||
DWORD dwState;
|
||||
|
||||
|
||||
public:
|
||||
TKeyDef();
|
||||
TKeyDef(char *def, DWORD state, DWORD code);
|
||||
TKeyDef(optype op, DWORD state, DWORD code);
|
||||
TKeyDef(const TKeyDef &t);
|
||||
|
||||
|
||||
char *operator=(char *def);
|
||||
DWORD operator=(DWORD code);
|
||||
TKeyDef& operator=(const TKeyDef &t);
|
||||
const optype& operator=(optype op);
|
||||
|
||||
|
||||
~TKeyDef();
|
||||
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
int operator==(TKeyDef &t);
|
||||
#else
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
friend bool operator==(const TKeyDef &t1, const TKeyDef &t2);
|
||||
friend bool operator<(const TKeyDef &t1, const TKeyDef &t2);
|
||||
#endif
|
||||
|
||||
|
||||
const char *GetszKey() { return uKeyDef.szKeyDef; }
|
||||
const KeyDefType GetKeyDef() { return uKeyDef; }
|
||||
DWORD GetCodeKey() { return vk_code; }
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
int Open(const char *szHost, const char *strPort = "23");
|
||||
int Close(); // close current connection
|
||||
int Resume(); // resume current session
|
||||
|
||||
|
||||
// changes to the keymap profile in the file
|
||||
int LoadKeyMap( const char * file, const char * name);
|
||||
void DisplayKeyMap(); // display available keymaps
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
SOCKET Connect();
|
||||
void telSetConsoleTitle(const char * szHost);
|
||||
void DoInit();
|
||||
|
||||
|
||||
SOCKET Socket;
|
||||
char strPort[32]; // int iPort;
|
||||
char szHost[127];
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#define __TNMISC_H
|
||||
|
||||
// Process-related functions
|
||||
BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION* ppi,
|
||||
BOOL CreateHiddenConsoleProcess(LPCTSTR szChildName, PROCESS_INFORMATION* ppi,
|
||||
LPHANDLE phInWrite, LPHANDLE phOutRead,
|
||||
LPHANDLE phErrRead);
|
||||
BOOL SpawnProcess(char *cmd_line, PROCESS_INFORMATION *pi);
|
||||
|
@@ -97,7 +97,7 @@
|
||||
#define MSG_WSANO_DATA 0x2AFC
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
|
@@ -1,29 +0,0 @@
|
||||
<module name="telnet" type="win32cui" installbase="system32" installname="telnet.exe">
|
||||
<include base="telnet">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="__REACTOS__" />
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<directory name="src">
|
||||
<file>ansiprsr.cpp</file>
|
||||
<file>keytrans.cpp</file>
|
||||
<file>tcharmap.cpp</file>
|
||||
<file>tconsole.cpp</file>
|
||||
<file>tkeydef.cpp</file>
|
||||
<file>tkeymap.cpp</file>
|
||||
<file>tmapldr.cpp</file>
|
||||
<file>tmouse.cpp</file>
|
||||
<file>tnclass.cpp</file>
|
||||
<file>tnclip.cpp</file>
|
||||
<file>tncon.cpp</file>
|
||||
<file>tnconfig.cpp</file>
|
||||
<file>tnerror.cpp</file>
|
||||
<file>tnetwork.cpp</file>
|
||||
<file>tnmain.cpp</file>
|
||||
<file>tnmisc.cpp</file>
|
||||
<file>tscript.cpp</file>
|
||||
<file>tscroll.cpp</file>
|
||||
<file>ttelhndl.cpp</file>
|
||||
</directory>
|
||||
<file>telnet.rc</file>
|
||||
</module>
|
@@ -222,7 +222,7 @@ static char sccsid[] = "@(#)traceroute.c 8.1 (Berkeley) 6/6/93";
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
|
||||
@@ -508,7 +508,7 @@ main(argc, argv)
|
||||
|
||||
status = WSAStartup(MAKEWORD(2, 2), &wsadata);
|
||||
if (status != 0) {
|
||||
printf("Could not initialize winsock dll.\n");
|
||||
printf("Could not initialize winsock dll.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
19
reactos/apps/utils/net/whois/makefile
Normal file
19
reactos/apps/utils/net/whois/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
PATH_TO_TOP = ../../../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = whois
|
||||
|
||||
TARGET_INSTALLDIR = system32
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
TARGET_GCCLIBS = iberty
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
@@ -36,13 +36,22 @@
|
||||
* more convenient fdopen()/fprintf() to send()/recv().
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1980, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <winsock2.h>
|
||||
/* #include <sys/socket.h> */
|
||||
/* #include <netinet/in.h> */
|
||||
/* #include <netdb.h> */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* #include <various.h> */
|
||||
#include <getopt.h>
|
||||
@@ -83,10 +92,10 @@ int main(int argc, char **argv)
|
||||
if (!argc)
|
||||
usage();
|
||||
|
||||
/* Start winsock */
|
||||
/* Start winsock */
|
||||
wVersionRequested = MAKEWORD( 1, 1 );
|
||||
err = WSAStartup( wVersionRequested, &wsaData );
|
||||
if ( err != 0 )
|
||||
if ( err != 0 )
|
||||
{
|
||||
/* Tell the user that we couldn't find a usable */
|
||||
/* WinSock DLL. */
|
||||
@@ -151,7 +160,6 @@ int main(int argc, char **argv)
|
||||
putchar(ch);
|
||||
|
||||
leave(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usage()
|
||||
|
@@ -3,4 +3,5 @@
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Whois\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "whois\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "whois.exe\0"
|
||||
#define REACTOS_STR_ORIGINAL_COPYRIGHT "Steven Edwards (Isolation@users.sourceforge.net)\0"
|
||||
#include <reactos/version.rc>
|
||||
|
@@ -1,7 +0,0 @@
|
||||
<module name="whois" type="win32cui" installbase="system32" installname="whois.exe">
|
||||
<include base="whois">.</include>
|
||||
<library>kernel32</library>
|
||||
<library>ws2_32</library>
|
||||
<file>whois.c</file>
|
||||
<file>whois.rc</file>
|
||||
</module>
|
@@ -1,16 +1,16 @@
|
||||
/* $Id$
|
||||
*
|
||||
*
|
||||
* Convert NTSTATUS codes to Win32 error codes: run it
|
||||
* on a NT box AND on a ROS box, then diff the results.
|
||||
*
|
||||
* This utility should help keeping correct how Ros
|
||||
* translates executive's errors codes into Win32 error
|
||||
* codes.
|
||||
*
|
||||
*
|
||||
* Usage: nts2w32err [MaxStatusCode] > log.txt
|
||||
*
|
||||
*
|
||||
* 2004-01-10 Emanuele Aliberti
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
#include <windows.h>
|
||||
|
@@ -35,7 +35,7 @@ RawUszAsz (
|
||||
)
|
||||
{
|
||||
register PCHAR a = szA;
|
||||
|
||||
|
||||
while (*szU) {*szA++ = (CHAR) (0x00ff & * szU++);}
|
||||
*szA = '\0';
|
||||
return a;
|
||||
@@ -51,7 +51,7 @@ RawAszUsz (
|
||||
)
|
||||
{
|
||||
register PWCHAR w = szW;
|
||||
|
||||
|
||||
while (*szA) {*szW++ = (WCHAR) *szA++;}
|
||||
*szW = L'\0';
|
||||
return w;
|
||||
@@ -64,7 +64,7 @@ STDCALL
|
||||
StatusToName (NTSTATUS Status)
|
||||
{
|
||||
static char RawValue [16];
|
||||
|
||||
|
||||
switch (Status)
|
||||
{
|
||||
case STATUS_BUFFER_TOO_SMALL:
|
||||
@@ -79,14 +79,10 @@ StatusToName (NTSTATUS Status)
|
||||
return "STATUS_PATH_SYNTAX_BAD";
|
||||
case STATUS_NO_MORE_ENTRIES:
|
||||
return "STATUS_NO_MORE_ENTRIES";
|
||||
case STATUS_MORE_ENTRIES:
|
||||
return "STATUS_MORE_ENTRIES";
|
||||
case STATUS_ACCESS_DENIED:
|
||||
return "STATUS_ACCESS_DENIED";
|
||||
case STATUS_UNSUCCESSFUL:
|
||||
return "STATUS_UNSUCCESSFUL";
|
||||
case STATUS_INVALID_HANDLE:
|
||||
return "STATUS_INVALID_HANDLE";
|
||||
}
|
||||
sprintf (RawValue, "0x%08lx", Status);
|
||||
return (const char *) RawValue;
|
||||
@@ -112,7 +108,7 @@ ExpandSymbolicLink (
|
||||
Path.Buffer = PathBuffer;
|
||||
Path.Length = 0;
|
||||
Path.MaximumLength = sizeof PathBuffer;
|
||||
|
||||
|
||||
RtlCopyUnicodeString (& Path, DirectoryName);
|
||||
if (L'\\' != Path.Buffer [(Path.Length / sizeof Path.Buffer[0]) - 1])
|
||||
{
|
||||
@@ -177,13 +173,12 @@ ListDirectory (
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
NTSTATUS Status;
|
||||
HANDLE DirectoryHandle;
|
||||
BYTE DirectoryEntry [512];
|
||||
BYTE DirectoryEntry [MAX_DIR_ENTRY * sizeof(OBJECT_DIRECTORY_INFORMATION)];
|
||||
POBJECT_DIRECTORY_INFORMATION pDirectoryEntry = (POBJECT_DIRECTORY_INFORMATION) DirectoryEntry;
|
||||
POBJECT_DIRECTORY_INFORMATION pDirectoryEntries = (POBJECT_DIRECTORY_INFORMATION) DirectoryEntry;
|
||||
ULONG Context = 0;
|
||||
ULONG ReturnLength = 0;
|
||||
ULONG EntryCount = 0;
|
||||
|
||||
|
||||
/* For expanding symbolic links */
|
||||
WCHAR TargetName [2 * MAX_PATH];
|
||||
UNICODE_STRING TargetObjectName = {
|
||||
@@ -222,23 +217,25 @@ ListDirectory (
|
||||
return (FALSE);
|
||||
}
|
||||
printf ("\n Directory of %s\n\n", DirectoryNameA);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
/*
|
||||
* Enumerate each item in the directory.
|
||||
*/
|
||||
Status = NtQueryDirectoryObject (
|
||||
DirectoryHandle,
|
||||
pDirectoryEntries,
|
||||
pDirectoryEntry,
|
||||
sizeof DirectoryEntry,
|
||||
FALSE,/* ReturnSingleEntry */
|
||||
FALSE, /* RestartScan */
|
||||
TRUE, /* RestartScan */
|
||||
& Context,
|
||||
& ReturnLength
|
||||
);
|
||||
if (!NT_SUCCESS(Status) && Status != STATUS_NO_MORE_ENTRIES)
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
if (STATUS_NO_MORE_ENTRIES == Status)
|
||||
{
|
||||
NtClose (DirectoryHandle);
|
||||
return TRUE;
|
||||
}
|
||||
printf (
|
||||
"Failed to query directory object (Status: %s)\n",
|
||||
StatusToName (Status)
|
||||
@@ -246,17 +243,12 @@ ListDirectory (
|
||||
NtClose (DirectoryHandle);
|
||||
return (FALSE);
|
||||
}
|
||||
if (Status == STATUS_NO_MORE_ENTRIES)
|
||||
{
|
||||
break;
|
||||
}
|
||||
pDirectoryEntry = pDirectoryEntries;
|
||||
while (EntryCount < Context)
|
||||
while (0 != pDirectoryEntry->ObjectTypeName.Length)
|
||||
{
|
||||
CHAR ObjectNameA [MAX_PATH];
|
||||
CHAR TypeNameA [MAX_PATH];
|
||||
CHAR TargetNameA [MAX_PATH];
|
||||
|
||||
|
||||
if (0 == wcscmp (L"SymbolicLink", pDirectoryEntry->ObjectTypeName.Buffer))
|
||||
{
|
||||
if (TRUE == ExpandSymbolicLink (
|
||||
@@ -266,7 +258,7 @@ ListDirectory (
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
printf (
|
||||
"%-16s %s -> %s\n",
|
||||
RawUszAsz (pDirectoryEntry->ObjectTypeName.Buffer, TypeNameA),
|
||||
@@ -291,10 +283,9 @@ ListDirectory (
|
||||
RawUszAsz (pDirectoryEntry->ObjectName.Buffer, ObjectNameA)
|
||||
);
|
||||
}
|
||||
++ pDirectoryEntry;
|
||||
++ EntryCount;
|
||||
++ pDirectoryEntry;
|
||||
}
|
||||
};
|
||||
printf ("\n\t%lu object(s)\n", EntryCount);
|
||||
/*
|
||||
* Free any resource.
|
||||
@@ -355,7 +346,7 @@ int main(int argc, char* argv[])
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
RawAszUsz (argv[2], DirectoryNameW);
|
||||
Recurse = TRUE;
|
||||
Recurse = TRUE;
|
||||
break;
|
||||
default:
|
||||
fprintf (
|
||||
|
@@ -10,7 +10,7 @@ TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = partinfo
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API -Wall -Werror -Wno-format
|
||||
TARGET_CFLAGS = -Wall -Werror -Wno-format
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a kernel32.a
|
||||
|
||||
|
@@ -8,11 +8,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
//#define DUMP_DATA
|
||||
#define DUMP_SIZE_INFO
|
||||
#define UNICODE
|
||||
|
||||
|
||||
#ifdef DUMP_DATA
|
||||
void HexDump(char *buffer, ULONG size)
|
||||
|
@@ -59,7 +59,7 @@ main(int argc, char *argv[])
|
||||
if (NULL == Buffer)
|
||||
{
|
||||
perror("Can't allocate buffer");
|
||||
fclose(File);
|
||||
fclose(File);
|
||||
exit(1);
|
||||
}
|
||||
rewind(File);
|
||||
@@ -67,7 +67,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
perror("Error reading from original file");
|
||||
free(Buffer);
|
||||
fclose(File);
|
||||
fclose(File);
|
||||
exit(1);
|
||||
}
|
||||
fclose(File);
|
||||
@@ -97,7 +97,7 @@ main(int argc, char *argv[])
|
||||
if (Size != fwrite(Buffer, 1, Size, File))
|
||||
{
|
||||
perror("Error writing to output file");
|
||||
fclose(File);
|
||||
fclose(File);
|
||||
remove(TempName);
|
||||
free(Buffer);
|
||||
exit(1);
|
||||
|
@@ -60,7 +60,7 @@ int main(int argc, char **argv)
|
||||
if (!((PIMAGE_SECTION_HEADER)IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS)&buffer[offset]))[i].VirtualAddress)
|
||||
break;
|
||||
#if 1
|
||||
printf("%-8.8s %08x %08x %08x ",
|
||||
printf("%-8.8s %08x %08x %08x ",
|
||||
((PIMAGE_SECTION_HEADER)IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS)&buffer[offset]))[i].Name,
|
||||
((PIMAGE_SECTION_HEADER)IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS)&buffer[offset]))[i].VirtualAddress,
|
||||
((PIMAGE_SECTION_HEADER)IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS)&buffer[offset]))[i].SizeOfRawData,
|
||||
|
@@ -7,7 +7,7 @@ Module Name:
|
||||
term<72>nal.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
HEADER for terminal.c
|
||||
|
||||
Environment:
|
||||
@@ -21,7 +21,7 @@ Author:
|
||||
Revision History:
|
||||
|
||||
23-Jan-2001: created
|
||||
|
||||
|
||||
Copyright notice:
|
||||
|
||||
This file may be distributed under the terms of the GNU Public License.
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2000-2001 Goran Devic
|
||||
Copyright (c) 2000-2001 Goran Devic
|
||||
Modified (c) 2001 Klaus P. Gerlicher
|
||||
|
||||
Module Name:
|
||||
@@ -16,15 +16,15 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Goran Devic
|
||||
Goran Devic
|
||||
|
||||
Revision History:
|
||||
|
||||
17-Mar-2000: Original (Goran Devic)
|
||||
17-Mar-2000: Original (Goran Devic)
|
||||
26-Apr-2000: Major rewrite, added coprocessor instructions (Goran Devic)
|
||||
04-Nov-2000: Modified for LinIce (Goran Devic)
|
||||
04-Nov-2000: Modified for LinIce (Goran Devic)
|
||||
05-Jan-2001: Modified for pICE (Klaus P. Gerlicher)
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static UCHAR GetNextUCHAR(USHORT sel, UCHAR *offset, UCHAR *pCode)
|
||||
pCode[0] = GetUCHAR((ULONG) offset + 0) & 0xFF;
|
||||
|
||||
return( pCode[0] );
|
||||
}
|
||||
}
|
||||
|
||||
static USHORT GetNextUSHORT(USHORT sel, UCHAR *offset, UCHAR *pCode)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ static USHORT GetNextUSHORT(USHORT sel, UCHAR *offset, UCHAR *pCode)
|
||||
pCode[1] = GetUCHAR((ULONG) offset + 1) & 0xFF;
|
||||
|
||||
return( *(USHORT *) pCode );
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG GetNextULONG(USHORT sel, UCHAR *offset, UCHAR *pCode)
|
||||
{
|
||||
@@ -128,7 +128,7 @@ static ULONG GetNextULONG(USHORT sel, UCHAR *offset, UCHAR *pCode)
|
||||
pCode[3] = GetUCHAR((ULONG) offset + 3) & 0xFF;
|
||||
|
||||
return( *(ULONG *) pCode );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define NEXTUCHAR GetNextUCHAR( pDis->wSel, bpTarget, bpCode); bpCode += 1; bpTarget += 1; bInstrLen += 1
|
||||
@@ -705,7 +705,7 @@ DisEnd:
|
||||
BOOLEAN Disasm(PULONG pOffset,PUCHAR pchDst)
|
||||
{
|
||||
TDisassembler dis;
|
||||
|
||||
|
||||
dis.dwFlags = DIS_DATA32 | DIS_ADDRESS32;
|
||||
dis.bpTarget = (UCHAR*)*pOffset;
|
||||
dis.szDisasm = pchDst;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#define OP_BPTR 0x400 /* BYTE Pointer */
|
||||
#define OP_WPTR 0x500 /* WORD Pointer */
|
||||
#define OP_DPTR 0x600 /* DWORD Pointer */
|
||||
#define OP_UNK 0x900
|
||||
#define OP_UNK 0x900
|
||||
//#define INS_INVALID 0x00 /* Not a valid instruction */
|
||||
/* Branch Instruction types */
|
||||
#define INS_BRANCH 0x01 /* Unconditional branch */
|
||||
@@ -94,7 +94,7 @@ enum argtype {
|
||||
ARG_REG_IY_IND,ARG_REG_C_IND,ARG_REG_I,ARG_REG_R,ARG_IMM16_A,ARG_MODRM16,ARG_SIMM8,
|
||||
ARG_IMM32,ARG_STRING,ARG_MODRM_BCD,ARG_PSTRING,ARG_DOSSTRING,ARG_CUNICODESTRING,
|
||||
ARG_PUNICODESTRING,ARG_NONEBYTE,ARG_XREG,ARG_XMMMODRM};
|
||||
|
||||
|
||||
typedef struct x86_inst {
|
||||
int flags;
|
||||
int destType, srcType, auxType;
|
||||
@@ -122,7 +122,7 @@ typedef struct x86_inst {
|
||||
#define DISP8 0x1000
|
||||
#define DISP32 0x2000
|
||||
#define HAS_SIB 0x4000
|
||||
#define HAS_MODRM 0x8000
|
||||
#define HAS_MODRM 0x8000
|
||||
|
||||
struct OPERAND { //arg1, arg2, arg3
|
||||
char * str; //temporary buffer for building arg text
|
||||
@@ -138,7 +138,7 @@ struct EA { //effective address [SIB/disp]
|
||||
char sib[32];
|
||||
};
|
||||
|
||||
struct modRM_byte {
|
||||
struct modRM_byte {
|
||||
unsigned int mod : 2;
|
||||
unsigned int reg : 3;
|
||||
unsigned int rm : 3;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2000-2001 Goran Devic
|
||||
Copyright (c) 2000-2001 Goran Devic
|
||||
Modified (c) 2001 Klaus P. Gerlicher
|
||||
|
||||
Module Name:
|
||||
@@ -16,13 +16,13 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Goran Devic
|
||||
Goran Devic
|
||||
|
||||
Revision History:
|
||||
|
||||
17-Mar-2000: Original (Goran Devic)
|
||||
17-Mar-2000: Original (Goran Devic)
|
||||
05-Jan-2001: Modified for pICE (Klaus P. Gerlicher)
|
||||
|
||||
Copyright notice:
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
@@ -28,7 +28,7 @@ Copyright notice:
|
||||
This file may be distributed under the terms of the GNU Public License.
|
||||
|
||||
--*/
|
||||
void DeinstallHooks(void);
|
||||
void DeinstallHooks(void);
|
||||
//ULONG HookInt(ULONG dwInt,ULONG NewIntHandler);
|
||||
//void UnhookInt(ULONG dwInt);
|
||||
void MaskIrqs(void);
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
@@ -29,7 +29,7 @@ Copyright notice:
|
||||
|
||||
--*/
|
||||
|
||||
BOOLEAN InitPICE(void);
|
||||
void CleanUpPICE(void);
|
||||
BOOLEAN InitPICE(void);
|
||||
void CleanUpPICE(void);
|
||||
|
||||
extern char szBootParams[1024];
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
@@ -33,4 +33,4 @@ Copyright notice:
|
||||
#define PICE_MINOR_VERSION (99)
|
||||
// reset this on major or minor version change
|
||||
// increment this on every release build
|
||||
#define PICE_BUILD (0007)
|
||||
#define PICE_BUILD (0007)
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
@@ -32,5 +32,5 @@ void SendString(LPSTR s);
|
||||
void SetupSerial(ULONG port,ULONG baudrate);
|
||||
|
||||
BOOLEAN ConsoleInitSerial(void);
|
||||
void ConsoleShutdownSerial(void);
|
||||
void ConsoleShutdownSerial(void);
|
||||
|
||||
|
@@ -17,7 +17,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -2035,7 +2035,7 @@ PICE_SYMBOLFILE_HEADER* LoadSymbols(LPSTR filename)
|
||||
if(pSymbols->magic == PICE_MAGIC)
|
||||
{
|
||||
DPRINT((0,"magic = %X\n",pSymbols->magic));
|
||||
DPRINT((0,"name = %S\n",pSymbols->name));
|
||||
DPRINT((0,"name = %S\n",pSymbols->name));;
|
||||
DPRINT((0,"ulOffsetToHeaders,ulSizeOfHeader = %X,%X\n",pSymbols->ulOffsetToHeaders,pSymbols->ulSizeOfHeader));
|
||||
DPRINT((0,"ulOffsetToGlobals,ulSizeOfGlobals = %X,%X\n",pSymbols->ulOffsetToGlobals,pSymbols->ulSizeOfGlobals));
|
||||
DPRINT((0,"ulOffsetToGlobalsStrings,ulSizeOfGlobalsStrings = %X,%X\n",pSymbols->ulOffsetToGlobalsStrings,pSymbols->ulSizeOfGlobalsStrings));
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -15,7 +15,7 @@ Environment:
|
||||
LINUX 2.2.X
|
||||
Kernel mode only
|
||||
|
||||
Author:
|
||||
Author:
|
||||
|
||||
Klaus P. Gerlicher
|
||||
|
||||
|
@@ -10,7 +10,7 @@ TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = pnpdump
|
||||
|
||||
TARGET_CFLAGS = -D__USE_W32API -Wall -Werror
|
||||
TARGET_CFLAGS = -Wall -Werror
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a kernel32.a
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user