Minor changes.
svn path=/trunk/; revision=1021
-#include <ddk/ntddk.h>
+/* $Id: shell.c,v 1.32 2000/02/29 23:57:44 ea Exp $
+ *
+ * PROJECT : ReactOS Operating System
+ * DESCRIPTION: ReactOS' Native Shell
+ * LICENSE : See top level directory
+ *
+ */
+#define NTOS_MODE_USER
+#include <ntos.h>
#include <windows.h>
#include <stdarg.h>
#include <string.h>
return;
}
+void ExecuteHelp (void * dummy)
+{
+ debug_printf (
+ "A:\t\t\tCurrent drive is A:\n"
+ "C:\t\t\tCurrent drive is C:\n"
+ "cd [directory]\t\tChange current directory\n"
+ "dir [directory]\t\tList directory\n"
+ "exit\t\t\tTerminate the shell\n"
+ "help\t\t\tPrint this help message\n"
+ "kill [pid]\t\tKill process which PID is pid\n"
+ "reboot\t\t\tRestart the system\n"
+ "start [program.exe]\tDetach program.exe\n"
+ "type [file]\t\tPrint the file on console\n"
+ "validate\t\tValidate the process' heap\n"
+ "ver\t\t\tPrint version information\n"
+ "[program.exe]\t\tStart synchronously program.exe\n\n"
+ );
+}
+
void ExecuteCommand(char* line)
{
char* cmd;
ExecuteStart(tail);
return;
}
+ if ((strcmp(cmd,"help") * strcmp(cmd,"?")) == 0)
+ {
+ ExecuteHelp(tail);
+ return;
+ }
if (strcmp(cmd,"exit")==0)
{
if (bCanExit == TRUE)
return 0;
}
+/* EOF */
#ifndef __INCLUDE_DDK_KDFUNCS_H
#define __INCLUDE_DDK_KDFUNCS_H
-/* $Id: kdfuncs.h,v 1.1 2000/02/26 22:41:34 ea Exp $ */
+/* $Id: kdfuncs.h,v 1.2 2000/02/29 23:57:44 ea Exp $ */
/* --- NTOSKRNL.EXE --- */
-extern BOOLEAN KdDebuggerEnabled;
-extern BOOLEAN KdDebuggerNotPresent;
+#if defined(__NTOSKRNL__)
+extern BOOLEAN KdDebuggerEnabled __declspec(dllexport);
+extern BOOLEAN KdDebuggerNotPresent __declspec(dllexport);
+#else
+extern BOOLEAN KdDebuggerEnabled __declspec(dllimport);
+extern BOOLEAN KdDebuggerNotPresent __declspec(dllimport);
+#endif
BYTE
STDCALL
);
/* --- HAL.DLL --- */
-extern ULONG KdComPortInUse;
+#if defined(__NTOSKRNL__)
+extern ULONG KdComPortInUse __declspec(dllexport);
+#else
+extern ULONG KdComPortInUse __declspec(dllimport);
+#endif
BOOLEAN
STDCALL
-/* $Id: kdbg.c,v 1.6 2000/02/27 02:08:53 ekohl Exp $
+/* $Id: kdbg.c,v 1.7 2000/02/29 23:57:45 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* GLOBAL VARIABLES *********************************************************/
-ULONG KdComPortInUse = 0; /* EXPORTED */
+ULONG
+__declspec(dllexport)
+KdComPortInUse = 0; /* EXPORTED */
/* STATIC VARIABLES *********************************************************/
-/* $Id: main.c,v 1.37 2000/02/27 02:10:09 ekohl Exp $
+/* $Id: main.c,v 1.38 2000/02/29 23:57:45 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* DATA *********************************************************************/
-USHORT NtBuildNumber = KERNEL_VERSION_BUILD; /* EXPORTED */
+USHORT
+__declspec(dllexport)
+NtBuildNumber = KERNEL_VERSION_BUILD; /* EXPORTED */
-ULONG NtGlobalFlag = 0; /* FIXME: EXPORTED */
+ULONG
+__declspec(dllexport)
+NtGlobalFlag = 0; /* FIXME: EXPORTED */
/* FUNCTIONS ****************************************************************/
-/* $Id: wapi.c,v 1.3 2000/02/27 02:12:07 ekohl Exp $
+/* $Id: wapi.c,v 1.4 2000/02/29 23:57:46 ea Exp $
*
- * reactos/subsys/csrss/init.c
+ * reactos/subsys/csrss/api/wapi.c
*
* Initialize the CSRSS subsystem server process.
*
&LpcRequest);
if (!NT_SUCCESS(Status))
{
- DisplayString(L"NtReplyWaitReceivePort failed\n");
+ DisplayString(L"CSR: NtReplyWaitReceivePort failed\n");
}
Request = (PCSRSS_API_REQUEST)LpcRequest.MessageData;
ProcessData = CsrGetProcessData(LpcRequest.ClientProcessId);
- DisplayString(L"Received request\n");
+ DisplayString(L"CSR: Received request\n");
switch (Request->Type)
{
NULL);
if (CsrssApiHeap == NULL)
{
- PrintString("Failed to create private heap, aborting\n");
+ PrintString("CSR: Failed to create private heap, aborting\n");
return;
}
Status = NtListenPort(PortHandle, &Request);
if (!NT_SUCCESS(Status))
{
- DisplayString(L"NtListenPort() failed\n");
+ DisplayString(L"CSR: NtListenPort() failed\n");
NtTerminateThread(NtCurrentThread(), Status);
}
NULL);
if (!NT_SUCCESS(Status))
{
- DisplayString(L"NtAcceptConnectPort() failed\n");
+ DisplayString(L"CSR: NtAcceptConnectPort() failed\n");
NtTerminateThread(NtCurrentThread(), Status);
}
Status = NtCompleteConnectPort(ServerPort);
if (!NT_SUCCESS(Status))
{
- DisplayString(L"NtCompleteConnectPort() failed\n");
+ DisplayString(L"CSR: NtCompleteConnectPort() failed\n");
NtTerminateThread(NtCurrentThread(), Status);
}
NULL);
if (!NT_SUCCESS(Status))
{
- DisplayString(L"Unable to create server thread\n");
+ DisplayString(L"CSR: Unable to create server thread\n");
NtClose(ServerPort);
NtTerminateThread(NtCurrentThread(), Status);
}
-/* $Id: init.c,v 1.5 2000/02/27 02:11:54 ekohl Exp $
+/* $Id: init.c,v 1.6 2000/02/29 23:57:45 ea Exp $
*
* reactos/subsys/csrss/init.c
*
Status = CsrParseCommandLine (ArgumentCount, ArgumentArray);
if (!NT_SUCCESS(Status))
{
- PrintString("Unable to parse the command line (Status: %x)\n", Status);
+ PrintString("CSR: Unable to parse the command line (Status: %x)\n", Status);
return(FALSE);
}
0);
if (!NT_SUCCESS(Status))
{
- PrintString("Unable to create \\ApiPort (Status %x)\n", Status);
+ PrintString("CSR: Unable to create \\ApiPort (Status %x)\n", Status);
return(FALSE);
}
NULL);
if (!NT_SUCCESS(Status))
{
- PrintString("Unable to create server thread\n");
+ PrintString("CSR: Unable to create server thread\n");
NtClose(ApiPortHandle);
return FALSE;
}
DIST_DIR = dist
endif
+
ifeq ($(HOST),mingw32-windows)
PREFIX =
EXE_POSTFIX = .exe
CC = $(PREFIX)gcc
NATIVE_CC = gcc
-CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-builtin \
- $(LEAN_AND_MEAN_DEFINE) $(DEFINES) $(DEBUGGING_CFLAGS) \
- $(EXTRA_CFLAGS)
+CFLAGS = \
+ -pipe \
+ -O2 \
+ -Wall \
+ -Wstrict-prototypes \
+ -fno-builtin \
+ $(LEAN_AND_MEAN_DEFINE) \
+ $(DEFINES) \
+ $(DEBUGGING_CFLAGS) \
+ $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
LD = $(PREFIX)ld
NM = $(PREFIX)nm
CPP = $(PREFIX)cpp
AR = $(PREFIX)ar
RC = $(PREFIX)windres
+RCINC = --include-dir ../reactos/include --include-dir ../../reactos/include --include-dir ../../../reactos/include
+%.o: %.cc
+ $(CC) $(CFLAGS) -c $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
+%.o: %.asm
+ $(NASM_CMD) $(NFLAGS) $< -o $@
%.coff: %.rc
- $(RC) $< $@
+ $(RC) $(RCINC) $< $@
+
RULES_MAK_INCLUDED = 1
//======================================================================
//
-// $Id: chkdsk.c,v 1.1 1999/05/16 07:27:35 ea Exp $
+// $Id: chkdsk.c,v 1.2 2000/02/29 23:57:46 ea Exp $
//
// Chkdskx
//
#define UNICODE
#include <windows.h>
#include <stdio.h>
-#include "fmifs.h"
+#include <fmifs.h>
#define _UNICODE 1
#include <tchar.h>
#include "config.h"
//
// FMIFS function
//
-PCHKDSK Chkdsk;
+//PCHKDSK ChkDsk;
#endif /* ndef FMIFS_IMPORT_DLL */
BOOLEAN gotFix = FALSE;
BOOLEAN gotVerbose = FALSE;
BOOLEAN gotClean = FALSE;
- BOOLEAN gotScan = FALSE;
+ /*BOOLEAN gotScan = FALSE;*/
for ( i = 1;
//
//----------------------------------------------------------------------
BOOLEAN
-__stdcall
+STDCALL
ChkdskCallback(
CALLBACKCOMMAND Command,
DWORD Modifier,
//
switch( Command )
{
+ case UNKNOWN2:
+ wprintf(L"UNKNOWN2\r");
+ break;
+
+ case UNKNOWN3:
+ wprintf(L"UNKNOWN3\r");
+ break;
+
+ case UNKNOWN4:
+ wprintf(L"UNKNOWN4\r");
+ break;
+
+ case UNKNOWN5:
+ wprintf(L"UNKNOWN5\r");
+ break;
+
+ case UNKNOWN7:
+ wprintf(L"UNKNOWN7\r");
+ break;
+
+ case UNKNOWN8:
+ wprintf(L"UNKNOWN8\r");
+ break;
+
+ case UNKNOWN9:
+ wprintf(L"UNKNOWN9\r");
+ break;
+
+ case UNKNOWNA:
+ wprintf(L"UNKNOWNA\r");
+ break;
+
+ case UNKNOWNC:
+ wprintf(L"UNKNOWNC\r");
+ break;
+
+ case UNKNOWND:
+ wprintf(L"UNKNOWND\r");
+ break;
+
+ case INSUFFICIENTRIGHTS:
+ wprintf(L"INSUFFICIENTRIGHTS\r");
+ break;
+
+ case STRUCTUREPROGRESS:
+ wprintf(L"STRUCTUREPROGRESS\r");
+ break;
+
+ case DONEWITHSTRUCTURE:
+ wprintf(L"DONEWITHSTRUCTURE\r");
+ break;
+
case PROGRESS:
percent = (PDWORD) Argument;
- _tprintf(L"%d percent completed.\r", *percent);
+ wprintf(L"%d percent completed.\r", *percent);
break;
case OUTPUT:
output = (PTEXTOUTPUT) Argument;
- fprintf(stdout, "%s", output->Output);
+ fwprintf(stdout, L"%s", output->Output);
break;
case DONE:
status = (PBOOLEAN) Argument;
- if( *status == TRUE ) {
-
- _tprintf(L"Chkdsk was unable to complete successfully.\n\n");
+ if ( *status == TRUE )
+ {
+ wprintf(L"Chkdsk was unable to complete successfully.\n\n");
Error = TRUE;
}
break;
//
// Loads FMIFS.DLL and locates the entry point(s) we are going to use
//
-// 19990216 EA User wide functions
+// 19990216 EA Used wide functions
//
//----------------------------------------------------------------------
BOOLEAN
{
LoadLibraryW( L"fmifs.dll" );
- if( !(Chkdsk =
+ if( !(ChkDsk =
(void *) GetProcAddress(
GetModuleHandleW(L"fmifs.dll"),
"Chkdsk" ))
wprintf(
L"\n\
-Chkdskx v1.0 by Mark Russinovich\n\
+Chkdskx v1.0.1 by Mark Russinovich\n\
Systems Internals - http://www.sysinternals.com/\n\
ReactOS adaptation 1999 by Emanuele Aliberti\n\n"
);
//
if( (badArg = ParseCommandLine( argc, argv )))
{
- wprintf(L"Unknown argument: %s\n", argv[badArg] );
+ wprintf(
+ L"Unknown argument: %s\n",
+ argv[badArg]
+ );
Usage(argv[0]);
return -1;
);
if( volumeHandle == INVALID_HANDLE_VALUE )
{
- wprintf("Chdskx cannot run because the volume is in use by another process.\n\n");
+ wprintf(L"Chdskx cannot run because the volume is in use by another process.\n\n");
return -1;
}
CloseHandle( volumeHandle );
// Just do it
//
wprintf(
- "The type of file system is %s.\n",
+ L"The type of file system is %s.\n",
fileSystem
);
- Chkdsk(
+ ChkDsk(
Drive,
fileSystem,
FixErrors,
-/* $Id: chklib.c,v 1.1 1999/05/16 07:27:35 ea Exp $
+/* $Id: chklib.c,v 1.2 2000/02/29 23:57:46 ea Exp $
*
* chklib.c
*
* --------------------------------------------------------------------
*
* This software is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
+ * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
+ * General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public
- * License along with this software; see the file COPYING.LIB. If
+ * You should have received a copy of the GNU General Public
+ * License along with this software; see the file COPYING. If
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
* Cambridge, MA 02139, USA.
*
HINSTANCE dll;
TCHAR ModuleName [_MAX_PATH];
- if (argc != 2 && argc != 3)
+ if (argc < 2)
{
fprintf(
stderr,
ReactOS System Tools\n\
Check a Dynamic Link Library (DLL) for loading\n\
Copyright (c) 1998, 1999 Emanuele Aliberti\n\n\
-usage: %s module [symbol]\n",
+usage: %s module [symbol [, ...]]\n",
argv[0]
);
exit(EXIT_FAILURE);
#ifdef DISPLAY_VERSION
DisplayVersion(dll,ModuleName);
#endif
- if (argc == 3) DisplayEntryPoint( dll, argv[2] );
+ if (argc > 2)
+ {
+ int CurrentSymbol;
+
+ for ( CurrentSymbol = 2;
+ (CurrentSymbol < argc);
+ ++CurrentSymbol
+ )
+ {
+ DisplayEntryPoint( dll, argv[CurrentSymbol] );
+ }
+ }
FreeLibrary(dll);
printf(
"%s unloaded.\n",
//======================================================================
//
-// $Id: format.c,v 1.1 1999/05/16 07:27:35 ea Exp $
+// $Id: format.c,v 1.2 2000/02/29 23:57:46 ea Exp $
//
// Formatx
//
#define _UNICODE 1
#include <windows.h>
#include <stdio.h>
-#include "fmifs.h"
+#include "../../reactos/include/fmifs.h"
//#include <tchar.h>
#include "win32err.h"
#include "config.h"
-# $Id: makefile,v 1.2 1999/10/03 22:12:07 ekohl Exp $
+# $Id: makefile,v 1.3 2000/02/29 23:57:47 ea Exp $
#
# ReactOS System Utilities
#
# 1999-03-16 (Emanuele Aliberti)
# Added regnav.c
#
+# 1999-12-19 (ea)
+# Added qsi.c
+#
ROSINC=../../reactos/include
-TARGET=regnav.exe
+TARGET=regnav.exe chklib.exe
# chkdsk.exe format.exe \
# chklib.exe shutdown.exe regnav.exe
# login.exe chklib.exe shutdown.exe regnav.exe
-lcrtdll \
-lfmifs
$(NM) --numeric-sort format.exe > format.sym
-#---
-#login.exe: login.o
-# $(CC) login.o \
-# -o login.exe \
-# -lntdll \
-# -Wl,--subsystem native:4.0
-# $(NM) --numeric-sort login.exe > login.sym
+#---
chklib.exe: chklib.o win32err.o
$(CC) chklib.o win32err.o \
-lcrtdll
$(NM) --numeric-sort shutdown.exe > shutdown.sym
+qsi.exe: qsi.o
+ $(CC) qsi.o \
+ ../../reactos/lib/ntdll/ntdll.a
+ -o qsi.exe \
+ -lkernel32 \
+ -lcrtdll
+ $(NM) --numeric-sort qsi.exe > qsi.sym
+
+qsi.o: qsi.c
+
#---
CLEAN_FILES = *.o *.exe *.sym