flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > du + encoding issue when in local var

Author
Thread Post new topic Reply to topic
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
i found this problem when using a structure, which has "du" inside, in local variables.
this code:
Code:
    local wfd:WIN32_FIND_DATA
...
    mov edx,[wfd.nFileSizeHigh]
    
compilable until win32u + encoding used. i know, it is because encoding macro replaces dwords in ready code, which is impossible with local data. so, i solved this problem for myself with this way:
Code:
    local wfd: rb sizeof.WIN32_FIND_DATA 
...
    mov edx,dword [wfd + WIN32_FIND_DATA.nFileSizeHigh]
    
so, it is not fatal just not handy Smile

_________________
UNICODE forever!
Post 25 Sep 2008, 11:22
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
shoorick,

May be we should replace du MAX_PATH dup (?) with rw MAX_PATH here and there? How often somebody expected to initialize those members in static variables? lpFindFileData is an [out] parameter of FindFirstFile() anyway…
Post 09 Nov 2008, 09:25
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1608
Location: Ukraine
shoorick
another thing - how ofter assembly writers use real unicode with national characters? Wink

i'm using such structures in initialised section also when i have many members predefined and rare changed, if we will replace du to rw in structure definition, then it will not work correctly if preinitialized structure used.

to be true, i have not used cyrillic letters in predefined file names yet, but this is more common case - other structures win32 or own-made may work different in initialized and not initialized sections, and it is not good in general.
Post 09 Nov 2008, 09:50
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
Post 12 Aug 2009, 11:38
View user's profile Send private message Visit poster's website 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.