2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
7 #include <proto/arossupport.h>
8 #include <proto/exec.h>
12 BSTR
CreateBSTR(CONST_STRPTR src
)
15 ULONG len
= strlen(src
);
16 ULONG size
= AROS_BSTR_MEMSIZE4LEN(len
);
18 dst
= AllocVec(size
, MEMF_ANY
);
23 CopyMem(src
, dst
, size
);
25 /* Our BSTR's are also NUL-terminated: len + 1 */
26 CopyMem(src
, dst
+ 1, len
+ 1);