mirror of
https://github.com/reactos/reactos.git
synced 2024-10-08 02:13:56 +00:00
Established forwarded exports and removed superfluous functions
svn path=/trunk/; revision=1623
This commit is contained in:
parent
beae346469
commit
9f2db0a1d2
|
@ -1,4 +1,4 @@
|
||||||
; $Id: kernel32.edf,v 1.9 2001/01/05 05:39:18 phreak Exp $
|
; $Id: kernel32.edf,v 1.10 2001/02/17 00:02:32 ekohl Exp $
|
||||||
;
|
;
|
||||||
; kernel32.edf
|
; kernel32.edf
|
||||||
;
|
;
|
||||||
|
@ -109,7 +109,7 @@ DebugBreak=DebugBreak@0
|
||||||
DefineDosDeviceA=DefineDosDeviceA@12
|
DefineDosDeviceA=DefineDosDeviceA@12
|
||||||
DefineDosDeviceW=DefineDosDeviceW@12
|
DefineDosDeviceW=DefineDosDeviceW@12
|
||||||
DeleteAtom=DeleteAtom@4
|
DeleteAtom=DeleteAtom@4
|
||||||
DeleteCriticalSection=DeleteCriticalSection@4
|
DeleteCriticalSection=NTDLL.RtlDeleteCriticalSection
|
||||||
DeleteFiber=DeleteFiber@4
|
DeleteFiber=DeleteFiber@4
|
||||||
DeleteFileA=DeleteFileA@4
|
DeleteFileA=DeleteFileA@4
|
||||||
DeleteFileW=DeleteFileW@4
|
DeleteFileW=DeleteFileW@4
|
||||||
|
@ -121,7 +121,7 @@ DuplicateConsoleHandle=DuplicateConsoleHandle@16
|
||||||
DuplicateHandle=DuplicateHandle@28
|
DuplicateHandle=DuplicateHandle@28
|
||||||
EndUpdateResourceA=EndUpdateResourceA@8
|
EndUpdateResourceA=EndUpdateResourceA@8
|
||||||
EndUpdateResourceW=EndUpdateResourceW@8
|
EndUpdateResourceW=EndUpdateResourceW@8
|
||||||
EnterCriticalSection=EnterCriticalSection@4
|
EnterCriticalSection=NTDLL.RtlEnterCriticalSection
|
||||||
EnumCalendarInfoA=EnumCalendarInfoA@16
|
EnumCalendarInfoA=EnumCalendarInfoA@16
|
||||||
EnumCalendarInfoW=EnumCalendarInfoW@16
|
EnumCalendarInfoW=EnumCalendarInfoW@16
|
||||||
EnumDateFormatsA=EnumDateFormatsA@12
|
EnumDateFormatsA=EnumDateFormatsA@12
|
||||||
|
@ -385,17 +385,17 @@ GlobalUnWire=GlobalUnWire@4
|
||||||
GlobalUnfix=GlobalUnfix@4
|
GlobalUnfix=GlobalUnfix@4
|
||||||
GlobalUnlock=GlobalUnlock@4
|
GlobalUnlock=GlobalUnlock@4
|
||||||
GlobalWire=GlobalWire@4
|
GlobalWire=GlobalWire@4
|
||||||
HeapAlloc=HeapAlloc@12
|
HeapAlloc=NTDLL.RtlAllocateHeap
|
||||||
HeapCompact=HeapCompact@8
|
HeapCompact=HeapCompact@8
|
||||||
HeapCreate=HeapCreate@12
|
HeapCreate=HeapCreate@12
|
||||||
HeapCreateTagsW=HeapCreateTagsW@16
|
HeapCreateTagsW=HeapCreateTagsW@16
|
||||||
HeapDestroy=HeapDestroy@4
|
HeapDestroy=HeapDestroy@4
|
||||||
HeapExtend=HeapExtend@16
|
HeapExtend=HeapExtend@16
|
||||||
HeapFree=HeapFree@12
|
HeapFree=NTDLL.RtlFreeHeap
|
||||||
HeapLock=HeapLock@4
|
HeapLock=HeapLock@4
|
||||||
HeapQueryTagW=HeapQueryTagW@20
|
HeapQueryTagW=HeapQueryTagW@20
|
||||||
HeapReAlloc=HeapReAlloc@16
|
HeapReAlloc=NTDLL.RtlReAllocateHeap
|
||||||
HeapSize=HeapSize@12
|
HeapSize=NTDLL.RtlSizeHeap
|
||||||
HeapSummary=HeapSummary@12
|
HeapSummary=HeapSummary@12
|
||||||
HeapUnlock=HeapUnlock@4
|
HeapUnlock=HeapUnlock@4
|
||||||
HeapUsage=HeapUsage@20
|
HeapUsage=HeapUsage@20
|
||||||
|
@ -423,7 +423,7 @@ IsValidCodePage=IsValidCodePage@4
|
||||||
IsValidLocale=IsValidLocale@8
|
IsValidLocale=IsValidLocale@8
|
||||||
LCMapStringA=LCMapStringA@24
|
LCMapStringA=LCMapStringA@24
|
||||||
LCMapStringW=LCMapStringW@24
|
LCMapStringW=LCMapStringW@24
|
||||||
LeaveCriticalSection=LeaveCriticalSection@4
|
LeaveCriticalSection=NTDLL.RtlLeaveCriticalSection
|
||||||
LoadLibraryA=LoadLibraryA@4
|
LoadLibraryA=LoadLibraryA@4
|
||||||
LoadLibraryExA=LoadLibraryExA@12
|
LoadLibraryExA=LoadLibraryExA@12
|
||||||
LoadLibraryExW=LoadLibraryExW@12
|
LoadLibraryExW=LoadLibraryExW@12
|
||||||
|
@ -503,10 +503,10 @@ RemoveDirectoryA=RemoveDirectoryA@4
|
||||||
RemoveDirectoryW=RemoveDirectoryW@4
|
RemoveDirectoryW=RemoveDirectoryW@4
|
||||||
ResetEvent=ResetEvent@4
|
ResetEvent=ResetEvent@4
|
||||||
ResumeThread=ResumeThread@4
|
ResumeThread=ResumeThread@4
|
||||||
RtlFillMemory=RtlFillMemory@12
|
RtlFillMemory=NTDLL.RtlFillMemory
|
||||||
RtlMoveMemory=RtlMoveMemory@12
|
RtlMoveMemory=NTDLL.RtlMoveMemory
|
||||||
RtlUnwind=RtlUnwind@16
|
RtlUnwind=NTDLL.RtlUnwind
|
||||||
RtlZeroMemory=RtlZeroMemory@8
|
RtlZeroMemory=NTDLL.RtlZeroMemory
|
||||||
ScrollConsoleScreenBufferA=ScrollConsoleScreenBufferA@20
|
ScrollConsoleScreenBufferA=ScrollConsoleScreenBufferA@20
|
||||||
ScrollConsoleScreenBufferW=ScrollConsoleScreenBufferW@20
|
ScrollConsoleScreenBufferW=ScrollConsoleScreenBufferW@20
|
||||||
SearchPathA=SearchPathA@24
|
SearchPathA=SearchPathA@24
|
||||||
|
@ -604,7 +604,7 @@ TlsSetValue=TlsSetValue@8
|
||||||
TransactNamedPipe=TransactNamedPipe@28
|
TransactNamedPipe=TransactNamedPipe@28
|
||||||
TransmitCommChar=TransmitCommChar@8
|
TransmitCommChar=TransmitCommChar@8
|
||||||
TrimVirtualBuffer=TrimVirtualBuffer@4
|
TrimVirtualBuffer=TrimVirtualBuffer@4
|
||||||
TryEnterCriticalSection=TryEnterCriticalSection@4
|
TryEnterCriticalSection=NTDLL.RtlTryEnterCriticalSection
|
||||||
UnhandledExceptionFilter=UnhandledExceptionFilter@4
|
UnhandledExceptionFilter=UnhandledExceptionFilter@4
|
||||||
UnlockFile=UnlockFile@20
|
UnlockFile=UnlockFile@20
|
||||||
UnlockFileEx=UnlockFileEx@20
|
UnlockFileEx=UnlockFileEx@20
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.42 2001/01/20 12:17:51 ekohl Exp $
|
# $Id: makefile,v 1.43 2001/02/17 00:02:32 ekohl Exp $
|
||||||
#
|
#
|
||||||
# ReactOS Operating System
|
# ReactOS Operating System
|
||||||
#
|
#
|
||||||
|
@ -18,7 +18,7 @@ SYNCH_OBJECTS = synch/critical.o synch/event.o synch/intrlck.o synch/mutex.o \
|
||||||
synch/sem.o synch/timer.o synch/wait.o
|
synch/sem.o synch/timer.o synch/wait.o
|
||||||
|
|
||||||
MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o misc/dllmain.o \
|
MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o misc/dllmain.o \
|
||||||
misc/console.o misc/time.o misc/stubs.o misc/rtl.o misc/ldr.o misc/res.o \
|
misc/console.o misc/time.o misc/stubs.o misc/ldr.o misc/res.o \
|
||||||
misc/debug.o misc/sysinfo.o
|
misc/debug.o misc/sysinfo.o
|
||||||
|
|
||||||
FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
|
FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: heap.c,v 1.16 1999/09/12 22:09:34 ea Exp $
|
/* $Id: heap.c,v 1.17 2001/02/17 00:01:26 ekohl Exp $
|
||||||
*
|
*
|
||||||
* kernel/heap.c
|
* kernel/heap.c
|
||||||
* Copyright (C) 1996, Onno Hovers, All rights reserved
|
* Copyright (C) 1996, Onno Hovers, All rights reserved
|
||||||
|
@ -51,30 +51,6 @@ BOOL WINAPI HeapDestroy(HANDLE hheap)
|
||||||
return(RtlDestroyHeap(hheap));
|
return(RtlDestroyHeap(hheap));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* HeapAlloc -- KERNEL32 *
|
|
||||||
*********************************************************************/
|
|
||||||
LPVOID STDCALL HeapAlloc(HANDLE hheap, DWORD flags, DWORD size)
|
|
||||||
{
|
|
||||||
return(RtlAllocateHeap(hheap, flags, size));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* HeapReAlloc -- KERNEL32 *
|
|
||||||
*********************************************************************/
|
|
||||||
LPVOID STDCALL HeapReAlloc(HANDLE hheap, DWORD flags, LPVOID ptr, DWORD size)
|
|
||||||
{
|
|
||||||
return(RtlReAllocateHeap(hheap, flags, ptr, size));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* HeapFree -- KERNEL32 *
|
|
||||||
*********************************************************************/
|
|
||||||
WINBOOL STDCALL HeapFree(HANDLE hheap, DWORD flags, LPVOID ptr)
|
|
||||||
{
|
|
||||||
return(RtlFreeHeap(hheap, flags, ptr));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* GetProcessHeap -- KERNEL32 *
|
* GetProcessHeap -- KERNEL32 *
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
@ -118,25 +94,11 @@ 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
|
UINT STDCALL
|
||||||
STDCALL
|
HeapCompact(HANDLE hheap,
|
||||||
HeapCompact (
|
DWORD flags)
|
||||||
HANDLE hheap,
|
|
||||||
DWORD flags
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return RtlCompactHeap(
|
return RtlCompactHeap(hheap, flags);
|
||||||
hheap,
|
|
||||||
flags
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* HeapSize -- KERNEL32 *
|
|
||||||
*********************************************************************/
|
|
||||||
DWORD WINAPI HeapSize(HANDLE hheap, DWORD flags, LPCVOID pmem)
|
|
||||||
{
|
|
||||||
return(RtlSizeHeap(hheap, flags, (PVOID)pmem));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
/* $Id: rtl.c,v 1.4 2001/02/10 22:51:07 dwelch Exp $
|
|
||||||
*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* FILE: lib/kernel32/misc/rtl.c
|
|
||||||
* PURPOSE:
|
|
||||||
* PROGRAMMER: Boudewijn Dekker
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
typedef DWORD
|
|
||||||
(*RtlFillMemoryType) (PVOID Destination, ULONG Length, UCHAR Fill);
|
|
||||||
|
|
||||||
#undef FillMemory
|
|
||||||
VOID STDCALL
|
|
||||||
RtlFillMemory (PVOID Destination, ULONG Length, UCHAR Fill)
|
|
||||||
{
|
|
||||||
HINSTANCE hModule;
|
|
||||||
RtlFillMemoryType FillMemory;
|
|
||||||
|
|
||||||
hModule = LoadLibraryA("ntdll.dll");
|
|
||||||
if (hModule == NULL)
|
|
||||||
return;
|
|
||||||
FillMemory = (RtlFillMemoryType)GetProcAddress(hModule, "RtlFillMemory");
|
|
||||||
if ( FillMemory == NULL )
|
|
||||||
return;
|
|
||||||
FillMemory(Destination, Length, Fill);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef DWORD
|
|
||||||
(*RtlMoveMemoryType) (PVOID Destination, CONST VOID* Source, ULONG Length);
|
|
||||||
#undef MoveMemory
|
|
||||||
VOID STDCALL
|
|
||||||
RtlMoveMemory (PVOID Destination, CONST VOID* Source, ULONG Length)
|
|
||||||
{
|
|
||||||
HINSTANCE hModule;
|
|
||||||
RtlMoveMemoryType MoveMemory;
|
|
||||||
|
|
||||||
hModule = LoadLibraryA("ntdll.dll");
|
|
||||||
if (hModule == NULL)
|
|
||||||
return;
|
|
||||||
MoveMemory = (RtlMoveMemoryType)GetProcAddress(hModule, "RtlMoveMemory");
|
|
||||||
if (MoveMemory == NULL)
|
|
||||||
return;
|
|
||||||
MoveMemory(Destination, Source, Length);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef DWORD ( *RtlZeroMemoryType) (PVOID Destination, ULONG Length);
|
|
||||||
#undef ZeroMemory
|
|
||||||
VOID STDCALL
|
|
||||||
RtlZeroMemory (PVOID Destination, ULONG Length)
|
|
||||||
{
|
|
||||||
HINSTANCE hModule;
|
|
||||||
RtlZeroMemoryType ZeroMemory;
|
|
||||||
|
|
||||||
hModule = LoadLibraryA("ntdll.dll");
|
|
||||||
if (hModule == NULL)
|
|
||||||
return;
|
|
||||||
ZeroMemory = (RtlZeroMemoryType)GetProcAddress(hModule, "RtlZeroMemory");
|
|
||||||
if (ZeroMemory == NULL)
|
|
||||||
return;
|
|
||||||
ZeroMemory(Destination, Length);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef DWORD ( *RtlUnwindType) (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3 );
|
|
||||||
#undef Unwind
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
RtlUnwind (
|
|
||||||
ULONG Unknown0,
|
|
||||||
ULONG Unknown1,
|
|
||||||
ULONG Unknown2,
|
|
||||||
ULONG Unknown3
|
|
||||||
)
|
|
||||||
{
|
|
||||||
HINSTANCE hModule;
|
|
||||||
RtlUnwindType Unwind;
|
|
||||||
hModule = LoadLibraryA("ntdll.dll");
|
|
||||||
if ( hModule == NULL )
|
|
||||||
return;
|
|
||||||
Unwind = (RtlUnwindType)GetProcAddress(hModule, "RtlUnwind");
|
|
||||||
if ( Unwind == NULL )
|
|
||||||
return;
|
|
||||||
Unwind(Unknown0, Unknown1, Unknown2, Unknown3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* $Id: critical.c,v 1.9 2000/04/25 23:22:55 ea Exp $
|
/* $Id: critical.c,v 1.10 2001/02/17 00:02:13 ekohl Exp $
|
||||||
*
|
*
|
||||||
* 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/sync/critical.c
|
* FILE: lib/kernel32/sync/critical.c
|
||||||
* PURPOSE: Critical regions
|
* PURPOSE: Critical sections
|
||||||
* UPDATE HISTORY:
|
* UPDATE HISTORY:
|
||||||
* Created 30/09/98
|
* Created 30/09/98
|
||||||
*/
|
*/
|
||||||
|
@ -14,85 +14,19 @@
|
||||||
|
|
||||||
#include <kernel32/kernel32.h>
|
#include <kernel32/kernel32.h>
|
||||||
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ntos.h>
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
VOID STDCALL
|
||||||
VOID
|
InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
||||||
STDCALL
|
|
||||||
DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
|
||||||
{
|
{
|
||||||
CloseHandle(lpCriticalSection->LockSemaphore);
|
NTSTATUS Status;
|
||||||
lpCriticalSection->Reserved = -1;
|
|
||||||
|
Status = RtlInitializeCriticalSection(lpCriticalSection);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
RtlRaiseStatus(Status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
|
||||||
{
|
|
||||||
if( InterlockedIncrement(&(lpCriticalSection->LockCount) ) != 1 ) {
|
|
||||||
if (lpCriticalSection->OwningThread != (HANDLE)GetCurrentThreadId() ) {
|
|
||||||
WaitForSingleObject(lpCriticalSection->LockSemaphore,100000);
|
|
||||||
// WAIT_TIMEOUT should give message if DEBUG
|
|
||||||
lpCriticalSection->OwningThread = (HANDLE)GetCurrentThreadId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lpCriticalSection->OwningThread = (HANDLE)GetCurrentThreadId();
|
|
||||||
|
|
||||||
lpCriticalSection->RecursionCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
InitializeCriticalSection(LPCRITICAL_SECTION pcritical)
|
|
||||||
{
|
|
||||||
pcritical->LockCount = -1;
|
|
||||||
pcritical->RecursionCount = 0;
|
|
||||||
pcritical->LockSemaphore = CreateSemaphoreW(NULL,0,100,NULL);
|
|
||||||
pcritical->OwningThread = (HANDLE)-1; // critical section has no owner yet
|
|
||||||
pcritical->Reserved = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
|
||||||
{
|
|
||||||
lpCriticalSection->RecursionCount--;
|
|
||||||
if ( lpCriticalSection->RecursionCount == 0 ) {
|
|
||||||
lpCriticalSection->OwningThread = (HANDLE)-1;
|
|
||||||
// if LockCount > 0 and RecursionCount == 0 there
|
|
||||||
// is a waiting thread
|
|
||||||
// ReleaseSemaphore will fire up a waiting thread
|
|
||||||
if ( InterlockedDecrement( &lpCriticalSection->LockCount ) > 0 )
|
|
||||||
ReleaseSemaphore( lpCriticalSection->LockSemaphore,1,NULL);
|
|
||||||
}
|
|
||||||
else InterlockedDecrement( &lpCriticalSection->LockCount );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
|
||||||
{
|
|
||||||
if( InterlockedCompareExchange( (PVOID *)&lpCriticalSection->LockCount, (PVOID)1, (PVOID)0 ) == 0 )
|
|
||||||
{
|
|
||||||
lpCriticalSection->OwningThread = (HANDLE)GetCurrentThreadId();
|
|
||||||
lpCriticalSection->RecursionCount++;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
if( lpCriticalSection->OwningThread == (HANDLE)GetCurrentThreadId() )
|
|
||||||
{
|
|
||||||
lpCriticalSection->RecursionCount++;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue