WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

ERROR_ALREADY_EXISTS with CreateFile, find attached my source code using CreateFile returns ERROR_ALREADY_EXISTS

Slider
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 313
Member No.: 5004
Joined: 11-May 07


I am getting ERROR_ALREADY_EXISTS when I run this.

Where is my mistake ?

Thanks.

CODE
.CONST

.data

file        db  "c:\Windows_XP_Partition",0
FSize       dd  0

.data?

hFile      HANDLE ?
FPointer   dd     ?
Numb       dd     ?
fCRTime    dd     ?
fACTime    dd     ?
fWRTime    dd     ?

.code

start:

invoke CreateFile, addr file, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
; ERROR_ALREADY_EXISTS ??

.IF eax==INVALID_HANDLE_VALUE

invoke ExitProcess,0

.endif

mov     hFile,eax

invoke SetFileTime, hFile, addr fCRTime, addr fACTime, addr fWRTime

invoke CloseHandle, hFile; Release handle fails if return value is 0

invoke ExitProcess,0

end start

Sponsored Links
PMEmail Poster
Top
ragdog
Quote Post


Extremely Active Member
******

Group: Moderators
Posts: 892
Member No.: 5019
Joined: 13-May 07


Hi Andy

"c:\Windows_XP_Partition" is not a file

What trying you?

PMUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google