ReactOS
0.4.16-dev-125-g798ea90
fxautostring.hpp
Go to the documentation of this file.
1
/*++
2
3
Copyright (c) Microsoft Corporation
4
5
Module Name:
6
7
FxAutoString.hpp
8
9
Abstract:
10
11
This is the C++ header for FxAutoString which represents a UNICODE_STRING
12
and follows the RAII (resource acquisiion is initialization) pattern where
13
it frees the buffer when the struct goes out of scope.
14
15
Author:
16
17
18
19
Revision History:
20
21
22
23
--*/
24
25
#ifndef _FXAUTOSTRING_H_
26
#define _FXAUTOSTRING_H_
27
28
struct
FxAutoString
{
29
FxAutoString
(
30
VOID
31
)
32
{
33
RtlZeroMemory
(&
m_UnicodeString
,
sizeof
(
m_UnicodeString
));
34
}
35
36
~FxAutoString
(
37
VOID
38
)
39
{
40
if
(
m_UnicodeString
.
Buffer
!=
NULL
) {
41
#if _WDFLDR_
42
ExFreePool
(
m_UnicodeString
.
Buffer
);
43
#else
44
FxPoolFree
(
m_UnicodeString
.
Buffer
);
45
#endif
46
RtlZeroMemory
(&
m_UnicodeString
,
sizeof
(
m_UnicodeString
));
47
}
48
}
49
50
UNICODE_STRING
m_UnicodeString
;
51
};
52
53
#endif
// _FXAUTOSTRING_H_
NULL
#define NULL
Definition:
types.h:112
ExFreePool
#define ExFreePool(addr)
Definition:
env_spec_w32.h:352
FxPoolFree
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition:
wdfpool.cpp:361
void
Definition:
nsiface.idl:2307
FxAutoString
Definition:
fxautostring.hpp:28
FxAutoString::m_UnicodeString
UNICODE_STRING m_UnicodeString
Definition:
fxautostring.hpp:50
FxAutoString::~FxAutoString
~FxAutoString(VOID)
Definition:
fxautostring.hpp:36
FxAutoString::FxAutoString
FxAutoString(VOID)
Definition:
fxautostring.hpp:29
_UNICODE_STRING
Definition:
env_spec_w32.h:368
_UNICODE_STRING::Buffer
PWSTR Buffer
Definition:
env_spec_w32.h:371
RtlZeroMemory
#define RtlZeroMemory(Destination, Length)
Definition:
typedefs.h:262
sdk
lib
drivers
wdf
shared
inc
private
common
fxautostring.hpp
Generated on Mon Oct 14 2024 06:13:34 for ReactOS by
1.9.6