From af54377eb62ee1c8f4e1b9acf14362808f23d8fb Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 22 Apr 2022 16:33:11 +0200 Subject: [PATCH] winedump: Avoid using DWORD in private definitions. Signed-off-by: Alexandre Julliard --- tools/winedump/font.c | 2 +- tools/winedump/lib.c | 8 +-- tools/winedump/lnk.c | 80 +++++++++++----------- tools/winedump/msc.c | 4 +- tools/winedump/nls.c | 42 ++++++------ tools/winedump/pdb.c | 53 +++++++-------- tools/winedump/pe.c | 154 +++++++++++++++++++++--------------------- tools/winedump/tlb.c | 6 +- 8 files changed, 171 insertions(+), 178 deletions(-) diff --git a/tools/winedump/font.c b/tools/winedump/font.c index 58441975d3a..ca4065340c3 100644 --- a/tools/winedump/font.c +++ b/tools/winedump/font.c @@ -73,7 +73,7 @@ typedef struct typedef struct { SHORT dfVersion; /* Version */ - LONG dfSize; /* Total File Size */ + int dfSize; /* Total File Size */ char dfCopyright[60]; /* Copyright notice */ FONTINFO16 fi; /* FONTINFO structure */ } WINFNT; diff --git a/tools/winedump/lib.c b/tools/winedump/lib.c index 4000e8679cf..cf5941864eb 100644 --- a/tools/winedump/lib.c +++ b/tools/winedump/lib.c @@ -38,9 +38,9 @@ static inline USHORT ushort_bswap(USHORT s) return (s >> 8) | (s << 8); } -static inline ULONG ulong_bswap(ULONG l) +static inline UINT ulong_bswap(UINT l) { - return ((ULONG)ushort_bswap((USHORT)l) << 16) | ushort_bswap((USHORT)(l >> 16)); + return ((UINT)ushort_bswap((USHORT)l) << 16) | ushort_bswap(l >> 16); } static void dump_import_object(const IMPORT_OBJECT_HEADER *ioh) @@ -192,9 +192,9 @@ void lib_dump(void) } else if (!strncmp((const char *)iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name))) { - const DWORD *offset = (const DWORD *)ioh; + const UINT *offset = (const UINT *)ioh; const char *name; - DWORD i, count; + UINT i, count; if (first_linker_member) /* 1st archive linker member, BE format */ { diff --git a/tools/winedump/lnk.c b/tools/winedump/lnk.c index e9f7229b5ae..194b6b40403 100644 --- a/tools/winedump/lnk.c +++ b/tools/winedump/lnk.c @@ -64,85 +64,85 @@ typedef enum { typedef struct tagDATABLOCKHEADER { - DWORD cbSize; - DWORD dwSignature; + UINT cbSize; + UINT dwSignature; } DATABLOCK_HEADER; typedef struct _LINK_HEADER { - DWORD dwSize; /* 0x00 size of the header - 0x4c */ + UINT dwSize; /* 0x00 size of the header - 0x4c */ GUID MagicGuid; /* 0x04 is CLSID_ShellLink */ - DWORD dwFlags; /* 0x14 describes elements following */ - DWORD dwFileAttr; /* 0x18 attributes of the target file */ + UINT dwFlags; /* 0x14 describes elements following */ + UINT dwFileAttr; /* 0x18 attributes of the target file */ FILETIME Time1; /* 0x1c */ FILETIME Time2; /* 0x24 */ FILETIME Time3; /* 0x2c */ - DWORD dwFileLength; /* 0x34 File length */ - DWORD nIcon; /* 0x38 icon number */ - DWORD fStartup; /* 0x3c startup type */ - DWORD wHotKey; /* 0x40 hotkey */ - DWORD Unknown5; /* 0x44 */ - DWORD Unknown6; /* 0x48 */ + UINT dwFileLength; /* 0x34 File length */ + UINT nIcon; /* 0x38 icon number */ + UINT fStartup; /* 0x3c startup type */ + UINT wHotKey; /* 0x40 hotkey */ + UINT Unknown5; /* 0x44 */ + UINT Unknown6; /* 0x48 */ } LINK_HEADER, * PLINK_HEADER; typedef struct tagLINK_SZ_BLOCK { - DWORD size; - DWORD magic; + UINT size; + UINT magic; CHAR bufA[MAX_PATH]; WCHAR bufW[MAX_PATH]; } LINK_SZ_BLOCK; typedef struct tagLINK_PROPERTYSTORAGE_GUID { - DWORD size; - DWORD magic; + UINT size; + UINT magic; GUID fmtid; } LINK_PROPERTYSTORAGE_GUID; typedef struct tagLINK_PROPERTYSTORAGE_VALUE { - DWORD size; - DWORD pid; + UINT size; + UINT pid; BYTE unknown8; - DWORD vt; - DWORD unknown25; + UINT vt; + UINT unknown25; } LINK_PROPERTYSTORAGE_VALUE; typedef struct _LOCATION_INFO { - DWORD dwTotalSize; - DWORD dwHeaderSize; - DWORD dwFlags; - DWORD dwVolTableOfs; - DWORD dwLocalPathOfs; - DWORD dwNetworkVolTableOfs; - DWORD dwFinalPathOfs; + UINT dwTotalSize; + UINT dwHeaderSize; + UINT dwFlags; + UINT dwVolTableOfs; + UINT dwLocalPathOfs; + UINT dwNetworkVolTableOfs; + UINT dwFinalPathOfs; } LOCATION_INFO; typedef struct _LOCAL_VOLUME_INFO { - DWORD dwSize; - DWORD dwType; - DWORD dwVolSerial; - DWORD dwVolLabelOfs; + UINT dwSize; + UINT dwType; + UINT dwVolSerial; + UINT dwVolLabelOfs; } LOCAL_VOLUME_INFO; typedef struct _NETWORK_VOLUME_INFO { - DWORD dwSize; - DWORD dwUnknown1; - DWORD dwShareNameOfs; - DWORD dwReserved; - DWORD dwUnknown2; + UINT dwSize; + UINT dwUnknown1; + UINT dwShareNameOfs; + UINT dwReserved; + UINT dwUnknown2; } NETWORK_VOLUME_INFO; typedef struct { - DWORD cbSize; - DWORD dwSignature; - DWORD idSpecialFolder; - DWORD cbOffset; + UINT cbSize; + UINT dwSignature; + UINT idSpecialFolder; + UINT cbOffset; } EXP_SPECIAL_FOLDER; typedef struct lnk_string_tag @@ -529,7 +529,7 @@ void lnk_dump(void) { const LINK_HEADER* hdr; const DATABLOCK_HEADER* bhdr; - DWORD dwFlags; + UINT dwFlags; offset = 0; hdr = fetch_block(); diff --git a/tools/winedump/msc.c b/tools/winedump/msc.c index 160ed07892e..a7e3df961bb 100644 --- a/tools/winedump/msc.c +++ b/tools/winedump/msc.c @@ -1750,7 +1750,7 @@ BOOL codeview_dump_symbols(const void* root, unsigned long start, unsigned long pname = PSTRING(sym, length); length += (pname->namelen + 1 + 3) & ~3; printf("%08x %08x %08x '%s'\n", - *(((const DWORD*)sym) + 1), *(((const DWORD*)sym) + 2), *(((const DWORD*)sym) + 3), + ((const UINT *)sym)[1], ((const UINT *)sym)[2], ((const UINT *)sym)[3], p_string(pname)); } break; @@ -2125,7 +2125,7 @@ void codeview_dump_linetab2(const char* linetab, DWORD size, const char* strimag } break; default: - printf("%sUnknown signature %x in INLINEELINES subsection\n", pfx, *(DWORD*)CV_RECORD_AFTER(hdr)); + printf("%sUnknown signature %x in INLINEELINES subsection\n", pfx, *(UINT *)CV_RECORD_AFTER(hdr)); break; } break; diff --git a/tools/winedump/nls.c b/tools/winedump/nls.c index 236f0e2952d..6f69aeeb538 100644 --- a/tools/winedump/nls.c +++ b/tools/winedump/nls.c @@ -472,11 +472,11 @@ static void dump_norm(void) struct sortguid { GUID id; /* sort GUID */ - DWORD flags; /* flags */ - DWORD compr; /* offset to compression table */ - DWORD except; /* exception table offset in sortkey table */ - DWORD ling_except; /* exception table offset for linguistic casing */ - DWORD casemap; /* linguistic casemap table offset */ + UINT flags; /* flags */ + UINT compr; /* offset to compression table */ + UINT except; /* exception table offset in sortkey table */ + UINT ling_except; /* exception table offset for linguistic casing */ + UINT casemap; /* linguistic casemap table offset */ }; #define FLAG_HAS_3_BYTE_WEIGHTS 0x01 @@ -486,13 +486,13 @@ struct sortguid struct language_id { - DWORD offset; + UINT offset; WCHAR name[32]; }; struct compression { - DWORD offset; + UINT offset; WCHAR minchar, maxchar; WORD len[8]; }; @@ -503,7 +503,7 @@ struct comprlang WCHAR name[32]; }; -static const char *get_sortkey( DWORD key ) +static const char *get_sortkey( UINT key ) { static char buffer[16]; if (!key) return "...."; @@ -514,9 +514,9 @@ static const char *get_sortkey( DWORD key ) return buffer; } -static const void *dump_expansions( const DWORD *ptr ) +static const void *dump_expansions( const UINT *ptr ) { - DWORD i, count = *ptr++; + UINT i, count = *ptr++; printf( "\nExpansions: (count=%04x)\n\n", count ); for (i = 0; i < count; i++) @@ -527,10 +527,10 @@ static const void *dump_expansions( const DWORD *ptr ) return ptr + count; } -static void dump_exceptions( const DWORD *sortkeys, DWORD offset ) +static void dump_exceptions( const UINT *sortkeys, DWORD offset ) { int i, j; - const DWORD *table = sortkeys + offset; + const UINT *table = sortkeys + offset; for (i = 0; i < 0x100; i++) { @@ -566,9 +566,9 @@ static const void *dump_compression( const struct compression *compr, const WCHA return p; } -static const void *dump_multiple_weights( const DWORD *ptr ) +static const void *dump_multiple_weights( const UINT *ptr ) { - int i, count = *ptr++; + UINT i, count = *ptr++; const WCHAR *p; printf( "\nMultiple weights: (count=%u)\n\n", count ); @@ -586,10 +586,10 @@ static void dump_sort( int old_version ) { const struct { - DWORD sortkeys; - DWORD casemaps; - DWORD ctypes; - DWORD sortids; + UINT sortkeys; + UINT casemaps; + UINT ctypes; + UINT sortids; } *header; const struct compression *compr; @@ -597,7 +597,7 @@ static void dump_sort( int old_version ) const struct comprlang *comprlangs; const struct language_id *language_ids = NULL; const WORD *casemaps, *map; - const DWORD *sortkeys, *ptr; + const UINT *sortkeys, *ptr; const WCHAR *p = NULL; int i, j, size, len; int nb_casemaps = 0, casemap_offsets[16]; @@ -618,7 +618,7 @@ static void dump_sort( int old_version ) len = 0; if (old_version) { - ptr = (const DWORD *)casemaps; + ptr = (const UINT *)casemaps; len = *ptr++; language_ids = (const struct language_id *)ptr; casemaps = (const WORD *)(language_ids + len); @@ -732,7 +732,7 @@ static void dump_sort( int old_version ) guids[i].flags, guids[i].compr, j < nb_casemaps ? j : -1 ); } - ptr = dump_expansions( (const DWORD *)(guids + guid_count) ); + ptr = dump_expansions( (const UINT *)(guids + guid_count) ); size = *ptr++; printf( "\nCompressions:\n" ); diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 7badc8a32e2..03bd3290bb8 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -134,9 +134,8 @@ static DWORD pdb_get_file_size(const struct pdb_reader* reader, unsigned idx) static void pdb_exit(struct pdb_reader* reader) { - unsigned i; + unsigned i, size; unsigned char* file; - DWORD size; for (i = 0; i < pdb_get_num_files(reader); i++) { @@ -218,8 +217,8 @@ static void *read_string_table(struct pdb_reader* reader) if (stream_idx == -1) return NULL; ret = reader->read_file(reader, stream_idx); if (!ret) return NULL; - if(*(const DWORD*)ret == 0xeffeeffe) return ret; - printf("wrong header %x expecting 0xeffeeffe\n", *(const DWORD*)ret); + if(*(const UINT *)ret == 0xeffeeffe) return ret; + printf("wrong header %x expecting 0xeffeeffe\n", *(const UINT *)ret); free( ret ); return NULL; } @@ -766,14 +765,14 @@ static void pdb_dump_segments(struct pdb_reader* reader, unsigned stream_idx) { printf("Segment %s\n", ptr); ptr += (strlen(ptr) + 1 + 3) & ~3; - printf("\tdword[0]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[1]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[2]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[3]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[4]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[5]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[6]: %08x\n", *(DWORD*)ptr); ptr += 4; - printf("\tdword[7]: %08x\n", *(DWORD*)ptr); ptr += 4; + printf("\tdword[0]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[1]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[2]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[3]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[4]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[5]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[6]: %08x\n", *(UINT *)ptr); ptr += 4; + printf("\tdword[7]: %08x\n", *(UINT *)ptr); ptr += 4; } free((char*)segs); } else printf("nosdfsdffd\n"); @@ -804,10 +803,8 @@ static void pdb_jg_dump(void) reader.u.jg.root = reader.read_file(&reader, 1); if (reader.u.jg.root) { - DWORD* pdw; - DWORD* ok_bits; - DWORD numok, count; - unsigned i; + UINT *pdw, *ok_bits; + UINT i, numok, count; PDB_STREAM_INDEXES sidx; printf("Root:\n" @@ -820,7 +817,7 @@ static void pdb_jg_dump(void) reader.u.jg.root->Age, (unsigned)reader.u.jg.root->cbNames); - pdw = (DWORD*)(reader.u.jg.root->names + reader.u.jg.root->cbNames); + pdw = (UINT *)(reader.u.jg.root->names + reader.u.jg.root->cbNames); numok = *pdw++; count = *pdw++; printf("\tStreams directory:\n" @@ -842,7 +839,7 @@ static void pdb_jg_dump(void) { if (ok_bits[i / 32] & (1 << (i % 32))) { - DWORD string_idx, stream_idx; + UINT string_idx, stream_idx; string_idx = *pdw++; stream_idx = *pdw++; printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.jg.root->names[string_idx], stream_idx); @@ -873,7 +870,7 @@ static void pdb_jg_dump(void) pdb_exit(&reader); } -static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const DWORD* block_list, int size) +static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const UINT *block_list, int size) { int i, nBlocks; BYTE* buffer; @@ -892,8 +889,8 @@ static void* pdb_ds_read(const struct PDB_DS_HEADER* header, const DWORD* block_ static void* pdb_ds_read_file(struct pdb_reader* reader, DWORD file_number) { - const DWORD* block_list; - DWORD i; + const UINT *block_list; + UINT i; if (!reader->u.ds.toc || file_number >= reader->u.ds.toc->num_files) return NULL; @@ -914,8 +911,8 @@ static BOOL pdb_ds_init(struct pdb_reader* reader) reader->u.ds.header = PRD(0, sizeof(*reader->u.ds.header)); if (!reader->u.ds.header) return FALSE; reader->read_file = pdb_ds_read_file; - reader->u.ds.toc = pdb_ds_read(reader->u.ds.header, - (const DWORD*)((const char*)reader->u.ds.header + reader->u.ds.header->toc_page * reader->u.ds.header->block_size), + reader->u.ds.toc = pdb_ds_read(reader->u.ds.header, + (const UINT *)((const char*)reader->u.ds.header + reader->u.ds.header->toc_page * reader->u.ds.header->block_size), reader->u.ds.header->toc_size); memset(reader->file_used, 0, sizeof(reader->file_used)); return TRUE; @@ -963,10 +960,8 @@ static void pdb_ds_dump(void) reader.u.ds.root = reader.read_file(&reader, 1); if (reader.u.ds.root) { - DWORD* pdw; - DWORD* ok_bits; - DWORD numok, count; - unsigned i; + UINT *pdw, *ok_bits; + UINT i, numok, count; PDB_STREAM_INDEXES sidx; printf("Root:\n" @@ -980,7 +975,7 @@ static void pdb_ds_dump(void) reader.u.ds.root->Age, get_guid_str(&reader.u.ds.root->guid), reader.u.ds.root->cbNames); - pdw = (DWORD*)(reader.u.ds.root->names + reader.u.ds.root->cbNames); + pdw = (UINT *)(reader.u.ds.root->names + reader.u.ds.root->cbNames); numok = *pdw++; count = *pdw++; printf("\tStreams directory:\n" @@ -1002,7 +997,7 @@ static void pdb_ds_dump(void) { if (ok_bits[i / 32] & (1 << (i % 32))) { - DWORD string_idx, stream_idx; + UINT string_idx, stream_idx; string_idx = *pdw++; stream_idx = *pdw++; printf("\t\t\t%2d) %-20s => %x\n", i, &reader.u.ds.root->names[string_idx], stream_idx); diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 2207ed9accc..64581f28238 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -161,7 +161,7 @@ static inline void print_word(const char *title, WORD value) printf(" %-34s 0x%-4X %u\n", title, value, value); } -static inline void print_dword(const char *title, DWORD value) +static inline void print_dword(const char *title, UINT value) { printf(" %-34s 0x%-8x %u\n", title, value, value); } @@ -600,11 +600,10 @@ static void dump_dir_exported_functions(void) { unsigned int size = 0; const IMAGE_EXPORT_DIRECTORY*exportDir = get_dir_and_size(IMAGE_FILE_EXPORT_DIRECTORY, &size); - unsigned int i; - const DWORD* pFunc; - const DWORD* pName; - const WORD* pOrdl; - DWORD* funcs; + UINT i, *funcs; + const UINT *pFunc; + const UINT *pName; + const WORD *pOrdl; if (!exportDir) return; @@ -656,45 +655,45 @@ static void dump_dir_exported_functions(void) struct runtime_function_x86_64 { - DWORD BeginAddress; - DWORD EndAddress; - DWORD UnwindData; + UINT BeginAddress; + UINT EndAddress; + UINT UnwindData; }; struct runtime_function_armnt { - DWORD BeginAddress; + UINT BeginAddress; union { - DWORD UnwindData; + UINT UnwindData; struct { - DWORD Flag : 2; - DWORD FunctionLength : 11; - DWORD Ret : 2; - DWORD H : 1; - DWORD Reg : 3; - DWORD R : 1; - DWORD L : 1; - DWORD C : 1; - DWORD StackAdjust : 10; + UINT Flag : 2; + UINT FunctionLength : 11; + UINT Ret : 2; + UINT H : 1; + UINT Reg : 3; + UINT R : 1; + UINT L : 1; + UINT C : 1; + UINT StackAdjust : 10; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; }; struct runtime_function_arm64 { - DWORD BeginAddress; + UINT BeginAddress; union { - DWORD UnwindData; + UINT UnwindData; struct { - DWORD Flag : 2; - DWORD FunctionLength : 11; - DWORD RegF : 3; - DWORD RegI : 4; - DWORD H : 1; - DWORD CR : 2; - DWORD FrameSize : 9; + UINT Flag : 2; + UINT FunctionLength : 11; + UINT RegF : 3; + UINT RegI : 4; + UINT H : 1; + UINT CR : 2; + UINT FrameSize : 9; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; }; @@ -702,7 +701,7 @@ struct runtime_function_arm64 union handler_data { struct runtime_function_x86_64 chain; - DWORD handler; + UINT handler; }; struct opcode @@ -726,13 +725,13 @@ struct unwind_info_x86_64 struct unwind_info_armnt { - DWORD function_length : 18; - DWORD version : 2; - DWORD x : 1; - DWORD e : 1; - DWORD f : 1; - DWORD count : 5; - DWORD words : 4; + UINT function_length : 18; + UINT version : 2; + UINT x : 1; + UINT e : 1; + UINT f : 1; + UINT count : 5; + UINT words : 4; }; struct unwind_info_ext_armnt @@ -744,10 +743,10 @@ struct unwind_info_ext_armnt struct unwind_info_epilogue_armnt { - DWORD offset : 18; - DWORD res : 2; - DWORD cond : 4; - DWORD index : 8; + UINT offset : 18; + UINT res : 2; + UINT cond : 4; + UINT index : 8; }; #define UWOP_PUSH_NONVOL 0 @@ -810,7 +809,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct case UWOP_ALLOC_LARGE: if (info->opcodes[i].info) { - count = *(const DWORD *)&info->opcodes[i+1]; + count = *(const UINT *)&info->opcodes[i+1]; i += 2; } else @@ -834,7 +833,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct i++; break; case UWOP_SAVE_NONVOL_FAR: - count = *(const DWORD *)&info->opcodes[i+1]; + count = *(const UINT *)&info->opcodes[i+1]; printf( "mov %%%s,0x%x(%%rsp)\n", reg_names[info->opcodes[i].info], count ); i += 2; break; @@ -844,7 +843,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct i++; break; case UWOP_SAVE_XMM128_FAR: - count = *(const DWORD *)&info->opcodes[i+1]; + count = *(const UINT *)&info->opcodes[i+1]; printf( "movaps %%xmm%u,0x%x(%%rsp)\n", info->opcodes[i].info, count ); i += 2; break; @@ -866,7 +865,7 @@ static void dump_x86_64_unwind_info( const struct runtime_function_x86_64 *funct } if (info->flags & (UNW_FLAG_EHANDLER | UNW_FLAG_UHANDLER)) printf( " handler %08x data at %08x\n", handler_data->handler, - (ULONG)(function->UnwindData + (const char *)(&handler_data->handler + 1) - (const char *)info )); + (UINT)(function->UnwindData + (const char *)(&handler_data->handler + 1) - (const char *)info )); } static const BYTE armnt_code_lengths[256] = @@ -1281,12 +1280,12 @@ static void dump_armnt_unwind_info( const struct runtime_function_armnt *fnc ) struct unwind_info_arm64 { - DWORD function_length : 18; - DWORD version : 2; - DWORD x : 1; - DWORD e : 1; - DWORD epilog : 5; - DWORD codes : 5; + UINT function_length : 18; + UINT version : 2; + UINT x : 1; + UINT e : 1; + UINT epilog : 5; + UINT codes : 5; }; struct unwind_info_ext_arm64 @@ -1298,9 +1297,9 @@ struct unwind_info_ext_arm64 struct unwind_info_epilog_arm64 { - DWORD offset : 18; - DWORD res : 4; - DWORD index : 10; + UINT offset : 18; + UINT res : 4; + UINT index : 10; }; static const BYTE code_lengths[256] = @@ -1601,7 +1600,7 @@ static void dump_arm64_unwind_info( const struct runtime_function_arm64 *func ) rva += codes * 4; if (info->x) { - const DWORD *handler = RVA( rva, sizeof(*handler) ); + const UINT *handler = RVA( rva, sizeof(*handler) ); rva += sizeof(*handler); printf( " handler: %08x data %08x\n", *handler, rva ); } @@ -1641,14 +1640,14 @@ static void dump_dir_exceptions(void) } -static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, DWORD thunk_rva) +static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, UINT thunk_rva) { /* FIXME: This does not properly handle large images */ const IMAGE_IMPORT_BY_NAME* iibn; for (; il->u1.Ordinal; il++, thunk_rva += sizeof(LONGLONG)) { if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal)) - printf(" %08x %4u \n", thunk_rva, (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal)); + printf(" %08x %4u \n", thunk_rva, (UINT)IMAGE_ORDINAL64(il->u1.Ordinal)); else { iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD)); @@ -1660,10 +1659,10 @@ static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, DWORD thunk_rv } } -static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il, int offset, DWORD thunk_rva) +static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il, int offset, UINT thunk_rva) { const IMAGE_IMPORT_BY_NAME* iibn; - for (; il->u1.Ordinal; il++, thunk_rva += sizeof(DWORD)) + for (; il->u1.Ordinal; il++, thunk_rva += sizeof(UINT)) { if (IMAGE_SNAP_BY_ORDINAL32(il->u1.Ordinal)) printf(" %08x %4u \n", thunk_rva, IMAGE_ORDINAL32(il->u1.Ordinal)); @@ -1694,11 +1693,11 @@ static void dump_dir_imported_functions(void) if (!importDesc->Name || !importDesc->FirstThunk) break; printf(" offset %08lx %s\n", Offset(importDesc), (const char*)RVA(importDesc->Name, sizeof(DWORD))); - printf(" Hint/Name Table: %08X\n", (DWORD)importDesc->u.OriginalFirstThunk); + printf(" Hint/Name Table: %08X\n", (UINT)importDesc->u.OriginalFirstThunk); printf(" TimeDateStamp: %08X (%s)\n", importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp)); printf(" ForwarderChain: %08X\n", importDesc->ForwarderChain); - printf(" First thunk RVA: %08X\n", (DWORD)importDesc->FirstThunk); + printf(" First thunk RVA: %08X\n", (UINT)importDesc->FirstThunk); printf(" Thunk Ordn Name\n"); @@ -1893,7 +1892,7 @@ static void dump_dir_debug(void) printf("\n"); } -static inline void print_clrflags(const char *title, DWORD value) +static inline void print_clrflags(const char *title, UINT value) { printf(" %-34s 0x%X\n", title, value); #define X(f,s) if (value & f) printf(" %s\n", s) @@ -1983,7 +1982,7 @@ static void dump_dir_reloc(void) static void dump_dir_tls(void) { IMAGE_TLS_DIRECTORY64 dir; - const DWORD *callbacks; + const UINT *callbacks; const IMAGE_TLS_DIRECTORY32 *pdir = get_dir(IMAGE_FILE_THREAD_LOCAL_STORAGE); if (!pdir) return; @@ -2003,19 +2002,19 @@ static void dump_dir_tls(void) /* FIXME: This does not properly handle large images */ printf( "Thread Local Storage\n" ); printf( " Raw data %08x-%08x (data size %x zero fill size %x)\n", - (DWORD)dir.StartAddressOfRawData, (DWORD)dir.EndAddressOfRawData, - (DWORD)(dir.EndAddressOfRawData - dir.StartAddressOfRawData), - (DWORD)dir.SizeOfZeroFill ); - printf( " Index address %08x\n", (DWORD)dir.AddressOfIndex ); - printf( " Characteristics %08x\n", dir.Characteristics ); - printf( " Callbacks %08x -> {", (DWORD)dir.AddressOfCallBacks ); + (UINT)dir.StartAddressOfRawData, (UINT)dir.EndAddressOfRawData, + (UINT)(dir.EndAddressOfRawData - dir.StartAddressOfRawData), + (UINT)dir.SizeOfZeroFill ); + printf( " Index address %08x\n", (UINT)dir.AddressOfIndex ); + printf( " Characteristics %08x\n", (UINT)dir.Characteristics ); + printf( " Callbacks %08x -> {", (UINT)dir.AddressOfCallBacks ); if (dir.AddressOfCallBacks) { - DWORD addr = (DWORD)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase; - while ((callbacks = RVA(addr, sizeof(DWORD))) && *callbacks) + UINT addr = (UINT)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase; + while ((callbacks = RVA(addr, sizeof(UINT))) && *callbacks) { printf( " %08x", *callbacks ); - addr += sizeof(DWORD); + addr += sizeof(UINT); } } printf(" }\n\n"); @@ -2487,12 +2486,11 @@ static void dll_close (void) static void do_grab_sym( void ) { const IMAGE_EXPORT_DIRECTORY*exportDir; - unsigned i, j; - const DWORD* pName; - const DWORD* pFunc; - const WORD* pOrdl; - const char* ptr; - DWORD* map; + UINT i, j, *map; + const UINT *pName; + const UINT *pFunc; + const WORD *pOrdl; + const char *ptr; PE_nt_headers = get_nt_header(); if (!(exportDir = get_dir(IMAGE_FILE_EXPORT_DIRECTORY))) return; diff --git a/tools/winedump/tlb.c b/tools/winedump/tlb.c index a22ff09b4d1..9676ba88ef8 100644 --- a/tools/winedump/tlb.c +++ b/tools/winedump/tlb.c @@ -1171,7 +1171,7 @@ static const char *lookup_code(const BYTE *table, DWORD table_size, struct bitst return NULL; } -static const char *decode_string(const BYTE *table, const char *stream, DWORD stream_length, DWORD *read_bytes) +static const char *decode_string(const BYTE *table, const char *stream, UINT stream_length, UINT *read_bytes) { char *buf; DWORD buf_size, table_size; @@ -1655,7 +1655,7 @@ static void dump_type(int len, const char *hlp_strings) if (value != -1) { const char *str; - DWORD hlpstr_maxlen; + UINT hlpstr_maxlen; printf("helpstring offset = %#x (+%#x=%#x)\n", value, vars_start_offset, value + vars_start_offset); @@ -1761,7 +1761,7 @@ static void dump_type(int len, const char *hlp_strings) if (value != -1) { const char *str; - DWORD hlpstr_maxlen; + UINT hlpstr_maxlen; printf("helpstring offset = %#x (+%#x=%#x)\n", value, funcs_start_offset, value + funcs_start_offset);