Removed obsolete code

svn path=/trunk/; revision=1626
This commit is contained in:
Eric Kohl 2001-02-17 17:42:46 +00:00
parent 65a803db11
commit d458692c89
5 changed files with 137 additions and 196 deletions

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.43 2001/02/17 00:02:32 ekohl Exp $ # $Id: makefile,v 1.44 2001/02/17 17:41:17 ekohl Exp $
# #
# ReactOS Operating System # ReactOS Operating System
# #
@ -27,8 +27,8 @@ FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
file/move.o file/lock.o file/rw.o file/delete.o \ file/move.o file/lock.o file/rw.o file/delete.o \
file/npipe.o file/npipe.o
MEM_OBJECTS = mem/global.o mem/heap.o mem/utils.o mem/section.o mem/isbad.o \ MEM_OBJECTS = mem/global.o mem/heap.o mem/isbad.o mem/procmem.o \
mem/procmem.o mem/virtual.o mem/section.o mem/virtual.o
NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\ NLS_OBJECTS = nls/codepage.o nls/cpmisc.o nls/cptable.o\
nls/cp37.o nls/cp437.o nls/cp500.o nls/cp737.o nls/cp775.o nls/cp850.o nls/cp852.o nls/cp855.o nls/cp857.o\ nls/cp37.o nls/cp437.o nls/cp500.o nls/cp737.o nls/cp775.o nls/cp850.o nls/cp852.o nls/cp855.o nls/cp857.o\

View file

