Added Stream_ConstBuffer function
This commit is contained in:
parent
1f59dff316
commit
a40467b3b0
@ -1476,11 +1476,11 @@ fail:
|
||||
|
||||
static void* stream_copy(const void* obj)
|
||||
{
|
||||
wStream* src = obj;
|
||||
const wStream* src = obj;
|
||||
wStream* dst = Stream_New(NULL, Stream_Capacity(src));
|
||||
if (!dst)
|
||||
return NULL;
|
||||
memcpy(Stream_Buffer(dst), Stream_Buffer(src), Stream_Capacity(dst));
|
||||
memcpy(Stream_Buffer(dst), Stream_ConstBuffer(src), Stream_Capacity(dst));
|
||||
Stream_SetLength(dst, Stream_Length(src));
|
||||
Stream_SetPosition(dst, Stream_GetPosition(src));
|
||||
return dst;
|
||||
|
@ -353,6 +353,12 @@ extern "C"
|
||||
return _s->buffer;
|
||||
}
|
||||
|
||||
static INLINE const BYTE* Stream_ConstBuffer(const wStream* _s)
|
||||
{
|
||||
WINPR_ASSERT(_s);
|
||||
return _s->buffer;
|
||||
}
|
||||
|
||||
#define Stream_GetBuffer(_s, _b) _b = Stream_Buffer(_s)
|
||||
|
||||
static INLINE BYTE* Stream_Pointer(wStream* _s)
|
||||
|
Loading…
Reference in New Issue
Block a user