flat assembler
Message board for the users of flat assembler.

Index > Windows > Basic Strings (BSTRs)

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 06 Feb 2009, 06:01
Alexander wrote:
Length Prefix | Data itself | Terminator

4 Byte | 2 Bytes * number of characters | NULL
Just out of curiosity.. what is the terminator used for if there is a length prefix? Confused
Post 06 Feb 2009, 06:01
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Alexander



Joined: 22 Dec 2008
Posts: 40
Alexander 11 Feb 2009, 14:20
Azu wrote:
Alexander wrote:
Length Prefix | Data itself | Terminator

4 Byte | 2 Bytes * number of characters | NULL
Just out of curiosity.. what is the terminator used for if there is a length prefix? Confused


Hi Azu,

the terminator is used to convert a BSTR to a C-String or a C-Style-String easyly.
Post 11 Feb 2009, 14:20
View user's profile Send private message Reply with quote
Alexander



Joined: 22 Dec 2008
Posts: 40
Alexander 11 Feb 2009, 14:39
bitRAKE,

thanks for your suggestions. Japheth's website is great, but not directly what I wanted. Isn't there a simple solution to create a structure in FASM and to export it to the caller (in my case this would be any language which uses the component object model for string manipulation like VB6)?

Thanks
Alexander
Post 11 Feb 2009, 14:39
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4047
Location: vpcmpistri
bitRAKE 11 Feb 2009, 17:26
Japheth defines BSTR as "BSTR typedef ptr word" and looking over the code we see stuff like:
Code:
invoke SysAllocStringByteLen, NULL, MAX_PATH
mov [bstr],eax
.
.
.
invoke WideCharToMultiByte,CP_ACP,0,\
 [bstr],-1,addr szValue, sizeof szValue,0,0
.
.
.
invoke SysFreeString, [bstr]    
Maybe, I'm missing something because he never uses the BSTR directly, afaik.
(Looks like he is using a UTF-16 string - not a BSTR?)
Post 11 Feb 2009, 17:26
View user's profile Send private message Visit poster's website Reply with quote
Alexander



Joined: 22 Dec 2008
Posts: 40
Alexander 11 Feb 2009, 17:36
Thanks bitRAKE
Post 11 Feb 2009, 17:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.