Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how to use Overlapped field of WriteFile?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sun Feb 13, 2011 8:02 pm    Post subject: how to use Overlapped field of WriteFile? Reply with quote

//This two funcitons can be used to append data to end of the file.
Code:

SetFilePointer(datafile, 0, 0, FILE_END);
WriteFile(datafile,text, strlen(text), &dwBytesWritten, 0);

how can we use the last field "Overlapped" of WriteFile to achieve the same functions as above?
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Feb 13, 2011 8:23 pm    Post subject: Reply with quote

The file handle has to have FILE_FLAG_OVERLAPPED permissions in order to even use the overlapped field. Once you have a proper handle, you can fill the overlapped structures members 'Offset' and 'OffsetHigh' to 0xFFFFFFFF in order to write to the end of the file.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Mon Feb 14, 2011 7:39 am    Post subject: Reply with quote

i also found that stuff in msdn..
but was unable to figure it out.. how??
can you give some code explanation..
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Feb 14, 2011 1:35 pm    Post subject: Reply with quote

Not really sure what you don't understand, it's fairly straight forward.

WriteFile's first param is a handle that has to have 'FILE_FLAG_OVERLAPPED' permissions.

The overlapped struct needs to have its 'Offset' and 'OffsetHigh' members set to 0xFFFFFFFF.

It's pretty straight forward, I'm not going to spoon feed you with code.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites