/* resbin.c -- manipulate the Windows binary resource format.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
PARAMS ((const unsigned char *, unsigned long, int));
static struct res_resource *bin_to_res_userdata
PARAMS ((const unsigned char *, unsigned long, int));
+static void get_version_header
+ PARAMS ((const unsigned char *, unsigned long, int, const char *,
+ unichar **, int *, int *, int *, int *));
/* Given a resource type ID, a pointer to data, a length, return a
res_resource structure which represents that resource. The caller
unsigned long length;
int big_endian;
{
- int version;
+ int signature;
struct dialog *d;
int c, sublen, i;
unsigned int off;
d = (struct dialog *) res_alloc (sizeof *d);
- version = get_16 (big_endian, data);
- if (version != 1)
+ signature = get_16 (big_endian, data + 2);
+ if (signature != 0xffff)
{
d->ex = NULL;
d->style = get_32 (big_endian, data);
}
else
{
- int signature;
-
- signature = get_16 (big_endian, data + 2);
- if (signature != 0xffff)
- fatal (_("unexpected dialog signature %d"), signature);
+ int version;
+
+ version = get_16 (big_endian, data);
+ if (version != 1)
+ fatal (_("unexpected DIALOGEX version %d"), version);
d->ex = (struct dialog_ex *) res_alloc (sizeof (struct dialog_ex));
d->ex->help = get_32 (big_endian, data + 4);
bin_to_res_rcdata (data, length, big_endian)
const unsigned char *data;
unsigned long length;
- int big_endian;
+ int big_endian ATTRIBUTE_UNUSED;
{
struct rcdata_item *ri;
struct res_resource *r;
struct res_resource *r;
get_version_header (data, length, big_endian, "VS_VERSION_INFO",
- (unichar *) NULL, &verlen, &vallen, &type, &off);
+ (unichar **) NULL, &verlen, &vallen, &type, &off);
if ((unsigned int) verlen != length)
fatal (_("version length %d does not match resource length %lu"),
vi->type = VERINFO_STRING;
get_version_header (data, length, big_endian, "StringFileInfo",
- (unichar *) NULL, &verlen, &vallen, &type,
+ (unichar **) NULL, &verlen, &vallen, &type,
&off);
if (vallen != 0)
vi->type = VERINFO_VAR;
get_version_header (data, length, big_endian, "VarFileInfo",
- (unichar *) NULL, &verlen, &vallen, &type,
+ (unichar **) NULL, &verlen, &vallen, &type,
&off);
if (vallen != 0)
bin_to_res_userdata (data, length, big_endian)
const unsigned char *data;
unsigned long length;
- int big_endian;
+ int big_endian ATTRIBUTE_UNUSED;
{
struct rcdata_item *ri;
struct res_resource *r;