ReactOS  0.4.15-dev-2354-g9e947e2
prefxsup.c File Reference
#include "npfs.h"
Include dependency graph for prefxsup.c:

Go to the source code of this file.

Macros

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_PREFXSUP)
 

Functions

PNP_FCB NTAPI NpFindPrefix (IN PUNICODE_STRING Name, IN ULONG CaseInsensitiveIndex, IN PUNICODE_STRING Prefix)
 
NTSTATUS NTAPI NpFindRelativePrefix (IN PNP_DCB Dcb, IN PUNICODE_STRING Name, IN ULONG CaseInsensitiveIndex, IN PUNICODE_STRING Prefix, OUT PNP_FCB *FoundFcb)
 

Macro Definition Documentation

◆ NPFS_BUGCHECK_FILE_ID

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_PREFXSUP)

Definition at line 14 of file prefxsup.c.

Function Documentation

◆ NpFindPrefix()

PNP_FCB NTAPI NpFindPrefix ( IN PUNICODE_STRING  Name,
IN ULONG  CaseInsensitiveIndex,
IN PUNICODE_STRING  Prefix 
)

Definition at line 20 of file prefxsup.c.

23 {
25  PNP_FCB Fcb;
26  PAGED_CODE();
27 
29  Name,
31  if (!Entry) NpBugCheck(0, 0, 0);
32 
34 
35  Prefix->Length = Name->Length - Fcb->FullName.Length;
37  Prefix->Buffer = &Name->Buffer[Fcb->FullName.Length / sizeof(WCHAR)];
38 
40  {
41  Prefix->Length -= sizeof(WCHAR);
42  Prefix->MaximumLength -= sizeof(WCHAR);
43  ++Prefix->Buffer;
44  }
45 
46  return Fcb;
47 }
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1631
struct _Entry Entry
Definition: kefuncs.h:627
_In_ __drv_aliasesMem PSTRING _Out_ PPREFIX_TABLE_ENTRY PrefixTableEntry
Definition: rtlfuncs.h:1631
unsigned short Length
Definition: sprintf.c:451
Definition: npfs.h:228
void * Buffer
Definition: sprintf.c:453
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
Definition: rtltypes.h:621
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define NpBugCheck(p1, p2, p3)
Definition: npfs.h:106
__wchar_t WCHAR
Definition: xmlstorage.h:180
PUNICODE_PREFIX_TABLE_ENTRY NTAPI RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, PUNICODE_STRING FullName, ULONG CaseInsensitiveIndex)
PNP_VCB NpVcb
Definition: strucsup.c:19
UNICODE_PREFIX_TABLE PrefixTable
Definition: npfs.h:282
_In_ PFCB Fcb
Definition: cdprocs.h:159
unsigned short MaximumLength
Definition: sprintf.c:452
_In_ PUNICODE_STRING _In_ ULONG CaseInsensitiveIndex
Definition: rtlfuncs.h:1682
base of all file and directory entries
Definition: entries.h:82
#define PAGED_CODE()

Referenced by NpFindRelativePrefix(), NpFsdCreate(), NpFsdCreateNamedPipe(), and NpWaitForNamedPipe().

◆ NpFindRelativePrefix()

NTSTATUS NTAPI NpFindRelativePrefix ( IN PNP_DCB  Dcb,
IN PUNICODE_STRING  Name,
IN ULONG  CaseInsensitiveIndex,
IN PUNICODE_STRING  Prefix,
OUT PNP_FCB FoundFcb 
)

Definition at line 51 of file prefxsup.c.

56 {
57  PWCHAR Buffer;
58  PNP_FCB Fcb;
59  UNICODE_STRING RootName;
61  PAGED_CODE();
62 
63  Length = Name->Length;
66 
67  ASSERT(Dcb->NodeType == NPFS_NTC_ROOT_DCB);
68 
70  if (!Buffer)
71  {
73  }
74 
76  RtlCopyMemory(Buffer + 1, Name->Buffer, Length);
77  Buffer[(Length / sizeof(WCHAR)) + 1] = UNICODE_NULL;
78 
79  RootName.Length = Length + sizeof(OBJ_NAME_PATH_SEPARATOR);
80  RootName.MaximumLength = MaximumLength;
81  RootName.Buffer = Buffer;
82 
84 
86 
87  Prefix->Buffer = &Name->Buffer[(Length - Prefix->Length) / sizeof(WCHAR)];
88  *FoundFcb = Fcb;
89 
90  return STATUS_SUCCESS;
91 }
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1631
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
USHORT MaximumLength
Definition: env_spec_w32.h:370
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define NPFS_NAME_BLOCK_TAG
Definition: npfs.h:59
unsigned short Length
Definition: sprintf.c:451
uint16_t * PWCHAR
Definition: typedefs.h:56
Definition: npfs.h:228
void * Buffer
Definition: sprintf.c:453
#define UNICODE_NULL
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
Definition: bufpool.h:45
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
#define ASSERT(a)
Definition: mode.c:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NPFS_NTC_ROOT_DCB
Definition: npfs.h:113
unsigned short USHORT
Definition: pedump.c:61
PNP_FCB NTAPI NpFindPrefix(IN PUNICODE_STRING Name, IN ULONG CaseInsensitiveIndex, IN PUNICODE_STRING Prefix)
Definition: prefxsup.c:20
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
_In_ PFCB Fcb
Definition: cdprocs.h:159
_In_ PUNICODE_STRING _In_ ULONG CaseInsensitiveIndex
Definition: rtlfuncs.h:1682
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB * Dcb
Definition: create.c:4137
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PAGED_CODE()

Referenced by NpFsdCreate(), and NpFsdCreateNamedPipe().