diff --git a/rosapps/cmd/cmdinput.c b/rosapps/cmd/cmdinput.c index 9f087ef0378..e981f0b3541 100644 --- a/rosapps/cmd/cmdinput.c +++ b/rosapps/cmd/cmdinput.c @@ -360,19 +360,14 @@ VOID ReadCommand (LPTSTR str, INT maxlen) break; default: -#ifdef __REACTOS__ - ch = ir.Event.KeyEvent.AsciiChar; - if ((ch >= 32) && (charcount != (maxlen - 2))) - { -#else #ifdef _UNICODE ch = ir.Event.KeyEvent.uChar.UnicodeChar; + if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2))) #else ch = ir.Event.KeyEvent.uChar.AsciiChar; + if (ch >= 32 && (charcount != (maxlen - 2))) #endif /* _UNICODE */ - if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2))) { -#endif /* __REACTOS__ */ /* insert character into string... */ if (bInsert && current != charcount) { diff --git a/rosapps/cmd/config.h b/rosapps/cmd/config.h index a0243cc00e7..89eb96f525b 100644 --- a/rosapps/cmd/config.h +++ b/rosapps/cmd/config.h @@ -14,9 +14,17 @@ #ifndef _CONFIG_H_INCLUDED_ #define _CONFIG_H_INCLUDED_ -#ifndef __REACTOS__ +//#ifndef __REACTOS__ #define WIN32_LEAN_AND_MEAN -#endif /* __REACTOS__ */ +//#endif /* __REACTOS__ */ + + +//#ifdef UNICODE +//#define _T(x) L##x +//#else +//#define _T(x) x +//#endif + /* JPP 20 Jul 1998 - define DEBUG to add debugging code */ diff --git a/rosapps/cmd/dir.c b/rosapps/cmd/dir.c index 4641ccdac76..247bbad3efe 100644 --- a/rosapps/cmd/dir.c +++ b/rosapps/cmd/dir.c @@ -810,8 +810,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags) count = 0; } - uliSize.LowPart = file.nFileSizeLow; - uliSize.HighPart = file.nFileSizeHigh; + uliSize.u.LowPart = file.nFileSizeLow; + uliSize.u.HighPart = file.nFileSizeHigh; bytecount.QuadPart += uliSize.QuadPart; } else if (dwFlags & DIR_BARE) @@ -841,8 +841,8 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags) if (IncLine (pLine, dwFlags)) return 1; - uliSize.LowPart = file.nFileSizeLow; - uliSize.HighPart = file.nFileSizeHigh; + uliSize.u.LowPart = file.nFileSizeLow; + uliSize.u.HighPart = file.nFileSizeHigh; bytecount.QuadPart += uliSize.QuadPart; } else @@ -866,14 +866,14 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags) { ULARGE_INTEGER uliSize; - uliSize.LowPart = file.nFileSizeLow; - uliSize.HighPart = file.nFileSizeHigh; + uliSize.u.LowPart = file.nFileSizeLow; + uliSize.u.HighPart = file.nFileSizeHigh; ConvertULargeInteger (uliSize, buffer, sizeof(buffer)); ConOutPrintf (_T(" %20s"), buffer); bytecount.QuadPart += uliSize.QuadPart; - filecount++; + filecount++; } /* print long filename */ @@ -918,9 +918,9 @@ DirList (LPTSTR szPath, LPTSTR szFilespec, LPINT pLine, DWORD dwFlags) { ULARGE_INTEGER uliSize; - uliSize.LowPart = file.nFileSizeLow; - uliSize.HighPart = file.nFileSizeHigh; - ConvertULargeInteger (uliSize, buffer, sizeof(buffer)); + uliSize.u.LowPart = file.nFileSizeLow; + uliSize.u.HighPart = file.nFileSizeHigh; + ConvertULargeInteger (uliSize, buffer, sizeof(buffer)); ConOutPrintf (_T(" %10s "), buffer); bytecount.QuadPart += uliSize.QuadPart; filecount++; @@ -1058,7 +1058,7 @@ DirRecurse (LPTSTR szPath, LPTSTR szSpec, LPINT pLine, DWORD dwFlags) dwFlags &= ~DIR_RECURSE; if (PrintSummary (szPath, recurse_file_cnt, - recurse_dir_cnt, recurse_bytes, pLine, dwFlags)) + recurse_dir_cnt, recurse_bytes, pLine, dwFlags)) return 1; if ((dwFlags & DIR_BARE) == 0) diff --git a/rosapps/cmd/filecomp.c b/rosapps/cmd/filecomp.c index 3232570c366..488b3bb69ec 100644 --- a/rosapps/cmd/filecomp.c +++ b/rosapps/cmd/filecomp.c @@ -223,7 +223,7 @@ BOOL ShowCompletionMatches (LPTSTR str, INT charcount) continue; if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - _stprintf (fname, _T("[%s]"), file.cFileName); + _stprintf (fname, _T("[%s]"), file.cFileName); else _tcscpy (fname, file.cFileName); diff --git a/rosapps/cmd/history.c b/rosapps/cmd/history.c index cae614013ee..e1225e4e774 100644 --- a/rosapps/cmd/history.c +++ b/rosapps/cmd/history.c @@ -28,6 +28,7 @@ #include #include +#include "cmd.h" #define MAXLINES 128 diff --git a/rosapps/cmd/makefile b/rosapps/cmd/makefile index aadd0f82c7e..706adc92ad5 100644 --- a/rosapps/cmd/makefile +++ b/rosapps/cmd/makefile @@ -2,21 +2,15 @@ # ReactOS makefile for CMD # -# target: raw binary (does not work right now) -#all: cmd.bin - -# target: executable (not tested/experimental) all: cmd.exe -OBJECTS = ../common/crt0.o cmd.o attrib.o alias.o batch.o beep.o call.o \ +OBJECTS = cmd.o attrib.o alias.o batch.o beep.o call.o \ chcp.o cls.o cmdinput.o cmdtable.o color.o console.o copy.o date.o \ del.o dir.o dirstack.o echo.o error.o filecomp.o for.o goto.o \ history.o if.o internal.o label.o locale.o misc.o move.o path.o \ - pause.o prompt.o redir.o ren.o ros.o set.o shift.o time.o title.o type.o \ + pause.o prompt.o redir.o ren.o set.o shift.o time.o title.o type.o \ ver.o verify.o vol.o where.o -LIBS= ../../lib/kernel32/kernel32.a ../../lib/ntdll/ntdll.a - CLEAN_FILES = *.o cmd.exe cmd.sym clean: $(CLEAN_FILES:%=%_clean) @@ -26,15 +20,8 @@ $(CLEAN_FILES:%=%_clean): %_clean: .phony: clean $(CLEAN_FILES:%=%_clean) -cmd.bin: $(OBJECTS) - $(LD) -Ttext 0x10000 $(OBJECTS) $(LIBS) -o cmd.exe - $(OBJCOPY) -O binary cmd.exe cmd.bin - -cmd.exe: $(OBJECTS) $(LIBS) - $(CC) -specs=../../specs $(OBJECTS) $(LIBS) -lgcc -o cmd.exe +cmd.exe: $(OBJECTS) + $(CC) $(OBJECTS) -lkernel32 -lcrtdll -o cmd.exe $(NM) --numeric-sort cmd.exe > cmd.sym -include ../../rules.mak - - - +include ../rules.mak diff --git a/rosapps/cmd/misc.c b/rosapps/cmd/misc.c index d863ac762e4..26c6b14b45b 100644 --- a/rosapps/cmd/misc.c +++ b/rosapps/cmd/misc.c @@ -62,15 +62,11 @@ TCHAR cgetchar (VOID) } while (TRUE); -#ifdef __REACTOS__ - return irBuffer.Event.KeyEvent.AsciiChar; -#else #ifndef _UNICODE return irBuffer.Event.KeyEvent.uChar.AsciiChar; #else return irBuffer.Event.KeyEvent.uChar.UnicodeChar; #endif /* _UNICODE */ -#endif /* __REACTOS__ */ }