mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 19:11:16 +00:00
![Victor Perevertkin](/assets/img/avatar_default.png)
Not all files are included, but these are necessary to compile cdrom driver. So far it can only be statically linked with drivers, a proper implementation requires wdfldr helper driver
68 lines
1.1 KiB
C++
68 lines
1.1 KiB
C++
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
FxString.cpp
|
|
|
|
Abstract:
|
|
|
|
This module implements a simple string class to operate on
|
|
unicode strings.
|
|
|
|
Author:
|
|
|
|
|
|
|
|
Environment:
|
|
|
|
Both kernel and user mode
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
#include "fxsupportpch.hpp"
|
|
|
|
FxString::FxString(
|
|
__in PFX_DRIVER_GLOBALS FxDriverGlobals
|
|
) :
|
|
FxObject(FX_TYPE_STRING, sizeof(FxString), FxDriverGlobals)
|
|
{
|
|
RtlInitUnicodeString(&m_UnicodeString, NULL);
|
|
MarkPassiveDispose(ObjectDoNotLock);
|
|
}
|
|
|
|
FxString::~FxString()
|
|
{
|
|
if (m_UnicodeString.Buffer) {
|
|
FxPoolFree(m_UnicodeString.Buffer);
|
|
}
|
|
}
|
|
|
|
_Must_inspect_result_
|
|
NTSTATUS
|
|
FxString::Assign(
|
|
__in const UNICODE_STRING* UnicodeString
|
|
)
|
|
{
|
|
return FxDuplicateUnicodeString(GetDriverGlobals(),
|
|
UnicodeString,
|
|
&m_UnicodeString);
|
|
}
|
|
|
|
_Must_inspect_result_
|
|
NTSTATUS
|
|
FxString::Assign(
|
|
__in PCWSTR SourceString
|
|
)
|
|
|
|
{
|
|
UNICODE_STRING string;
|
|
|
|
RtlInitUnicodeString(&string, SourceString);
|
|
|
|
return Assign(&string);
|
|
}
|