mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 20:23:01 +00:00
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9
Licensed under MIT
This commit is contained in:
parent
545df81502
commit
8a978a179f
475 changed files with 285099 additions and 0 deletions
|
@ -0,0 +1,53 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
FxAutoString.hpp
|
||||
|
||||
Abstract:
|
||||
|
||||
This is the C++ header for FxAutoString which represents a UNICODE_STRING
|
||||
and follows the RAII (resource acquisiion is initialization) pattern where
|
||||
it frees the buffer when the struct goes out of scope.
|
||||
|
||||
Author:
|
||||
|
||||
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _FXAUTOSTRING_H_
|
||||
#define _FXAUTOSTRING_H_
|
||||
|
||||
struct FxAutoString {
|
||||
FxAutoString(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
RtlZeroMemory(&m_UnicodeString, sizeof(m_UnicodeString));
|
||||
}
|
||||
|
||||
~FxAutoString(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
if (m_UnicodeString.Buffer != NULL) {
|
||||
#if _WDFLDR_
|
||||
ExFreePool(m_UnicodeString.Buffer);
|
||||
#else
|
||||
FxPoolFree(m_UnicodeString.Buffer);
|
||||
#endif
|
||||
RtlZeroMemory(&m_UnicodeString, sizeof(m_UnicodeString));
|
||||
}
|
||||
}
|
||||
|
||||
UNICODE_STRING m_UnicodeString;
|
||||
};
|
||||
|
||||
#endif // _FXAUTOSTRING_H_
|
Loading…
Add table
Add a link
Reference in a new issue