diff --git a/reactos/Makefile b/reactos/Makefile index ccaae4074d2..da91ea6994b 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -64,7 +64,7 @@ STORAGE_DRIVERS = class2 scsiport atapi disk cdrom # system applications (required for startup) # #SYS_APPS = lsass -SYS_APPS = services shell winlogon +SYS_APPS = services shell winlogon autochk #readfile APPS = args hello test cat bench apc shm lpc thread event file gditest \ diff --git a/reactos/install.bat b/reactos/install.bat index ab337d19136..dc39d3e7179 100644 --- a/reactos/install.bat +++ b/reactos/install.bat @@ -52,6 +52,7 @@ copy services\storage\scsiport\scsiport.sys %ROS_INSTALL%\system32\drivers copy services\storage\cdrom\cdrom.sys %ROS_INSTALL%\system32\drivers copy services\storage\disk\disk.sys %ROS_INSTALL%\system32\drivers copy services\storage\class2\class2.sys %ROS_INSTALL%\system32\drivers +copy apps\system\autochk\autochk.exe %ROS_INSTALL%\system32 copy apps\system\shell\shell.exe %ROS_INSTALL%\system32 copy apps\system\winlogon\winlogon.exe %ROS_INSTALL%\system32 copy apps\system\services\services.exe %ROS_INSTALL%\system32 diff --git a/reactos/ntoskrnl/cm/import.c b/reactos/ntoskrnl/cm/import.c index 75ae85dffcc..6787f9a20c5 100644 --- a/reactos/ntoskrnl/cm/import.c +++ b/reactos/ntoskrnl/cm/import.c @@ -1,4 +1,4 @@ -/* $Id: import.c,v 1.5 2002/04/27 19:00:14 ekohl Exp $ +/* $Id: import.c,v 1.6 2002/05/24 07:42:19 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -234,6 +234,14 @@ getKeyValueTypeFromChunk (PCHAR regChunk, PCHAR dataFormat, int *keyValueType) if (*regChunk == ':') regChunk++; } + else if (strncmp (regChunk, "expand", 6) == 0) + { + strcpy (dataFormat, "expand"); + *keyValueType = REG_EXPAND_SZ; + regChunk += 6; + if (*regChunk == ':') + regChunk++; + } else { UNIMPLEMENTED; @@ -315,6 +323,18 @@ computeKeyValueDataSize (PCHAR regChunk, PCHAR dataFormat) dataSize++; dataSize++; } + else if (strcmp (dataFormat, "expand") == 0) + { + regChunk++; + while (*regChunk != 0 && *regChunk != '\"') + { + dataSize++; + dataSize++; + regChunk++; + } + dataSize++; + dataSize++; + } else { UNIMPLEMENTED; @@ -417,6 +437,18 @@ getKeyValueDataFromChunk (PCHAR regChunk, PCHAR dataFormat, PCHAR data) } *ptr = 0; } + else if (strcmp (dataFormat, "expand") == 0) + { + /* convert quoted string to zero-terminated Unicode string */ + ptr = (PWCHAR)data; + regChunk++; + while (*regChunk != 0 && *regChunk != '\"') + { + *ptr++ = (WCHAR)*regChunk++; + } + *ptr = 0; + regChunk++; + } else { UNIMPLEMENTED; @@ -572,7 +604,7 @@ CmImportHive(PCHAR ChunkBase, ExFreePool (data); } - return; + return; } diff --git a/reactos/ntoskrnl/io/fs.c b/reactos/ntoskrnl/io/fs.c index b3ade7fb2af..18bbabdc1fd 100644 --- a/reactos/ntoskrnl/io/fs.c +++ b/reactos/ntoskrnl/io/fs.c @@ -1,4 +1,4 @@ -/* $Id: fs.c,v 1.26 2002/05/15 09:39:02 ekohl Exp $ +/* $Id: fs.c,v 1.27 2002/05/24 07:44:56 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -449,6 +449,8 @@ IoVerifyVolume(IN PDEVICE_OBJECT DeviceObject, FALSE, NULL); + DeviceObject->Flags &= ~DO_VERIFY_VOLUME; + if (DeviceObject->Vpb->Flags & VPB_MOUNTED) { /* Issue verify request to the FSD */ @@ -469,7 +471,6 @@ IoVerifyVolume(IN PDEVICE_OBJECT DeviceObject, } Irp->UserIosb = &IoStatusBlock; - DPRINT("Irp->UserIosb %x\n", Irp->UserIosb); Irp->UserEvent = Event; Irp->Tail.Overlay.Thread = PsGetCurrentThread(); @@ -505,10 +506,11 @@ IoVerifyVolume(IN PDEVICE_OBJECT DeviceObject, if (Status == STATUS_WRONG_VOLUME) { - /* FIXME: Replace existing VPB by a new one */ - DPRINT1("Wrong volume!\n"); - + /* Clean existing VPB. This unmounts the filesystem (in an ugly way). */ + DPRINT("Wrong volume!\n"); + DeviceObject->Vpb->DeviceObject = NULL; + DeviceObject->Vpb->Flags &= ~VPB_MOUNTED; } /* Start mount sequence */ diff --git a/reactos/subsys/smss/init.c b/reactos/subsys/smss/init.c index 0e9e09168d4..7a2e0c80ea8 100644 --- a/reactos/subsys/smss/init.c +++ b/reactos/subsys/smss/init.c @@ -1,4 +1,4 @@ -/* $Id: init.c,v 1.34 2002/05/22 15:55:51 ekohl Exp $ +/* $Id: init.c,v 1.35 2002/05/24 07:49:41 ekohl Exp $ * * init.c - Session Manager initialization * @@ -26,6 +26,9 @@ * 19990530 (Emanuele Aliberti) * Compiled successfully with egcs 1.1.2 */ + +/* INCLUDES *****************************************************************/ + #include #include #include @@ -34,12 +37,9 @@ #define NDEBUG -/* TYPES ********************************************************************/ +/* GLOBALS ******************************************************************/ -/* GLOBAL VARIABLES *********************************************************/ - -HANDLE SmApiPort = INVALID_HANDLE_VALUE; HANDLE DbgSsApiPort = INVALID_HANDLE_VALUE; HANDLE DbgUiApiPort = INVALID_HANDLE_VALUE; @@ -48,7 +48,6 @@ PWSTR SmSystemEnvironment = NULL; /* FUNCTIONS ****************************************************************/ - static NTSTATUS STDCALL SmObjectDirectoryQueryRoutine(PWSTR ValueName, ULONG ValueType, @@ -60,12 +59,16 @@ SmObjectDirectoryQueryRoutine(PWSTR ValueName, OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING UnicodeString; HANDLE WindowsDirectory; - NTSTATUS Status; + NTSTATUS Status = STATUS_SUCCESS; #ifndef NDEBUG PrintString("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); PrintString("ValueData '%S'\n", (PWSTR)ValueData); #endif + if (ValueType != REG_SZ) + { + return(STATUS_SUCCESS); + } RtlInitUnicodeString(&UnicodeString, (PWSTR)ValueData); @@ -119,46 +122,49 @@ SmDosDevicesQueryRoutine(PWSTR ValueName, UNICODE_STRING LinkName; HANDLE LinkHandle; WCHAR LinkBuffer[80]; - NTSTATUS Status = STATUS_SUCCESS; + NTSTATUS Status; #ifndef NDEBUG PrintString("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); PrintString("ValueData '%S'\n", (PWSTR)ValueData); #endif - if (ValueType = REG_SZ) + if (ValueType != REG_SZ) { - swprintf(LinkBuffer, L"\\??\\%s", - ValueName); - RtlInitUnicodeString(&LinkName, - LinkBuffer); - RtlInitUnicodeString(&DeviceName, - (PWSTR)ValueData); + return(STATUS_SUCCESS); + } + + swprintf(LinkBuffer, + L"\\??\\%s", + ValueName); + RtlInitUnicodeString(&LinkName, + LinkBuffer); + RtlInitUnicodeString(&DeviceName, + (PWSTR)ValueData); #ifndef NDEBUG - PrintString("SM: Linking %wZ --> %wZ\n", - &LinkName, - &DeviceName); + PrintString("SM: Linking %wZ --> %wZ\n", + &LinkName, + &DeviceName); #endif - /* create symbolic link */ - InitializeObjectAttributes(&ObjectAttributes, - &LinkName, - OBJ_PERMANENT, - NULL, - NULL); - Status = NtCreateSymbolicLinkObject(&LinkHandle, - SYMBOLIC_LINK_ALL_ACCESS, - &ObjectAttributes, - &DeviceName); - if (!NT_SUCCESS(Status)) - { - PrintString("SmDosDevicesQueryRoutine: NtCreateSymbolicLink( %wZ --> %wZ ) failed!\n", - &LinkName, - &DeviceName); - } - NtClose(LinkHandle); + /* create symbolic link */ + InitializeObjectAttributes(&ObjectAttributes, + &LinkName, + OBJ_PERMANENT, + NULL, + NULL); + Status = NtCreateSymbolicLinkObject(&LinkHandle, + SYMBOLIC_LINK_ALL_ACCESS, + &ObjectAttributes, + &DeviceName); + if (!NT_SUCCESS(Status)) + { + PrintString("SmDosDevicesQueryRoutine: NtCreateSymbolicLink( %wZ --> %wZ ) failed!\n", + &LinkName, + &DeviceName); } + NtClose(LinkHandle); return(Status); } @@ -192,36 +198,43 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, PVOID Context, PVOID EntryContext) { -#if 0 PRTL_USER_PROCESS_PARAMETERS ProcessParameters; RTL_PROCESS_INFO ProcessInfo; + UNICODE_STRING ImagePathString; + UNICODE_STRING CommandLineString; WCHAR Description[256]; + WCHAR ImageName[256]; WCHAR ImagePath[256]; WCHAR CommandLine[256]; PWSTR p1, p2; ULONG len; - NTSTATUS Status = STATUS_SUCCESS; + NTSTATUS Status; #ifndef NDEBUG PrintString("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); PrintString("ValueData '%S'\n", (PWSTR)ValueData); #endif + if (ValueType != REG_SZ) + { + return(STATUS_SUCCESS); + } + /* Extract the description */ p1 = wcschr((PWSTR)ValueData, L' '); len = p1 - (PWSTR)ValueData; memcpy(Description,ValueData, len * sizeof(WCHAR)); Description[len] = 0; - /* Extract the full image path */ + /* Extract the image name */ p1++; p2 = wcschr(p1, L' '); if (p2 != NULL) len = p2 - p1; else len = wcslen(p1); - memcpy(ImagePath, p1, len * sizeof(WCHAR)); - ImagePath[len] = 0; + memcpy(ImageName, p1, len * sizeof(WCHAR)); + ImageName[len] = 0; /* Extract the command line */ if (p2 == NULL) @@ -234,19 +247,19 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, wcscpy(CommandLine, p2); } -#ifndef NDEBUG PrintString("Running %S...\n", Description); - PrintString("Executable: '%S'\n", ImagePath); +#ifndef NDEBUG + PrintString("ImageName: '%S'\n", ImageName); PrintString("CommandLine: '%S'\n", CommandLine); #endif -#if 0 /* initialize executable path */ - wcscpy(UnicodeBuffer, L"\\??\\"); - wcscat(UnicodeBuffer, SharedUserData->NtSystemRoot); - wcscat(UnicodeBuffer, L"\\system32\\csrss.exe"); + wcscpy(ImagePath, L"\\SystemRoot\\system32\\"); + wcscat(ImagePath, ImageName); + wcscat(ImagePath, L".exe"); + RtlInitUnicodeString(&ImagePathString, - UnicodeBuffer); + ImagePath); RtlInitUnicodeString(&CommandLineString, CommandLine); @@ -262,7 +275,7 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, NULL, NULL); - Status = RtlCreateUserProcess(&UnicodeString, + Status = RtlCreateUserProcess(&ImagePathString, OBJ_CASE_INSENSITIVE, ProcessParameters, NULL, @@ -272,15 +285,22 @@ SmRunBootAppsQueryRoutine(PWSTR ValueName, NULL, NULL, &ProcessInfo); + if (!NT_SUCCESS(Status)) + { + PrintString("Running %s failed (Status %lx)\n", Description, Status); + return(STATUS_SUCCESS); + } - RtlDestroyProcessParameters (ProcessParameters); + RtlDestroyProcessParameters(ProcessParameters); - /* FIXME: wait for process termination */ + /* Wait for process termination */ + NtWaitForSingleObject(ProcessInfo.ProcessHandle, + FALSE, + NULL); -#endif + NtClose(ProcessInfo.ThreadHandle); + NtClose(ProcessInfo.ProcessHandle); - return(Status); -#endif return(STATUS_SUCCESS); } @@ -316,9 +336,6 @@ SmRunBootApps(VOID) PrintString("SmRunBootApps: RtlQueryRegistryValues() failed! (Status %lx)\n", Status); } -// PrintString("*** System stopped ***\n"); -// for(;;); - return(Status); } @@ -330,6 +347,8 @@ SmProcessFileRenameList(VOID) PrintString("SmProcessFileRenameList() called\n"); #endif + /* FIXME: implement it! */ + #ifndef NDEBUG PrintString("SmProcessFileRenameList() done\n"); #endif @@ -338,6 +357,23 @@ SmProcessFileRenameList(VOID) } +static NTSTATUS +SmPreloadDlls(VOID) +{ +#ifndef NDEBUG + PrintString("SmPreloadDlls() called\n"); +#endif + + /* FIXME: implement it! */ + +#ifndef NDEBUG + PrintString("SmPreloadDlls() done\n"); +#endif + + return(STATUS_SUCCESS); +} + + static NTSTATUS STDCALL SmPagingFilesQueryRoutine(PWSTR ValueName, ULONG ValueType, @@ -356,6 +392,11 @@ SmPagingFilesQueryRoutine(PWSTR ValueName, PrintString("ValueData '%S'\n", (PWSTR)ValueData); #endif + if (ValueType != REG_SZ) + { + return(STATUS_SUCCESS); + } + RtlInitUnicodeString(&FileName, (PWSTR)ValueData); @@ -400,9 +441,52 @@ SmCreatePagingFiles(VOID) } +#if 0 +static NTSTATUS STDCALL +SmEnvironmentQueryRoutine(PWSTR ValueName, + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) +{ +// NTSTATUS Status; + +//#ifndef NDEBUG + PrintString("ValueName '%S' Type %lu Length %lu\n", ValueName, ValueType, ValueLength); + PrintString("ValueData '%S'\n", (PWSTR)ValueData); +//#endif + +// return(Status); + return(STATUS_SUCCESS); +} +#endif + + static NTSTATUS SmSetEnvironmentVariables(VOID) { +#if 0 + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + NTSTATUS Status; + + RtlZeroMemory(&QueryTable, + sizeof(QueryTable)); + + QueryTable[0].QueryRoutine = SmEnvironmentQueryRoutine; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, + L"\\Session Manager\\Environment", + QueryTable, + NULL, + NULL); + + PrintString("*** System stopped ***\n"); + for(;;); + + return(Status); +#endif +//#if 0 UNICODE_STRING EnvVariable; UNICODE_STRING EnvValue; UNICODE_STRING EnvExpandedValue; @@ -494,6 +578,7 @@ SmSetEnvironmentVariables(VOID) &EnvExpandedValue); return(STATUS_SUCCESS); +//#endif } @@ -513,72 +598,32 @@ InitSessionManager(HANDLE Children[]) Status = SmCreateObjectDirectories(); if (!NT_SUCCESS(Status)) { - PrintString("SM: Failed to create object directories! (Status %lx)\n", Status); + PrintString("SM: Failed to create object directories (Status %lx)\n", Status); return(Status); } - /* Create the "\SmApiPort" object (LPC) */ - RtlInitUnicodeString(&UnicodeString, - L"\\SmApiPort"); - InitializeObjectAttributes(&ObjectAttributes, - &UnicodeString, - PORT_ALL_ACCESS, - NULL, - NULL); - - Status = NtCreatePort(&SmApiPort, - &ObjectAttributes, - 0, - 0, - 0); + /* Create the SmApiPort object (LPC) */ + Status = SmCreateApiPort(); if (!NT_SUCCESS(Status)) { + PrintString("SM: Failed to create SmApiPort (Status %lx)\n", Status); return(Status); } -#ifndef NDEBUG - DisplayString (L"SM: \\SmApiPort created...\n"); -#endif - - /* Create two threads for "\SmApiPort" */ - RtlCreateUserThread(NtCurrentProcess(), - NULL, - FALSE, - 0, - NULL, - NULL, - (PTHREAD_START_ROUTINE)SmApiThread, - (PVOID)SmApiPort, - NULL, - NULL); - - RtlCreateUserThread(NtCurrentProcess(), - NULL, - FALSE, - 0, - NULL, - NULL, - (PTHREAD_START_ROUTINE)SmApiThread, - (PVOID)SmApiPort, - NULL, - NULL); - /* Create the system environment */ Status = RtlCreateEnvironment(FALSE, &SmSystemEnvironment); if (!NT_SUCCESS(Status)) { + PrintString("SM: Failed to create the system environment (Status %lx)\n", Status); return(Status); } -#ifndef NDEBUG - DisplayString(L"SM: System Environment created\n"); -#endif /* Define symbolic links to kernel devices (MS-DOS names) */ Status = SmInitDosDevices(); if (!NT_SUCCESS(Status)) { - PrintString("SM: Failed to create dos device links! (Status %lx)\n", Status); + PrintString("SM: Failed to create dos device links (Status %lx)\n", Status); return(Status); } @@ -586,7 +631,7 @@ InitSessionManager(HANDLE Children[]) Status = SmRunBootApps(); if (!NT_SUCCESS(Status)) { - PrintString("SM: Failed to run boot applications! (Status %lx)\n", Status); + PrintString("SM: Failed to run boot applications (Status %lx)\n", Status); return(Status); } @@ -598,8 +643,13 @@ InitSessionManager(HANDLE Children[]) return(Status); } - /* FIXME: Load the well known DLLs */ -// SmPreloadDlls(); + /* Load the well known DLLs */ + Status = SmPreloadDlls(); + if (!NT_SUCCESS(Status)) + { + PrintString("SM: Failed to preload system DLLs (Status %lx)\n", Status); + return(Status); + } /* Create paging files */ Status = SmCreatePagingFiles(); @@ -616,7 +666,7 @@ InitSessionManager(HANDLE Children[]) Status = SmSetEnvironmentVariables(); if (!NT_SUCCESS(Status)) { - PrintString("SM: Failed to initialize the system environment (Status %lx)\n", Status); + PrintString("SM: Failed to set system environment variables (Status %lx)\n", Status); return(Status); } diff --git a/reactos/subsys/smss/smapi.c b/reactos/subsys/smss/smapi.c index 25a3c0e557f..e27524033be 100644 --- a/reactos/subsys/smss/smapi.c +++ b/reactos/subsys/smss/smapi.c @@ -1,4 +1,4 @@ -/* $Id: smapi.c,v 1.5 2002/02/08 02:57:10 chorns Exp $ +/* $Id: smapi.c,v 1.6 2002/05/24 07:49:41 ekohl Exp $ * * Reactos Session Manager * @@ -6,62 +6,120 @@ */ #include +#include #include #include "smss.h" #define NDEBUG +/* GLOBAL VARIABLES *********************************************************/ + +static HANDLE SmApiPort = INVALID_HANDLE_VALUE; + +/* FUNCTIONS ****************************************************************/ + VOID STDCALL -SmApiThread (HANDLE Port) +SmApiThread(HANDLE Port) { - NTSTATUS Status; - ULONG Unknown; - PLPC_MESSAGE Reply = NULL; - LPC_MESSAGE Message; + NTSTATUS Status; + ULONG Unknown; + PLPC_MESSAGE Reply = NULL; + LPC_MESSAGE Message; #ifndef NDEBUG - DisplayString (L"SmApiThread: running\n"); + DisplayString(L"SmApiThread: running\n"); #endif - for (;;) + while (TRUE) { #ifndef NDEBUG - DisplayString (L"SmApiThread: waiting for message\n"); + DisplayString(L"SmApiThread: waiting for message\n"); #endif - Status = NtReplyWaitReceivePort (Port, - &Unknown, - Reply, - &Message); - if (NT_SUCCESS(Status)) - { + Status = NtReplyWaitReceivePort(Port, + &Unknown, + Reply, + &Message); + if (NT_SUCCESS(Status)) + { #ifndef NDEBUG - DisplayString (L"SmApiThread: message received\n"); + DisplayString(L"SmApiThread: message received\n"); #endif - if (Message.MessageType == LPC_CONNECTION_REQUEST) - { -// SmHandleConnectionRequest (Port, &Message); - Reply = NULL; - } - else if (Message.MessageType == LPC_DEBUG_EVENT) - { -// DbgSsHandleKmApiMsg (&Message, 0); - Reply = NULL; - } - else if (Message.MessageType == LPC_PORT_CLOSED) - { - Reply = NULL; - } - else - { - -// Reply = &Message; - } - } + if (Message.MessageType == LPC_CONNECTION_REQUEST) + { +// SmHandleConnectionRequest (Port, &Message); + Reply = NULL; + } + else if (Message.MessageType == LPC_DEBUG_EVENT) + { +// DbgSsHandleKmApiMsg (&Message, 0); + Reply = NULL; + } + else if (Message.MessageType == LPC_PORT_CLOSED) + { + Reply = NULL; + } + else + { +// Reply = &Message; + } + } } } + +NTSTATUS +SmCreateApiPort(VOID) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING UnicodeString; + NTSTATUS Status; + + RtlInitUnicodeString(&UnicodeString, + L"\\SmApiPort"); + InitializeObjectAttributes(&ObjectAttributes, + &UnicodeString, + PORT_ALL_ACCESS, + NULL, + NULL); + + Status = NtCreatePort(&SmApiPort, + &ObjectAttributes, + 0, + 0, + 0); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + /* Create two threads for "\SmApiPort" */ + RtlCreateUserThread(NtCurrentProcess(), + NULL, + FALSE, + 0, + NULL, + NULL, + (PTHREAD_START_ROUTINE)SmApiThread, + (PVOID)SmApiPort, + NULL, + NULL); + + RtlCreateUserThread(NtCurrentProcess(), + NULL, + FALSE, + 0, + NULL, + NULL, + (PTHREAD_START_ROUTINE)SmApiThread, + (PVOID)SmApiPort, + NULL, + NULL); + + return(Status); +} + /* EOF */ diff --git a/reactos/subsys/smss/smss.c b/reactos/subsys/smss/smss.c index 775d33370b7..d81c85d99dd 100644 --- a/reactos/subsys/smss/smss.c +++ b/reactos/subsys/smss/smss.c @@ -1,4 +1,4 @@ -/* $Id: smss.c,v 1.10 2002/05/22 15:55:51 ekohl Exp $ +/* $Id: smss.c,v 1.11 2002/05/24 07:49:41 ekohl Exp $ * * smss.c - Session Manager * @@ -32,34 +32,33 @@ void -DisplayString( LPCWSTR lpwString ) +DisplayString(LPCWSTR lpwString) { - UNICODE_STRING us; + UNICODE_STRING us; - RtlInitUnicodeString (&us, lpwString); - NtDisplayString (&us); + RtlInitUnicodeString(&us, lpwString); + NtDisplayString(&us); } void -PrintString (char* fmt,...) +PrintString(char* fmt,...) { - char buffer[512]; - va_list ap; - UNICODE_STRING UnicodeString; - ANSI_STRING AnsiString; + char buffer[512]; + va_list ap; + UNICODE_STRING UnicodeString; + ANSI_STRING AnsiString; - va_start(ap, fmt); - vsprintf(buffer, fmt, ap); - va_end(ap); + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); - RtlInitAnsiString (&AnsiString, buffer); - RtlAnsiStringToUnicodeString ( - &UnicodeString, - &AnsiString, - TRUE); - NtDisplayString(&UnicodeString); - RtlFreeUnicodeString (&UnicodeString); + RtlInitAnsiString(&AnsiString, buffer); + RtlAnsiStringToUnicodeString(&UnicodeString, + &AnsiString, + TRUE); + NtDisplayString(&UnicodeString); + RtlFreeUnicodeString(&UnicodeString); } @@ -78,20 +77,12 @@ NtProcessStartup(PPEB Peb) goto ByeBye; } -#if 0 Status = NtWaitForMultipleObjects(((LONG) sizeof(Children) / sizeof(HANDLE)), Children, WaitAny, TRUE, /* alertable */ NULL); /* NULL for infinite */ -#endif - - Status = NtWaitForSingleObject(Children[CHILD_WINLOGON], - TRUE, /* alertable */ - NULL); - -// if (!NT_SUCCESS(Status)) - if (Status > 1) + if (!NT_SUCCESS(Status)) { PrintString("SM: NtWaitForMultipleObjects failed!\n"); } diff --git a/reactos/subsys/smss/smss.h b/reactos/subsys/smss/smss.h index 13034385eea..295f1a3b1dc 100644 --- a/reactos/subsys/smss/smss.h +++ b/reactos/subsys/smss/smss.h @@ -9,7 +9,7 @@ /* GLOBAL VARIABLES ****/ -extern HANDLE SmApiPort; +//extern HANDLE SmApiPort; /* FUNCTIONS ***********/ @@ -25,6 +25,10 @@ void PrintString (char* fmt,...); /* smapi.c */ + +NTSTATUS +SmCreateApiPort(VOID); + VOID STDCALL SmApiThread(HANDLE Port); diff --git a/reactos/subsys/system/autochk/autochk.c b/reactos/subsys/system/autochk/autochk.c new file mode 100644 index 00000000000..9d68957a9e2 --- /dev/null +++ b/reactos/subsys/system/autochk/autochk.c @@ -0,0 +1,89 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or 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 program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: autochk.c,v 1.1 2002/05/24 07:51:01 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: apps/system/autochk/autochk.c + * PURPOSE: Filesystem checker + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +/* FUNCTIONS ****************************************************************/ + +void +DisplayString(LPCWSTR lpwString) +{ + UNICODE_STRING us; + + RtlInitUnicodeString(&us, lpwString); + NtDisplayString(&us); +} + + +void +PrintString(char* fmt,...) +{ + char buffer[512]; + va_list ap; + UNICODE_STRING UnicodeString; + ANSI_STRING AnsiString; + + va_start(ap, fmt); + vsprintf(buffer, fmt, ap); + va_end(ap); + + RtlInitAnsiString(&AnsiString, buffer); + RtlAnsiStringToUnicodeString(&UnicodeString, + &AnsiString, + TRUE); + NtDisplayString(&UnicodeString); + RtlFreeUnicodeString(&UnicodeString); +} + + +/* Native image's entry point */ + +VOID +NtProcessStartup(PPEB Peb) +{ + ULONG i; + + PrintString("Autochk 0.0.1\n"); + + for (i = 0; i < 26; i++) + { + if ((SharedUserData->DosDeviceMap & (1 << i)) && + (SharedUserData->DosDeviceDriveType[i] == DOSDEVICE_DRIVE_FIXED)) + { + PrintString(" Checking drive %c:", 'A'+i); + PrintString(" OK\n"); + } + } + PrintString("\n"); + + NtTerminateProcess(NtCurrentProcess(), 0); +} + +/* EOF */ diff --git a/reactos/subsys/system/autochk/autochk.rc b/reactos/subsys/system/autochk/autochk.rc new file mode 100644 index 00000000000..270e3922d0e --- /dev/null +++ b/reactos/subsys/system/autochk/autochk.rc @@ -0,0 +1,38 @@ +#include +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +VS_VERSION_INFO VERSIONINFO + FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD + PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", RES_STR_COMPANY_NAME + VALUE "FileDescription", "File system checker\0" + VALUE "FileVersion", RES_STR_FILE_VERSION + VALUE "InternalName", "autochk\0" + VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "autochk.exe\0" + VALUE "ProductName", RES_STR_PRODUCT_NAME + VALUE "ProductVersion", RES_STR_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + diff --git a/reactos/subsys/system/autochk/makefile b/reactos/subsys/system/autochk/makefile new file mode 100644 index 00000000000..f4577d093c2 --- /dev/null +++ b/reactos/subsys/system/autochk/makefile @@ -0,0 +1,21 @@ +# $Id: makefile,v 1.1 2002/05/24 07:51:01 ekohl Exp $ + +PATH_TO_TOP = ../../.. + +TARGET_TYPE = program + +TARGET_APPTYPE = native + +TARGET_NAME = autochk + +TARGET_INSTALLDIR = system32 + +TARGET_CFLAGS = -D__NTAPP__ + +TARGET_OBJECTS = $(TARGET_NAME).o + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF