Commit af54377e authored by Alexandre Julliard's avatar Alexandre Julliard

winedump: Avoid using DWORD in private definitions.

parent e1e6d18a
......@@ -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;
......
......@@ -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 */
{
......
......@@ -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();
......
......@@ -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;
......
......@@ -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" );
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment