mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 14:39:46 +00:00

- Rob Shearman <rob@codeweavers.com> Wed, 26 Mar 2008 widl: Support using context handles as the binding handle in client functions. - Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008 widl: Use is_string_type for detecting strings in write_typeformatstring_var to make it consistent with write_remoting_arg. - Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008 widl: Add support for generic binding handles. - Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008 widl: Fix detection of non-pointer context handles. - Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008 widl: Make sure that string types are always written out by write_string_tfs and not write_simple_pointer. - Rob Shearman <rob@codeweavers.com> Mon, 31 Mar 2008 widl: Parse typedefs of function pointers. - Rob Shearman <rob@codeweavers.com> Tue, 1 Apr 2008 widl: Be more strict about where semicolons can appear in IDL files. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Add a function to get the return type of a parsed function. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Store function and function pointer types completely within type_t type. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Support parsing calling conventions for function identifiers. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Support __fastcall and __pascal calling conventions. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Add a newline between function prototypes for non-object interfaces. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Fix the writing out of function pointers with more than one level of indirection. - Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008 widl: Turn on verbose errors, which gives a little more information in the case of a syntax error. - Dan Hipschman <dsh@linux.ucla.edu> Thu, 3 Apr 2008 widl: Fix a mistake in an ordered list (keywords). svn path=/trunk/; revision=36829
333 lines
10 KiB
Diff
333 lines
10 KiB
Diff
--- client.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ client.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -113,7 +113,7 @@
|
|
}
|
|
if (explicit_handle)
|
|
{
|
|
- if (!explicit_handle_var || !explicit_generic_handle_var || !context_handle_var)
|
|
+ if (!explicit_handle_var && !explicit_generic_handle_var && !context_handle_var)
|
|
{
|
|
error("%s() does not define an explicit binding handle!\n", def->name);
|
|
return;
|
|
--- hash.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ hash.c 2008-09-22 00:14:35.703125000 +0200
|
|
@@ -21,9 +21,7 @@
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
-#include "windef.h"
|
|
-#include "winbase.h"
|
|
-#include "winnls.h"
|
|
+#include <host/nls.h>
|
|
|
|
#include "hash.h"
|
|
|
|
@@ -535,6 +533,7 @@
|
|
case LANG_SWEDISH: case LANG_SYRIAC: case LANG_TAMIL:
|
|
case LANG_TATAR: case LANG_TELUGU: case LANG_THAI:
|
|
case LANG_UKRAINIAN: case LANG_URDU: case LANG_UZBEK:
|
|
+#ifndef __REACTOS__
|
|
case LANG_VIETNAMESE: case LANG_GAELIC: case LANG_MALTESE:
|
|
case LANG_TAJIK: case LANG_ROMANSH: case LANG_IRISH:
|
|
case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_SUTU:
|
|
@@ -542,6 +541,12 @@
|
|
case LANG_XHOSA: case LANG_ZULU: case LANG_ESPERANTO:
|
|
case LANG_WALON: case LANG_CORNISH: case LANG_WELSH:
|
|
case LANG_BRETON:
|
|
+#else
|
|
+ case LANG_VIETNAMESE: case LANG_MALTESE: case LANG_IRISH:
|
|
+ case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_TSWANA:
|
|
+ case LANG_XHOSA: case LANG_ZULU: case LANG_WELSH:
|
|
+ case LANG_BRETON:
|
|
+#endif
|
|
nOffset = 16;
|
|
pnLookup = Lookup_16;
|
|
break;
|
|
--- header.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ header.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -891,6 +891,8 @@
|
|
const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE);
|
|
int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE);
|
|
const var_t* explicit_handle_var;
|
|
+ const var_t* explicit_generic_handle_var = NULL;
|
|
+ const var_t* context_handle_var = NULL;
|
|
const func_t *cur;
|
|
int prefixes_differ = strcmp(prefix_client, prefix_server);
|
|
|
|
@@ -901,8 +903,14 @@
|
|
|
|
/* check for a defined binding handle */
|
|
explicit_handle_var = get_explicit_handle_var(cur);
|
|
+ if (!explicit_handle_var)
|
|
+ {
|
|
+ explicit_generic_handle_var = get_explicit_generic_handle_var(cur);
|
|
+ if (!explicit_generic_handle_var)
|
|
+ context_handle_var = get_context_handle_var(cur);
|
|
+ }
|
|
if (explicit_handle) {
|
|
- if (!explicit_handle_var) {
|
|
+ if (!explicit_handle_var && !explicit_generic_handle_var && !context_handle_var) {
|
|
error("%s() does not define an explicit binding handle!\n", def->name);
|
|
return;
|
|
}
|
|
--- header.h 2008-09-27 21:56:02.000000000 +0200
|
|
+++ header.h 2008-09-23 21:14:50.781250000 +0200
|
|
@@ -66,6 +66,7 @@
|
|
extern const var_t* get_explicit_handle_var(const func_t* func);
|
|
extern const type_t* get_explicit_generic_handle_type(const var_t* var);
|
|
extern const var_t* get_explicit_generic_handle_var(const func_t* func);
|
|
+extern const var_t* get_context_handle_var(const func_t* func);
|
|
extern int has_out_arg_or_return(const func_t *func);
|
|
extern void write_guid(FILE *f, const char *guid_prefix, const char *name,
|
|
const UUID *uuid);
|
|
@@ -88,11 +89,19 @@
|
|
|
|
static inline int is_context_handle(const type_t *type)
|
|
{
|
|
- const type_t *t;
|
|
- for (t = type; is_ptr(t); t = t->ref)
|
|
- if (is_attr(t->attrs, ATTR_CONTEXTHANDLE))
|
|
+ if (is_attr(type->attrs, ATTR_CONTEXTHANDLE))
|
|
+ return 1;
|
|
+
|
|
+ for (;;)
|
|
+ {
|
|
+ if (is_attr(type->attrs, ATTR_CONTEXTHANDLE))
|
|
return 1;
|
|
- return 0;
|
|
+ else if (type->kind == TKIND_ALIAS)
|
|
+ type = type->orig;
|
|
+ else if (is_ptr(type))
|
|
+ type = type->ref;
|
|
+ else return 0;
|
|
+ }
|
|
}
|
|
|
|
#endif
|
|
--- proxy.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ proxy.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -463,41 +463,45 @@
|
|
print_proxy("\n");
|
|
}
|
|
|
|
-static int write_proxy_methods(type_t *iface)
|
|
+static int write_proxy_methods(type_t *iface, int skip)
|
|
{
|
|
const func_t *cur;
|
|
int i = 0;
|
|
|
|
- if (iface->ref) i = write_proxy_methods(iface->ref);
|
|
+ if (iface->ref) i = write_proxy_methods(iface->ref, iface->ref->ref != NULL);
|
|
if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
|
|
var_t *def = cur->def;
|
|
if (!is_callas(def->attrs)) {
|
|
if (i) fprintf(proxy, ",\n");
|
|
- print_proxy( "%s_", iface->name);
|
|
+ print_proxy( "%s%s_", skip ? "0\t/* " : "", iface->name);
|
|
write_name(proxy, def);
|
|
- fprintf(proxy, "_Proxy");
|
|
+ fprintf(proxy, "_Proxy%s", skip ? " */" : "");
|
|
i++;
|
|
}
|
|
}
|
|
return i;
|
|
}
|
|
|
|
-static int write_stub_methods(type_t *iface)
|
|
+static int write_stub_methods(type_t *iface, int skip)
|
|
{
|
|
const func_t *cur;
|
|
int i = 0;
|
|
|
|
- if (iface->ref) i = write_stub_methods(iface->ref);
|
|
+ if (iface->ref) i = write_stub_methods(iface->ref, TRUE);
|
|
else return i; /* skip IUnknown */
|
|
|
|
if (iface->funcs) LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) {
|
|
var_t *def = cur->def;
|
|
if (!is_local(def->attrs)) {
|
|
- if (i) fprintf(proxy,",\n");
|
|
- print_proxy( "%s_", iface->name);
|
|
- write_name(proxy, def);
|
|
- fprintf(proxy, "_Stub");
|
|
- i++;
|
|
+ if (skip)
|
|
+ print_proxy("STUB_FORWARDING_FUNCTION,\n");
|
|
+ else {
|
|
+ if (i) fprintf(proxy,",\n");
|
|
+ print_proxy( "%s_", iface->name);
|
|
+ write_name(proxy, def);
|
|
+ fprintf(proxy, "_Stub");
|
|
+ i++;
|
|
+ }
|
|
}
|
|
}
|
|
return i;
|
|
@@ -551,7 +555,7 @@
|
|
print_proxy( "},\n");
|
|
print_proxy( "{\n");
|
|
indent++;
|
|
- write_proxy_methods(iface);
|
|
+ write_proxy_methods(iface, FALSE);
|
|
fprintf(proxy, "\n");
|
|
indent--;
|
|
print_proxy( "}\n");
|
|
@@ -563,7 +567,7 @@
|
|
print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name);
|
|
print_proxy( "{\n");
|
|
indent++;
|
|
- stubs = write_stub_methods(iface);
|
|
+ stubs = write_stub_methods(iface, FALSE);
|
|
fprintf(proxy, "\n");
|
|
indent--;
|
|
fprintf(proxy, "};\n");
|
|
--- server.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ server.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -60,13 +60,21 @@
|
|
LIST_FOR_EACH_ENTRY( func, iface->funcs, const func_t, entry )
|
|
{
|
|
const var_t *def = func->def;
|
|
+ const var_t* context_handle_var = NULL;
|
|
+ const var_t* explicit_generic_handle_var = NULL;
|
|
int has_full_pointer = is_full_pointer_function(func);
|
|
|
|
/* check for a defined binding handle */
|
|
explicit_handle_var = get_explicit_handle_var(func);
|
|
+ if (!explicit_handle_var)
|
|
+ {
|
|
+ explicit_generic_handle_var = get_explicit_generic_handle_var(func);
|
|
+ if (!explicit_generic_handle_var)
|
|
+ context_handle_var = get_context_handle_var(func);
|
|
+ }
|
|
if (explicit_handle)
|
|
{
|
|
- if (!explicit_handle_var)
|
|
+ if (!explicit_handle_var && !explicit_generic_handle_var && !context_handle_var)
|
|
{
|
|
error("%s() does not define an explicit binding handle!\n", def->name);
|
|
return;
|
|
@@ -399,6 +407,7 @@
|
|
print_server("/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
|
|
print_server("#include <string.h>\n");
|
|
fprintf(server, "\n");
|
|
+ print_server("#define _SEH_NO_NATIVE_NLG\n");
|
|
print_server("#include \"%s\"\n", header_name);
|
|
fprintf(server, "\n");
|
|
}
|
|
--- typelib.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ typelib.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -35,8 +35,7 @@
|
|
#define NONAMELESSUNION
|
|
#define NONAMELESSSTRUCT
|
|
|
|
-#include "windef.h"
|
|
-#include "winbase.h"
|
|
+#include <host/typedefs.h>
|
|
|
|
#include "widl.h"
|
|
#include "utils.h"
|
|
@@ -360,10 +359,10 @@
|
|
|
|
file_name = wpp_find_include(importlib->name, NULL);
|
|
if(file_name) {
|
|
- fd = open(file_name, O_RDONLY);
|
|
+ fd = open(file_name, O_RDONLY | O_BINARY);
|
|
free(file_name);
|
|
}else {
|
|
- fd = open(importlib->name, O_RDONLY);
|
|
+ fd = open(importlib->name, O_RDONLY | O_BINARY);
|
|
}
|
|
|
|
if(fd < 0)
|
|
--- typelib_struct.h 2008-09-27 21:56:02.000000000 +0200
|
|
+++ typelib_struct.h 2008-09-22 00:14:35.703125000 +0200
|
|
@@ -302,7 +302,7 @@
|
|
*
|
|
*/
|
|
|
|
-#include "pshpack1.h"
|
|
+#include <host/pshpack1.h>
|
|
|
|
typedef struct {
|
|
/*00*/ DWORD SLTG_magic; /* 0x47544c53 == "SLTG" */
|
|
@@ -599,7 +599,7 @@
|
|
WORD typeofarray
|
|
*/
|
|
|
|
-#include "poppack.h"
|
|
+#include <host/poppack.h>
|
|
|
|
/*---------------------------END--------------------------------------------*/
|
|
#endif
|
|
--- widl.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ widl.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -174,7 +174,7 @@
|
|
token = xstrdup(name);
|
|
for (i=0; token[i]; i++) {
|
|
if (!isalnum(token[i])) token[i] = '_';
|
|
- else token[i] = toupper(token[i]);
|
|
+ else token[i] = tolower(token[i]);
|
|
}
|
|
return token;
|
|
}
|
|
@@ -561,8 +561,8 @@
|
|
fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
|
|
fprintf(header, "#include <rpc.h>\n" );
|
|
fprintf(header, "#include <rpcndr.h>\n\n" );
|
|
- fprintf(header, "#ifndef __WIDL_%s\n", header_token);
|
|
- fprintf(header, "#define __WIDL_%s\n", header_token);
|
|
+ fprintf(header, "#ifndef __%s__\n", header_token);
|
|
+ fprintf(header, "#define __%s__\n", header_token);
|
|
start_cplusplus_guard(header);
|
|
}
|
|
|
|
@@ -607,7 +607,7 @@
|
|
fprintf(header, "/* End additional prototypes */\n");
|
|
fprintf(header, "\n");
|
|
end_cplusplus_guard(header);
|
|
- fprintf(header, "#endif /* __WIDL_%s */\n", header_token);
|
|
+ fprintf(header, "#endif /* __%s__ */\n", header_token);
|
|
fclose(header);
|
|
}
|
|
|
|
--- widltypes.h 2008-09-27 21:56:02.000000000 +0200
|
|
+++ widltypes.h 2008-09-26 19:42:52.859375000 +0200
|
|
@@ -21,6 +21,13 @@
|
|
#ifndef __WIDL_WIDLTYPES_H
|
|
#define __WIDL_WIDLTYPES_H
|
|
|
|
+#define S_OK 0
|
|
+#define S_FALSE 1
|
|
+#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
|
|
+#define TYPE_E_IOERROR ((HRESULT)0x80028CA2L)
|
|
+
|
|
+#define max(a, b) ((a) > (b) ? a : b)
|
|
+
|
|
#include <stdarg.h>
|
|
#include "guiddef.h"
|
|
#include "wine/rpcfc.h"
|
|
@@ -31,7 +38,9 @@
|
|
typedef GUID UUID;
|
|
#endif
|
|
|
|
+#ifndef TRUE
|
|
#define TRUE 1
|
|
+#endif
|
|
#define FALSE 0
|
|
|
|
#define RPC_FC_FUNCTION 0xfe
|
|
--- write_msft.c 2008-09-27 21:56:02.000000000 +0200
|
|
+++ write_msft.c 2008-09-27 20:49:05.000000000 +0200
|
|
@@ -40,10 +40,8 @@
|
|
#define NONAMELESSUNION
|
|
#define NONAMELESSSTRUCT
|
|
|
|
-#include "winerror.h"
|
|
-#include "windef.h"
|
|
-#include "winbase.h"
|
|
-#include "winnls.h"
|
|
+#include <host/typedefs.h>
|
|
+#include <host/nls.h>
|
|
|
|
#include "widltypes.h"
|
|
#include "typelib.h"
|