ReactOS  0.4.15-dev-3441-g67ad4e7
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 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:20
#define NULL
Definition: types.h:112
#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 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static USHORT USHORT * NewLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:20
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
WCHAR * PWCH
Definition: ntbasedef.h:410
#define NULL
Definition: types.h:112
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by FltpGetObjectName().