Can anybody please explain why this code:

invoke CreateFile, addr parambuff, GENERIC_WRITE, FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL

does effectively create the file in MASM V5 but in V7 eax==INVALID_HANDLE_VALUE on return. Invoking GetLastError
to see what the problem is, shows error # 2, meaning the file doesn't exist, I think. Why should the file exist if the point is to create a new one? TIA
Posted on 2002-05-09 21:53:29 by xXXx
Would be more helpful if we could see how your using the createfile api...

There are many examples of creating a file in this forum or in the masm32 package...

Sliver
Posted on 2002-05-09 23:48:45 by Sliver
in V7

What make in V7 so great when 5 and 6 did the job RIGHT.

All upgrades are not true to me.... c...xp and what ever
Posted on 2002-05-09 23:49:02 by cmax
Ok, found the bug. It's not in CreateFile, but in the filename. Some parsing is being done on the filename before it's used. In v5 lstr was being used. In v7 lstr is equ'd to szLeft, but szLeft copies one more character to the destination buffer. It happens this character is invalid for filenames.

It's true, upgrades aren't always so good. I'm still running Win95, but in this case I just wanted to make sure MASM contained all upgraded functions/constants for Internet programming.
Posted on 2002-05-10 00:11:16 by xXXx
""for Internet programming""

I would never beleive that V7 is for us as i said. But someone else will surely know better than me....But as i said M$ need money...so
Posted on 2002-05-10 00:22:10 by cmax
cmax, masm32 != ml.exe
Posted on 2002-05-10 10:29:20 by f0dder