Lines Matching refs:dos
115 static inline BOOLEAN verify_dos(const struct DosFileHeader *dos) { in verify_dos() argument
116 assert(dos); in verify_dos()
117 return CompareMem(dos->Magic, DOS_FILE_MAGIC, STRLEN(DOS_FILE_MAGIC)) == 0; in verify_dos()
129 static inline UINTN section_table_offset(const struct DosFileHeader *dos, const struct PeFileHeader… in section_table_offset() argument
130 assert(dos); in section_table_offset()
132 …return dos->ExeHeader + offsetof(struct PeFileHeader, OptionalHeader) + pe->FileHeader.SizeOfOptio… in section_table_offset()
169 const struct DosFileHeader *dos; in pe_alignment_info() local
177 dos = (const struct DosFileHeader *) base; in pe_alignment_info()
178 if (!verify_dos(dos)) in pe_alignment_info()
181 pe = (const struct PeFileHeader*) ((const UINT8 *)base + dos->ExeHeader); in pe_alignment_info()
196 const struct DosFileHeader *dos; in pe_memory_locate_sections() local
205 dos = (const struct DosFileHeader*)base; in pe_memory_locate_sections()
206 if (!verify_dos(dos)) in pe_memory_locate_sections()
209 pe = (const struct PeFileHeader*)&base[dos->ExeHeader]; in pe_memory_locate_sections()
213 offset = section_table_offset(dos, pe); in pe_memory_locate_sections()
228 struct DosFileHeader dos; in pe_file_locate_sections() local
243 len = sizeof(dos); in pe_file_locate_sections()
244 err = handle->Read(handle, &len, &dos); in pe_file_locate_sections()
247 if (len != sizeof(dos) || !verify_dos(&dos)) in pe_file_locate_sections()
250 err = handle->SetPosition(handle, dos.ExeHeader); in pe_file_locate_sections()
266 err = handle->SetPosition(handle, section_table_offset(&dos, &pe)); in pe_file_locate_sections()