diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /public/sdk/inc/memser.hxx | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'public/sdk/inc/memser.hxx')
-rw-r--r-- | public/sdk/inc/memser.hxx | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/public/sdk/inc/memser.hxx b/public/sdk/inc/memser.hxx new file mode 100644 index 000000000..b3a8d74a6 --- /dev/null +++ b/public/sdk/inc/memser.hxx @@ -0,0 +1,79 @@ +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1992 - 1992. +// +// File: MemSer.hxx +// +// History: 29-Jul-94 KyleP Created +// +//-------------------------------------------------------------------------- + +#if !defined( __MEMSER_HXX__ ) +#define __MEMSER_HXX__ + +#include <restrict.hxx> +#include <SStream.hxx> + +class CMemSerStream : public PSerStream +{ +public: + + CMemSerStream( unsigned cb ); + CMemSerStream(BYTE * pb, ULONG cb); + + virtual ~CMemSerStream(); + + inline BYTE *AcqBuf(); + + virtual void PutByte( BYTE b ); + + virtual void PutChar( char const * pc, ULONG cc ); + + virtual void PutWChar( WCHAR const * pwc, ULONG cc ); + + virtual void PutUShort( USHORT us ); + + virtual void PutULong( ULONG ul ); + + virtual void PutLong( long l ); + + virtual void PutFloat( float f ); + + virtual void PutDouble( double d ); + + virtual void PutString( char const * psz ); + + virtual void PutWString( WCHAR const * pwsz ); + + virtual void PutBlob( BYTE const * pb, ULONG cb ); + + virtual void PutGUID( GUID const & guid ); + + inline unsigned Size() { return _cb; } + +protected: + + unsigned _cb; + BYTE * _pb; + BYTE * _pbCurrent; + BYTE * _pbEnd; +}; + +inline BYTE * CMemSerStream::AcqBuf() +{ + BYTE * pb; + + if ( _cb > 0 ) + { + pb = _pb; + _pb = 0; + _cb = 0; + } + else + pb = 0; + + return( pb ); +} + +#endif // __MEMSER_HXX__ |