#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_CLEANUP)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_CLOSE)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_CREATE)
+
/* FUNCTIONS ******************************************************************/
VOID
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_DATASUP)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_FILEINFO)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
{
if (NamedPipeEnd != FILE_PIPE_SERVER_END)
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0xA04EFu, NamedPipeEnd, 0, 0);
+ NpBugCheck(NamedPipeEnd, 0, 0);
}
ReadQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
WriteQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
if (*Length < NameLength)
{
Status = STATUS_BUFFER_OVERFLOW;
- NameLength = *Length;
+ NameLength = (USHORT)*Length;
}
else
{
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_FILEOBSUP)
+
/* FUNCTIONS ******************************************************************/
NODE_TYPE_CODE
return NPFS_NTC_CCB;
default:
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0xB0108, Node->NodeType, 0, 0);
+ NpBugCheck(Node->NodeType, 0, 0);
break;
}
}
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_FLUSHBUF)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_FSCTRL)
+
/* GLOBALS ********************************************************************/
IO_STATUS_BLOCK NpUserIoStatusBlock;
{
if (NamedPipeEnd != FILE_PIPE_SERVER_END)
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0xD02E5, NamedPipeEnd, 0, 0);
+ NpBugCheck(NamedPipeEnd, 0, 0);
}
DataQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
{
if (NamedPipeEnd != FILE_PIPE_SERVER_END)
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0xD0538, NamedPipeEnd, 0, 0);
+ NpBugCheck(NamedPipeEnd, 0, 0);
}
ReadQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
WriteQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_MAIN)
+
/* GLOBALS ********************************************************************/
PDEVICE_OBJECT NpfsDeviceObject;
+/*
+ * PROJECT: ReactOS Named Pipe FileSystem
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
+ * FILE: drivers/filesystems/npfs/npfs.h
+ * PURPOSE: Named Pipe FileSystem Header
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ */
+
+/* INCLUDES *******************************************************************/
+
//
// System Headers
//
#pragma warning(disable:4100)
#endif
+
+/* TYPEDEFS & DEFINES *********************************************************/
+
//
// Pool Tags for NPFS (from pooltag.txt)
//
#define NPFS_WAIT_BLOCK_TAG 'NpFt'
#define NPFS_WRITE_BLOCK_TAG 'NpFw'
+//
+// NPFS bugchecking support
+//
+// We define the NpBugCheck macro which triggers a NPFS_FILE_SYSTEM bugcheck
+// containing the source file ID number and the line where it was emitted, as
+// described in the MSDN article "Bug Check 0x25: NPFS_FILE_SYSTEM".
+//
+// The bugcheck emits 4 ULONGs; the first one is made, in its high word, by
+// the current source file ID and in its low word, by the line number; the
+// three other ones are user-defined.
+//
+// In order to avoid redefinition of the same file ID in different source files,
+// we gather all of them here, so that you will have to add (or remove) a new
+// one as soon as you add (or remove) a source file from the NPFS driver code.
+//
+// To use the NpBugCheck macro in a source file, define at its beginning
+// the constant NPFS_BUGCHECK_FILE_ID with one of the following file IDs,
+// then use the bugcheck macro wherever you want.
+//
+#define NPFS_BUGCHECK_CLEANUP 0x0001
+#define NPFS_BUGCHECK_CLOSE 0x0002
+#define NPFS_BUGCHECK_CREATE 0x0003
+#define NPFS_BUGCHECK_DATASUP 0x0004
+#define NPFS_BUGCHECK_FILEINFO 0x0005
+#define NPFS_BUGCHECK_FILEOBSUP 0x0006
+#define NPFS_BUGCHECK_FLUSHBUF 0x0007
+#define NPFS_BUGCHECK_FSCTRL 0x0008
+#define NPFS_BUGCHECK_MAIN 0x0009
+#define NPFS_BUGCHECK_PREFXSUP 0x000a
+#define NPFS_BUGCHECK_READ 0x000b
+#define NPFS_BUGCHECK_READSUP 0x000c
+#define NPFS_BUGCHECK_SECURSUP 0x000d
+#define NPFS_BUGCHECK_SEINFO 0x000e
+#define NPFS_BUGCHECK_STATESUP 0x000f
+#define NPFS_BUGCHECK_STRUCSUP 0x0010
+#define NPFS_BUGCHECK_VOLINFO 0x0011
+#define NPFS_BUGCHECK_WAITSUP 0x0012
+#define NPFS_BUGCHECK_WRITE 0x0013
+#define NPFS_BUGCHECK_WRITESUP 0x0014
+
+#define NpBugCheck(p1, p2, p3) \
+ KeBugCheckEx(NPFS_FILE_SYSTEM, \
+ (NPFS_BUGCHECK_FILE_ID << 16) | __LINE__, \
+ (p1), (p2), (p3))
+
//
// Node Type Codes for NPFS
//
extern PNP_VCB NpVcb;
+
+/* FUNCTIONS ******************************************************************/
+
//
// Functions to lock/unlock the global VCB lock
//
NpFsdQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+/* EOF */
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_PREFXSUP)
+
/* FUNCTIONS ******************************************************************/
PNP_FCB
Entry = RtlFindUnicodePrefix(&NpVcb->PrefixTable,
Name,
CaseInsensitiveIndex);
- if (!Entry) KeBugCheckEx(NPFS_FILE_SYSTEM, 0x100065u, 0, 0, 0);
+ if (!Entry) NpBugCheck(0, 0, 0);
Fcb = CONTAINING_RECORD(Entry, NP_FCB, PrefixTableEntry);
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_READ)
+
/* GLOBALS ********************************************************************/
LONG NpSlowReadCalls;
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_READSUP)
+
/* FUNCTIONS ******************************************************************/
IO_STATUS_BLOCK
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_SECURSUP)
+
/* FUNCTIONS ******************************************************************/
VOID
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_SEINFO)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_STATESUP)
+
/* FUNCTIONS ******************************************************************/
VOID
break;
default:
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x1603DD, Ccb->NamedPipeState, 0, 0);
+ NpBugCheck(Ccb->NamedPipeState, 0, 0);
break;
}
break;
default:
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x160133, Ccb->NamedPipeState, 0, 0);
+ NpBugCheck(Ccb->NamedPipeState, 0, 0);
break;
}
break;
default:
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x1602F9, Ccb->NamedPipeState, 0, 0);
+ NpBugCheck(Ccb->NamedPipeState, 0, 0);
break;
}
return STATUS_SUCCESS;
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_STRUCSUP)
+
/* GLOBALS ********************************************************************/
#define UNIMPLEMENTED
PAGED_CODE();
Dcb = Fcb->ParentDcb;
- if (Fcb->CurrentInstances) KeBugCheckEx(NPFS_FILE_SYSTEM, 0x17025F, 0, 0, 0);
+ if (Fcb->CurrentInstances) NpBugCheck(0, 0, 0);
NpCancelWaiter(&NpVcb->WaitQueue,
&Fcb->FullName,
if (NpVcb->RootDcb)
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x1700F3, 0, 0, 0);
+ NpBugCheck(0, 0, 0);
}
NpVcb->RootDcb = ExAllocatePoolWithTag(PagedPool, sizeof(*Dcb), NPFS_DCB_TAG);
&Dcb->FullName,
&Dcb->PrefixTableEntry))
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x170128, 0, 0, 0);
+ NpBugCheck(0, 0, 0);
}
return STATUS_SUCCESS;
&Fcb->FullName,
&Fcb->PrefixTableEntry))
{
- KeBugCheckEx(NPFS_FILE_SYSTEM, 0x170222, 0, 0, 0);
+ NpBugCheck(0, 0, 0);
}
Fcb->NamedPipeConfiguration = NamedPipeConfiguration;
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_VOLINFO)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS
if (NameLength < 18)
{
- NameLength = *Length;
+ NameLength = (USHORT)*Length;
Status = STATUS_BUFFER_OVERFLOW;
}
else
NTSTATUS Status;
USHORT NameLength;
- NameLength = *Length - 12;
+ NameLength = (USHORT)(*Length - 12);
if (NameLength < 8)
{
*Length = 0;
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_WAITSUP)
+
/* FUNCTIONS ******************************************************************/
VOID
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_WRITE)
+
/* GLOBALS ********************************************************************/
LONG NpSlowWriteCalls;
#include "npfs.h"
+// File ID number for NPFS bugchecking support
+#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_WRITESUP)
+
/* FUNCTIONS ******************************************************************/
NTSTATUS