- Fix this by defining DBG on non-debug build too and deprecate all usage of #ifdef DBG.
svn path=/trunk/; revision=41436
96 files changed:
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
+ <if property="DBG" value="0">
+ <define name="DBG">0</define>
+ </if>
+
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
<define name="_SEH_ENABLE_TRACE" />
<property name="DBG_OR_KDBG" value="true" />
</if>
+ <if property="DBG" value="0">
+ <define name="DBG">0</define>
+ </if>
+
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
<if property="KDBG" value="1">
<define name="KDBG">1</define>
<property name="DBG_OR_KDBG" value="true" />
#define DEBUG_ADAPTER 0x00000100
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_ADAPTER 0x00000100
#define DEBUG_ULTRA 0xFFFFFFFF
extern unsigned long debug_trace_level;
extern unsigned long debug_trace_level;
IniSection = IniCacheAppendSection(IniCache,
L"FREELOADER");
IniSection = IniCacheAppendSection(IniCache,
L"FREELOADER");
if (IsUnattendedSetup)
{
/* DefaultOS=ReactOS */
if (IsUnattendedSetup)
{
/* DefaultOS=ReactOS */
if (IsUnattendedSetup)
#endif
{
if (IsUnattendedSetup)
#endif
{
else
{
/* Timeout=0 or 10 */
else
{
/* Timeout=0 or 10 */
L"ReactOS_Debug",
L"\"ReactOS (Debug)\"");
L"ReactOS_Debug",
L"\"ReactOS (Debug)\"");
/* ReactOS_KdSerial="ReactOS (RosDbg)" */
IniCacheInsertKey(IniSection,
NULL,
/* ReactOS_KdSerial="ReactOS (RosDbg)" */
IniCacheInsertKey(IniSection,
NULL,
L"Options",
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS");
L"Options",
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS");
/* Create "ReactOS_KdSerial" section */
IniSection = IniCacheAppendSection(IniCache,
/* Create "ReactOS_KdSerial" section */
IniSection = IniCacheAppendSection(IniCache,
VOID
PrintString(LPCSTR fmt, ...)
{
VOID
PrintString(LPCSTR fmt, ...)
{
CHAR buffer[512];
va_list ap;
CHAR buffer[512];
va_list ap;
memcpy(Buffer, Ptr, BufferSize);
memcpy(Buffer, Ptr, BufferSize);
DPRINTM(DPRINT_DISK, "size of buffer: %x\n", Ptr[0]);
DPRINTM(DPRINT_DISK, "information flags: %x\n", Ptr[1]);
DPRINTM(DPRINT_DISK, "number of physical cylinders on drive: %u\n", *(PULONG)&Ptr[2]);
DPRINTM(DPRINT_DISK, "size of buffer: %x\n", Ptr[0]);
DPRINTM(DPRINT_DISK, "information flags: %x\n", Ptr[1]);
DPRINTM(DPRINT_DISK, "number of physical cylinders on drive: %u\n", *(PULONG)&Ptr[2]);
/* MACROS *******************************************************************/
/* MACROS *******************************************************************/
#define DEFAULT_BAUD_RATE 19200
#define DEFAULT_BAUD_RATE 19200
WRITE_PORT_UCHAR (SER_THR(Rs232PortBase), ByteToSend);
}
WRITE_PORT_UCHAR (SER_THR(Rs232PortBase), ByteToSend);
}
-#endif /* defined DBG */
BOOLEAN Rs232PortInUse(ULONG Base)
{
BOOLEAN Rs232PortInUse(ULONG Base)
{
return PortInitialized && Rs232PortBase == (PUCHAR)(ULONG_PTR)Base ? TRUE : FALSE;
#else
return FALSE;
return PortInitialized && Rs232PortBase == (PUCHAR)(ULONG_PTR)Base ? TRUE : FALSE;
#else
return FALSE;
//#define DEBUG_ALL
//#define DEBUG_INIFILE
//#define DEBUG_ALL
//#define DEBUG_INIFILE
ULONG
MsgBoxPrint(const char *Format, ...)
ULONG
MsgBoxPrint(const char *Format, ...)
return NtfsFixupRecord((PNTFS_RECORD)Buffer);
}
return NtfsFixupRecord((PNTFS_RECORD)Buffer);
}
VOID NtfsPrintFile(PNTFS_INDEX_ENTRY IndexEntry)
{
PWCHAR FileName;
VOID NtfsPrintFile(PNTFS_INDEX_ENTRY IndexEntry)
{
PWCHAR FileName;
EntryFileName = IndexEntry->FileName.FileName;
EntryFileNameLength = IndexEntry->FileName.FileNameLength;
EntryFileName = IndexEntry->FileName.FileName;
EntryFileNameLength = IndexEntry->FileName.FileNameLength;
NtfsPrintFile(IndexEntry);
#endif
NtfsPrintFile(IndexEntry);
#endif
extern char* g_file;
extern int g_line;
extern char* g_file;
extern int g_line;
VOID DbgPrintMask(ULONG Mask, char *format, ...);
VOID DebugInit(VOID);
VOID DbgPrintMask(ULONG Mask, char *format, ...);
VOID DebugInit(VOID);
#define BugCheck(_x_)
#define DbgDumpBuffer(_x_, _y_, _z_)
#define BugCheck(_x_)
#define DbgDumpBuffer(_x_, _y_, _z_)
#endif // defined __DEBUG_H
#endif // defined __DEBUG_H
extern ULONG FreePagesInLookupTable;
extern ULONG LastFreePageHint;
extern ULONG FreePagesInLookupTable;
extern ULONG LastFreePageHint;
PCSTR MmGetSystemMemoryMapTypeString(MEMORY_TYPE Type);
#endif
PCSTR MmGetSystemMemoryMapTypeString(MEMORY_TYPE Type);
#endif
#include <freeldr.h>
#include <debug.h>
#include <freeldr.h>
#include <debug.h>
typedef struct
{
MEMORY_TYPE Type;
typedef struct
{
MEMORY_TYPE Type;
BOOLEAN MmInitializeMemoryManager(VOID)
{
BOOLEAN MmInitializeMemoryManager(VOID)
{
MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
#endif
DPRINTM(DPRINT_MEMORY, "Initializing Memory Manager.\n");
MEMORY_DESCRIPTOR* MemoryDescriptor = NULL;
#endif
DPRINTM(DPRINT_MEMORY, "Initializing Memory Manager.\n");
// Dump the system memory map
DPRINTM(DPRINT_MEMORY, "System Memory Map (Base Address, Length, Type):\n");
while ((MemoryDescriptor = ArcGetMemoryDescriptor(MemoryDescriptor)) != NULL)
// Dump the system memory map
DPRINTM(DPRINT_MEMORY, "System Memory Map (Base Address, Length, Type):\n");
while ((MemoryDescriptor = ArcGetMemoryDescriptor(MemoryDescriptor)) != NULL)
DPRINTM(DPRINT_MEMORY, "Heap initialized, base 0x%08x, pages %d\n", (HeapStart << MM_PAGE_SHIFT), PagesNeeded);
}
DPRINTM(DPRINT_MEMORY, "Heap initialized, base 0x%08x, pages %d\n", (HeapStart << MM_PAGE_SHIFT), PagesNeeded);
}
PCSTR MmGetSystemMemoryMapTypeString(MEMORY_TYPE Type)
{
ULONG Index;
PCSTR MmGetSystemMemoryMapTypeString(MEMORY_TYPE Type)
{
ULONG Index;
#include <freeldr.h>
#include <debug.h>
#include <freeldr.h>
#include <debug.h>
VOID DumpMemoryAllocMap(VOID);
VOID MemAllocTest(VOID);
#endif // DBG
VOID DumpMemoryAllocMap(VOID);
VOID MemAllocTest(VOID);
#endif // DBG
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)StartPageNumber * MM_PAGE_SIZE);
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)StartPageNumber * MM_PAGE_SIZE);
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, StartPageNumber);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, StartPageNumber);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
FreePagesInLookupTable -= PagesNeeded;
MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE);
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
DPRINTM(DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd);
DPRINTM(DPRINT_MEMORY, "Memory allocation pointer: 0x%x\n", MemPointer);
#endif // DBG
VOID DumpMemoryAllocMap(VOID)
{
VOID DumpMemoryAllocMap(VOID)
{
if (!*SourcePath)
SourcePath = "\\";
if (!*SourcePath)
SourcePath = "\\";
/* Get load options */
if (InfFindFirstLine (InfHandle,
"SetupData",
/* Get load options */
if (InfFindFirstLine (InfHandle,
"SetupData",
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
DPRINTM(DPRINT_WINDOWS, "Memory Descriptor List prepared, printing PDE\n");
List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
DPRINTM(DPRINT_WINDOWS, "Memory Descriptor List prepared, printing PDE\n");
List_PaToVa(&LoaderBlock->MemoryDescriptorListHead);
{
ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000;
int j;
{
ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000;
int j;
ULONG ul_reason_for_call,
LPVOID lpReserved);
ULONG ul_reason_for_call,
LPVOID lpReserved);
-#if defined(KDBG) || defined(DBG)
+#if defined(KDBG) || DBG
VOID
LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule);
#endif
VOID
LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule);
#endif
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
&NtModule->InInitializationOrderModuleList);
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
&NtModule->InInitializationOrderModuleList);
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
LdrpLoadUserModuleSymbols(NtModule);
LdrpLoadUserModuleSymbols(NtModule);
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
LdrpLoadUserModuleSymbols(ExeModule);
LdrpLoadUserModuleSymbols(ExeModule);
/* FUNCTIONS *****************************************************************/
/* FUNCTIONS *****************************************************************/
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
VOID
LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule)
VOID
LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule)
DPRINT1("LdrFixupImports failed for %wZ, status=%x\n", &(*Module)->BaseDllName, Status);
return Status;
}
DPRINT1("LdrFixupImports failed for %wZ, status=%x\n", &(*Module)->BaseDllName, Status);
return Status;
}
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
LdrpLoadUserModuleSymbols(*Module);
#endif /* DBG || KDBG */
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
LdrpLoadUserModuleSymbols(*Module);
#endif /* DBG || KDBG */
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
#define EXPORT CALLBACK
#endif
#define EXPORT CALLBACK
#endif
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
#endif /* DBG */
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
#endif /* DBG */
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
//DWORD DebugTraceLevel = DEBUG_ULTRA;
DWORD DebugTraceLevel = 0;
#endif /* DBG */
//DWORD DebugTraceLevel = DEBUG_ULTRA;
DWORD DebugTraceLevel = 0;
#endif /* DBG */
ULONG DbgPrint(PCH Format,...);
ULONG DbgPrint(PCH Format,...);
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
{
WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider));
{
WS_DbgPrint(MAX_TRACE, ("Provider (0x%X).\n", Provider));
if (Provider->ReferenceCount <= 0)
{
WS_DbgPrint(MIN_TRACE, ("Provider at 0x%X has invalid reference count (%ld).\n",
if (Provider->ReferenceCount <= 0)
{
WS_DbgPrint(MIN_TRACE, ("Provider at 0x%X has invalid reference count (%ld).\n",
#include <handle.h>
#include <upcall.h>
#include <handle.h>
#include <upcall.h>
/* See debug.h for debug/trace constants */
//DWORD DebugTraceLevel = MIN_TRACE;
/* See debug.h for debug/trace constants */
//DWORD DebugTraceLevel = MIN_TRACE;
LPSOCKADDR_IN sa = (LPSOCKADDR_IN)addr;
WS_DbgPrint(MAX_TRACE,("Returned address: %d %s:%d (len %d)\n",
sa->sin_family,
LPSOCKADDR_IN sa = (LPSOCKADDR_IN)addr;
WS_DbgPrint(MAX_TRACE,("Returned address: %d %s:%d (len %d)\n",
sa->sin_family,
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
#include "ws2help.h"
#include <debug.h>
#include "ws2help.h"
#include <debug.h>
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_ULTRA 0xFFFFFFFF
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
/* See debug.h for debug/trace constants */
DWORD DebugTraceLevel = MAX_TRACE;
PDEVICE_OBJECT DeviceObject,
PFILE_DISPOSITION_INFORMATION DispositionInfo)
{
PDEVICE_OBJECT DeviceObject,
PFILE_DISPOSITION_INFORMATION DispositionInfo)
{
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
#endif
PDEVICE_EXTENSION DeviceExt = DeviceObject->DeviceExtension;
#endif
/* Default value for CrashOnCtrlScroll depends if we're
* running a debug build or a normal build.
*/
/* Default value for CrashOnCtrlScroll depends if we're
* running a debug build or a normal build.
*/
DefaultCrashOnCtrlScroll = 1;
#else
DefaultCrashOnCtrlScroll = 0;
DefaultCrashOnCtrlScroll = 1;
#else
DefaultCrashOnCtrlScroll = 0;
}
VOID SocketStateUnlock( PAFD_FCB FCB ) {
}
VOID SocketStateUnlock( PAFD_FCB FCB ) {
PVOID CurrentThread = KeGetCurrentThread();
#endif
ASSERT(FCB->LockCount > 0);
PVOID CurrentThread = KeGetCurrentThread();
#endif
ASSERT(FCB->LockCount > 0);
#include "tdiconn.h"
#include "debug.h"
#include "tdiconn.h"
#include "debug.h"
/* See debug.h for debug/trace constants */
//DWORD DebugTraceLevel = DEBUG_ULTRA;
/* See debug.h for debug/trace constants */
//DWORD DebugTraceLevel = DEBUG_ULTRA;
{
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS Status = STATUS_SUCCESS;
{
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
NTSTATUS Status = STATUS_SUCCESS;
PFILE_OBJECT FileObject = IrpSp->FileObject;
#endif
PFILE_OBJECT FileObject = IrpSp->FileObject;
#endif
#include "tdiconn.h"
#include "tdi_proto.h"
#include "tdiconn.h"
#include "tdi_proto.h"
#if 0
static VOID DisplayBuffer(
PVOID Buffer,
#if 0
static VOID DisplayBuffer(
PVOID Buffer,
#define DEBUG_IRP 0x00000200
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_IRP 0x00000200
#define DEBUG_ULTRA 0xFFFFFFFF
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
#define DEBUG_MEMORY 0x00000100
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_MEMORY 0x00000100
#define DEBUG_ULTRA 0xFFFFFFFF
extern ULONG DebugTraceLevel;
extern ULONG DebugTraceLevel;
NdisStallExecution(500);
}
NdisStallExecution(500);
}
if (i == 4)
NDIS_DbgPrint(MIN_TRACE, ("NIC was not reset after 2ms.\n"));
#endif
if (i == 4)
NDIS_DbgPrint(MIN_TRACE, ("NIC was not reset after 2ms.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
if (Count == 0xFFFF)
NDIS_DbgPrint(MIN_TRACE, ("Remote DMA did not complete.\n"));
#endif
NdisStallExecution(500);
}
NdisStallExecution(500);
}
if (i == 4)
NDIS_DbgPrint(MIN_TRACE, ("NIC was not reset after 2ms.\n"));
#endif
if (i == 4)
NDIS_DbgPrint(MIN_TRACE, ("NIC was not reset after 2ms.\n"));
#endif
PUNICODE_STRING RegistryPath);
PUNICODE_STRING RegistryPath);
/* See debug.h for debug/trace constants */
ULONG DebugTraceLevel = 0;
/* See debug.h for debug/trace constants */
ULONG DebugTraceLevel = 0;
#define DEBUG_CPOINT 0x00800000
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_CPOINT 0x00800000
#define DEBUG_ULTRA 0xFFFFFFFF
extern DWORD DebugTraceLevel;
extern DWORD DebugTraceLevel;
#define DEBUG_PACKET 0x00000800
#define DEBUG_ULTRA 0xFFFFFFFF
#define DEBUG_PACKET 0x00000800
#define DEBUG_ULTRA 0xFFFFFFFF
extern ULONG DebugTraceLevel;
extern ULONG DebugTraceLevel;
extern KSPIN_LOCK AdapterListLock;
extern KSPIN_LOCK AdapterListLock;
VOID
MiniDisplayPacket(
PNDIS_PACKET Packet);
VOID
MiniDisplayPacket(
PNDIS_PACKET Packet);
/* See debug.h for debug/trace constants */
ULONG DebugTraceLevel = MIN_TRACE;
/* See debug.h for debug/trace constants */
ULONG DebugTraceLevel = MIN_TRACE;
MiniDisplayPacket(
PNDIS_PACKET Packet)
{
MiniDisplayPacket(
PNDIS_PACKET Packet)
{
ULONG i, Length;
UCHAR Buffer[64];
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
ULONG i, Length;
UCHAR Buffer[64];
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
PVOID LookaheadBuffer,
UINT LookaheadBufferSize)
{
PVOID LookaheadBuffer,
UINT LookaheadBufferSize)
{
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
ULONG i, Length;
PUCHAR p;
if ((DebugTraceLevel & DEBUG_PACKET) > 0) {
ULONG i, Length;
PUCHAR p;
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
if(!Adapter)
{
NDIS_DbgPrint(MID_TRACE, ("Adapter object was null\n"));
if(!Adapter)
{
NDIS_DbgPrint(MID_TRACE, ("Adapter object was null\n"));
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
MiniDisplayPacket(Packet);
#endif
MiniDisplayPacket(Packet);
#endif
EHeader->EType = ETYPE_IPv6;
break;
default:
EHeader->EType = ETYPE_IPv6;
break;
default:
/* Should not happen */
TI_DbgPrint(MIN_TRACE, ("Unknown LAN protocol.\n"));
/* Should not happen */
TI_DbgPrint(MIN_TRACE, ("Unknown LAN protocol.\n"));
(IPAddress)->Address.IPv4Address = (RawAddress); \
}
(IPAddress)->Address.IPv4Address = (RawAddress); \
}
PCHAR A2S(
PIP_ADDRESS Address);
PCHAR A2S(
PIP_ADDRESS Address);
#define DEBUG_INFO 0x02000000
#define DEBUG_ULTRA 0x7FFFFFFF
#define DEBUG_INFO 0x02000000
#define DEBUG_ULTRA 0x7FFFFFFF
#define REMOVE_PARENS(...) __VA_ARGS__
#define TI_DbgPrint(_t_, _x_) \
#define REMOVE_PARENS(...) __VA_ARGS__
#define TI_DbgPrint(_t_, _x_) \
#define AllocatePacketWithBuffer(x,y,z) AllocatePacketWithBufferX(x,y,z,__FILE__,__LINE__)
#define FreeNdisPacket(x) FreeNdisPacketX(x,__FILE__,__LINE__)
#define AllocatePacketWithBuffer(x,y,z) AllocatePacketWithBufferX(x,y,z,__FILE__,__LINE__)
#define FreeNdisPacket(x) FreeNdisPacketX(x,__FILE__,__LINE__)
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define exAllocatePool(x,y) ExAllocatePoolX(x,y,__FILE__,__LINE__)
#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolX(x,y,__FILE__,__LINE__)
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define exAllocatePool(x,y) ExAllocatePoolX(x,y,__FILE__,__LINE__)
#define exAllocatePoolWithTag(x,y,z) ExAllocatePoolX(x,y,__FILE__,__LINE__)
PCHAR *DataOut,
PUINT Size );
PCHAR *DataOut,
PUINT Size );
VOID DisplayIPPacket(
PIP_PACKET IPPacket);
#define DISPLAY_IP_PACKET(x) DisplayIPPacket(x)
VOID DisplayIPPacket(
PIP_PACKET IPPacket);
#define DISPLAY_IP_PACKET(x) DisplayIPPacket(x)
#define DEFINE_TAG ULONG Tag;
#define INIT_TAG(_Object, _Tag) \
#define DEFINE_TAG ULONG Tag;
#define INIT_TAG(_Object, _Tag) \
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_CANCELLED;
Irp->IoStatus.Information = 0;
if (!Irp->Cancel)
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
if (!Irp->Cancel)
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
TI_DbgPrint(DEBUG_IRP, ("IRP at (0x%X).\n", Irp));
TI_DbgPrint(DEBUG_IRP, ("IRP at (0x%X).\n", Irp));
if (!Irp->Cancel)
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
if (!Irp->Cancel)
TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n"));
#endif
* DriverObject = Pointer to driver object created by the system
*/
{
* DriverObject = Pointer to driver object created by the system
*/
{
KIRQL OldIrql;
TcpipAcquireSpinLock(&AddressFileListLock, &OldIrql);
KIRQL OldIrql;
TcpipAcquireSpinLock(&AddressFileListLock, &OldIrql);
UCHAR MediaChangeCountDown;
UCHAR MediaChangeCountDown;
//
// Second timer to keep track of how long the media change IRP has been
// in use. If this value exceeds the timeout (#defined) then we should
//
// Second timer to keep track of how long the media change IRP has been
// in use. If this value exceeds the timeout (#defined) then we should
#define CDROM_SRB_LIST_SIZE 4
#define CDROM_SRB_LIST_SIZE 4
//
// Used to detect the loss of the autorun irp. The driver prints out a message
//
// Used to detect the loss of the autorun irp. The driver prints out a message
deviceExtension->MediaChangeNoMedia = TRUE;
cddata->MediaChangeIrp = NULL;
deviceExtension->MediaChangeNoMedia = TRUE;
cddata->MediaChangeIrp = NULL;
cddata->MediaChangeIrpTimeInUse = 0;
cddata->MediaChangeIrpLost = FALSE;
#endif
cddata->MediaChangeIrpTimeInUse = 0;
cddata->MediaChangeIrpLost = FALSE;
#endif
cddata->MediaChangeCountDown--;
cddata->MediaChangeCountDown--;
cddata->MediaChangeIrpTimeInUse = 0;
cddata->MediaChangeIrpLost = FALSE;
#endif
cddata->MediaChangeIrpTimeInUse = 0;
cddata->MediaChangeIrpLost = FALSE;
#endif
if(cddata->MediaChangeIrpLost == FALSE) {
if(cddata->MediaChangeIrpTimeInUse++ >
MEDIA_CHANGE_TIMEOUT_TIME) {
if(cddata->MediaChangeIrpLost == FALSE) {
if(cddata->MediaChangeIrpTimeInUse++ >
MEDIA_CHANGE_TIMEOUT_TIME) {
if (!IS_RDP((srb->Cdb[0]))) {
KdPrint2((PRINT_PREFIX "AtapiCallBack: Invalid CDB marked as RDP - %#x\n", srb->Cdb[0]));
}
if (!IS_RDP((srb->Cdb[0]))) {
KdPrint2((PRINT_PREFIX "AtapiCallBack: Invalid CDB marked as RDP - %#x\n", srb->Cdb[0]));
}
PEHCI_DEV ehci;
ULONG status;
PEHCI_DEV ehci;
ULONG status;
ULONG urb_count;
#endif
PLIST_ENTRY pthis, pnext;
ULONG urb_count;
#endif
PLIST_ENTRY pthis, pnext;
door_bell_rings = ((status & STS_IAA) != 0);
// scan to remove those due
door_bell_rings = ((status & STS_IAA) != 0);
// scan to remove those due
urb_count = dbg_count_list(&ehci->urb_list);
ehci_dbg_print(DBGLVL_MAXIMUM, ("ehci_isr(): urb# in process is %d\n", urb_count));
#endif
urb_count = dbg_count_list(&ehci->urb_list);
ehci_dbg_print(DBGLVL_MAXIMUM, ("ehci_isr(): urb# in process is %d\n", urb_count));
#endif
#define DebugPrint(x) ChangerClassDebugPrint x
#else
#define DebugPrint(x)
#define DebugPrint(x) ChangerClassDebugPrint x
#else
#define DebugPrint(x)
#define SCSIPORTAPI DECLSPEC_IMPORT
#endif
#define SCSIPORTAPI DECLSPEC_IMPORT
#endif
#define DebugPrint(x) ScsiDebugPrint x
#else
#define DebugPrint(x)
#define DebugPrint(x) ScsiDebugPrint x
#else
#define DebugPrint(x)
#define MAXIMUM_CDB_SIZE 12
#define MAXIMUM_CDB_SIZE 12
#define SCSI_PORT_SIGNATURE 0x54524f50
#endif
#define SCSI_PORT_SIGNATURE 0x54524f50
#endif
IN PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
IN PVOID Context);
IN PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
IN PVOID Context);
#define DebugPrint(x) StorPortDebugPrint x
#else
#define DebugPrint(x)
#define DebugPrint(x) StorPortDebugPrint x
#else
#define DebugPrint(x)
#define PAGED_CODE() \
if (VideoPortGetCurrentIrql() > 1 /* APC_LEVEL */) \
#define PAGED_CODE() \
if (VideoPortGetCurrentIrql() > 1 /* APC_LEVEL */) \
IN PVOID Destination,
IN ULONG Length);
IN PVOID Destination,
IN ULONG Length);
#define VideoDebugPrint(x) VideoPortDebugPrint x
#else
#define VideoDebugPrint(x)
#define VideoDebugPrint(x) VideoPortDebugPrint x
#else
#define VideoDebugPrint(x)
typedef struct _IO_REMOVE_LOCK {
IO_REMOVE_LOCK_COMMON_BLOCK Common;
typedef struct _IO_REMOVE_LOCK {
IO_REMOVE_LOCK_COMMON_BLOCK Common;
IO_REMOVE_LOCK_DBG_BLOCK Dbg;
#endif
} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
IO_REMOVE_LOCK_DBG_BLOCK Dbg;
#endif
} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
#define ROUND_TO_PAGES(Size) \
((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
#define ROUND_TO_PAGES(Size) \
((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
#define ASSERT(exp) \
(VOID)((!(exp)) ? \
#define ASSERT(exp) \
(VOID)((!(exp)) ? \
#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
#define PAGED_CODE() { \
if (KeGetCurrentIrql() > APC_LEVEL) { \
#define PAGED_CODE() { \
if (KeGetCurrentIrql() > APC_LEVEL) { \
IN ULONG Level,
IN BOOLEAN State);
IN ULONG Level,
IN BOOLEAN State);
#define KdPrint(_x_) DbgPrint _x_
#define KdPrintEx(_x_) DbgPrintEx _x_
#define KdPrint(_x_) DbgPrint _x_
#define KdPrintEx(_x_) DbgPrintEx _x_
/* Print stuff only on Debug Builds*/
#define DPFLTR_DEFAULT_ID -1
/* Print stuff only on Debug Builds*/
#define DPFLTR_DEFAULT_ID -1
/* These are always printed */
#define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint
/* These are always printed */
#define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint
TI_DbgPrint(DEBUG_IP, ("Called. BindInfo (0x%X).\n", BindInfo));
TI_DbgPrint(DEBUG_IP, ("Called. BindInfo (0x%X).\n", BindInfo));
if (BindInfo->Address) {
PUCHAR A = BindInfo->Address;
TI_DbgPrint(DEBUG_IP, ("Interface address (%02X %02X %02X %02X %02X %02X).\n",
if (BindInfo->Address) {
PUCHAR A = BindInfo->Address;
TI_DbgPrint(DEBUG_IP, ("Interface address (%02X %02X %02X %02X %02X %02X).\n",
#define TRACK_TAG TAG('T','r','C','K')
static LIST_ENTRY AllocatedObjectsList;
#define TRACK_TAG TAG('T','r','C','K')
static LIST_ENTRY AllocatedObjectsList;
static VOID DisplayIPHeader(
PCHAR Header,
UINT Length)
static VOID DisplayIPHeader(
PCHAR Header,
UINT Length)
VOID DisplayIPPacket(
PIP_PACKET IPPacket)
{
VOID DisplayIPPacket(
PIP_PACKET IPPacket)
{
PCHAR p;
UINT Length;
PNDIS_BUFFER Buffer;
PCHAR p;
UINT Length;
PNDIS_BUFFER Buffer;
#define FBSD_MALLOC FOURCC('d','s','b','f')
#define EXALLOC_TAG FOURCC('E','x','A','l')
#define FBSD_MALLOC FOURCC('d','s','b','f')
#define EXALLOC_TAG FOURCC('E','x','A','l')
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define NdisAllocateBuffer(x,y,z,a,b) { \
NdisAllocateBuffer(x,y,z,a,b); \
#define MTMARK() TrackDumpFL(__FILE__, __LINE__)
#define NdisAllocateBuffer(x,y,z,a,b) { \
NdisAllocateBuffer(x,y,z,a,b); \
extern OSK_UINT OskitDebugTraceLevel;
extern OSK_UINT OskitDebugTraceLevel;
RtlFreeHandle(PRTL_HANDLE_TABLE HandleTable,
PRTL_HANDLE_TABLE_ENTRY Handle)
{
RtlFreeHandle(PRTL_HANDLE_TABLE HandleTable,
PRTL_HANDLE_TABLE_ENTRY Handle)
{
/* check if handle is valid */
if (!RtlIsValidHandle(HandleTable, Handle))
{
/* check if handle is valid */
if (!RtlIsValidHandle(HandleTable, Handle))
{
/* INCLUDES ******************************************************************/
/* PAGED_CODE equivalent for user-mode RTL */
/* INCLUDES ******************************************************************/
/* PAGED_CODE equivalent for user-mode RTL */
extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line);
#define PAGED_CODE_RTL() CHECK_PAGED_CODE_RTL(__FILE__, __LINE__)
#else
extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line);
#define PAGED_CODE_RTL() CHECK_PAGED_CODE_RTL(__FILE__, __LINE__)
#else
#error Unknown compiler for alloca intrinsic stack allocation "function"
#endif
#error Unknown compiler for alloca intrinsic stack allocation "function"
#endif
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
static void CcRosCacheSegmentIncRefCount_ ( PCACHE_SEGMENT cs, const char* file, int line )
{
++cs->ReferenceCount;
static void CcRosCacheSegmentIncRefCount_ ( PCACHE_SEGMENT cs, const char* file, int line )
{
++cs->ReferenceCount;
PBCB Bcb,
BOOLEAN Trace )
{
PBCB Bcb,
BOOLEAN Trace )
{
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
KIRQL oldirql;
PLIST_ENTRY current_entry;
PCACHE_SEGMENT current;
KIRQL oldirql;
PLIST_ENTRY current_entry;
PCACHE_SEGMENT current;
current->PageOut = FALSE;
current->FileOffset = ROUND_DOWN(FileOffset, Bcb->CacheSegmentSize);
current->Bcb = Bcb;
current->PageOut = FALSE;
current->FileOffset = ROUND_DOWN(FileOffset, Bcb->CacheSegmentSize);
current->Bcb = Bcb;
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
if ( Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: new Cache Segment: 0x%p\n", Bcb, current );
if ( Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: new Cache Segment: 0x%p\n", Bcb, current );
{
CcRosCacheSegmentIncRefCount(current);
KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
{
CcRosCacheSegmentIncRefCount(current);
KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
if ( Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: deleting newly created Cache Segment 0x%p ( found existing one 0x%p )\n",
if ( Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: deleting newly created Cache Segment 0x%p ( found existing one 0x%p )\n",
KIRQL oldIrql;
#endif
DPRINT("Freeing cache segment 0x%p\n", CacheSeg);
KIRQL oldIrql;
#endif
DPRINT("Freeing cache segment 0x%p\n", CacheSeg);
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
if ( CacheSeg->Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: deleting Cache Segment: 0x%p\n", CacheSeg->Bcb, CacheSeg );
if ( CacheSeg->Bcb->Trace )
{
DPRINT1("CacheMap 0x%p: deleting Cache Segment: 0x%p\n", CacheSeg->Bcb, CacheSeg );
}
InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry);
}
}
InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry);
}
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
Bcb->Trace = FALSE;
#endif
KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
Bcb->Trace = FALSE;
#endif
KeReleaseSpinLock(&Bcb->BcbLock, oldIrql);
- *ExInterlockedExchangeUlong(IN PULONG Taget,\r
+ *ExInterlockedExchangeUlong(IN PULONG Target,\r
* IN ULONG Value,\r
* IN PKSPIN_LOCK Lock)\r
*/\r
* IN ULONG Value,\r
* IN PKSPIN_LOCK Lock)\r
*/\r
- *Exi386InterlockedExchangeUlong(IN PULONG Taget,\r
+ *Exi386InterlockedExchangeUlong(IN PULONG Target,\r
* IN ULONG Value,\r
* IN PKSPIN_LOCK Lock)\r
*/\r
* IN ULONG Value,\r
* IN PKSPIN_LOCK Lock)\r
*/\r
/* Sanity check */
ASSERT(!WaitBlock->Signaled);
/* Sanity check */
ASSERT(!WaitBlock->Signaled);
/* We are about to get signaled */
WaitBlock->Signaled = TRUE;
#endif
/* We are about to get signaled */
WaitBlock->Signaled = TRUE;
#endif
#define IsOwnedExclusive(r) (r->Flag & ResourceOwnedExclusive)
#define IsBoostAllowed(r) (!(r->Flag & ResourceHasDisabledPriorityBoost))
#define IsOwnedExclusive(r) (r->Flag & ResourceOwnedExclusive)
#define IsBoostAllowed(r) (!(r->Flag & ResourceHasDisabledPriorityBoost))
-#if (!(defined(CONFIG_SMP)) && !(defined(DBG)))
+#if (!(defined(CONFIG_SMP)) && !(DBG))
/********** mm/ppool.c **********/
/* Disable Debugging Features */
/********** mm/ppool.c **********/
/* Disable Debugging Features */
/* Enable strict checking of the nonpaged pool on every allocation */
#undef ENABLE_VALIDATE_POOL
/* Enable strict checking of the nonpaged pool on every allocation */
#undef ENABLE_VALIDATE_POOL
PVOID LazyWriteContext;
KSPIN_LOCK BcbLock;
ULONG RefCount;
PVOID LazyWriteContext;
KSPIN_LOCK BcbLock;
ULONG RefCount;
-#if defined(DBG) || defined(KDBG)
+#if DBG || defined(KDBG)
BOOLEAN Trace; /* enable extra trace output for this BCB and it's cache segments */
#endif
} BCB, *PBCB;
BOOLEAN Trace; /* enable extra trace output for this BCB and it's cache segments */
#endif
} BCB, *PBCB;
// @remark
//
.macro TRAP_EPILOG SystemCall, RestorePreviousMode, RestoreSegments, RestoreVolatiles, RestoreAllRegs
// @remark
//
.macro TRAP_EPILOG SystemCall, RestorePreviousMode, RestoreSegments, RestoreVolatiles, RestoreAllRegs
/* Assert the flags */
pushfd
pop edx
/* Assert the flags */
pushfd
pop edx
/* Assert the trap frame */
#endif
5:
/* Assert the trap frame */
#endif
5:
sub dword ptr [esp+KTRAP_FRAME_DEBUGARGMARK], 0xBADB0D00
jnz 0f
sub dword ptr [esp+KTRAP_FRAME_DEBUGARGMARK], 0xBADB0D00
jnz 0f
/* Get exception list */
mov edx, [esp+KTRAP_FRAME_EXCEPTION_LIST]
/* Get exception list */
mov edx, [esp+KTRAP_FRAME_EXCEPTION_LIST]
/* Assert the saved exception list */
or edx, edx
jnz 1f
/* Assert the saved exception list */
or edx, edx
jnz 1f
/* Get previous mode */
mov ecx, [esp+KTRAP_FRAME_PREVIOUS_MODE]
/* Get previous mode */
mov ecx, [esp+KTRAP_FRAME_PREVIOUS_MODE]
/* Assert the saved previous mode */
cmp ecx, -1
jnz 1f
/* Assert the saved previous mode */
cmp ecx, -1
jnz 1f
mov byte ptr [esi+KTHREAD_PREVIOUS_MODE], cl
.else
mov byte ptr [esi+KTHREAD_PREVIOUS_MODE], cl
.else
/* Assert the saved previous mode */
mov ecx, [esp+KTRAP_FRAME_PREVIOUS_MODE]
cmp ecx, -1
/* Assert the saved previous mode */
mov ecx, [esp+KTRAP_FRAME_PREVIOUS_MODE]
cmp ecx, -1
.macro VERIFY_INT Label
/* Get the current time and mask it to 192 ticks */
.macro VERIFY_INT Label
/* Get the current time and mask it to 192 ticks */
/* SYMBOL ROUTINES **********************************************************/
#ifdef __NTOSKRNL__
/* SYMBOL ROUTINES **********************************************************/
#ifdef __NTOSKRNL__
-#if defined(KDBG) || defined(DBG)
+#if defined(KDBG) || DBG
VOID
KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule);
VOID
KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule);
# define KDB_CREATE_THREAD_HOOK(CONTEXT) do { } while (0)
#endif
# define KDB_CREATE_THREAD_HOOK(CONTEXT) do { } while (0)
#endif
-#if defined(KDBG) || defined(DBG)
+#if defined(KDBG) || DBG
# define KeRosPrintAddress(ADDRESS) KdbSymPrintAddress(ADDRESS)
#else
# define KeRosPrintAddress(ADDRESS) KiRosPrintAddress(ADDRESS)
# define KeRosPrintAddress(ADDRESS) KdbSymPrintAddress(ADDRESS)
#else
# define KeRosPrintAddress(ADDRESS) KiRosPrintAddress(ADDRESS)
/* Value changed... wait until it's locked */
while (*(volatile KSPIN_LOCK *)SpinLock == 1)
{
/* Value changed... wait until it's locked */
while (*(volatile KSPIN_LOCK *)SpinLock == 1)
{
/* On debug builds, we use a much slower but useful routine */
//Kii386SpinOnSpinLock(SpinLock, 5);
/* On debug builds, we use a much slower but useful routine */
//Kii386SpinOnSpinLock(SpinLock, 5);
/* On debug builds, we OR in the KTHREAD */
*SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1;
#endif
/* On debug builds, we OR in the KTHREAD */
*SpinLock = (KSPIN_LOCK)KeGetCurrentThread() | 1;
#endif
VOID
KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
{
VOID
KxReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
{
/* Make sure that the threads match */
if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock)
{
/* Make sure that the threads match */
if (((KSPIN_LOCK)KeGetCurrentThread() | 1) != *SpinLock)
{
Result = KdpPrintString(Buffer1, Buffer1Length);
break;
Result = KdpPrintString(Buffer1, Buffer1Length);
break;
case TAG('R', 'o', 's', ' '): /* ROS-INTERNAL */
{
switch ((ULONG)Buffer1)
case TAG('R', 'o', 's', ' '): /* ROS-INTERNAL */
{
switch ((ULONG)Buffer1)
/* Load symbols only if we have 96Mb of RAM or more */
if (MmNumberOfPhysicalPages >= 0x6000)
LoadSymbols = TRUE;
/* Load symbols only if we have 96Mb of RAM or more */
if (MmNumberOfPhysicalPages >= 0x6000)
LoadSymbols = TRUE;
#ifndef CONFIG_SMP
Prcb->BuildType |= PRCB_BUILD_UNIPROCESSOR;
#endif
#ifndef CONFIG_SMP
Prcb->BuildType |= PRCB_BUILD_UNIPROCESSOR;
#endif
Prcb->BuildType |= PRCB_BUILD_DEBUG;
#endif
Prcb->CurrentThread = InitThread;
Prcb->BuildType |= PRCB_BUILD_DEBUG;
#endif
Prcb->CurrentThread = InitThread;
cmp dword ptr [esp+20], 0
je Return
cmp dword ptr [esp+20], 0
je Return
/* Assert Fxsr support */
test byte ptr _KeI386FxsrPresent, 1
jnz AssertOk
/* Assert Fxsr support */
test byte ptr _KeI386FxsrPresent, 1
jnz AssertOk
cmp byte ptr [eax+KTHREAD_NPX_STATE], NPX_STATE_NOT_LOADED
jnz DontSave
cmp byte ptr [eax+KTHREAD_NPX_STATE], NPX_STATE_NOT_LOADED
jnz DontSave
/* We are the NPX Thread with an unloaded NPX State... this isn't normal! */
int 3
#endif
/* We are the NPX Thread with an unloaded NPX State... this isn't normal! */
int 3
#endif
AfterTrace:
#ifdef CONFIG_SMP
AfterTrace:
#ifdef CONFIG_SMP
/* Assert that we're on the right CPU */
mov cl, [esi+KTHREAD_NEXT_PROCESSOR]
cmp cl, [ebx+KPCR_PROCESSOR_NUMBER]
/* Assert that we're on the right CPU */
mov cl, [esi+KTHREAD_NEXT_PROCESSOR]
cmp cl, [ebx+KPCR_PROCESSOR_NUMBER]
lock xor [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
/* Assert change went ok */
lock xor [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
/* Assert change went ok */
test [ebp+KPROCESS_ACTIVE_PROCESSORS], ecx
jz WrongActiveCpu
test [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
test [ebp+KPROCESS_ACTIVE_PROCESSORS], ecx
jz WrongActiveCpu
test [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
/* Assert NPX State */
test byte ptr [esi+KTHREAD_NPX_STATE], ~(NPX_STATE_NOT_LOADED)
jnz InvalidNpx
/* Assert NPX State */
test byte ptr [esi+KTHREAD_NPX_STATE], ~(NPX_STATE_NOT_LOADED)
jnz InvalidNpx
push ATTEMPTED_SWITCH_FROM_DPC
call _KeBugCheckEx@20
push ATTEMPTED_SWITCH_FROM_DPC
call _KeBugCheckEx@20
InvalidNpx:
int 3
WrongActiveCpu:
InvalidNpx:
int 3
WrongActiveCpu:
lock xor [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
/* Sanity check */
lock xor [eax+KPROCESS_ACTIVE_PROCESSORS], ecx
/* Sanity check */
test dword ptr [edx+KPROCESS_ACTIVE_PROCESSORS], 0
jz WrongCpu1
test dword ptr [eax+KPROCESS_ACTIVE_PROCESSORS], 0
test dword ptr [edx+KPROCESS_ACTIVE_PROCESSORS], 0
jz WrongCpu1
test dword ptr [eax+KPROCESS_ACTIVE_PROCESSORS], 0
WrongCpu1:
int 3
WrongCpu2:
WrongCpu1:
int 3
WrongCpu2:
#ifndef CONFIG_SMP
Pcr->PrcbData.BuildType |= PRCB_BUILD_UNIPROCESSOR;
#endif
#ifndef CONFIG_SMP
Pcr->PrcbData.BuildType |= PRCB_BUILD_UNIPROCESSOR;
#endif
Pcr->PrcbData.BuildType |= PRCB_BUILD_DEBUG;
#endif
Pcr->PrcbData.BuildType |= PRCB_BUILD_DEBUG;
#endif
/* At dispatch, increase DPC time */
inc dword ptr [eax+KPCR_PRCB_DPC_TIME]
/* At dispatch, increase DPC time */
inc dword ptr [eax+KPCR_PRCB_DPC_TIME]
/* Update the DPC time */
inc dword ptr [eax+KPCR_PRCB_DEBUG_DPC_TIME]
/* Update the DPC time */
inc dword ptr [eax+KPCR_PRCB_DEBUG_DPC_TIME]
/* Increase total syscall count */
inc dword ptr PCR[KPCR_SYSTEM_CALLS]
/* Increase total syscall count */
inc dword ptr PCR[KPCR_SYSTEM_CALLS]
/* Increase per-syscall count */
mov ecx, [edi+SERVICE_DESCRIPTOR_COUNT]
jecxz NoCountTable
/* Increase per-syscall count */
mov ecx, [edi+SERVICE_DESCRIPTOR_COUNT]
jecxz NoCountTable
/* Make sure the user-mode call didn't return at elevated IRQL */
test byte ptr [ebp+KTRAP_FRAME_CS], MODE_MASK
jz SkipCheck
/* Make sure the user-mode call didn't return at elevated IRQL */
test byte ptr [ebp+KTRAP_FRAME_CS], MODE_MASK
jz SkipCheck
InvalidIrql:
/* Save current IRQL */
push PCR[KPCR_IRQL]
InvalidIrql:
/* Save current IRQL */
push PCR[KPCR_IRQL]
/* On debug builds, we OR in the KTHREAD */
*SpinLock = (ULONG_PTR)KeGetCurrentThread() | 1;
#endif
/* On debug builds, we OR in the KTHREAD */
*SpinLock = (ULONG_PTR)KeGetCurrentThread() | 1;
#endif
struct _MM_RMAP_ENTRY* Next;
PEPROCESS Process;
PVOID Address;
struct _MM_RMAP_ENTRY* Next;
PEPROCESS Process;
PVOID Address;
}
new_entry->Address = Address;
new_entry->Process = (PEPROCESS)Process;
}
new_entry->Address = Address;
new_entry->Process = (PEPROCESS)Process;
#ifdef __GNUC__
new_entry->Caller = __builtin_return_address(0);
#else
#ifdef __GNUC__
new_entry->Caller = __builtin_return_address(0);
#else
ExAcquireFastMutex(&RmapListLock);
current_entry = MmGetRmapListHeadPage(Page);
new_entry->Next = current_entry;
ExAcquireFastMutex(&RmapListLock);
current_entry = MmGetRmapListHeadPage(Page);
new_entry->Next = current_entry;
while (current_entry)
{
if (current_entry->Address == new_entry->Address && current_entry->Process == new_entry->Process)
while (current_entry)
{
if (current_entry->Address == new_entry->Address && current_entry->Process == new_entry->Process)
ASSERT ( pool->FirstFree == Item );
pool->FirstFree = Item->NextFree;
}
ASSERT ( pool->FirstFree == Item );
pool->FirstFree = Item->NextFree;
}
Item->NextFree = Item->PrevFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF;
#endif//DBG
}
Item->NextFree = Item->PrevFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF;
#endif//DBG
}
#endif//R_FREEMAGIC
block->Status = 0;
RFreeFillStack ( block );
#endif//R_FREEMAGIC
block->Status = 0;
RFreeFillStack ( block );
block->PrevFree = block->NextFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF;
#endif//DBG
return block;
block->PrevFree = block->NextFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF;
#endif//DBG
return block;
//ASSERT_SIZE ( Block->Size );
// now add the block to the used block list
//ASSERT_SIZE ( Block->Size );
// now add the block to the used block list
Block->NextUsed = (PR_USED)(ULONG_PTR)0xDEADBEEF;
#endif//R_USED_LIST
Block->NextUsed = (PR_USED)(ULONG_PTR)0xDEADBEEF;
#endif//R_USED_LIST
Block->UserSize = UserSize;
memset ( Addr - R_RZ, R_RZ_LOVALUE, R_RZ );
memset ( Addr + Block->UserSize, R_RZ_HIVALUE, R_RZ );
Block->UserSize = UserSize;
memset ( Addr - R_RZ, R_RZ_LOVALUE, R_RZ );
memset ( Addr + Block->UserSize, R_RZ_HIVALUE, R_RZ );
memset ( Addr, 0xCD, UserSize );
#endif//DBG
}
memset ( Addr, 0xCD, UserSize );
#endif//DBG
}
/* PRIVATE FUNCTIONS *********************************************************/
/* PRIVATE FUNCTIONS *********************************************************/
VOID
NTAPI
PspDumpThreads(BOOLEAN IncludeSystem)
VOID
NTAPI
PspDumpThreads(BOOLEAN IncludeSystem)
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
#ifndef CAB_READ_ONLY
#if 0
#ifndef CAB_READ_ONLY
#if 0
void DumpBuffer(void* Buffer, ULONG Size)
{
void DumpBuffer(void* Buffer, ULONG Size)
{
#define NORMAL_MASK 0x000000FF
#define SPECIAL_MASK 0xFFFFFF00
#define MIN_TRACE 0x00000001
#define NORMAL_MASK 0x000000FF
#define SPECIAL_MASK 0xFFFFFF00
#define MIN_TRACE 0x00000001
#define DEBUG_MEMORY 0x00000100
#define DEBUG_MEMORY 0x00000100
extern ULONG DebugTraceLevel;
extern ULONG DebugTraceLevel;
ULONG DebugTraceLevel = MIN_TRACE;
//ULONG DebugTraceLevel = MID_TRACE;
ULONG DebugTraceLevel = MIN_TRACE;
//ULONG DebugTraceLevel = MID_TRACE;
#include <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
#define trace printf
#else
#define trace if (0) printf
#define trace printf
#else
#define trace if (0) printf