@ -1,4 +1,4 @@
/* $Id: heap.c,v 1.17 2001/02/17 00:01:26 ekohl Exp $ /* $Id: heap.c,v 1.18 2001/02/17 17:42:46 ekohl Exp $
* *
* kernel/heap.c * kernel/heap.c
* Copyright (C) 1996, Onno Hovers, All rights reserved * Copyright (C) 1996, Onno Hovers, All rights reserved
@ -62,14 +62,10 @@ HANDLE WINAPI GetProcessHeap(VOID)
/******************************************************************** /********************************************************************
* GetProcessHeaps -- KERNEL32 * * GetProcessHeaps -- KERNEL32 *
* *
* NOTE in Win95 this function is not implemented and just returns *
* ERROR_CALL_NOT_IMPLEMENTED *
********************************************************************/ ********************************************************************/
DWORD WINAPI GetProcessHeaps(DWORD maxheaps, PHANDLE phandles ) DWORD WINAPI GetProcessHeaps(DWORD maxheaps, PHANDLE phandles )
{ {
UNIMPLEMENTED; return(RtlGetProcessHeaps(maxheaps, phandles));
return(ERROR_CALL_NOT_IMPLEMENTED);
} }
/********************************************************************* /*********************************************************************
@ -94,17 +90,13 @@ BOOL WINAPI HeapUnlock(HANDLE hheap)
* NT uses this function to compact moveable blocks and other things * * NT uses this function to compact moveable blocks and other things *
* Here it does not compact, but it finds the largest free region * * Here it does not compact, but it finds the largest free region *
*********************************************************************/ *********************************************************************/
UINT STDCALL UINT WINAPI HeapCompact(HANDLE hheap, DWORD flags)
HeapCompact(HANDLE hheap,
DWORD flags)
{ {
return RtlCompactHeap(hheap, flags); return RtlCompactHeap(hheap, flags);
} }
/********************************************************************* /*********************************************************************
* HeapValidate -- KERNEL32 * * HeapValidate -- KERNEL32 *
* *
* NOTE: only implemented in NT *
*********************************************************************/ *********************************************************************/
BOOL WINAPI HeapValidate(HANDLE hheap, DWORD flags, LPCVOID pmem) BOOL WINAPI HeapValidate(HANDLE hheap, DWORD flags, LPCVOID pmem)
{ {

View file

@ -1,25 +0,0 @@
/* $Id: mem.c,v 1.2 2000/07/01 17:07:00 ea Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user mode libraries
* FILE: kernel32/mem/utils.cc
* PURPOSE: Various simple memory initalizations functions
*/
#include <windows.h>
VOID ZeroMemory(PVOID Destination, DWORD Length)
{
#ifdef __i386__
#endif /* __i386__ */
}
VOID CopyMemory(PVOID Destination, CONST VOID* Source, DWORD Length)
{
#ifdef __i386__
#endif /* __i386__ */
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: section.c,v 1.12 2000/07/01 17:07:00 ea Exp $ /* $Id: section.c,v 1.13 2001/02/17 17:42:46 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -13,16 +13,17 @@
#include <kernel32/error.h> #include <kernel32/error.h>
#include <windows.h> #include <windows.h>
#include <kernel32/kernel32.h>
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
HANDLE STDCALL CreateFileMappingA ( HANDLE STDCALL
HANDLE hFile, CreateFileMappingA(HANDLE hFile,
LPSECURITY_ATTRIBUTES lpFileMappingAttributes, LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
DWORD flProtect, DWORD flProtect,
DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, DWORD dwMaximumSizeLow,
LPCSTR lpName LPCSTR lpName)
)
{ {
NTSTATUS Status; NTSTATUS Status;
HANDLE SectionHandle; HANDLE SectionHandle;
@ -43,12 +44,15 @@ HANDLE STDCALL CreateFileMappingA (
MaximumSize.u.LowPart = dwMaximumSizeLow; MaximumSize.u.LowPart = dwMaximumSizeLow;
MaximumSize.u.HighPart = dwMaximumSizeHigh; MaximumSize.u.HighPart = dwMaximumSizeHigh;
RtlInitAnsiString(&AnsiName, (LPSTR)lpName); RtlInitAnsiString(&AnsiName,
RtlAnsiStringToUnicodeString(&UnicodeName, &AnsiName, TRUE); (LPSTR)lpName);
RtlAnsiStringToUnicodeString(&UnicodeName,
&AnsiName,
TRUE);
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&UnicodeName, &UnicodeName,
0, 0,
NULL, hBaseDir,
SecurityDescriptor); SecurityDescriptor);
Status = NtCreateSection(&SectionHandle, Status = NtCreateSection(&SectionHandle,
SECTION_ALL_ACCESS, SECTION_ALL_ACCESS,
@ -57,27 +61,23 @@ HANDLE STDCALL CreateFileMappingA (
flProtect, flProtect,
0, 0,
hFile); hFile);
RtlFreeUnicodeString (&UnicodeName); RtlFreeUnicodeString(&UnicodeName);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus (Status); SetLastErrorByStatus(Status);
return NULL; return NULL;
} }
return SectionHandle; return SectionHandle;
} }
HANDLE HANDLE STDCALL
STDCALL CreateFileMappingW(HANDLE hFile,
CreateFileMappingW ( LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
HANDLE hFile, DWORD flProtect,
LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD dwMaximumSizeHigh,
DWORD flProtect, DWORD dwMaximumSizeLow,
DWORD dwMaximumSizeHigh, LPCWSTR lpName)
DWORD dwMaximumSizeLow,
LPCWSTR lpName
)
{ {
NTSTATUS Status; NTSTATUS Status;
HANDLE SectionHandle; HANDLE SectionHandle;
@ -97,11 +97,12 @@ CreateFileMappingW (
MaximumSize.u.LowPart = dwMaximumSizeLow; MaximumSize.u.LowPart = dwMaximumSizeLow;
MaximumSize.u.HighPart = dwMaximumSizeHigh; MaximumSize.u.HighPart = dwMaximumSizeHigh;
RtlInitUnicodeString(&UnicodeName, lpName); RtlInitUnicodeString(&UnicodeName,
lpName);
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&UnicodeName, &UnicodeName,
0, 0,
NULL, hBaseDir,
SecurityDescriptor); SecurityDescriptor);
Status = NtCreateSection(&SectionHandle, Status = NtCreateSection(&SectionHandle,
SECTION_ALL_ACCESS, SECTION_ALL_ACCESS,
@ -112,20 +113,20 @@ CreateFileMappingW (
hFile); hFile);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus (Status); SetLastErrorByStatus(Status);
return NULL; return NULL;
} }
return SectionHandle; return SectionHandle;
} }
LPVOID STDCALL MapViewOfFileEx(HANDLE hFileMappingObject, LPVOID STDCALL
DWORD dwDesiredAccess, MapViewOfFileEx(HANDLE hFileMappingObject,
DWORD dwFileOffsetHigh, DWORD dwDesiredAccess,
DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh,
DWORD dwNumberOfBytesToMap, DWORD dwFileOffsetLow,
LPVOID lpBaseAddress) DWORD dwNumberOfBytesToMap,
LPVOID lpBaseAddress)
{ {
NTSTATUS Status; NTSTATUS Status;
LARGE_INTEGER SectionOffset; LARGE_INTEGER SectionOffset;
@ -157,66 +158,60 @@ LPVOID STDCALL MapViewOfFileEx(HANDLE hFileMappingObject,
} }
Status = ZwMapViewOfSection(hFileMappingObject, Status = ZwMapViewOfSection(hFileMappingObject,
NtCurrentProcess(), NtCurrentProcess(),
&BaseAddress, &BaseAddress,
0, 0,
dwNumberOfBytesToMap, dwNumberOfBytesToMap,
&SectionOffset, &SectionOffset,
&ViewSize, &ViewSize,
ViewShare, ViewShare,
0, 0,
Protect); Protect);
if (!NT_SUCCESS(Status))
if (!NT_SUCCESS(Status)) {
{ SetLastErrorByStatus(Status);
SetLastErrorByStatus (Status); return NULL;
return NULL; }
} return BaseAddress;
return BaseAddress;
} }
LPVOID
STDCALL LPVOID STDCALL
MapViewOfFile ( MapViewOfFile(HANDLE hFileMappingObject,
HANDLE hFileMappingObject, DWORD dwDesiredAccess,
DWORD dwDesiredAccess, DWORD dwFileOffsetHigh,
DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow,
DWORD dwFileOffsetLow, DWORD dwNumberOfBytesToMap)
DWORD dwNumberOfBytesToMap
)
{ {
return MapViewOfFileEx(hFileMappingObject,dwDesiredAccess, return MapViewOfFileEx(hFileMappingObject,
dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap,NULL); dwDesiredAccess,
dwFileOffsetHigh,
dwFileOffsetLow,
dwNumberOfBytesToMap,
NULL);
} }
WINBOOL WINBOOL STDCALL
STDCALL UnmapViewOfFile(LPVOID lpBaseAddress)
UnmapViewOfFile (
LPVOID lpBaseAddress
)
{ {
NTSTATUS Status; NTSTATUS Status;
Status = NtUnmapViewOfSection(NtCurrentProcess(),lpBaseAddress);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus (Status);
return FALSE;
}
return TRUE; Status = NtUnmapViewOfSection(NtCurrentProcess(),
lpBaseAddress);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
}
return TRUE;
} }
HANDLE HANDLE STDCALL
STDCALL OpenFileMappingA(DWORD dwDesiredAccess,
OpenFileMappingA ( WINBOOL bInheritHandle,
DWORD dwDesiredAccess, LPCSTR lpName)
WINBOOL bInheritHandle,
LPCSTR lpName
)
{ {
NTSTATUS Status; NTSTATUS Status;
HANDLE SectionHandle; HANDLE SectionHandle;
@ -226,89 +221,87 @@ OpenFileMappingA (
ULONG Attributes = 0; ULONG Attributes = 0;
if ( bInheritHandle ) if (bInheritHandle)
Attributes = OBJ_INHERIT; {
Attributes = OBJ_INHERIT;
}
RtlInitAnsiString(&AnsiName, (LPSTR)lpName); RtlInitAnsiString(&AnsiName,
RtlAnsiStringToUnicodeString(&UnicodeName, &AnsiName, TRUE); (LPSTR)lpName);
RtlAnsiStringToUnicodeString(&UnicodeName,
&AnsiName,
TRUE);
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&UnicodeName, &UnicodeName,
Attributes, Attributes,
NULL, hBaseDir,
NULL); NULL);
Status = NtOpenSection(&SectionHandle, Status = NtOpenSection(&SectionHandle,
SECTION_ALL_ACCESS, SECTION_ALL_ACCESS,
&ObjectAttributes &ObjectAttributes);
); RtlFreeUnicodeString (&UnicodeName);
RtlFreeUnicodeString (&UnicodeName); if (!NT_SUCCESS(Status))
if (!NT_SUCCESS(Status)) {
{ SetLastErrorByStatus (Status);
SetLastErrorByStatus (Status); return NULL;
return NULL; }
} return SectionHandle;
return SectionHandle;
} }
HANDLE HANDLE STDCALL
STDCALL OpenFileMappingW(DWORD dwDesiredAccess,
OpenFileMappingW ( WINBOOL bInheritHandle,
DWORD dwDesiredAccess, LPCWSTR lpName)
WINBOOL bInheritHandle,
LPCWSTR lpName
)
{ {
NTSTATUS Status; NTSTATUS Status;
HANDLE SectionHandle; HANDLE SectionHandle;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING UnicodeName; UNICODE_STRING UnicodeName;
ULONG Attributes = 0; ULONG Attributes = 0;
if ( bInheritHandle ) if (bInheritHandle)
Attributes = OBJ_INHERIT; {
Attributes = OBJ_INHERIT;
}
RtlInitUnicodeString(&UnicodeName, lpName); RtlInitUnicodeString(&UnicodeName,
lpName);
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&UnicodeName, &UnicodeName,
Attributes, Attributes,
NULL, hBaseDir,
NULL); NULL);
Status = ZwOpenSection(&SectionHandle, Status = ZwOpenSection(&SectionHandle,
SECTION_ALL_ACCESS, SECTION_ALL_ACCESS,
&ObjectAttributes); &ObjectAttributes);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus (Status); SetLastErrorByStatus(Status);
return NULL; return NULL;
} }
return SectionHandle;
return SectionHandle;
} }
WINBOOL
STDCALL
FlushViewOfFile (
LPCVOID lpBaseAddress,
DWORD dwNumberOfBytesToFlush
)
{
NTSTATUS Status;
ULONG NumberOfBytesFlushed;
Status = NtFlushVirtualMemory (NtCurrentProcess (), WINBOOL STDCALL
(LPVOID)lpBaseAddress, FlushViewOfFile(LPCVOID lpBaseAddress,
dwNumberOfBytesToFlush, DWORD dwNumberOfBytesToFlush)
&NumberOfBytesFlushed); {
NTSTATUS Status;
if (!NT_SUCCESS(Status)) ULONG NumberOfBytesFlushed;
{
SetLastErrorByStatus (Status); Status = NtFlushVirtualMemory(NtCurrentProcess(),
return FALSE; (LPVOID)lpBaseAddress,
} dwNumberOfBytesToFlush,
return TRUE; &NumberOfBytesFlushed);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
}
return TRUE;
} }
/* EOF */ /* EOF */

View file

@ -1,19 +0,0 @@
/* $Id: utils.c,v 1.5 2000/07/01 17:07:00 ea Exp $
*
* FILE: lib/kernel32/mem/utils.c
*/
#include <windows.h>
#include <kernel32/kernel32.h>
VOID CopyMemory(PVOID Destination, CONST VOID* Source, DWORD Length)
{
DWORD i;
for (i=0; i<Length; i++)
{
((PCH)Destination)[i] = ((PCH)Source)[i];
}
}
/* EOF */