mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implemented debugger functions
svn path=/trunk/; revision=1121
This commit is contained in:
parent
4542601468
commit
86a1100180
17 changed files with 571 additions and 166 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: rtl.h,v 1.30 2000/03/18 13:53:26 ekohl Exp $
|
||||
/* $Id: rtl.h,v 1.31 2000/04/14 01:42:07 ekohl Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -278,6 +278,15 @@ RtlAreBitsSet (
|
|||
ULONG Length
|
||||
);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
RtlAssert (
|
||||
PVOID FailedAssertion,
|
||||
PVOID FileName,
|
||||
ULONG LineNumber,
|
||||
PCHAR Message
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
RtlCharToInteger (
|
||||
|
|
19
reactos/include/ntdll/dbg.h
Normal file
19
reactos/include/ntdll/dbg.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/* $Id: dbg.h,v 1.1 2000/04/14 01:41:38 ekohl Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_NTDLL_DBG_H
|
||||
#define __INCLUDE_NTDLL_DBG_H
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
DbgUiContinue (
|
||||
PCLIENT_ID ClientId,
|
||||
ULONG ContinueStatus
|
||||
);
|
||||
|
||||
|
||||
#endif /* __INCLUDE_NTDLL_DBG_H */
|
||||
|
||||
/* EOF */
|
|
@ -559,7 +559,6 @@ SetTapeParameters@12
|
|||
SetTapePosition@24
|
||||
SetThreadAffinityMask@8
|
||||
SetThreadContext@8
|
||||
;_imp__SetThreadContext@8
|
||||
SetThreadLocale@4
|
||||
SetThreadPriority@8
|
||||
SetTimeZoneInformation@4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: kernel32.edf,v 1.5 2000/04/07 21:45:32 phreak Exp $
|
||||
; $Id: kernel32.edf,v 1.6 2000/04/14 01:46:20 ekohl Exp $
|
||||
;
|
||||
; kernel32.edf
|
||||
;
|
||||
|
@ -563,7 +563,6 @@ SetTapeParameters=SetTapeParameters@12
|
|||
SetTapePosition=SetTapePosition@24
|
||||
SetThreadAffinityMask=SetThreadAffinityMask@8
|
||||
SetThreadContext=SetThreadContext@8
|
||||
;_imp__SetThreadContext@8
|
||||
SetThreadLocale=SetThreadLocale@4
|
||||
SetThreadPriority=SetThreadPriority@8
|
||||
SetTimeZoneInformation=SetTimeZoneInformation@4
|
||||
|
|
|
@ -1,21 +1,79 @@
|
|||
/* $Id: debug.c,v 1.1 2000/04/06 17:23:06 ekohl Exp $
|
||||
/* $Id: debug.c,v 1.2 2000/04/14 01:49:40 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/kernel32/misc/debug.c
|
||||
* PURPOSE: Win32 server console functions
|
||||
* PURPOSE: Application debugger support functions
|
||||
* PROGRAMMER: ???
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/dbg.h>
|
||||
#include <windows.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
ContinueDebugEvent (
|
||||
DWORD dwProcessId,
|
||||
DWORD dwThreadId,
|
||||
DWORD dwContinueStatus
|
||||
)
|
||||
{
|
||||
CLIENT_ID ClientId;
|
||||
NTSTATUS Status;
|
||||
|
||||
ClientId.UniqueProcess = (HANDLE)dwProcessId;
|
||||
ClientId.UniqueThread = (HANDLE)dwThreadId;
|
||||
|
||||
Status = DbgUiContinue (&ClientId,
|
||||
dwContinueStatus);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastError (RtlNtStatusToDosError(Status));
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
DebugActiveProcess (
|
||||
DWORD dwProcessId
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
DebugBreak (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DbgBreakPoint ();
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
IsDebuggerPresent (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return (WINBOOL)NtCurrentPeb ()->BeingDebugged;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* NOTE: Don't call DbgService()!
|
||||
* It's a ntdll internal function and is NOT exported!
|
||||
|
@ -44,4 +102,16 @@ VOID STDCALL OutputDebugStringW(LPCWSTR lpOutputString)
|
|||
DbgPrint( AnsiString.Buffer );
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
WaitForDebugEvent (
|
||||
LPDEBUG_EVENT lpDebugEvent,
|
||||
DWORD dwMilliseconds
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ldr.c,v 1.4 1999/11/17 21:30:00 ariadne Exp $
|
||||
/* $Id: ldr.c,v 1.5 2000/04/14 01:49:40 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT : ReactOS user mode libraries
|
||||
|
@ -6,51 +6,112 @@
|
|||
* FILE : reactos/lib/kernel32/misc/ldr.c
|
||||
* AUTHOR : Boudewijn Dekker
|
||||
*/
|
||||
#define WIN32_NO_STATUS
|
||||
#define WIN32_NO_PEHDR
|
||||
#include <windows.h>
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <pe.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <kernel32/kernel32.h>
|
||||
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryA (
|
||||
LPCSTR lpLibFileName
|
||||
)
|
||||
{
|
||||
return LoadLibraryExA (lpLibFileName, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryA( LPCSTR lpLibFileName )
|
||||
LoadLibraryExA (
|
||||
LPCSTR lpLibFileName,
|
||||
HANDLE hFile,
|
||||
DWORD dwFlags
|
||||
)
|
||||
{
|
||||
UNICODE_STRING LibFileNameU;
|
||||
ANSI_STRING LibFileName;
|
||||
HINSTANCE hInstance;
|
||||
|
||||
RtlInitAnsiString (&LibFileName,
|
||||
(LPSTR)lpLibFileName);
|
||||
|
||||
/* convert ansi (or oem) string to unicode */
|
||||
if (bIsFileApiAnsi)
|
||||
RtlAnsiStringToUnicodeString (&LibFileNameU,
|
||||
&LibFileName,
|
||||
TRUE);
|
||||
else
|
||||
RtlOemStringToUnicodeString (&LibFileNameU,
|
||||
&LibFileName,
|
||||
TRUE);
|
||||
|
||||
hInstance = LoadLibraryExW (LibFileNameU.Buffer,
|
||||
hFile,
|
||||
dwFlags);
|
||||
|
||||
RtlFreeUnicodeString (&LibFileNameU);
|
||||
|
||||
return hInstance;
|
||||
}
|
||||
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryW (
|
||||
LPCWSTR lpLibFileName
|
||||
)
|
||||
{
|
||||
return LoadLibraryExW (lpLibFileName, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryExW (
|
||||
LPCWSTR lpLibFileName,
|
||||
HANDLE hFile,
|
||||
DWORD dwFlags
|
||||
)
|
||||
{
|
||||
HINSTANCE hInst;
|
||||
int i;
|
||||
LPSTR lpDllName;
|
||||
LPWSTR lpDllName;
|
||||
NTSTATUS Status;
|
||||
|
||||
|
||||
|
||||
if ( lpLibFileName == NULL )
|
||||
return NULL;
|
||||
|
||||
i = lstrlen(lpLibFileName);
|
||||
|
||||
i = wcslen (lpLibFileName);
|
||||
// full path specified
|
||||
if ( lpLibFileName[2] == ':' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,i+3);
|
||||
lstrcpyA(lpDllName,"\\??\\");
|
||||
lstrcatA(lpDllName,lpLibFileName);
|
||||
if ( lpLibFileName[2] == L':' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,(i+3)*sizeof(WCHAR));
|
||||
wcscpy (lpDllName,L"\\??\\");
|
||||
wcscat (lpDllName,lpLibFileName);
|
||||
}
|
||||
// point at the end means no extension
|
||||
else if ( lpLibFileName[i-1] == '.' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,i+1);
|
||||
lstrcpyA(lpDllName,lpLibFileName);
|
||||
else if ( lpLibFileName[i-1] == L'.' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,(i+1)*sizeof(WCHAR));
|
||||
wcscpy (lpDllName,lpLibFileName);
|
||||
lpDllName[i-1] = 0;
|
||||
}
|
||||
// no extension
|
||||
else if (i > 3 && lpLibFileName[i-3] != '.' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,i+4);
|
||||
lstrcpyA(lpDllName,lpLibFileName);
|
||||
lstrcatA(lpDllName,".dll");
|
||||
else if (i > 3 && lpLibFileName[i-3] != L'.' ) {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,(i+4)*sizeof(WCHAR));
|
||||
wcscpy (lpDllName,lpLibFileName);
|
||||
wcscat (lpDllName,L".dll");
|
||||
}
|
||||
else {
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,i+1);
|
||||
lstrcpyA(lpDllName,lpLibFileName);
|
||||
lpDllName = HeapAlloc(GetProcessHeap(),0,(i+1)*sizeof(WCHAR));
|
||||
wcscpy (lpDllName,lpLibFileName);
|
||||
}
|
||||
|
||||
|
||||
Status = LdrLoadDll((PDLL *)&hInst,lpDllName );
|
||||
HeapFree(GetProcessHeap(),0,lpDllName);
|
||||
if ( !NT_SUCCESS(Status))
|
||||
|
@ -67,9 +128,8 @@ FARPROC
|
|||
STDCALL
|
||||
GetProcAddress( HMODULE hModule, LPCSTR lpProcName )
|
||||
{
|
||||
|
||||
FARPROC fnExp;
|
||||
|
||||
|
||||
if ( HIWORD(lpProcName ) != 0 )
|
||||
fnExp = LdrGetExportByName (hModule,(LPSTR)lpProcName);
|
||||
else
|
||||
|
@ -87,12 +147,13 @@ FreeLibrary( HMODULE hLibModule )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
FreeLibraryAndExitThread(
|
||||
HMODULE hLibModule,
|
||||
DWORD dwExitCode
|
||||
)
|
||||
FreeLibraryAndExitThread (
|
||||
HMODULE hLibModule,
|
||||
DWORD dwExitCode
|
||||
)
|
||||
{
|
||||
|
||||
if ( FreeLibrary(hLibModule) )
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
#define WIN32_NO_STATUS
|
||||
#define WIN32_NO_PEHDR
|
||||
#include <windows.h>
|
||||
/* $Id: res.c,v 1.4 2000/04/14 01:50:38 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT : ReactOS user mode libraries
|
||||
* MODULE : kernel32.dll
|
||||
* FILE : reactos/lib/kernel32/misc/res.c
|
||||
* AUTHOR : ???
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <pe.h>
|
||||
#include <windows.h>
|
||||
#include <ntdll/ldr.h>
|
||||
#include <kernel32/kernel32.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: stubs.c,v 1.13 2000/03/22 18:35:47 dwelch Exp $
|
||||
/* $Id: stubs.c,v 1.14 2000/04/14 01:49:40 ekohl Exp $
|
||||
*
|
||||
* KERNEL32.DLL stubs (unimplemented functions)
|
||||
* Remove from this file, if you implement them.
|
||||
|
@ -344,19 +344,6 @@ ConsoleMenuControl (
|
|||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
ContinueDebugEvent (
|
||||
DWORD dwProcessId,
|
||||
DWORD dwThreadId,
|
||||
DWORD dwContinueStatus
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
LCID
|
||||
STDCALL
|
||||
ConvertDefaultLocale (
|
||||
|
@ -368,9 +355,6 @@ ConvertDefaultLocale (
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HANDLE
|
||||
STDCALL
|
||||
CreateMailslotA (
|
||||
|
@ -462,25 +446,6 @@ CreateVirtualBuffer (
|
|||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
DebugActiveProcess (
|
||||
DWORD dwProcessId
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
DebugBreak (VOID)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
|
||||
ATOM
|
||||
STDCALL
|
||||
DeleteAtom (
|
||||
|
@ -984,11 +949,6 @@ FormatMessageA (
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
FreeVirtualBuffer (
|
||||
|
@ -2643,15 +2603,6 @@ IsDBCSLeadByteEx (
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
IsDebuggerPresent (VOID)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE; /* FIXME: */
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
IsValidCodePage (
|
||||
|
@ -2707,32 +2658,6 @@ LCMapStringW (
|
|||
}
|
||||
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryExA (
|
||||
LPCSTR lpLibFileName,
|
||||
HANDLE hFile,
|
||||
DWORD dwFlags
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryExW (
|
||||
LPCWSTR lpLibFileName,
|
||||
HANDLE hFile,
|
||||
DWORD dwFlags
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
LoadModule (
|
||||
|
@ -3874,18 +3799,6 @@ WaitCommEvent (
|
|||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
WaitForDebugEvent (
|
||||
LPDEBUG_EVENT lpDebugEvent,
|
||||
DWORD dwMilliseconds
|
||||
)
|
||||
{
|
||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
WaitNamedPipeA (
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: lib.c,v 1.5 1999/10/18 21:50:11 ariadne Exp $
|
||||
/* $Id: lib.c,v 1.6 2000/04/14 01:49:18 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -25,6 +25,7 @@
|
|||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
#if 0
|
||||
HINSTANCE
|
||||
STDCALL
|
||||
LoadLibraryW (
|
||||
|
@ -34,7 +35,7 @@ LoadLibraryW (
|
|||
UNIMPLEMENTED;
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: thread.c,v 1.14 2000/04/14 01:48:26 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/kernel32/thread/thread.c
|
||||
|
@ -108,14 +109,13 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess,
|
|||
DPRINT("Stack base address: %p\n", BaseAddress);
|
||||
|
||||
memset(&ThreadContext,0,sizeof(CONTEXT));
|
||||
// ThreadContext.Eip = (LONG)lpStartAddress;
|
||||
ThreadContext.Eip = (LONG)ThreadStartup;
|
||||
ThreadContext.SegGs = USER_DS;
|
||||
ThreadContext.SegFs = USER_DS;
|
||||
ThreadContext.SegEs = USER_DS;
|
||||
ThreadContext.SegDs = USER_DS;
|
||||
ThreadContext.SegCs = USER_CS;
|
||||
ThreadContext.SegSs = USER_DS;
|
||||
ThreadContext.SegSs = USER_DS;
|
||||
ThreadContext.Esp = (ULONG)(BaseAddress + StackSize - 12);
|
||||
ThreadContext.EFlags = (1<<1) + (1<<9);
|
||||
|
||||
|
@ -150,7 +150,7 @@ HANDLE STDCALL CreateRemoteThread(HANDLE hProcess,
|
|||
|
||||
NT_TEB *GetTeb(VOID)
|
||||
{
|
||||
return NULL;
|
||||
return NtCurrentTeb();
|
||||
}
|
||||
|
||||
WINBOOL STDCALL SwitchToThread(VOID)
|
||||
|
@ -162,16 +162,16 @@ WINBOOL STDCALL SwitchToThread(VOID)
|
|||
|
||||
DWORD STDCALL GetCurrentThreadId()
|
||||
{
|
||||
return((DWORD)(GetTeb()->Cid).UniqueThread);
|
||||
return((DWORD)(NtCurrentTeb()->Cid).UniqueThread);
|
||||
}
|
||||
|
||||
VOID STDCALL ExitThread(UINT uExitCode)
|
||||
VOID STDCALL ExitThread(UINT uExitCode)
|
||||
{
|
||||
NTSTATUS errCode;
|
||||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtTerminateThread(NtCurrentThread(),
|
||||
uExitCode);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ WINBOOL STDCALL GetThreadTimes(HANDLE hThread,
|
|||
&KernelUserTimes,
|
||||
sizeof(KERNEL_USER_TIMES),
|
||||
&ReturnLength);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -201,18 +201,18 @@ WINBOOL STDCALL GetThreadTimes(HANDLE hThread,
|
|||
memcpy(lpExitTime, &KernelUserTimes.ExitTime, sizeof(FILETIME));
|
||||
memcpy(lpKernelTime, &KernelUserTimes.KernelTime, sizeof(FILETIME));
|
||||
memcpy(lpUserTime, &KernelUserTimes.UserTime, sizeof(FILETIME));
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
WINBOOL STDCALL GetThreadContext(HANDLE hThread,
|
||||
WINBOOL STDCALL GetThreadContext(HANDLE hThread,
|
||||
LPCONTEXT lpContext)
|
||||
{
|
||||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtGetContextThread(hThread,
|
||||
lpContext);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -220,14 +220,14 @@ WINBOOL STDCALL GetThreadContext(HANDLE hThread,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
WINBOOL STDCALL SetThreadContext(HANDLE hThread,
|
||||
WINBOOL STDCALL SetThreadContext(HANDLE hThread,
|
||||
CONST CONTEXT *lpContext)
|
||||
{
|
||||
NTSTATUS errCode;
|
||||
|
||||
errCode = NtSetContextThread(hThread,
|
||||
(void *)lpContext);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -235,7 +235,7 @@ WINBOOL STDCALL SetThreadContext(HANDLE hThread,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
WINBOOL STDCALL GetExitCodeThread(HANDLE hThread,
|
||||
WINBOOL STDCALL GetExitCodeThread(HANDLE hThread,
|
||||
LPDWORD lpExitCode)
|
||||
{
|
||||
NTSTATUS errCode;
|
||||
|
@ -247,13 +247,13 @@ WINBOOL STDCALL GetExitCodeThread(HANDLE hThread,
|
|||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION),
|
||||
&DataWritten);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(lpExitCode, &ThreadBasic.ExitStatus, sizeof(DWORD));
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD STDCALL ResumeThread(HANDLE hThread)
|
||||
|
@ -263,7 +263,7 @@ DWORD STDCALL ResumeThread(HANDLE hThread)
|
|||
|
||||
errCode = NtResumeThread(hThread,
|
||||
&PreviousResumeCount);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return -1;
|
||||
|
@ -283,7 +283,7 @@ TerminateThread (
|
|||
|
||||
errCode = NtTerminateThread(hThread,
|
||||
dwExitCode);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -299,7 +299,7 @@ DWORD STDCALL SuspendThread(HANDLE hThread)
|
|||
|
||||
errCode = NtSuspendThread(hThread,
|
||||
&PreviousSuspendCount);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return -1;
|
||||
|
@ -325,7 +325,7 @@ WINBOOL STDCALL SetThreadPriority(HANDLE hThread,
|
|||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION),
|
||||
&DataWritten);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -335,7 +335,7 @@ WINBOOL STDCALL SetThreadPriority(HANDLE hThread,
|
|||
ThreadBasicInformation,
|
||||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION));
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return FALSE;
|
||||
|
@ -354,10 +354,12 @@ int STDCALL GetThreadPriority(HANDLE hThread)
|
|||
&ThreadBasic,
|
||||
sizeof(THREAD_BASIC_INFORMATION),
|
||||
&DataWritten);
|
||||
if (!NT_SUCCESS(errCode))
|
||||
if (!NT_SUCCESS(errCode))
|
||||
{
|
||||
SetLastError(RtlNtStatusToDosError(errCode));
|
||||
return THREAD_PRIORITY_ERROR_RETURN;
|
||||
}
|
||||
return ThreadBasic.BasePriority;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
30
reactos/lib/ntdll/dbg/debug.c
Normal file
30
reactos/lib/ntdll/dbg/debug.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* $Id: debug.c,v 1.1 2000/04/14 01:43:05 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: lib/ntdll/dbg/debug.c
|
||||
* PURPOSE: User mode debugger support functions
|
||||
* PROGRAMMER: Eric Kohl
|
||||
* UPDATE HISTORY:
|
||||
* 14/04/2000 Created
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ntdll/dbg.h>
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
DbgUiContinue (
|
||||
PCLIENT_ID ClientId,
|
||||
ULONG ContinueStatus
|
||||
)
|
||||
{
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.def,v 1.50 2000/04/06 02:28:45 ekohl Exp $
|
||||
; $Id: ntdll.def,v 1.51 2000/04/14 01:43:20 ekohl Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -9,6 +9,12 @@ CsrClientCallServer@16
|
|||
;CsrClientConnectToServer@24
|
||||
DbgBreakPoint@0
|
||||
DbgPrint
|
||||
;DbgPrompt
|
||||
;DbgSsHandleKmApiMsg
|
||||
;DbgSsInitialize
|
||||
;DbgUiConnectToDbg
|
||||
DbgUiContinue@8
|
||||
;DbgUiWaitStateChange
|
||||
DbgUserBreakPoint@0
|
||||
NlsAnsiCodePage DATA
|
||||
NlsMbCodePageTag DATA
|
||||
|
@ -257,7 +263,7 @@ RtlAreAllAccessesGranted@8
|
|||
RtlAreAnyAccessesGranted@8
|
||||
RtlAreBitsClear@12
|
||||
RtlAreBitsSet@12
|
||||
;RtlAssert
|
||||
RtlAssert@16
|
||||
;RtlCaptureStackBackTrace
|
||||
RtlCharToInteger@12
|
||||
;RtlCheckRegistryKey
|
||||
|
@ -428,7 +434,7 @@ RtlLeaveCriticalSection@4
|
|||
RtlLengthRequiredSid@4
|
||||
RtlLengthSecurityDescriptor@4
|
||||
RtlLengthSid@4
|
||||
;RtlLocalTimeToSystemTime
|
||||
RtlLocalTimeToSystemTime@8
|
||||
RtlLockHeap@4
|
||||
;RtlLookupAtomInAtomTable
|
||||
;RtlLookupElementGenericTable
|
||||
|
@ -511,7 +517,7 @@ RtlSubAuthorityCountSid@4
|
|||
RtlSubAuthoritySid@8
|
||||
;RtlSubtreePredecessor
|
||||
;RtlSubtreeSuccessor
|
||||
;RtlSystemTimeToLocalTime
|
||||
RtlSystemTimeToLocalTime@8
|
||||
RtlTimeFieldsToTime@8
|
||||
;RtlTimeToElapsedTimeFields
|
||||
RtlTimeToSecondsSince1970@8
|
||||
|
@ -848,7 +854,7 @@ memcpy
|
|||
memmove
|
||||
memset
|
||||
pow
|
||||
;qsort
|
||||
qsort
|
||||
sin
|
||||
sprintf
|
||||
sqrt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.edf,v 1.39 2000/04/06 02:28:45 ekohl Exp $
|
||||
; $Id: ntdll.edf,v 1.40 2000/04/14 01:43:20 ekohl Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -9,6 +9,12 @@ CsrClientCallServer=CsrClientCallServer@16
|
|||
;CsrClientConnectToServer=CsrClientConnectToServer@24
|
||||
DbgBreakPoint=DbgBreakPoint@0
|
||||
DbgPrint
|
||||
;DbgPrompt
|
||||
;DbgSsHandleKmApiMsg
|
||||
;DbgSsInitialize
|
||||
;DbgUiConnectToDbg
|
||||
DbgUiContinue=DbgUiContinue@8
|
||||
;DbgUiWaitStateChange
|
||||
DbgUserBreakPoint=DbgUserBreakPoint@0
|
||||
NlsAnsiCodePage DATA
|
||||
NlsMbCodePageTag DATA
|
||||
|
@ -240,6 +246,7 @@ RtlAreAllAccessesGranted=RtlAreAllAccessesGranted@8
|
|||
RtlAreAnyAccessesGranted=RtlAreAnyAccessesGranted@8
|
||||
RtlAreBitsClear=RtlAreBitsClear@12
|
||||
RtlAreBitsSet=RtlAreBitsSet@12
|
||||
RtlAssert=RtlAssert@16
|
||||
RtlCharToInteger=RtlCharToInteger@12
|
||||
RtlClearAllBits=RtlClearAllBits@4
|
||||
RtlClearBits=RtlClearBits@12
|
||||
|
@ -336,6 +343,7 @@ RtlLeaveCriticalSection=RtlLeaveCriticalSection@4
|
|||
RtlLengthRequiredSid=RtlLengthRequiredSid@4
|
||||
RtlLengthSecurityDescriptor=RtlLengthSecurityDescriptor@4
|
||||
RtlLengthSid=RtlLengthSid@4
|
||||
RtlLocalTimeToSystemTime=RtlLocalTimeToSystemTime@8
|
||||
RtlLockHeap=RtlLockHeap@4
|
||||
RtlMakeSelfRelativeSD=RtlMakeSelfRelativeSD@12
|
||||
RtlMapGenericMask=RtlMapGenericMask@8
|
||||
|
@ -370,6 +378,7 @@ RtlSetSaclSecurityDescriptor=RtlSetSaclSecurityDescriptor@16
|
|||
RtlSizeHeap=RtlSizeHeap@12
|
||||
RtlSubAuthorityCountSid=RtlSubAuthorityCountSid@4
|
||||
RtlSubAuthoritySid=RtlSubAuthoritySid@8
|
||||
RtlSystemTimeToLocalTime=RtlSystemTimeToLocalTime@8
|
||||
RtlTimeFieldsToTime=RtlTimeFieldsToTime@8
|
||||
RtlTimeToSecondsSince1970=RtlTimeToSecondsSince1970@8
|
||||
RtlTimeToSecondsSince1980=RtlTimeToSecondsSince1980@8
|
||||
|
@ -678,6 +687,7 @@ memcpy
|
|||
memmove
|
||||
memset
|
||||
pow
|
||||
qsort
|
||||
sin
|
||||
sprintf
|
||||
sqrt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: makefile,v 1.43 2000/04/06 02:28:27 ekohl Exp $
|
||||
# $Id: makefile,v 1.44 2000/04/14 01:45:17 ekohl Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -25,7 +25,7 @@ all: $(DLLTARGET)
|
|||
|
||||
CSR_OBJECTS = csr/api.o
|
||||
|
||||
DBG_OBJECTS = dbg/brkpoint.o dbg/print.o
|
||||
DBG_OBJECTS = dbg/brkpoint.o dbg/debug.o dbg/print.o
|
||||
|
||||
RTL_OBJECTS = rtl/critical.o rtl/error.o rtl/heap.o rtl/largeint.o \
|
||||
rtl/math.o rtl/mem.o rtl/nls.o rtl/process.o rtl/sd.o \
|
||||
|
@ -39,7 +39,7 @@ STDLIB_OBJECTS = stdlib/abs.o stdlib/atoi.o stdlib/atoi64.o stdlib/atol.o \
|
|||
stdlib/itoa.o stdlib/itow.o stdlib/labs.o stdlib/splitp.o \
|
||||
stdlib/strtol.o stdlib/strtoul.o stdlib/wcstol.o \
|
||||
stdlib/wcstoul.o stdlib/wtoi.o stdlib/wtoi64.o stdlib/wtol.o \
|
||||
stdlib/mbstowcs.o stdlib/wcstombs.o
|
||||
stdlib/mbstowcs.o stdlib/wcstombs.o stdlib/qsort.o
|
||||
|
||||
STRING_OBJECTS = string/ctype.o string/memccpy.o string/memchr.o \
|
||||
string/memcmp.o string/memcpy.o string/memicmp.o\
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: error.c,v 1.3 1999/12/18 10:16:11 ea Exp $
|
||||
/* $Id: error.c,v 1.4 2000/04/14 01:43:38 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -20,6 +20,22 @@
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
RtlAssert (
|
||||
PVOID FailedAssertion,
|
||||
PVOID FileName,
|
||||
ULONG LineNumber,
|
||||
PCHAR Message
|
||||
)
|
||||
{
|
||||
DbgPrint ("Assertion \'%s\' failed at %s line %d: %s\n",
|
||||
(PCHAR)FailedAssertion,
|
||||
(PCHAR)FileName,
|
||||
LineNumber,
|
||||
Message);
|
||||
}
|
||||
|
||||
|
||||
DWORD STDCALL RtlNtStatusToDosError (NTSTATUS Status)
|
||||
{
|
||||
|
|
266
reactos/lib/ntdll/stdlib/qsort.c
Normal file
266
reactos/lib/ntdll/stdlib/qsort.c
Normal file
|
@ -0,0 +1,266 @@
|
|||
/* $Id: qsort.c,v 1.1 2000/04/14 01:44:52 ekohl Exp $
|
||||
*
|
||||
* FILE: lib/ntdll/stdlib/qsort.c
|
||||
* NOTE: Adapted from CygWin newlib 2000-03-12.
|
||||
*/
|
||||
/*
|
||||
FUNCTION
|
||||
<<qsort>>---sort an array
|
||||
|
||||
INDEX
|
||||
qsort
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <stdlib.h>
|
||||
void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
|
||||
int (*<[compar]>)(const void *, const void *) );
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <stdlib.h>
|
||||
qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
|
||||
char *<[base]>;
|
||||
size_t <[nmemb]>;
|
||||
size_t <[size]>;
|
||||
int (*<[compar]>)();
|
||||
|
||||
DESCRIPTION
|
||||
<<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects.
|
||||
<[size]> describes the size of each element of the array.
|
||||
|
||||
You must supply a pointer to a comparison function, using the argument
|
||||
shown as <[compar]>. (This permits sorting objects of unknown
|
||||
properties.) Define the comparison function to accept two arguments,
|
||||
each a pointer to an element of the array starting at <[base]>. The
|
||||
result of <<(*<[compar]>)>> must be negative if the first argument is
|
||||
less than the second, zero if the two arguments match, and positive if
|
||||
the first argument is greater than the second (where ``less than'' and
|
||||
``greater than'' refer to whatever arbitrary ordering is appropriate).
|
||||
|
||||
The array is sorted in place; that is, when <<qsort>> returns, the
|
||||
array elements beginning at <[base]> have been reordered.
|
||||
|
||||
RETURNS
|
||||
<<qsort>> does not return a result.
|
||||
|
||||
PORTABILITY
|
||||
<<qsort>> is required by ANSI (without specifying the sorting algorithm).
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define inline
|
||||
#endif
|
||||
|
||||
/* FIXME: these types should be from the default includes */
|
||||
|
||||
typedef int (* _pfunccmp_t) (char *, char *);
|
||||
typedef int size_t;
|
||||
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
|
||||
/*
|
||||
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
|
||||
*/
|
||||
#define swapcode(TYPE, parmi, parmj, n) { \
|
||||
long i = (n) / sizeof (TYPE); \
|
||||
register TYPE *pi = (TYPE *) (parmi); \
|
||||
register TYPE *pj = (TYPE *) (parmj); \
|
||||
do { \
|
||||
register TYPE t = *pi; \
|
||||
*pi++ = *pj; \
|
||||
*pj++ = t; \
|
||||
} while (--i > 0); \
|
||||
}
|
||||
|
||||
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
|
||||
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
|
||||
|
||||
static inline void
|
||||
swapfunc (
|
||||
char * a,
|
||||
char * b,
|
||||
int n,
|
||||
int swaptype
|
||||
)
|
||||
{
|
||||
if(swaptype <= 1)
|
||||
swapcode(long, a, b, n)
|
||||
else
|
||||
swapcode(char, a, b, n)
|
||||
}
|
||||
|
||||
#define swap(a, b) \
|
||||
if (swaptype == 0) { \
|
||||
long t = *(long *)(a); \
|
||||
*(long *)(a) = *(long *)(b); \
|
||||
*(long *)(b) = t; \
|
||||
} else \
|
||||
swapfunc(a, b, es, swaptype)
|
||||
|
||||
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
|
||||
|
||||
static inline char *
|
||||
med3 (
|
||||
char * a,
|
||||
char * b,
|
||||
char * c,
|
||||
_pfunccmp_t cmp
|
||||
)
|
||||
{
|
||||
return cmp(a, b) < 0 ?
|
||||
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
|
||||
:(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
|
||||
}
|
||||
|
||||
|
||||
/* EXPORTED */
|
||||
void
|
||||
qsort (
|
||||
void * a,
|
||||
size_t n,
|
||||
size_t es,
|
||||
_pfunccmp_t cmp
|
||||
)
|
||||
{
|
||||
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
|
||||
int d, r, swaptype, swap_cnt;
|
||||
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
if (n < 7)
|
||||
{
|
||||
for ( pm = (char *) a + es;
|
||||
pm < (char *) a + n * es;
|
||||
pm += es
|
||||
)
|
||||
{
|
||||
for ( pl = pm;
|
||||
pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es
|
||||
)
|
||||
{
|
||||
swap(pl, pl - es);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
pm = (char *) a + (n / 2) * es;
|
||||
if (n > 7)
|
||||
{
|
||||
pl = (char *) a;
|
||||
pn = (char *) a + (n - 1) * es;
|
||||
if (n > 40)
|
||||
{
|
||||
d = (n / 8) * es;
|
||||
pl = med3(pl, pl + d, pl + 2 * d, cmp);
|
||||
pm = med3(pm - d, pm, pm + d, cmp);
|
||||
pn = med3(pn - 2 * d, pn - d, pn, cmp);
|
||||
}
|
||||
pm = med3(pl, pm, pn, cmp);
|
||||
}
|
||||
swap(a, pm);
|
||||
pa = pb = (char *) a + es;
|
||||
|
||||
pc = pd = (char *) a + (n - 1) * es;
|
||||
for (;;)
|
||||
{
|
||||
while (pb <= pc && (r = cmp(pb, a)) <= 0)
|
||||
{
|
||||
if (r == 0)
|
||||
{
|
||||
swap_cnt = 1;
|
||||
swap(pa, pb);
|
||||
pa += es;
|
||||
}
|
||||
pb += es;
|
||||
}
|
||||
while (pb <= pc && (r = cmp(pc, a)) >= 0)
|
||||
{
|
||||
if (r == 0)
|
||||
{
|
||||
swap_cnt = 1;
|
||||
swap(pc, pd);
|
||||
pd -= es;
|
||||
}
|
||||
pc -= es;
|
||||
}
|
||||
if (pb > pc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
swap(pb, pc);
|
||||
swap_cnt = 1;
|
||||
pb += es;
|
||||
pc -= es;
|
||||
}
|
||||
if (swap_cnt == 0) /* Switch to insertion sort */
|
||||
{
|
||||
for ( pm = (char *) a + es;
|
||||
pm < (char *) a + n * es;
|
||||
pm += es
|
||||
)
|
||||
{
|
||||
for ( pl = pm;
|
||||
pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es
|
||||
)
|
||||
{
|
||||
swap(pl, pl - es);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
pn = (char *) a + n * es;
|
||||
r = min(pa - (char *)a, pb - pa);
|
||||
vecswap(a, pb - r, r);
|
||||
r = min(pd - pc, pn - pd - es);
|
||||
vecswap(pb, pn - r, r);
|
||||
if ((r = pb - pa) > es)
|
||||
{
|
||||
qsort(a, r / es, es, cmp);
|
||||
}
|
||||
if ((r = pd - pc) > es)
|
||||
{
|
||||
/* Iterate rather than recurse to save stack space */
|
||||
a = pn - r;
|
||||
n = r / es;
|
||||
goto loop;
|
||||
}
|
||||
/* qsort(pn - r, r / es, es, cmp);*/
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
|
@ -28,7 +28,6 @@ STUB(DbgPrompt)
|
|||
STUB(DbgSsHandleKmApiMsg)
|
||||
STUB(DbgSsInitialize)
|
||||
STUB(DbgUiConnectToDbg)
|
||||
STUB(DbgUiContinue)
|
||||
STUB(DbgUiWaitStateChange)
|
||||
STUB(KiRaiseUserExceptionDispatcher)
|
||||
STUB(KiUserApcDispatcher)
|
||||
|
@ -190,6 +189,5 @@ STUB(_aullrem)
|
|||
STUB(_aullshr)
|
||||
//STUB(_chkstk)
|
||||
STUB(_fltused)
|
||||
STUB(qsort)
|
||||
STUB(sscanf)
|
||||
|
||||
|
|
Loading…
Reference in a new issue