ReactOS  0.4.13-dev-961-g238ea69
Lib.c File Reference
#include "fltmgr.h"
#include <debug.h>
Include dependency graph for Lib.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID FltpFreeUnicodeString (_In_ PUNICODE_STRING String)
 
NTSTATUS FltpReallocateUnicodeString (_In_ PUNICODE_STRING String, _In_ SIZE_T NewLength, _In_ BOOLEAN CopyExisting)
 
NTSTATUS FltpCopyUnicodeString (_In_ PUNICODE_STRING StringOne, _In_ PUNICODE_STRING StringTwo)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file Lib.c.

Function Documentation

◆ FltpCopyUnicodeString()

NTSTATUS FltpCopyUnicodeString ( _In_ PUNICODE_STRING  StringOne,
_In_ PUNICODE_STRING  StringTwo 
)

Definition at line 79 of file Lib.c.

81 {
82  return 0;
83 }

◆ FltpFreeUnicodeString()

VOID FltpFreeUnicodeString ( _In_ PUNICODE_STRING  String)

Definition at line 24 of file Lib.c.

25 {
26  /* Free up any existing buffer */
27  if (String->Buffer)
28  {
30  }
31 
32  /* Empty the string */
33  String->Buffer = NULL;
34  String->Length = 0;
35  String->MaximumLength = 0;
36 }
static WCHAR String[]
Definition: stringtable.c:55
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:18
smooth NULL
Definition: ftsmooth.c:416
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by FltpEnumerateFileSystemVolumes(), and FltpFsNotification().

◆ FltpReallocateUnicodeString()

NTSTATUS FltpReallocateUnicodeString ( _In_ PUNICODE_STRING  String,
_In_ SIZE_T  NewLength,
_In_ BOOLEAN  CopyExisting 
)

Definition at line 39 of file Lib.c.

42 {
43  PWCH NewBuffer;
44 
45  /* Don't bother reallocating if the buffer is smaller */
46  if (NewLength <= String->MaximumLength)
47  {
48  String->Length = 0;
49  return STATUS_SUCCESS;
50  }
51 
52  /* Allocate a new buffer at the size requested */
54  if (NewBuffer == NULL) return STATUS_INSUFFICIENT_RESOURCES;
55 
56  if (CopyExisting)
57  {
58  /* Copy the old data across */
59  RtlCopyMemory(NewBuffer, String->Buffer, String->Length);
60  }
61  else
62  {
63  /* Reset the length */
64  String->Length = 0;
65  }
66 
67  /* Free any old buffer */
68  if (String->Buffer)
70 
71  /* Update the lengths */
72  String->Buffer = NewBuffer;
73  String->MaximumLength = NewLength;
74 
75  return STATUS_SUCCESS;
76 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static WCHAR String[]
Definition: stringtable.c:55
static USHORT USHORT * NewLength
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:18
smooth NULL
Definition: ftsmooth.c:416
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
WCHAR * PWCH
Definition: ntbasedef.h:417
UnicodeString MaximumLength
Definition: rtlfuncs.h:2982
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:2777

Referenced by FltpGetObjectName().