Re: [3/5] gdi32: Add the ability to load a scalable font resource. Take 3.
18 Nov
2010
18 Nov
'10
1:51 p.m.
Dmitry Timoshkov <dmitry(a)codeweavers.com> writes:
+ if (!ReadFile(hfile, &dos, sizeof(dos), NULL, NULL)) + goto errexit; + + if (dos.e_magic != IMAGE_DOS_SIGNATURE) + goto errexit; + + if (SetFilePointer(hfile, dos.e_lfanew, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER) + goto errexit; + + if (!ReadFile(hfile, &os2, sizeof(os2), NULL, NULL)) + goto errexit;
Again that's inefficient, you don't want to read it bit by bit. You should read the whole file in one go, or use a memory mapping. If using ReadFile you also have to check the returned size. -- Alexandre Julliard julliard(a)winehq.org
5504
Age (days ago)
5504
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard