mirror of https://github.com/FreeRDP/FreeRDP
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)
|
static void* stream_copy(const void* obj)
|
||||||
{
|
{
|
||||||
wStream* src = obj;
|
const wStream* src = obj;
|
||||||
wStream* dst = Stream_New(NULL, Stream_Capacity(src));
|
wStream* dst = Stream_New(NULL, Stream_Capacity(src));
|
||||||
if (!dst)
|
if (!dst)
|
||||||
return NULL;
|
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_SetLength(dst, Stream_Length(src));
|
||||||
Stream_SetPosition(dst, Stream_GetPosition(src));
|
Stream_SetPosition(dst, Stream_GetPosition(src));
|
||||||
return dst;
|
return dst;
|
||||||
|
|
|
@ -353,6 +353,12 @@ extern "C"
|
||||||
return _s->buffer;
|
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)
|
#define Stream_GetBuffer(_s, _b) _b = Stream_Buffer(_s)
|
||||||
|
|
||||||
static INLINE BYTE* Stream_Pointer(wStream* _s)
|
static INLINE BYTE* Stream_Pointer(wStream* _s)
|
||||||
|
|
Loading…
Reference in New Issue