flat assembler
Message board for the users of flat assembler.

Index > Windows > StrCpyNA

Author
Thread Post new topic Reply to topic
semiono



Joined: 31 Aug 2007
Posts: 192
Location: section '.code' executable
semiono 14 Jan 2014, 14:37
StrCpyN

http://msdn.microsoft.com/en-us/library/windows/desktop/bb759961(v=vs.85).aspx

Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]

Image

Rolling Eyes

Code:
include '%fasm%/win64ax.inc'
include '%fasm%/macro/de.inc'
include '%fasm%/equates/ole32.inc'
section '.code' executable
start:
        sub rsp,8

;..

        macro path w,x,y,z

        {

        invoke GetCurrentDirectory,MAX_PATH,a
        invoke lstrlen,a
        sub eax,6
        invoke StrCpyN,b,a,eax
        invoke PathAddBackslash,b
        invoke lstrcat,b,z
        invoke lstrlen,b
        invoke SHSetValue,w,x,y,REG_SZ,b,eax

        }

        path HKEY_CURRENT_USER,'Software\Image-Line\Shared\Paths','Shared DLLs'

;..

section '.idata' import readable

        library kernel32,'KERNEL32.DLL',ole32,'OLE32.DLL',shell32,'SHELL32.DLL',shlwapi,'SHLWAPI.DLL',user32,'USER32.DLL'
        include '%fasm%/api/kernel32.inc'
        include '%fasm%/api/shell32.inc'
        include '%fasm%/api/shlwapi.inc'
        include '%fasm%/api/user32.inc'
        import ole32,CoCreateInstance,'CoCreateInstance',CoInitializeEx,'CoInitializeEx'
    


Image
Maybe the windows has problem?
Very Happy

_________________
Windows 9, FL Studio 19
Post 14 Jan 2014, 14:37
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 192
Location: section '.code' executable
semiono 14 Jan 2014, 17:00
Only StrCpyN function found on msdn Confused
Post 14 Jan 2014, 17:00
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 14 Jan 2014, 21:28
semiono,

Three rows below "Minimum supported client":
DLL: Shlwapi.dll (version 4.71 or later)
Unicode and ANSI names: StrCpyNW (Unicode)

Anyway, it's simple word-by-word copy (and it doesn't support surrogate pairs).
Post 14 Jan 2014, 21:28
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 192
Location: section '.code' executable
semiono 14 Jan 2014, 22:01
Achtung!

StrCpyNW placed into shell32.inc original fasm.zip but this API from shlwapi.dll
Is it correct?

shell32.inc:

Shell_NotifyIconW,'Shell_NotifyIconW',\
StrChrA,'StrChrA',\< shlwapi
StrChrW,'StrChrW',\< shlwapi
StrChrIA,'StrChrIA',\< shlwapi
StrChrIW,'StrChrIW',\< shlwapi

Smile
Post 14 Jan 2014, 22:01
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 14 Jan 2014, 22:39
The only version is StrCpyNW


Description:
Filesize: 1.98 KB
Viewed: 2372 Time(s)

Capture.PNG


Post 14 Jan 2014, 22:39
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 15 Jan 2014, 14:19
semiono wrote:
StrCpyNW placed into shell32.inc original fasm.zip but this API from shlwapi.dll
Is it correct?
Those exports do exist in Windows XP shell32.dll (at least in SP3, version 6.00.2900.6018) in every variety (StrCpyNA/W and StrNCpyA/W). OTOH StrChr's variants exist in both shell32.dll and shlwapi.dll (for latter even in Windows Me; former one has dozens of ordinals, I suspect they're there too).
Post 15 Jan 2014, 14:19
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.