Raised This Month: $51 Target: $400
 12% 

Solved Set pack position on end not working


Post New Thread Reply   
 
Thread Tools Display Modes
adma
Senior Member
Join Date: Oct 2015
Old 02-24-2019 , 07:21   Re: Set pack position on end not working
Reply With Quote #11

Quote:
Originally Posted by Dragokas View Post
off.
One more question, please:

Can I withdraw the TIMER_DATA_HNDL_CLOSE flag in timer callback?
Or it is safe to use CloneHandle there:

Spoiler

thanks.
I think what youre doing in that snippet is legal, but why not reuse the same DataPack and close the handle if iWitches == 0? (and remove TIMER_DATA_HNDL_CLOSE)

Last edited by adma; 02-24-2019 at 07:22.
adma is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-24-2019 , 07:27   Re: Set pack position on end not working
Reply With Quote #12

Because it will cause handles leak if timer launched, but had no time to trigger until map end.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
adma
Senior Member
Join Date: Oct 2015
Old 02-24-2019 , 07:39   Re: Set pack position on end not working
Reply With Quote #13

Forgot about that, so your code makes sense. AFAIK, TIMER_DATA_HNDL_CLOSE just performs a CloseHandle() on the passed data after the timer is stopped/ends. You CloneHandle() the pack handle before timer end, which prevents the underlying pack data from being destroyed. When that iWitches > 0 check fails, the TIMER_DATA_HNDL_CLOSE will close and no more handles will point to the pack data, so then the pack data itself is destroyed.
adma is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 02-24-2019 , 07:53   Re: Set pack position on end not working
Reply With Quote #14

Yes, it is exactly what I am doing in above code
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode