mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[FORMATTING]
Generalize formatting a bit, normalize file's header svn path=/trunk/; revision=22354
This commit is contained in:
parent
7436b68377
commit
bd98cae02e
1 changed files with 49 additions and 67 deletions
|
@ -1,28 +1,9 @@
|
||||||
/*
|
|
||||||
* 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$
|
/* $Id$
|
||||||
*
|
* PROJECT: ReactOS Kernel
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* FILE: base/system/autochk/autochk.c
|
||||||
* FILE: apps/system/autochk/autochk.c
|
* PURPOSE: Filesystem checker
|
||||||
* PURPOSE: Filesystem checker
|
* PROGRAMMERS: Eric Kohl
|
||||||
* PROGRAMMER: Eric Kohl
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -38,68 +19,69 @@
|
||||||
void
|
void
|
||||||
DisplayString(LPCWSTR lpwString)
|
DisplayString(LPCWSTR lpwString)
|
||||||
{
|
{
|
||||||
UNICODE_STRING us;
|
UNICODE_STRING us;
|
||||||
|
|
||||||
RtlInitUnicodeString(&us, lpwString);
|
RtlInitUnicodeString(&us, lpwString);
|
||||||
NtDisplayString(&us);
|
NtDisplayString(&us);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PrintString(char* fmt,...)
|
PrintString(char* fmt,...)
|
||||||
{
|
{
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
UNICODE_STRING UnicodeString;
|
UNICODE_STRING UnicodeString;
|
||||||
ANSI_STRING AnsiString;
|
ANSI_STRING AnsiString;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsprintf(buffer, fmt, ap);
|
vsprintf(buffer, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
RtlInitAnsiString(&AnsiString, buffer);
|
RtlInitAnsiString(&AnsiString, buffer);
|
||||||
RtlAnsiStringToUnicodeString(&UnicodeString,
|
RtlAnsiStringToUnicodeString(&UnicodeString,
|
||||||
&AnsiString,
|
&AnsiString,
|
||||||
TRUE);
|
TRUE);
|
||||||
NtDisplayString(&UnicodeString);
|
NtDisplayString(&UnicodeString);
|
||||||
RtlFreeUnicodeString(&UnicodeString);
|
RtlFreeUnicodeString(&UnicodeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Native image's entry point */
|
/* Native image's entry point */
|
||||||
|
int
|
||||||
int _cdecl
|
_cdecl
|
||||||
_main(int argc,
|
_main(int argc,
|
||||||
char *argv[],
|
char *argv[],
|
||||||
char *envp[],
|
char *envp[],
|
||||||
int DebugFlag)
|
int DebugFlag)
|
||||||
{
|
{
|
||||||
PROCESS_DEVICEMAP_INFORMATION DeviceMap;
|
PROCESS_DEVICEMAP_INFORMATION DeviceMap;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
PrintString("Autochk 0.0.1\n");
|
PrintString("Autochk 0.0.1\n");
|
||||||
|
|
||||||
Status = NtQueryInformationProcess(NtCurrentProcess(),
|
Status = NtQueryInformationProcess(NtCurrentProcess(),
|
||||||
ProcessDeviceMap,
|
ProcessDeviceMap,
|
||||||
&DeviceMap.Query,
|
&DeviceMap.Query,
|
||||||
sizeof(DeviceMap.Query),
|
sizeof(DeviceMap.Query),
|
||||||
NULL);
|
NULL);
|
||||||
if(NT_SUCCESS(Status))
|
|
||||||
{
|
if(NT_SUCCESS(Status))
|
||||||
for (i = 0; i < 26; i++)
|
{
|
||||||
{
|
for (i = 0; i < 26; i++)
|
||||||
if ((DeviceMap.Query.DriveMap & (1 << i)) &&
|
{
|
||||||
(DeviceMap.Query.DriveType[i] == DOSDEVICE_DRIVE_FIXED))
|
if ((DeviceMap.Query.DriveMap & (1 << i)) &&
|
||||||
{
|
(DeviceMap.Query.DriveType[i] == DOSDEVICE_DRIVE_FIXED))
|
||||||
PrintString(" Checking drive %c:", 'A'+i);
|
{
|
||||||
PrintString(" OK\n");
|
PrintString(" Checking drive %c:", 'A'+i);
|
||||||
}
|
PrintString(" OK\n");
|
||||||
}
|
}
|
||||||
PrintString("\n");
|
}
|
||||||
return 0;
|
PrintString("\n");
|
||||||
}
|
return 0;
|
||||||
return 1;
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue