flat assembler
Message board for the users of flat assembler.

Index > Windows > String Size

Author
Thread Post new topic Reply to topic
Hutley



Joined: 12 Feb 2006
Posts: 6
Hutley
I need get the size of a string.
I'm using now this:

Code:
win_size   equ $-WinDir

        invoke GetWindowsDirectory,\
               WinDir,\
               256d     


but i don't know if is correct.
Exits other way of get the size of a string?
Post 20 Apr 2006, 16:58
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
you could do it like this,
Code:
mydir rb 0xFF
mydirsize dd 0

invoke GetWindowsDirectory,mydir,0xFF
mov  [mydirsize],eax
    


the above would make mydirsize contained the count of bytes copied into mydir.
Post 20 Apr 2006, 18:34
View user's profile Send private message Visit poster's website Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
is MAX_PATH = 260? Smile
Post 21 Apr 2006, 05:45
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Win95 & NT had 255 (100h-"\n"-character), but recent versions of NT have 260 <= I don't know what is it good for Razz
Maybe they lend 5 bytes from the name of the file or maybe they strip off C:/ drive identification.
Post 21 Apr 2006, 07:01
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
ok, this 5 bytes is "\\.\",0
Post 21 Apr 2006, 16:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.