#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "widl.h"
#include "windef.h"
#include "winbase.h"
#include "utils.h"
#include "wpp_private.h"
#include "parser.h"
#include "header.h"
#include "typelib.h"
#include "widltypes.h"
#include "typelib_struct.h"
#include "typetree.h"
Go to the source code of this file.
|
| static int | kw_cmp_func (const void *s1, const void *s2) |
| |
| static unsigned short | builtin_vt (const type_t *t) |
| |
| static int | match (const char *n, const char *m) |
| |
| unsigned short | get_type_vt (type_t *t) |
| |
| static void | msft_read_guid (void *data, MSFT_SegDir *segdir, int offset, struct uuid *guid) |
| |
| static void | read_msft_importlib (importlib_t *importlib, void *data, unsigned int size) |
| |
| static unsigned int | rva_to_va (const IMAGE_NT_HEADERS32 *nt, unsigned int rva) |
| |
| static void | read_pe_importlib (importlib_t *importlib, void *data, unsigned int size) |
| |
| static void | read_importlib (importlib_t *importlib) |
| |
| void | add_importlib (const char *name, typelib_t *typelib) |
| |
◆ KWP
◆ add_importlib()
Definition at line 411 of file typelib.c.
413{
415
417
420 return;
421
423
425 memset( importlib, 0,
sizeof(*importlib) );
427
430}
int strcmp(const char *String1, const char *String2)
char * xstrdup(const char *s)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
◆ builtin_vt()
Definition at line 77 of file typelib.c.
78{
79 const char *kw =
t->name;
83#ifdef KW_BSEARCH
85#else
86 {
91 break;
92 }
93 }
94#endif
95 if (kwp) {
97 }
99 {
103 else
106 {
108 {
111 default: break;
112 }
113 }
114 }
115 return 0;
116}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static enum type_type type_get_type(const type_t *type)
static type_t * type_array_get_element_type(const type_t *type)
static enum type_basic_type type_basic_get_type(const type_t *type)
static type_t * type_pointer_get_ref_type(const type_t *type)
Referenced by get_type_vt().
◆ get_type_vt()
Definition at line 124 of file typelib.c.
125{
127
128 chat(
"get_type_vt: %p type->name %s\n",
t,
t->name);
132 }
133
137
147 else
154 else
159 else
166 else
172 else
176 {
179 else
181 }
182 else
183 {
186 else
188 }
194 error(
"handles can't be used in typelibs\n");
195 }
196 break;
197
200
203 {
207 }
208 else
210
212 if(
match(
t->name,
"IUnknown"))
214 if(
match(
t->name,
"IDispatch"))
217
227
230
235
237 break;
238
240 error(
"get_type_vt: functions not supported\n");
241 break;
242
244 error(
"get_type_vt: bitfields not supported\n");
245 break;
246 }
247 return 0;
248}
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
static int type_array_is_decl_as_ptr(const type_t *type)
static int type_basic_get_sign(const type_t *type)
static int type_is_alias(const type_t *type)
unsigned int pointer_size
@ TYPE_PARAMETERIZED_TYPE
@ TYPE_ENCAPSULATED_UNION
@ TYPE_BASIC_ERROR_STATUS_T
Referenced by add_typedef_typeinfo(), encode_type(), encode_var(), get_element_size(), write_args(), write_default_value(), and write_var_desc().
◆ kw_cmp_func()
◆ match()
◆ msft_read_guid()
Definition at line 265 of file typelib.c.
266{
268}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define memcpy(s1, s2, n)
Referenced by read_msft_importlib().
◆ read_importlib()
Definition at line 378 of file typelib.c.
379{
382
384
385
388
391
397
402 else
403 error(
"Wrong or unsupported typelib\n");
404
406}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
char * strmake(size_t *lenp,...)
int open_typelib(const char *name)
Referenced by add_importlib().
◆ read_msft_importlib()
Definition at line 270 of file typelib.c.
271{
274 int *typeinfo_offs;
276
279
280 typeinfo_offs = (
int *)(
header + 1);
282
284
287
292
297
298 if(
base->posguid != -1) {
301 }
303
305
310 }
311}
#define MSFT_IMPINFO_OFFSET_IS_GUID
Referenced by read_importlib(), and read_pe_importlib().
◆ read_pe_importlib()
Definition at line 327 of file typelib.c.
328{
337
342 error(
"invalid PE file\n" );
344 {
347 break;
350 break;
351 default:
352 error(
"invalid PE file\n" );
353 }
354 if (!
dir->VirtualAddress || !
dir->Size)
error(
"resource not found in PE file\n" );
356 if (va +
dir->Size >
size)
error(
"invalid resource data in PE file\n" );
360 {
361 static const WCHAR typelibW[] = {
'T',
'Y',
'P',
'E',
'L',
'I',
'B'};
365 }
367 while (
entry->DataIsDirectory)
368 {
371 }
374 if (
memcmp(
ptr,
"MSFT", 4 ))
error(
"invalid typelib found in PE file\n" );
376}
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define IMAGE_FIRST_SECTION(NtHeader)
#define IMAGE_NT_SIGNATURE
#define IMAGE_DIRECTORY_ENTRY_RESOURCE
static const WCHAR typelibW[]
WORD NumberOfNamedEntries
Referenced by read_importlib().
◆ rva_to_va()
Definition at line 313 of file typelib.c.
314{
317
321 error(
"no PE section found for addr %x\n", rva );
322#ifdef __REACTOS__
323 return 0;
324#endif
325}
Referenced by read_pe_importlib().
◆ oatypes