widl: Add support for writing 64-bit format typelibs.

This commit is contained in:
Alexandre Julliard 2009-05-21 11:10:22 +02:00
parent 1c75ab091c
commit b3a0833972
5 changed files with 16 additions and 10 deletions

View File

@ -25,6 +25,7 @@
#include "winbase.h"
#include "winnls.h"
#include "widltypes.h"
#include "hash.h"
static const unsigned char Lookup_16[128 * 3] = {

View File

@ -22,12 +22,6 @@
#ifndef __WIDL_HASH_H
#define __WIDL_HASH_H
typedef enum tag_syskind_t {
SYS_WIN16 = 0,
SYS_WIN32,
SYS_MAC
} syskind_t;
extern unsigned int lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr);
#endif

View File

@ -135,6 +135,7 @@ FILE *header;
FILE *idfile;
size_t pointer_size = 0;
syskind_t typelib_kind = sizeof(void*) == 8 ? SYS_WIN64 : SYS_WIN32;
time_t now;

View File

@ -487,6 +487,14 @@ struct _statement_t {
} u;
};
typedef enum {
SYS_WIN16,
SYS_WIN32,
SYS_MAC,
SYS_WIN64
} syskind_t;
extern syskind_t typelib_kind;
extern user_type_list_t user_type_list;
void check_for_additional_prototype_types(const var_list_t *list);

View File

@ -45,7 +45,7 @@
#include "winbase.h"
#include "winnls.h"
#include "widltypes.h"
#include "widl.h"
#include "typelib.h"
#include "typelib_struct.h"
#include "utils.h"
@ -1543,7 +1543,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
/* adjust size of VTBL */
if(funckind != 0x3 /* FUNC_STATIC */)
typeinfo->typeinfo->cbSizeVft += 4;
typeinfo->typeinfo->cbSizeVft += pointer_size;
/* Increment the number of function elements */
typeinfo->typeinfo->cElement += 1;
@ -2031,7 +2031,7 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
}
}
msft_typeinfo->typeinfo->datatype2 = num_funcs << 16 | num_parents;
msft_typeinfo->typeinfo->cbSizeVft = num_funcs * 4;
msft_typeinfo->typeinfo->cbSizeVft = num_funcs * pointer_size;
STATEMENTS_FOR_EACH_FUNC( stmt_func, type_iface_get_stmts(interface) ) {
var_t *func = stmt_func->u.var;
@ -2539,6 +2539,8 @@ int create_msft_typelib(typelib_t *typelib)
GUID midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
GUID midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
pointer_size = (typelib_kind == SYS_WIN64) ? 8 : 4;
msft = xmalloc(sizeof(*msft));
memset(msft, 0, sizeof(*msft));
msft->typelib = typelib;
@ -2546,7 +2548,7 @@ int create_msft_typelib(typelib_t *typelib)
ctl2_init_header(msft);
ctl2_init_segdir(msft);
msft->typelib_header.varflags |= SYS_WIN32;
msft->typelib_header.varflags |= typelib_kind;
/*
* The following two calls return an offset or -1 if out of memory. We