[WDF] Add Windows Driver Framework files

Takern from Microsoft GitHub repo:
d9c6040fe9

Licensed under MIT
This commit is contained in:
Victor Perevertkin 2020-09-24 23:51:15 +03:00
parent 545df81502
commit 8a978a179f
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
475 changed files with 285099 additions and 0 deletions

View file

@ -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_