mirror of
https://github.com/reactos/reactos.git
synced 2024-07-21 19:58:08 +00:00
cleanup
svn path=/trunk/; revision=490
This commit is contained in:
parent
cf7d159791
commit
3bc13b6875
|
@ -63,10 +63,13 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
hFile = CreateFile (arg[0], GENERIC_READ, FILE_SHARE_READ,
|
hFile = CreateFile (arg[0],
|
||||||
NULL, OPEN_EXISTING,
|
GENERIC_READ,
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
|
FILE_SHARE_READ,
|
||||||
NULL);
|
NULL,
|
||||||
|
OPEN_EXISTING,
|
||||||
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
@ -77,11 +80,17 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bResult = ReadFile (hFile, szBuffer, sizeof(szBuffer),
|
bResult = ReadFile (hFile,
|
||||||
&dwBytesRead, NULL);
|
szBuffer,
|
||||||
|
sizeof(szBuffer),
|
||||||
|
&dwBytesRead,
|
||||||
|
NULL);
|
||||||
if (dwBytesRead)
|
if (dwBytesRead)
|
||||||
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szBuffer, dwBytesRead,
|
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE),
|
||||||
&dwBytesWritten, NULL);
|
szBuffer,
|
||||||
|
dwBytesRead,
|
||||||
|
&dwBytesWritten,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
while (bResult && dwBytesRead > 0);
|
while (bResult && dwBytesRead > 0);
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/kernel32/file/file.c
|
* FILE: lib/kernel32/file/delete.c
|
||||||
* PURPOSE: Directory functions
|
* PURPOSE: Deleting files
|
||||||
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
|
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
|
||||||
* GetTempFileName is modified from WINE [ Alexandre Juiliard ]
|
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
* Created 01/11/98
|
* Created 01/11/98
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIXME: the large integer manipulations in this file dont handle overflow */
|
|
||||||
|
|
||||||
/* INCLUDES ****************************************************************/
|
/* INCLUDES ****************************************************************/
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -27,7 +24,7 @@ WINBOOL STDCALL DeleteFileA(LPCSTR lpFileName)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
WCHAR FileNameW[MAX_PATH];
|
WCHAR FileNameW[MAX_PATH];
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((*lpFileName)!=0 && i < MAX_PATH)
|
while ((*lpFileName)!=0 && i < MAX_PATH)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +43,7 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
|
||||||
NTSTATUS errCode;
|
NTSTATUS errCode;
|
||||||
WCHAR PathNameW[MAX_PATH];
|
WCHAR PathNameW[MAX_PATH];
|
||||||
UINT Len;
|
UINT Len;
|
||||||
|
|
||||||
if (lpFileName[1] != ':')
|
if (lpFileName[1] != ':')
|
||||||
{
|
{
|
||||||
Len = GetCurrentDirectoryW(MAX_PATH,PathNameW);
|
Len = GetCurrentDirectoryW(MAX_PATH,PathNameW);
|
||||||
|
@ -64,13 +61,13 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
|
||||||
FileNameString.Length = lstrlenW( PathNameW)*sizeof(WCHAR);
|
FileNameString.Length = lstrlenW( PathNameW)*sizeof(WCHAR);
|
||||||
if ( FileNameString.Length == 0 )
|
if ( FileNameString.Length == 0 )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (FileNameString.Length > MAX_PATH*sizeof(WCHAR))
|
if (FileNameString.Length > MAX_PATH*sizeof(WCHAR))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
FileNameString.Buffer = (WCHAR *)PathNameW;
|
FileNameString.Buffer = (WCHAR *)PathNameW;
|
||||||
FileNameString.MaximumLength = FileNameString.Length+sizeof(WCHAR);
|
FileNameString.MaximumLength = FileNameString.Length+sizeof(WCHAR);
|
||||||
|
|
||||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||||
ObjectAttributes.RootDirectory = NULL;
|
ObjectAttributes.RootDirectory = NULL;
|
||||||
ObjectAttributes.ObjectName = &FileNameString;
|
ObjectAttributes.ObjectName = &FileNameString;
|
||||||
|
@ -86,4 +83,3 @@ WINBOOL STDCALL DeleteFileW(LPCWSTR lpFileName)
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue