Check for failed allocation

Split up kernel32 stubs
Print proper stack trace for user mode exceptions

svn path=/trunk/; revision=1751
This commit is contained in:
David Welch 2001-03-31 01:17:30 +00:00
parent 5907d91e41
commit 4e81d099cf
15 changed files with 2193 additions and 2001 deletions

View file

@ -1,4 +1,4 @@
/* $Id: except.c,v 1.5 2000/06/03 14:47:31 ea Exp $
/* $Id: except.c,v 1.6 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -98,4 +98,16 @@ UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo)
}
VOID
STDCALL
RaiseException (
DWORD dwExceptionCode,
DWORD dwExceptionFlags,
DWORD nNumberOfArguments,
CONST DWORD * lpArguments
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
}
/* EOF */

View file

@ -0,0 +1,74 @@
/* $Id: backup.c,v 1.1 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/file/backup.c
* PURPOSE: Backup functions
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
* UPDATE HISTORY:
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <windows.h>
#include <wchar.h>
#include <string.h>
#include <ntdll/rtl.h>
#include <kernel32/kernel32.h>
#include <kernel32/error.h>
/* FUNCTIONS ****************************************************************/
WINBOOL
STDCALL
BackupRead (
HANDLE hFile,
LPBYTE lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
WINBOOL bAbort,
WINBOOL bProcessSecurity,
LPVOID * lpContext
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
BackupSeek (
HANDLE hFile,
DWORD dwLowBytesToSeek,
DWORD dwHighBytesToSeek,
LPDWORD lpdwLowByteSeeked,
LPDWORD lpdwHighByteSeeked,
LPVOID * lpContext
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
BackupWrite (
HANDLE hFile,
LPBYTE lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
WINBOOL bAbort,
WINBOOL bProcessSecurity,
LPVOID * lpContext
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: cnotify.c,v 1.2 2000/03/15 12:25:47 ekohl Exp $
/* $Id: cnotify.c,v 1.3 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -10,15 +10,12 @@
*/
#include <windows.h>
#include <wstring.h>
WINBOOL
FindCloseChangeNotification (
HANDLE hChangeHandle
)
WINBOOL STDCALL
FindCloseChangeNotification (HANDLE hChangeHandle)
{
return FALSE;
return FALSE;
}
@ -30,6 +27,7 @@ FindFirstChangeNotificationA (
DWORD dwNotifyFilter
)
{
#if 0
UNICODE_STRING PathNameU;
ANSI_STRING PathName;
HANDLE Result;
@ -56,6 +54,7 @@ FindFirstChangeNotificationA (
RootPathNameU.Buffer);
return Result;
#endif
}

View file

@ -0,0 +1,77 @@
/* $Id: mailslot.c,v 1.1 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/file/mailslot.c
* PURPOSE: Mailslot functions
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
* UPDATE HISTORY:
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <windows.h>
#include <wchar.h>
#include <string.h>
#include <ntdll/rtl.h>
#include <kernel32/kernel32.h>
#include <kernel32/error.h>
/* FUNCTIONS ****************************************************************/
HANDLE
STDCALL
CreateMailslotA (
LPCSTR lpName,
DWORD nMaxMessageSize,
DWORD lReadTimeout,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return INVALID_HANDLE_VALUE;
}
HANDLE
STDCALL
CreateMailslotW (
LPCWSTR lpName,
DWORD nMaxMessageSize,
DWORD lReadTimeout,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return INVALID_HANDLE_VALUE;
}
WINBOOL
STDCALL
GetMailslotInfo (
HANDLE hMailslot,
LPDWORD lpMaxMessageSize,
LPDWORD lpNextSize,
LPDWORD lpMessageCount,
LPDWORD lpReadTimeout
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetMailslotInfo (
HANDLE hMailslot,
DWORD lReadTimeout
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: npipe.c,v 1.3 2000/06/03 14:47:32 ea Exp $
/* $Id: npipe.c,v 1.4 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -377,4 +377,127 @@ BOOL STDCALL SetNamedPipeHandleState(HANDLE hNamedPipe,
return(TRUE);
}
WINBOOL
STDCALL
CallNamedPipeA (
LPCSTR lpNamedPipeName,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesRead,
DWORD nTimeOut
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
CallNamedPipeW (
LPCWSTR lpNamedPipeName,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesRead,
DWORD nTimeOut
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
DisconnectNamedPipe (
HANDLE hNamedPipe
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetNamedPipeHandleStateW (
HANDLE hNamedPipe,
LPDWORD lpState,
LPDWORD lpCurInstances,
LPDWORD lpMaxCollectionCount,
LPDWORD lpCollectDataTimeout,
LPWSTR lpUserName,
DWORD nMaxUserNameSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetNamedPipeHandleStateA (
HANDLE hNamedPipe,
LPDWORD lpState,
LPDWORD lpCurInstances,
LPDWORD lpMaxCollectionCount,
LPDWORD lpCollectDataTimeout,
LPSTR lpUserName,
DWORD nMaxUserNameSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetNamedPipeInfo (
HANDLE hNamedPipe,
LPDWORD lpFlags,
LPDWORD lpOutBufferSize,
LPDWORD lpInBufferSize,
LPDWORD lpMaxInstances
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
PeekNamedPipe (
HANDLE hNamedPipe,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesRead,
LPDWORD lpTotalBytesAvail,
LPDWORD lpBytesLeftThisMessage
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
TransactNamedPipe (
HANDLE hNamedPipe,
LPVOID lpInBuffer,
DWORD nInBufferSize,
LPVOID lpOutBuffer,
DWORD nOutBufferSize,
LPDWORD lpBytesRead,
LPOVERLAPPED lpOverlapped
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

View file

@ -0,0 +1,143 @@
/* $Id: tape.c,v 1.1 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/file/tape.c
* PURPOSE: Tape functions
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
* GetTempFileName is modified from WINE [ Alexandre Juiliard ]
* UPDATE HISTORY:
* Created 01/11/98
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <windows.h>
#include <wchar.h>
#include <string.h>
#define NDEBUG
#include <kernel32/kernel32.h>
#include <kernel32/error.h>
/* FUNCTIONS ****************************************************************/
DWORD
STDCALL
CreateTapePartition (
HANDLE hDevice,
DWORD dwPartitionMethod,
DWORD dwCount,
DWORD dwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
EraseTape (
HANDLE hDevice,
DWORD dwEraseType,
WINBOOL bImmediate
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetTapeParameters (
HANDLE hDevice,
DWORD dwOperation,
LPDWORD lpdwSize,
LPVOID lpTapeInformation
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetTapeStatus (
HANDLE hDevice
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
PrepareTape (
HANDLE hDevice,
DWORD dwOperation,
WINBOOL bImmediate
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
SetTapeParameters (
HANDLE hDevice,
DWORD dwOperation,
LPVOID lpTapeInformation
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
SetTapePosition (
HANDLE hDevice,
DWORD dwPositionMethod,
DWORD dwPartition,
DWORD dwOffsetLow,
DWORD dwOffsetHigh,
WINBOOL bImmediate
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
DWORD
STDCALL
WriteTapemark (
HANDLE hDevice,
DWORD dwTapemarkType,
DWORD dwTapemarkCount,
WINBOOL bImmediate
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetTapePosition (
HANDLE hDevice,
DWORD dwPositionType,
LPDWORD lpdwPartition,
LPDWORD lpdwOffsetLow,
LPDWORD lpdwOffsetHigh
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/* EOF */

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.45 2001/03/30 15:14:52 dwelch Exp $
# $Id: makefile,v 1.46 2001/03/31 01:17:29 dwelch Exp $
#
# ReactOS Operating System
#
@ -17,15 +17,17 @@ all: $(DLLTARGET)
SYNCH_OBJECTS = synch/critical.o synch/event.o synch/intrlck.o synch/mutex.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/console.o misc/time.o misc/stubs.o misc/ldr.o misc/res.o \
misc/debug.o misc/sysinfo.o
MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o \
misc/dllmain.o misc/comm.o \
misc/console.o misc/time.o misc/stubs.o misc/ldr.o misc/res.o \
misc/debug.o misc/sysinfo.o misc/profile.o
FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \
file/create.o file/find.o file/copy.o file/pipe.o \
file/move.o file/lock.o file/rw.o file/delete.o \
file/npipe.o
file/npipe.o file/tape.o file/mailslot.o file/backup.o \
file/cnotify.o
MEM_OBJECTS = mem/global.o mem/heap.o mem/isbad.o mem/procmem.o \
mem/section.o mem/virtual.o

View file

@ -1,4 +1,4 @@
/* $Id: atom.c,v 1.11 2001/03/30 17:26:42 dwelch Exp $
/* $Id: atom.c,v 1.12 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -249,7 +249,7 @@ AWGLAddAtom(ATOMTABLE *at, const WCHAR *lpString)
/* add to a free slot */
q = AtomHashString(lpString,&atomlen);
lpfree = 0;
lpfree = 0;
freeindex = 0;
for(index = 0;(lp = GetAtomPointer(at,index));index++)
@ -281,7 +281,10 @@ AWGLAddAtom(ATOMTABLE *at, const WCHAR *lpString)
/* so expand or create the table */
if(at->AtomTable == 0)
{
at->AtomTable = (ATOMENTRY *) RtlAllocateHeap(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,sizeof(ATOMENTRY));
at->AtomTable =
(ATOMENTRY*) RtlAllocateHeap(GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,
sizeof(ATOMENTRY));
at->TableSize = 1;
lp = at->AtomTable;
index = 0;
@ -289,9 +292,10 @@ AWGLAddAtom(ATOMTABLE *at, const WCHAR *lpString)
else
{
at->TableSize++;
at->AtomTable = (ATOMENTRY *) RtlReAllocateHeap(GetProcessHeap(),0,
(LPVOID) at->AtomTable,
at->TableSize * sizeof(ATOMENTRY));
at->AtomTable =
(ATOMENTRY*) RtlReAllocateHeap(GetProcessHeap(),0,
(LPVOID) at->AtomTable,
at->TableSize * sizeof(ATOMENTRY));
lp = &at->AtomTable[at->TableSize - 1];
}
@ -306,11 +310,23 @@ AWGLAddAtom(ATOMTABLE *at, const WCHAR *lpString)
newlen = at->DataSize + atomlen;
if(at->AtomData == 0) {
at->AtomData = (WCHAR *) RtlAllocateHeap(GetProcessHeap(),HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,newlen*2);
at->AtomData =
(WCHAR*)RtlAllocateHeap(GetProcessHeap(),
HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY,
newlen*2);
if (at->AtomData == NULL)
{
return(0);
}
lp->idx = 0;
} else {
at->AtomData = (WCHAR *) RtlReAllocateHeap(GetProcessHeap(),0,at->AtomData,newlen*2);
at->AtomData =
(WCHAR*)RtlReAllocateHeap(GetProcessHeap(), 0, at->AtomData, newlen*2);
if (at->AtomData == NULL)
{
return(0);
}
lp->idx = at->DataSize;
}

View file

@ -0,0 +1,357 @@
/* $Id: comm.c,v 1.1 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/misc/comm.c
* PURPOSE: Comm functions
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
* modified from WINE [ Onno Hovers, (onno@stack.urc.tue.nl) ]
* UPDATE HISTORY:
* Created 01/11/98
*/
#include <ddk/ntddk.h>
#include <kernel32/atom.h>
#include <kernel32/proc.h>
#include <kernel32/thread.h>
#include <wchar.h>
#include <string.h>
//#include <stdlib.h>
WINBOOL
STDCALL
BuildCommDCBA (
LPCSTR lpDef,
LPDCB lpDCB
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
BuildCommDCBW (
LPCWSTR lpDef,
LPDCB lpDCB
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
BuildCommDCBAndTimeoutsA (
LPCSTR lpDef,
LPDCB lpDCB,
LPCOMMTIMEOUTS lpCommTimeouts
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
BuildCommDCBAndTimeoutsW (
LPCWSTR lpDef,
LPDCB lpDCB,
LPCOMMTIMEOUTS lpCommTimeouts
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
ClearCommBreak (
HANDLE hFile
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
ClearCommError (
HANDLE hFile,
LPDWORD lpErrors,
LPCOMSTAT lpStat
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
CommConfigDialogA (
LPCSTR lpszName,
HWND hWnd,
LPCOMMCONFIG lpCC
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
CommConfigDialogW (
LPCWSTR lpszName,
HWND hWnd,
LPCOMMCONFIG lpCC
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EscapeCommFunction (
HANDLE hFile,
DWORD dwFunc
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommConfig (
HANDLE hCommDev,
LPCOMMCONFIG lpCC,
LPDWORD lpdwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommMask (
HANDLE hFile,
LPDWORD lpEvtMask
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommModemStatus (
HANDLE hFile,
LPDWORD lpModemStat
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommProperties (
HANDLE hFile,
LPCOMMPROP lpCommProp
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommState (
HANDLE hFile,
LPDCB lpDCB
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetCommTimeouts (
HANDLE hFile,
LPCOMMTIMEOUTS lpCommTimeouts
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetDefaultCommConfigW (
LPCWSTR lpszName,
LPCOMMCONFIG lpCC,
LPDWORD lpdwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetDefaultCommConfigA (
LPCSTR lpszName,
LPCOMMCONFIG lpCC,
LPDWORD lpdwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
PurgeComm (
HANDLE hFile,
DWORD dwFlags
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetCommBreak (
HANDLE hFile
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetCommConfig (
HANDLE hCommDev,
LPCOMMCONFIG lpCC,
DWORD dwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetCommMask (
HANDLE hFile,
DWORD dwEvtMask
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetCommState (
HANDLE hFile,
LPDCB lpDCB
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetCommTimeouts (
HANDLE hFile,
LPCOMMTIMEOUTS lpCommTimeouts
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetDefaultCommConfigA (
LPCSTR lpszName,
LPCOMMCONFIG lpCC,
DWORD dwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetDefaultCommConfigW (
LPCWSTR lpszName,
LPCOMMCONFIG lpCC,
DWORD dwSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetupComm (
HANDLE hFile,
DWORD dwInQueue,
DWORD dwOutQueue
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
TransmitCommChar (
HANDLE hFile,
char cChar
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WaitCommEvent (
HANDLE hFile,
LPDWORD lpEvtMask,
LPOVERLAPPED lpOverlapped
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: console.c,v 1.30 2001/02/10 22:26:26 ekohl Exp $
/* $Id: console.c,v 1.31 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -28,6 +28,533 @@
/* FUNCTIONS *****************************************************************/
BOOL STDCALL
AddConsoleAliasA (DWORD a0,
DWORD a1,
DWORD a2)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
BOOL STDCALL
AddConsoleAliasW (DWORD a0,
DWORD a1,
DWORD a2)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
BOOL STDCALL
ConsoleMenuControl (HANDLE hConsole,
DWORD Unknown1,
DWORD Unknown2)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
BOOL
STDCALL
DuplicateConsoleHandle (
HANDLE hConsole,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
DWORD
STDCALL
ExpungeConsoleCommandHistoryW (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
ExpungeConsoleCommandHistoryA (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasExesW (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasExesA (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasExesLengthA (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasExesLengthW (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasesW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasesA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasesLengthW (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleAliasesLengthA (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleCommandHistoryW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleCommandHistoryA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleCommandHistoryLengthW (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleCommandHistoryLengthA (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleDisplayMode (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleFontInfo (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleFontSize (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleHardwareState (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetConsoleInputWaitHandle (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
DWORD
STDCALL
GetCurrentConsoleFont (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
int
STDCALL
GetNumberOfConsoleFonts (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 1; /* FIXME: call csrss.exe */
}
DWORD
STDCALL
InvalidateConsoleDIBits (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
OpenConsoleW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
WINBOOL
STDCALL
SetConsoleCommandHistoryMode (
DWORD dwMode
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleCursor (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleDisplayMode (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleFont (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleHardwareState (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleKeyShortcuts (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleMaximumWindowSize (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleMenuClose (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleNumberOfCommandsA (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsoleNumberOfCommandsW (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetConsolePalette (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetLastConsoleEventActive (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
DWORD
STDCALL
ShowConsoleCursor (
DWORD Unknown0,
DWORD Unknown1
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
VerifyConsoleIoHandle (
DWORD Unknown0
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
WriteConsoleInputVDMA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
WriteConsoleInputVDMW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/*--------------------------------------------------------------
* CloseConsoleHandle
*/

View file

@ -0,0 +1,411 @@
/* $Id: profile.c,v 1.1 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/misc/profile.c
* PURPOSE: Profiles functions
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
* modified from WINE [ Onno Hovers, (onno@stack.urc.tue.nl) ]
* UPDATE HISTORY:
* Created 01/11/98
*/
#include <ddk/ntddk.h>
#include <kernel32/atom.h>
#include <kernel32/proc.h>
#include <kernel32/thread.h>
#include <wchar.h>
#include <string.h>
//#include <stdlib.h>
BOOL
STDCALL
CloseProfileUserMapping ( VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
UINT
STDCALL
GetPrivateProfileIntW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
INT nDefault,
LPCWSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
GetPrivateProfileIntA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
INT nDefault,
LPCSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileSectionW (
LPCWSTR lpAppName,
LPWSTR lpReturnedString,
DWORD nSize,
LPCWSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileSectionA (
LPCSTR lpAppName,
LPSTR lpReturnedString,
DWORD nSize,
LPCSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileSectionNamesW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileSectionNamesA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileStringW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
LPCWSTR lpDefault,
LPWSTR lpReturnedString,
DWORD nSize,
LPCWSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileStringA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
LPCSTR lpDefault,
LPSTR lpReturnedString,
DWORD nSize,
LPCSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileStructW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetPrivateProfileStructA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
GetProfileIntW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
INT nDefault
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
UINT
STDCALL
GetProfileIntA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
INT nDefault
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetProfileSectionW (
LPCWSTR lpAppName,
LPWSTR lpReturnedString,
DWORD nSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetProfileSectionA (
LPCSTR lpAppName,
LPSTR lpReturnedString,
DWORD nSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetProfileStringW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
LPCWSTR lpDefault,
LPWSTR lpReturnedString,
DWORD nSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
GetProfileStringA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
LPCSTR lpDefault,
LPSTR lpReturnedString,
DWORD nSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
DWORD
STDCALL
OpenProfileUserMapping (VOID)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
WINBOOL
STDCALL
QueryWin31IniFilesMappedToRegistry (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileSectionA (
LPCSTR lpAppName,
LPCSTR lpString,
LPCSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileSectionW (
LPCWSTR lpAppName,
LPCWSTR lpString,
LPCWSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileStringA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
LPCSTR lpString,
LPCSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileStringW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
LPCWSTR lpString,
LPCWSTR lpFileName
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileStructA (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WritePrivateProfileStructW (
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WriteProfileSectionA (
LPCSTR lpAppName,
LPCSTR lpString
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WriteProfileSectionW (
LPCWSTR lpAppName,
LPCWSTR lpString
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WriteProfileStringA (
LPCSTR lpAppName,
LPCSTR lpKeyName,
LPCSTR lpString
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
WriteProfileStringW (
LPCWSTR lpAppName,
LPCWSTR lpKeyName,
LPCWSTR lpString
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: res.c,v 1.8 2001/01/25 02:20:05 phreak Exp $
/* $Id: res.c,v 1.9 2001/03/31 01:17:29 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT : ReactOS user mode libraries
@ -213,4 +213,168 @@ LockResource (
return hResData;
}
HANDLE
STDCALL
BeginUpdateResourceW (
LPCWSTR pFileName,
WINBOOL bDeleteExistingResources
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
HANDLE
STDCALL
BeginUpdateResourceA (
LPCSTR pFileName,
WINBOOL bDeleteExistingResources
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EndUpdateResourceW (
HANDLE hUpdate,
WINBOOL fDiscard
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EndUpdateResourceA (
HANDLE hUpdate,
WINBOOL fDiscard
)
{
return EndUpdateResourceW(
hUpdate,
fDiscard
);
}
WINBOOL
STDCALL
EnumResourceLanguagesW (
HINSTANCE hModule,
LPCWSTR lpType,
LPCWSTR lpName,
ENUMRESLANGPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EnumResourceLanguagesA (
HINSTANCE hModule,
LPCSTR lpType,
LPCSTR lpName,
ENUMRESLANGPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EnumResourceNamesW (
HINSTANCE hModule,
LPCWSTR lpType,
ENUMRESNAMEPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EnumResourceNamesA (
HINSTANCE hModule,
LPCSTR lpType,
ENUMRESNAMEPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EnumResourceTypesW (
HINSTANCE hModule,
ENUMRESTYPEPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
EnumResourceTypesA (
HINSTANCE hModule,
ENUMRESTYPEPROC lpEnumFunc,
LONG lParam
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
UpdateResourceA (
HANDLE hUpdate,
LPCSTR lpType,
LPCSTR lpName,
WORD wLanguage,
LPVOID lpData,
DWORD cbData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
UpdateResourceW (
HANDLE hUpdate,
LPCWSTR lpType,
LPCWSTR lpName,
WORD wLanguage,
LPVOID lpData,
DWORD cbData
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/* EOF */

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* $Id: proc.c,v 1.39 2001/03/13 16:25:51 dwelch Exp $
/* $Id: proc.c,v 1.40 2001/03/31 01:17:30 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -44,6 +44,78 @@ RegisterWaitForInputIdle (WaitForInputIdleType lpfnRegisterWaitForInputIdle);
WINBOOL STDCALL
GetProcessId (HANDLE hProcess, LPDWORD lpProcessId);
WINBOOL
STDCALL
GetProcessAffinityMask (
HANDLE hProcess,
LPDWORD lpProcessAffinityMask,
LPDWORD lpSystemAffinityMask
)
{
if ( (NULL == lpProcessAffinityMask)
|| (NULL == lpSystemAffinityMask)
)
{
SetLastError(ERROR_BAD_ARGUMENTS);
return FALSE;
}
/* FIXME: check hProcess is actually a process */
/* FIXME: query the kernel process object */
*lpProcessAffinityMask = 0x00000001;
*lpSystemAffinityMask = 0x00000001;
return TRUE;
}
WINBOOL
STDCALL
GetProcessShutdownParameters (
LPDWORD lpdwLevel,
LPDWORD lpdwFlags
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
GetProcessWorkingSetSize (
HANDLE hProcess,
LPDWORD lpMinimumWorkingSetSize,
LPDWORD lpMaximumWorkingSetSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetProcessShutdownParameters (
DWORD dwLevel,
DWORD dwFlags
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL
STDCALL
SetProcessWorkingSetSize (
HANDLE hProcess,
DWORD dwMinimumWorkingSetSize,
DWORD dwMaximumWorkingSetSize
)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
WINBOOL STDCALL
GetProcessTimes (HANDLE hProcess,
LPFILETIME lpCreationTime,

View file

@ -72,6 +72,28 @@ extern ULONG init_stack_top;
static char KiNullLdt[8] = {0,};
static char *ExceptionTypeStrings[] =
{
"Divide Error",
"Debug Trap",
"NMI",
"Breakpoint",
"Overflow",
"BOUND range exceeded",
"Invalid Opcode",
"No Math Coprocessor",
"Double Fault",
"Unknown(9)",
"Invalid TSS",
"Segment Not Present",
"Stack Segment Fault",
"General Protection",
"Page Fault",
"Math Fault",
"Alignment Check",
"Machine Check"
};
/* FUNCTIONS ****************************************************************/
extern unsigned int _text_start__, _text_end__;
@ -107,6 +129,7 @@ print_address(PVOID address)
return(FALSE);
}
#if 0
ULONG
KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
{
@ -158,6 +181,120 @@ KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
KiDispatchException(&Er, 0, Tf, UserMode, TRUE);
return(0);
}
#endif
ULONG
KiUserTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr, PVOID Cr2)
{
PULONG Frame;
ULONG cr3;
ULONG i;
/*
* Get the PDBR
*/
__asm__("movl %%cr3,%0\n\t" : "=d" (cr3));
/*
* Print out the CPU registers
*/
if (ExceptionNr < 19)
{
DbgPrint("%s Exception: %d(%x)\n", ExceptionTypeStrings[ExceptionNr],
ExceptionNr, Tf->ErrorCode&0xffff);
}
else
{
DbgPrint("Exception: %d(%x)\n", ExceptionNr, Tf->ErrorCode&0xffff);
}
DbgPrint("CS:EIP %x:%x ", Tf->Cs&0xffff, Tf->Eip);
print_address((PVOID)Tf->Eip);
DbgPrint("\n");
__asm__("movl %%cr3,%0\n\t" : "=d" (cr3));
DbgPrint("CR2 %x CR3 %x ", Cr2, cr3);
DbgPrint("Proc: %x ",PsGetCurrentProcess());
if (PsGetCurrentProcess() != NULL)
{
DbgPrint("Pid: %x <", PsGetCurrentProcess()->UniqueProcessId);
DbgPrint("%.8s> ", PsGetCurrentProcess()->ImageFileName);
}
if (PsGetCurrentThread() != NULL)
{
DbgPrint("Thrd: %x Tid: %x",
PsGetCurrentThread(),
PsGetCurrentThread()->Cid.UniqueThread);
}
DbgPrint("\n");
DbgPrint("DS %x ES %x FS %x GS %x\n", Tf->Ds&0xffff, Tf->Es&0xffff,
Tf->Fs&0xffff, Tf->Gs&0xfff);
DbgPrint("EAX: %.8x EBX: %.8x ECX: %.8x\n", Tf->Eax, Tf->Ebx, Tf->Ecx);
DbgPrint("EDX: %.8x EBP: %.8x ESI: %.8x\n", Tf->Edx, Tf->Ebp, Tf->Esi);
DbgPrint("EDI: %.8x EFLAGS: %.8x ", Tf->Edi, Tf->Eflags);
DbgPrint("SS:ESP %x:%x\n", Tf->Ss, Tf->Esp);
#if 0
stack=(PULONG)(Tf->Esp);
DbgPrint("Stack:\n");
for (i=0; i<64; i++)
{
if (MmIsPagePresent(NULL,&stack[i]))
{
DbgPrint("%.8x ",stack[i]);
if (((i+1)%8) == 0)
{
DbgPrint("\n");
}
}
}
#endif
#if 0
if (MmIsPagePresent(NULL, (PVOID)Tf->Eip))
{
unsigned char instrs[512];
memcpy(instrs, (PVOID)Tf->Eip, 512);
DbgPrint("Instrs: ");
for (i=0; i<10; i++)
{
DbgPrint("%x ", instrs[i]);
}
}
#endif
/*
* Dump the stack frames
*/
DbgPrint("Frames: ");
i = 1;
Frame = (PULONG)Tf->Ebp;
while (Frame != NULL)
{
DbgPrint("%.8x ", Frame[1]);
Frame = (PULONG)Frame[0];
i++;
}
if ((i % 8) != 0)
{
DbgPrint("\n");
}
/*
* Kill the faulting task
*/
__asm__("sti\n\t");
ZwTerminateProcess(NtCurrentProcess(),
STATUS_NONCONTINUABLE_EXCEPTION);
/*
* If terminating the process fails then bugcheck
*/
KeBugCheck(0);
return(0);
}
ULONG
KiDoubleFaultHandler(VOID)
@ -169,33 +306,13 @@ KiDoubleFaultHandler(VOID)
ULONG Esp0;
ULONG ExceptionNr = 8;
extern KTSS KiTss;
static char *TypeStrings[] =
{
"Divide Error",
"Debug Trap",
"NMI",
"Breakpoint",
"Overflow",
"BOUND range exceeded",
"Invalid Opcode",
"No Math Coprocessor",
"Double Fault",
"Unknown(9)",
"Invalid TSS",
"Segment Not Present",
"Stack Segment Fault",
"General Protection",
"Page Fault",
"Math Fault",
"Alignment Check",
"Machine Check"
};
/* Use the address of the trap frame as approximation to the ring0 esp */
Esp0 = KiTss.Esp0;
/* Get CR2 */
__asm__("movl %%cr2,%0\n\t" : "=d" (cr2));
/* Get CR2 */
__asm__("movl %%cr2,%0\n\t" : "=d" (cr2));
/*
* Check for stack underflow
@ -213,7 +330,7 @@ KiDoubleFaultHandler(VOID)
*/
if (ExceptionNr < 19)
{
DbgPrint("%s Exception: %d(%x)\n",TypeStrings[ExceptionNr],
DbgPrint("%s Exception: %d(%x)\n", ExceptionTypeStrings[ExceptionNr],
ExceptionNr, 0);
}
else
@ -314,27 +431,6 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
NTSTATUS Status;
ULONG Esp0;
ULONG StackLimit;
static char *TypeStrings[] =
{
"Divide Error",
"Debug Trap",
"NMI",
"Breakpoint",
"Overflow",
"BOUND range exceeded",
"Invalid Opcode",
"No Math Coprocessor",
"Double Fault",
"Unknown(9)",
"Invalid TSS",
"Segment Not Present",
"Stack Segment Fault",
"General Protection",
"Page Fault",
"Math Fault",
"Alignment Check",
"Machine Check"
};
/* Use the address of the trap frame as approximation to the ring0 esp */
Esp0 = (ULONG)&Tf->Eip;
@ -351,7 +447,7 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
}
/*
* Check for stack underflow
* Check for stack underflow, this may be obsolete
*/
if (PsGetCurrentThread() != NULL &&
Esp0 < (ULONG)PsGetCurrentThread()->Tcb.StackLimit)
@ -360,7 +456,10 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
Esp0, (ULONG)PsGetCurrentThread()->Tcb.StackLimit);
ExceptionNr = 12;
}
/*
* Maybe handle the page fault and return
*/
if (ExceptionNr == 14)
{
__asm__("sti\n\t");
@ -375,19 +474,20 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
}
}
#if 0
/*
* Handle user exceptions differently
*/
if ((Tf->Cs & 0xFFFF) == USER_CS)
{
return(KiUserTrapHandler(Tf, ExceptionNr, (PVOID)cr2));
}
#endif
/*
* Print out the CPU registers
*/
if (ExceptionNr < 19)
{
DbgPrint("%s Exception: %d(%x)\n",TypeStrings[ExceptionNr],
DbgPrint("%s Exception: %d(%x)\n", ExceptionTypeStrings[ExceptionNr],
ExceptionNr, Tf->ErrorCode&0xffff);
}
else
@ -427,94 +527,40 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
}
}
else
{
DbgPrint("User ESP %.8x\n", Tf->Esp);
}
if ((Tf->Cs & 0xffff) == KERNEL_CS)
{
DbgPrint("ESP %x\n", Esp0);
stack = (PULONG) (Esp0 + 24);
stack = (PULONG)(((ULONG)stack) & (~0x3));
DbgPrint("stack<%p>: ", stack);
if (PsGetCurrentThread() != NULL)
{
StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase;
}
else
{
StackLimit = (ULONG)&init_stack_top;
}
for (i = 0; i < 18; i = i + 6)
{
DbgPrint("%.8x %.8x %.8x %.8x\n",
stack[i], stack[i+1],
stack[i+2], stack[i+3],
stack[i+4], stack[i+5]);
}
DbgPrint("Frames:\n");
for (i = 0; i < 32 && ((ULONG)&stack[i] < StackLimit); i++)
{
if (stack[i] > ((unsigned int) &_text_start__) &&
!(stack[i] >= ((ULONG)&init_stack) &&
stack[i] <= ((ULONG)&init_stack_top)))
{
// DbgPrint(" %.8x", stack[i]);
print_address((PVOID)stack[i]);
DbgPrint(" ");
}
}
}
DbgPrint("ESP %x\n", Esp0);
stack = (PULONG) (Esp0 + 24);
stack = (PULONG)(((ULONG)stack) & (~0x3));
DbgPrint("stack<%p>: ", stack);
if (PsGetCurrentThread() != NULL)
{
StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase;
}
else
{
#if 1
DbgPrint("SS:ESP %x:%x\n", Tf->Ss, Tf->Esp);
stack=(PULONG)(Tf->Esp);
DbgPrint("Stack:\n");
for (i=0; i<64; i++)
{
if (MmIsPagePresent(NULL,&stack[i]))
{
DbgPrint("%.8x ",stack[i]);
if (((i+1)%8) == 0)
{
DbgPrint("\n");
}
}
}
if (MmIsPagePresent(NULL, (PVOID)Tf->Eip))
{
unsigned char instrs[512];
memcpy(instrs, (PVOID)Tf->Eip, 512);
DbgPrint("Instrs: ");
for (i=0; i<10; i++)
{
DbgPrint("%x ", instrs[i]);
}
}
#endif
StackLimit = (ULONG)&init_stack_top;
}
DbgPrint("\n");
if ((Tf->Cs&0xffff) == USER_CS &&
Tf->Eip < KERNEL_BASE)
for (i = 0; i < 18; i = i + 6)
{
DbgPrint("Killing current task\n");
KeLowerIrql(PASSIVE_LEVEL);
if ((Tf->Cs&0xffff) == USER_CS)
{
ZwTerminateProcess(NtCurrentProcess(),
STATUS_NONCONTINUABLE_EXCEPTION);
}
}
DbgPrint("%.8x %.8x %.8x %.8x\n",
stack[i], stack[i+1],
stack[i+2], stack[i+3],
stack[i+4], stack[i+5]);
}
DbgPrint("Frames:\n");
for (i = 0; i < 32 && ((ULONG)&stack[i] < StackLimit); i++)
{
if (stack[i] > ((unsigned int) &_text_start__) &&
!(stack[i] >= ((ULONG)&init_stack) &&
stack[i] <= ((ULONG)&init_stack_top)))
{
print_address((PVOID)stack[i]);
DbgPrint(" ");
}
}
for(;;);
}