View Single Post
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-18-2020 , 00:37   Re: Bot Mimic: Enum Structs (Invalid Handle)
Reply With Quote #2

ReadFile is int ReadFile(Handle hndl, int[] items, int num_items, int size). It reads the given number of things, each of the given size.

In your original code, you do ReadFile(hFile, iFrame, view_as<int>(FrameInfo), 4) which essentially says to read as many bytes as a FrameInfo is large.

In your changed code, you split it up to read each member one at a time, but you're not giving it the proper size of each. The obvious fix is to give it the right size for each. Off the top of my head, though, you can still use one ReadFile call since an enum struct is still really an array.
Fyren is offline