Dmitry Timoshkov <dmitry(a)codeweavers.com> writes:
+ /* empty type info */ + memset(&rc_type, 0, sizeof(rc_type)); + if (!WriteFile(hfile, &rc_type, sizeof(rc_type), &dummy, NULL)) return FALSE; + + if (!WriteFile(hfile, "\7FONTDIR", 8, &dummy, NULL)) return FALSE; + str_len = strlen(resident_name); + if (!WriteFile(hfile, &str_len, 1, &dummy, NULL)) return FALSE; + if (!WriteFile(hfile, resident_name, str_len, &dummy, NULL)) return FALSE; + if (!WriteFile(hfile, filler, 5, &dummy, NULL)) return FALSE; + + str_len = strlen(non_resident_name); + if (!WriteFile(hfile, &str_len, 1, &dummy, NULL)) return FALSE; + if (!WriteFile(hfile, non_resident_name, str_len, &dummy, NULL)) return FALSE; + /* terminator */ + if (!WriteFile(hfile, filler, 1, &dummy, NULL)) return FALSE; + + /* empty ne_modtab and ne_imptab */ + if (!WriteFile(hfile, filler, 2, &dummy, NULL)) return FALSE; + + if (!write_pad(hfile)) return FALSE; + + if (!WriteFile(hfile, fd, fd->dfSize, &dummy, NULL)) return FALSE; + + if (!write_pad(hfile)) return FALSE; + + if (!WriteFile(hfile, ttf_file_nameA, strlen(ttf_file_nameA), &dummy, NULL)) return FALSE; + + if (!write_pad(hfile)) return FALSE;
That's ugly and inefficient. The data should be built into a memory buffer. -- Alexandre Julliard julliard(a)winehq.org