can't get the 'OPEN_ALWAYS' flag to work, it suppose to open the file if it exists otherwise create.
invoke CreateFile,addr filename,GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_ARCHIVE,0
OPEN_ALWAYS works for me, just as it is documented to work. If the file does not exist then the function returns a handle and GetLastError returns zero. If the file does exist then the function returns a handle and GetLastError returns ERROR_ALREADY_EXISTS. If the function fails (returns INVALID_HANDLE_VALUE) then the problem is elsewhere.
herm...not workin correctly on my xp, works on win7 :\ same code,both places have write permission for the directory they're in.
How is it failing, and what does GetLastError return?