winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2007
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
687 discussions
Start a n
N
ew thread
Dan Hipschman : widl: Declare fixed-size array args as pointers to arrays.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: a67c37f871fb21da67048ce70f916544ba7bc968 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a67c37f871fb21da67048ce70…
Author: Dan Hipschman <dsh(a)linux.ucla.edu> Date: Wed Apr 25 18:20:56 2007 -0700 widl: Declare fixed-size array args as pointers to arrays. --- tools/widl/proxy.c | 2 ++ tools/widl/server.c | 2 ++ tools/widl/typegen.c | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index e07d2af..2d6b75b 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -416,6 +416,8 @@ static void gen_stub(type_t *iface, const func_t *cur, const char *cas, LIST_FOR_EACH_ENTRY( arg, cur->args, const var_t, entry ) { fprintf(proxy, ", "); + if (arg->array) + fprintf(proxy, "*"); write_name(proxy, arg); } } diff --git a/tools/widl/server.c b/tools/widl/server.c index 6f95b09..a51a69c 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -211,6 +211,8 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig else fprintf(server, ",\n"); print_server(""); + if (var->array) + fprintf(server, "*"); write_name(server, var); } fprintf(server, ");\n"); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index f169f82..d63c49a 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2302,7 +2302,12 @@ void declare_stub_args( FILE *file, int indent, const func_t *func ) print_file(file, indent, ""); write_type(file, var->type, var, var->tname); fprintf(file, " "); - write_name(file, var); + if (var->array) { + fprintf(file, "( *"); + write_name(file, var); + fprintf(file, " )"); + } else + write_name(file, var); write_array(file, var->array, 0); fprintf(file, ";\n"); }
1
0
0
0
Dan Hipschman : rpcrt4: Add tests for RPC and widl generated code.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: cc09b0c19c1161ad7bf25016e2454440238deed4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cc09b0c19c1161ad7bf25016e…
Author: Dan Hipschman <dsh(a)linux.ucla.edu> Date: Wed Apr 25 18:18:29 2007 -0700 rpcrt4: Add tests for RPC and widl generated code. --- .gitignore | 4 + dlls/rpcrt4/tests/Makefile.in | 7 +- dlls/rpcrt4/tests/server.c | 262 +++++++++++++++++++++++++++++++++++++++++ dlls/rpcrt4/tests/server.idl | 45 +++++++ 4 files changed, 317 insertions(+), 1 deletions(-) diff --git a/.gitignore b/.gitignore index 0de124f..0e63048 100644 --- a/.gitignore +++ b/.gitignore @@ -441,6 +441,10 @@ dlls/riched32/version.res dlls/rpcrt4/librpcrt4.def dlls/rpcrt4/tests/*.ok dlls/rpcrt4/tests/rpcrt4_crosstest.exe +dlls/rpcrt4/tests/server.h +dlls/rpcrt4/tests/server.h +dlls/rpcrt4/tests/server_c.c +dlls/rpcrt4/tests/server_s.c dlls/rpcrt4/tests/testlist.c dlls/rpcrt4/version.res dlls/rsabase/tests/*.ok diff --git a/dlls/rpcrt4/tests/Makefile.in b/dlls/rpcrt4/tests/Makefile.in index 036cd21..c497aa3 100644 --- a/dlls/rpcrt4/tests/Makefile.in +++ b/dlls/rpcrt4/tests/Makefile.in @@ -5,12 +5,17 @@ VPATH = @srcdir@ TESTDLL = rpcrt4.dll IMPORTS = ole32 rpcrt4 kernel32 EXTRALIBS = -luuid +EXTRAIDLFLAGS = --prefix-server=s_ + +IDL_C_SRCS = server.idl +IDL_S_SRCS = server.idl CTESTS = \ cstub.c \ generated.c \ ndr_marshall.c \ - rpc.c + rpc.c \ + server.c @MAKE_TEST_RULES@ diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c new file mode 100644 index 0000000..9fef738 --- /dev/null +++ b/dlls/rpcrt4/tests/server.c @@ -0,0 +1,262 @@ +/* + * Tests for WIDL and RPC server/clients. + * + * Copyright (C) Google 2007 (Dan Hipschman) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include "wine/test.h" +#include "server.h" + +#include <stdio.h> + +#define PORT "4114" +#define PIPE "\\pipe\\wine_rpcrt4_test" + +#define INT_CODE 4198 + +static const char *progname; + +static HANDLE stop_event; + +void __RPC_FAR *__RPC_USER +midl_user_allocate(size_t n) +{ + return malloc(n); +} + +void __RPC_USER +midl_user_free(void __RPC_FAR *p) +{ + free(p); +} + +int +s_int_return(void) +{ + return INT_CODE; +} + +int +s_square(int x) +{ + return x * x; +} + +int +s_sum(int x, int y) +{ + return x + y; +} + +void +s_square_out(int x, int *y) +{ + *y = s_square(x); +} + +void +s_square_ref(int *x) +{ + *x = s_square(*x); +} + +int +s_str_length(const char *s) +{ + return strlen(s); +} + +int +s_dot_self(vector_t *v) +{ + return s_square(v->x) + s_square(v->y) + s_square(v->z); +} + +double +s_square_half(double x, double *y) +{ + *y = x / 2.0; + return x * x; +} + +float +s_square_half_float(float x, float *y) +{ + *y = x / 2.0f; + return x * x; +} + +long +s_square_half_long(long x, long *y) +{ + *y = x / 2; + return x * x; +} + +void +s_stop(void) +{ + ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n"); + ok(RPC_S_OK == RpcServerUnregisterIf(NULL, NULL, FALSE), "RpcServerUnregisterIf\n"); + ok(SetEvent(stop_event), "SetEvent\n"); +} + +static void +make_cmdline(char buffer[MAX_PATH], const char *test) +{ + sprintf(buffer, "%s server %s", progname, test); +} + +static int +run_client(const char *test) +{ + char cmdline[MAX_PATH]; + PROCESS_INFORMATION info; + STARTUPINFOA startup; + DWORD exitcode; + + memset(&startup, 0, sizeof startup); + startup.cb = sizeof startup; + + make_cmdline(cmdline, test); + ok(CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n"); + ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n"); + ok(GetExitCodeProcess(info.hProcess, &exitcode), "GetExitCodeProcess\n"); + ok(CloseHandle(info.hProcess), "CloseHandle\n"); + ok(CloseHandle(info.hThread), "CloseHandle\n"); + + return exitcode == 0; +} + +static void +basic_tests(void) +{ + static char string[] = "I am a string"; + static vector_t a = {1, 3, 7}; + double u, v; + float s, t; + long q, r; + int x; + + ok(int_return() == INT_CODE, "RPC int_return\n"); + + ok(square(7) == 49, "RPC square\n"); + ok(sum(23, -4) == 19, "RPC sum\n"); + + x = 0; + square_out(11, &x); + ok(x == 121, "RPC square_out\n"); + + x = 5; + square_ref(&x); + ok(x == 25, "RPC square_ref\n"); + + ok(str_length(string) == strlen(string), "RPC str_length\n"); + ok(dot_self(&a) == 59, "RPC dot_self\n"); + + v = 0.0; + u = square_half(3.0, &v); + ok(u == 9.0, "RPC square_half\n"); + ok(v == 1.5, "RPC square_half\n"); + + t = 0.0f; + s = square_half_float(3.0f, &t); + ok(s == 9.0f, "RPC square_half_float\n"); + ok(t == 1.5f, "RPC square_half_float\n"); + + r = 0; + q = square_half_long(3, &r); + ok(q == 9, "RPC square_half_long\n"); + ok(r == 1, "RPC square_half_long\n"); +} + +static void +client(const char *test) +{ + if (strcmp(test, "tcp_basic") == 0) + { + static unsigned char iptcp[] = "ncacn_ip_tcp"; + static unsigned char address[] = "127.0.0.1"; + static unsigned char port[] = PORT; + unsigned char *binding; + + ok(RPC_S_OK == RpcStringBindingCompose(NULL, iptcp, address, port, NULL, &binding), "RpcStringBindingCompose\n"); + ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + + basic_tests(); + + ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n"); + ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); + } + else if (strcmp(test, "np_basic") == 0) + { + static unsigned char np[] = "ncacn_np"; + static unsigned char address[] = "\\\\."; + static unsigned char pipe[] = PIPE; + unsigned char *binding; + + ok(RPC_S_OK == RpcStringBindingCompose(NULL, np, address, pipe, NULL, &binding), "RpcStringBindingCompose\n"); + ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + + basic_tests(); + stop(); + + ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n"); + ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); + } +} + +static void +server(void) +{ + static unsigned char iptcp[] = "ncacn_ip_tcp"; + static unsigned char port[] = PORT; + static unsigned char np[] = "ncacn_np"; + static unsigned char pipe[] = PIPE; + + ok(RPC_S_OK == RpcServerUseProtseqEp(iptcp, 20, port, NULL), "RpcServerUseProtseqEp\n"); + ok(RPC_S_OK == RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL), "RpcServerRegisterIf\n"); + ok(RPC_S_OK == RpcServerListen(1, 20, TRUE), "RpcServerListen\n"); + + stop_event = CreateEvent(NULL, FALSE, FALSE, NULL); + ok(stop_event != NULL, "CreateEvent failed\n"); + + ok(run_client("tcp_basic"), "tcp_basic client test failed\n"); + + ok(RPC_S_OK == RpcServerUseProtseqEp(np, 0, pipe, NULL), "RpcServerUseProtseqEp\n"); + ok(run_client("np_basic"), "np_basic client test failed\n"); + + ok(WAIT_OBJECT_0 == WaitForSingleObject(stop_event, 60000), "WaitForSingleObject\n"); + todo_wine { + ok(RPC_S_OK == RpcMgmtWaitServerListen(), "RpcMgmtWaitServerListening\n"); + } +} + +START_TEST(server) +{ + int argc; + char **argv; + + argc = winetest_get_mainargs(&argv); + progname = argv[0]; + + if (argc == 3) + client(argv[2]); + else + server(); +} diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl new file mode 100644 index 0000000..d42a3a9 --- /dev/null +++ b/dlls/rpcrt4/tests/server.idl @@ -0,0 +1,45 @@ +/* + * A simple interface to test the RPC server. + * + * Copyright (C) Google 2007 (Dan Hipschman) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +typedef struct tag_vector +{ + int x; + int y; + int z; +} vector_t; + +[ + uuid(00000000-4114-0704-2301-000000000000), + implicit_handle(handle_t IServer_IfHandle) +] +interface IServer +{ + int int_return(void); + int square(int x); + int sum(int x, int y); + void square_out(int x, [out] int *y); + void square_ref([in, out] int *x); + int str_length([string] const char *s); + int dot_self(vector_t *v); + double square_half(double x, [out] double *y); + float square_half_float(float x, [out] float *y); + long square_half_long(long x, [out] long *y); + void stop(void); +}
1
0
0
0
Dan Hipschman : widl: Add --prefix-* options (take 3).
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: e714c89d2fe27137ec014a66e0d0c9e0013c4709 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e714c89d2fe27137ec014a66e…
Author: Dan Hipschman <dsh(a)linux.ucla.edu> Date: Wed Apr 25 18:17:31 2007 -0700 widl: Add --prefix-* options (take 3). --- tools/widl/client.c | 6 ++-- tools/widl/header.c | 53 +++++++++++++++++++++++++++++++++++--------------- tools/widl/header.h | 1 + tools/widl/server.c | 6 ++-- tools/widl/widl.c | 30 ++++++++++++++++++++++++++- tools/widl/widl.h | 2 + 6 files changed, 74 insertions(+), 24 deletions(-) diff --git a/tools/widl/client.c b/tools/widl/client.c index 3322a07..ba49624 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -115,7 +115,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig write_type(client, def->type, def, def->tname); fprintf(client, " "); - write_name(client, def); + write_prefix_name(client, prefix_client, def); fprintf(client, "(\n"); indent++; if (func->args) @@ -363,8 +363,8 @@ static void write_clientinterfacedecl(type_t *iface) print_client("RPC_IF_HANDLE %s_ClientIfHandle = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", iface->name, iface->name); else - print_client("RPC_IF_HANDLE %s_v%d_%d_c_ifspec = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", - iface->name, LOWORD(ver), HIWORD(ver), iface->name); + print_client("RPC_IF_HANDLE %s%s_v%d_%d_c_ifspec = (RPC_IF_HANDLE)& %s___RpcClientInterface;\n", + prefix_client, iface->name, LOWORD(ver), HIWORD(ver), iface->name); fprintf(client, "\n"); } diff --git a/tools/widl/header.c b/tools/widl/header.c index 372b0b1..b7fd983 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -125,6 +125,12 @@ void write_name(FILE *h, const var_t *v) fprintf(h, "%s", v->name); } +void write_prefix_name(FILE *h, const char *prefix, const var_t *v) +{ + fprintf(h, "%s", prefix); + write_name(h, v); +} + const char* get_name(const var_t *v) { return v->name; @@ -709,12 +715,29 @@ static void write_method_proto(const type_t *iface) } } -static void write_function_proto(const type_t *iface) +static void write_function_proto(const type_t *iface, const func_t *fun, const char *prefix) +{ + var_t *def = fun->def; + + /* FIXME: do we need to handle call_as? */ + write_type(header, def->type, def, def->tname); + fprintf(header, " "); + write_prefix_name(header, prefix, def); + fprintf(header, "(\n"); + if (fun->args) + write_args(header, fun->args, iface->name, 0, TRUE); + else + fprintf(header, " void"); + fprintf(header, ");\n"); +} + +static void write_function_protos(const type_t *iface) { 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 func_t *cur; + int prefixes_differ = strcmp(prefix_client, prefix_server); if (!iface->funcs) return; LIST_FOR_EACH_ENTRY( cur, iface->funcs, const func_t, entry ) @@ -735,16 +758,12 @@ static void write_function_proto(const type_t *iface) } } - /* FIXME: do we need to handle call_as? */ - write_type(header, def->type, def, def->tname); - fprintf(header, " "); - write_name(header, def); - fprintf(header, "(\n"); - if (cur->args) - write_args(header, cur->args, iface->name, 0, TRUE); - else - fprintf(header, " void"); - fprintf(header, ");\n"); + if (prefixes_differ) { + fprintf(header, "/* client prototype */\n"); + write_function_proto(iface, cur, prefix_client); + fprintf(header, "/* server prototype */\n"); + } + write_function_proto(iface, cur, prefix_server); } } @@ -868,15 +887,17 @@ static void write_rpc_interface(const type_t *iface) if (var) fprintf(header, "extern handle_t %s;\n", var); if (old_names) { - fprintf(header, "extern RPC_IF_HANDLE %s_ClientIfHandle;\n", iface->name); - fprintf(header, "extern RPC_IF_HANDLE %s_ServerIfHandle;\n", iface->name); + fprintf(header, "extern RPC_IF_HANDLE %s%s_ClientIfHandle;\n", prefix_client, iface->name); + fprintf(header, "extern RPC_IF_HANDLE %s%s_ServerIfHandle;\n", prefix_server, iface->name); } else { - fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_c_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); - fprintf(header, "extern RPC_IF_HANDLE %s_v%d_%d_s_ifspec;\n", iface->name, LOWORD(ver), HIWORD(ver)); + fprintf(header, "extern RPC_IF_HANDLE %s%s_v%d_%d_c_ifspec;\n", + prefix_client, iface->name, LOWORD(ver), HIWORD(ver)); + fprintf(header, "extern RPC_IF_HANDLE %s%s_v%d_%d_s_ifspec;\n", + prefix_server, iface->name, LOWORD(ver), HIWORD(ver)); } - write_function_proto(iface); + write_function_protos(iface); } fprintf(header,"\n#endif /* __%s_INTERFACE_DEFINED__ */\n\n", iface->name); diff --git a/tools/widl/header.h b/tools/widl/header.h index 1383fda..ebf7917 100644 --- a/tools/widl/header.h +++ b/tools/widl/header.h @@ -28,6 +28,7 @@ extern int is_void(const type_t *t, const var_t *v); extern int is_conformant_array( const array_dims_t *array ); extern int is_non_void(const expr_list_t *list); extern void write_name(FILE *h, const var_t *v); +extern void write_prefix_name(FILE *h, const char *prefix, const var_t *v); extern const char* get_name(const var_t *v); extern void write_type(FILE *h, type_t *t, const var_t *v, const char *n); extern int is_object(const attr_list_t *list); diff --git a/tools/widl/server.c b/tools/widl/server.c index 831d7ac..6f95b09 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -196,7 +196,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig print_server("_RetVal = "); else print_server(""); - write_name(server, def); + write_prefix_name(server, prefix_server, def); if (func->args) { @@ -393,8 +393,8 @@ static void write_serverinterfacedecl(type_t *iface) print_server("RPC_IF_HANDLE %s_ServerIfHandle = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", iface->name, iface->name); else - print_server("RPC_IF_HANDLE %s_v%d_%d_s_ifspec = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", - iface->name, LOWORD(ver), HIWORD(ver), iface->name); + print_server("RPC_IF_HANDLE %s%s_v%d_%d_s_ifspec = (RPC_IF_HANDLE)& %s___RpcServerInterface;\n", + prefix_server, iface->name, LOWORD(ver), HIWORD(ver), iface->name); fprintf(server, "\n"); } diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 8cb84dc..ed09b32 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -22,6 +22,7 @@ #include "config.h" #include "wine/port.h" +#include <limits.h> #include <stdio.h> #include <stdlib.h> #ifdef HAVE_UNISTD_H @@ -62,6 +63,9 @@ static char usage[] = " --oldnames Use old naming conventions\n" " -p Generate proxy\n" " -P file Name of proxy file (default is infile_p.c)\n" +" --prefix-all=p Prefix names of client stubs / server functions with 'p'\n" +" --prefix-client=p Prefix names of client stubs with 'p'\n" +" --prefix-server=p Prefix names of server functions with 'p'\n" " -s Generate server stub\n" " -S file Name of server stub file (default is infile_s.c)\n" " -t Generate typelib\n" @@ -111,6 +115,8 @@ char *server_token; char *idfile_name; char *idfile_token; char *temp_name; +const char *prefix_client = ""; +const char *prefix_server = ""; int line_number = 1; @@ -120,10 +126,20 @@ FILE *idfile; time_t now; +enum { + OLDNAMES_OPTION = CHAR_MAX + 1, + PREFIX_ALL_OPTION, + PREFIX_CLIENT_OPTION, + PREFIX_SERVER_OPTION +}; + static const char *short_options = "cC:d:D:EhH:I:NpP:sS:tT:uU:VW"; static struct option long_options[] = { - { "oldnames", 0, 0, 1 }, + { "oldnames", no_argument, 0, OLDNAMES_OPTION }, + { "prefix-all", required_argument, 0, PREFIX_ALL_OPTION }, + { "prefix-client", required_argument, 0, PREFIX_CLIENT_OPTION }, + { "prefix-server", required_argument, 0, PREFIX_SERVER_OPTION }, { 0, 0, 0, 0 } }; @@ -181,9 +197,19 @@ int main(int argc,char *argv[]) while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF) { switch(optc) { - case 1: + case OLDNAMES_OPTION: old_names = 1; break; + case PREFIX_ALL_OPTION: + prefix_client = xstrdup(optarg); + prefix_server = xstrdup(optarg); + break; + case PREFIX_CLIENT_OPTION: + prefix_client = xstrdup(optarg); + break; + case PREFIX_SERVER_OPTION: + prefix_server = xstrdup(optarg); + break; case 'c': do_everything = 0; do_client = 1; diff --git a/tools/widl/widl.h b/tools/widl/widl.h index 92a9faf..a2b905c 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -54,6 +54,8 @@ extern char *client_name; extern char *client_token; extern char *server_name; extern char *server_token; +extern const char *prefix_client; +extern const char *prefix_server; extern time_t now; extern int line_number;
1
0
0
0
Emmanuel Maillard : winecoreaudio: Initial MIDI In Mach message handling.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 1a47f36cb970fbb00237561da45972b8f65fb837 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a47f36cb970fbb00237561da…
Author: Emmanuel Maillard <mahanuu(a)free.fr> Date: Thu Apr 26 01:24:53 2007 +0200 winecoreaudio: Initial MIDI In Mach message handling. --- dlls/winecoreaudio.drv/coremidi.c | 2 +- dlls/winecoreaudio.drv/coremidi.h | 3 + dlls/winecoreaudio.drv/midi.c | 91 +++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletions(-) diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c index ab4cd87..a127aff 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -67,7 +67,7 @@ void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefC msg.length = packet->length; memcpy(msg.data, packet->data, sizeof(packet->data)); - /* send message to Wine */ + MIDIIn_SendMessage(msg); packet = MIDIPacketNext(packet); } diff --git a/dlls/winecoreaudio.drv/coremidi.h b/dlls/winecoreaudio.drv/coremidi.h index 182c190..7cc7f08 100644 --- a/dlls/winecoreaudio.drv/coremidi.h +++ b/dlls/winecoreaudio.drv/coremidi.h @@ -76,4 +76,7 @@ extern MIDIClientRef CoreMIDI_CreateClient(CFStringRef name); extern void CoreMIDI_GetObjectName(MIDIObjectRef obj, char *name, int size); extern void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon); +/* midi.c */ +void MIDIIn_SendMessage(MIDIMessage msg); + #endif diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index d12532c..ff43a35 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -76,6 +76,10 @@ typedef struct tagMIDISource { DWORD startTime; } MIDISource; +static CRITICAL_SECTION midiInLock; /* Critical section for MIDI In */ +static CFStringRef MIDIInThreadPortName = NULL; + +static DWORD WINAPI MIDIIn_MessageThread(LPVOID p); #define MAX_MIDI_SYNTHS 1 @@ -114,6 +118,13 @@ LONG CoreAudio_MIDIInit(void) destinations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MIDIOut_NumDevs * sizeof(MIDIDestination)); sources = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MIDIIn_NumDevs * sizeof(MIDISource)); + if (MIDIIn_NumDevs > 0) + { + InitializeCriticalSection(&midiInLock); + MIDIInThreadPortName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("MIDIInThreadPortName.%u"), getpid()); + CreateThread(NULL, 0, MIDIIn_MessageThread, NULL, 0, NULL); + } + /* initialize sources */ for (i = 0; i < MIDIIn_NumDevs; i++) { @@ -182,6 +193,17 @@ LONG CoreAudio_MIDIInit(void) LONG CoreAudio_MIDIRelease(void) { TRACE("\n"); + if (MIDIIn_NumDevs > 0) + { + CFMessagePortRef messagePort; + /* Stop CFRunLoop in MIDIIn_MessageThread */ + messagePort = CFMessagePortCreateRemote(kCFAllocatorDefault, MIDIInThreadPortName); + CFMessagePortSendRequest(messagePort, 1, NULL, 0.0, 0.0, NULL, NULL); + CFRelease(messagePort); + + DeleteCriticalSection(&midiInLock); + } + if (wineMIDIClient) MIDIClientDispose(wineMIDIClient); /* MIDIClientDispose will close all ports */ HeapFree(GetProcessHeap(), 0, sources); @@ -567,6 +589,75 @@ static DWORD MIDIOut_Reset(WORD wDevID) return MMSYSERR_NOERROR; } +/* + * MIDI In Mach message handling + */ + +/* + * Call from CoreMIDI IO threaded callback, + * we can't call Wine debug channels, critical section or anything using NtCurrentTeb here. + */ +void MIDIIn_SendMessage(MIDIMessage msg) +{ + CFDataRef data; + + CFMessagePortRef messagePort; + messagePort = CFMessagePortCreateRemote(kCFAllocatorDefault, MIDIInThreadPortName); + + data = CFDataCreate(kCFAllocatorDefault, (UInt8 *) &msg, sizeof(msg)); + if (data) + { + CFMessagePortSendRequest(messagePort, 0, data, 0.0, 0.0, NULL, NULL); + CFRelease(data); + CFRelease(messagePort); + } +} + +static CFDataRef MIDIIn_MessageHandler(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info) +{ + MIDIMessage *msg = NULL; + int i = 0; + FIXME("\n"); + + switch (msgid) + { + case 0: + msg = (MIDIMessage *) CFDataGetBytePtr(data); + TRACE("devID=%d\n", msg->devID); + for (i = 0; i < msg->length; ++i) { + TRACE("%02X ", msg->data[i]); + } + TRACE("\n"); + break; + default: + CFRunLoopStop(CFRunLoopGetCurrent()); + break; + } + return NULL; +} + +static DWORD WINAPI MIDIIn_MessageThread(LPVOID p) +{ + CFMessagePortRef local; + CFRunLoopSourceRef source; + Boolean info; + + local = CFMessagePortCreateLocal(kCFAllocatorDefault, MIDIInThreadPortName, &MIDIIn_MessageHandler, NULL, &info); + + source = CFMessagePortCreateRunLoopSource(kCFAllocatorDefault, local, (CFIndex)0); + CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); + + CFRunLoopRun(); + + CFRunLoopSourceInvalidate(source); + CFRelease(source); + CFRelease(local); + CFRelease(MIDIInThreadPortName); + MIDIInThreadPortName = NULL; + + return 0; +} + /************************************************************************** * modMessage */
1
0
0
0
Emmanuel Maillard : winecoreaudio: Initial MIDI In support on Mac OS X.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 4903fbedc9ee791a41be60f48ca3975ec365f24c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4903fbedc9ee791a41be60f48…
Author: Emmanuel Maillard <mahanuu(a)free.fr> Date: Thu Apr 26 00:57:31 2007 +0200 winecoreaudio: Initial MIDI In support on Mac OS X. --- dlls/winecoreaudio.drv/coremidi.c | 20 ++++++ dlls/winecoreaudio.drv/coremidi.h | 12 ++++ dlls/winecoreaudio.drv/midi.c | 78 ++++++++++++++++++++++++- dlls/winecoreaudio.drv/winecoreaudio.drv.spec | 1 + 4 files changed, 110 insertions(+), 1 deletions(-) diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c index 59101ee..ab4cd87 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -52,4 +52,24 @@ void CoreMIDI_GetObjectName(MIDIObjectRef obj, char *name, int size) } } +/* + * CoreMIDI IO threaded callback, + * we can't call Wine debug channels, critical section or anything using NtCurrentTeb here. + */ +void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon) +{ + unsigned int i; + MIDIMessage msg; + + MIDIPacket *packet = (MIDIPacket *)pktlist->packet; + for (i = 0; i < pktlist->numPackets; ++i) { + msg.devID = *((UInt16 *)refCon); + msg.length = packet->length; + memcpy(msg.data, packet->data, sizeof(packet->data)); + + /* send message to Wine */ + + packet = MIDIPacketNext(packet); + } +} #endif /* HAVE_COREAUDIO_COREAUDIO_H */ diff --git a/dlls/winecoreaudio.drv/coremidi.h b/dlls/winecoreaudio.drv/coremidi.h index 69fd4ce..182c190 100644 --- a/dlls/winecoreaudio.drv/coremidi.h +++ b/dlls/winecoreaudio.drv/coremidi.h @@ -44,8 +44,13 @@ extern unsigned MIDIGetNumberOfSources(void); extern MIDIEndpointRef MIDIGetSource(unsigned i); extern OSStatus MIDIOutputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIPortRef *outPort); +typedef void (*MIDIReadProc)(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon); +extern OSStatus MIDIInputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIReadProc readProc, void *refCon, MIDIPortRef *outPort); + extern OSStatus MIDIObjectGetProperties(MIDIObjectRef obj, CFPropertyListRef *outProperties, Boolean deep); +extern OSStatus MIDIPortConnectSource(MIDIPortRef port, MIDIEndpointRef source, void *connRefCon); + /* * Due to AudioUnit headers conflict redefine some types. */ @@ -60,8 +65,15 @@ extern int AudioUnit_SetVolume(AudioUnit au, float left, float right); extern int AudioUnit_GetVolume(AudioUnit au, float *left, float *right); #endif +typedef struct { + UInt16 devID; + UInt16 length; + Byte data[256]; +} MIDIMessage; + /* coremidi.c */ extern MIDIClientRef CoreMIDI_CreateClient(CFStringRef name); extern void CoreMIDI_GetObjectName(MIDIObjectRef obj, char *name, int size); +extern void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon); #endif diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index fd00cb3..d12532c 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -52,6 +52,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(midi); static MIDIClientRef wineMIDIClient = NULL; static DWORD MIDIOut_NumDevs = 0; +static DWORD MIDIIn_NumDevs = 0; typedef struct tagMIDIDestination { /* graph and synth are only used for MIDI Synth */ @@ -64,9 +65,22 @@ typedef struct tagMIDIDestination { WORD wFlags; } MIDIDestination; +typedef struct tagMIDISource { + MIDIPortRef port; + WORD wDevID; + int state; /* 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */ + MIDIINCAPSW caps; + MIDIOPENDESC midiDesc; + LPMIDIHDR lpQueueHdr; + WORD wFlags; + DWORD startTime; +} MIDISource; + + #define MAX_MIDI_SYNTHS 1 MIDIDestination *destinations; +MIDISource *sources; extern int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth); extern int SynthUnit_Initialize(AudioUnit synth, AUGraph graph); @@ -93,9 +107,36 @@ LONG CoreAudio_MIDIInit(void) MIDIOut_NumDevs = MAX_MIDI_SYNTHS; MIDIOut_NumDevs += numDest; - TRACE("MIDIOut_NumDevs %d\n", MIDIOut_NumDevs); + MIDIIn_NumDevs = MIDIGetNumberOfSources(); + + TRACE("MIDIOut_NumDevs %d MIDIIn_NumDevs %d\n", MIDIOut_NumDevs, MIDIIn_NumDevs); destinations = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MIDIOut_NumDevs * sizeof(MIDIDestination)); + sources = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, MIDIIn_NumDevs * sizeof(MIDISource)); + + /* initialize sources */ + for (i = 0; i < MIDIIn_NumDevs; i++) + { + MIDIEndpointRef endpoint = MIDIGetSource(i); + + sources[i].wDevID = i; + + CoreMIDI_GetObjectName(endpoint, szPname, sizeof(szPname)); + MultiByteToWideChar(CP_ACP, 0, szPname, -1, sources[i].caps.szPname, sizeof(sources[i].caps.szPname)/sizeof(WCHAR)); + + name = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("WineInputPort.%d.%u"), i, getpid()); + MIDIInputPortCreate(wineMIDIClient, name, MIDIIn_ReadProc, &sources[i].wDevID, &sources[i].port); + CFRelease(name); + + MIDIPortConnectSource(sources[i].port, endpoint, NULL); + + sources[i].state = 0; + /* FIXME */ + sources[i].caps.wMid = 0x00FF; /* Manufac ID */ + sources[i].caps.wPid = 0x0001; /* Product ID */ + sources[i].caps.vDriverVersion = 0x0001; + sources[i].caps.dwSupport = 0; + } /* initialise MIDI synths */ for (i = 0; i < MAX_MIDI_SYNTHS; i++) @@ -142,6 +183,8 @@ LONG CoreAudio_MIDIRelease(void) { TRACE("\n"); if (wineMIDIClient) MIDIClientDispose(wineMIDIClient); /* MIDIClientDispose will close all ports */ + + HeapFree(GetProcessHeap(), 0, sources); HeapFree(GetProcessHeap(), 0, destinations); return 1; } @@ -565,6 +608,33 @@ DWORD WINAPI CoreAudio_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dw return MMSYSERR_NOTSUPPORTED; } +/************************************************************************** +* midMessage +*/ +DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) +{ + TRACE("%d %08x %08x %08x %08x\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + switch (wMsg) { + case DRVM_INIT: + case DRVM_EXIT: + case DRVM_ENABLE: + case DRVM_DISABLE: + return 0; + case MIDM_OPEN: + case MIDM_CLOSE: + case MIDM_ADDBUFFER: + case MIDM_PREPARE: + case MIDM_UNPREPARE: + case MIDM_GETDEVCAPS: + case MIDM_GETNUMDEVS: + case MIDM_START: + case MIDM_STOP: + case MIDM_RESET: + default: + TRACE("Unsupported message\n"); + } + return MMSYSERR_NOTSUPPORTED; +} #else DWORD WINAPI CoreAudio_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) @@ -573,4 +643,10 @@ DWORD WINAPI CoreAudio_modMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dw return MMSYSERR_NOTENABLED; } +DWORD WINAPI CoreAudio_midMessage(UINT wDevID, UINT wMsg, DWORD dwUser, + DWORD dwParam1, DWORD dwParam2) +{ + TRACE("%08x, %08x, %08x, %08x, %08x\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + return MMSYSERR_NOTENABLED; +} #endif diff --git a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec index dced551..41bbf84 100644 --- a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec +++ b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec @@ -1,4 +1,5 @@ @ stdcall -private DriverProc(long long long long long) CoreAudio_DriverProc @ stdcall -private widMessage(long long long long long) CoreAudio_widMessage @ stdcall -private wodMessage(long long long long long) CoreAudio_wodMessage +@ stdcall -private midMessage(long long long long long) CoreAudio_midMessage @ stdcall -private modMessage(long long long long long) CoreAudio_modMessage
1
0
0
0
Jesse Allen : wined3d: Remove fake nvidia card in GetAdapterIdentifier.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 00a84b0cb245e827b488fb2efadb12f87cf3c1b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00a84b0cb245e827b488fb2ef…
Author: Jesse Allen <the3dfxdude(a)gmail.com> Date: Wed Apr 25 12:13:24 2007 -0700 wined3d: Remove fake nvidia card in GetAdapterIdentifier. --- dlls/wined3d/directx.c | 46 ++++++++++++++-------------------------------- 1 files changed, 14 insertions(+), 32 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 3f72a47..0aabd14 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1326,38 +1326,20 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterIdentifier(IWineD3D *iface, UINT Ad isGLInfoValid = IWineD3DImpl_FillGLCaps(iface, IWineD3DImpl_GetAdapterDisplay(iface, Adapter)); } - /* If it worked, return the information requested */ - if (isGLInfoValid) { - TRACE_(d3d_caps)("device/Vendor Name and Version detection using FillGLCaps\n"); - strcpy(pIdentifier->Driver, "Display"); - strcpy(pIdentifier->Description, "Direct3D HAL"); - - /* Note dx8 doesn't supply a DeviceName */ - if (NULL != pIdentifier->DeviceName) strcpy(pIdentifier->DeviceName, "\\\\.\\DISPLAY"); /* FIXME: May depend on desktop? */ - /* Current Windows drivers have versions like 6.14.... (some older have an earlier version) */ - pIdentifier->DriverVersion->u.HighPart = MAKEDWORD_VERSION(6, 14); - pIdentifier->DriverVersion->u.LowPart = This->gl_info.gl_driver_version; - *(pIdentifier->VendorId) = This->gl_info.gl_vendor; - *(pIdentifier->DeviceId) = This->gl_info.gl_card; - *(pIdentifier->SubSysId) = 0; - *(pIdentifier->Revision) = 0; - - } else { - - /* If it failed, return dummy values from an NVidia driver */ - WARN_(d3d_caps)("Cannot get GLCaps for device/Vendor Name and Version detection using FillGLCaps, currently using NVIDIA identifiers\n"); - strcpy(pIdentifier->Driver, "Display"); - strcpy(pIdentifier->Description, "Direct3D HAL"); - if (NULL != pIdentifier->DeviceName) strcpy(pIdentifier->DeviceName, "\\\\.\\DISPLAY"); /* FIXME: May depend on desktop? */ - /* Current Windows Nvidia drivers have versions like e.g. 6.14.10.5672 */ - pIdentifier->DriverVersion->u.HighPart = MAKEDWORD_VERSION(6, 14); - /* 71.74 is a current Linux Nvidia driver version */ - pIdentifier->DriverVersion->u.LowPart = MAKEDWORD_VERSION(10, (71*100+74)); - *(pIdentifier->VendorId) = VENDOR_NVIDIA; - *(pIdentifier->DeviceId) = CARD_NVIDIA_GEFORCE4_TI4200; - *(pIdentifier->SubSysId) = 0; - *(pIdentifier->Revision) = 0; - } + /* Return the information requested */ + TRACE_(d3d_caps)("device/Vendor Name and Version detection using FillGLCaps\n"); + strcpy(pIdentifier->Driver, "Display"); + strcpy(pIdentifier->Description, "Direct3D HAL"); + + /* Note dx8 doesn't supply a DeviceName */ + if (NULL != pIdentifier->DeviceName) strcpy(pIdentifier->DeviceName, "\\\\.\\DISPLAY"); /* FIXME: May depend on desktop? */ + /* Current Windows drivers have versions like 6.14.... (some older have an earlier version) */ + pIdentifier->DriverVersion->u.HighPart = MAKEDWORD_VERSION(6, 14); + pIdentifier->DriverVersion->u.LowPart = This->gl_info.gl_driver_version; + *(pIdentifier->VendorId) = This->gl_info.gl_vendor; + *(pIdentifier->DeviceId) = This->gl_info.gl_card; + *(pIdentifier->SubSysId) = 0; + *(pIdentifier->Revision) = 0; /*FIXME: memcpy(&pIdentifier->DeviceIdentifier, ??, sizeof(??GUID)); */ if (Flags & WINED3DENUM_NO_WHQL_LEVEL) {
1
0
0
0
Stefan Dösinger : d3d: Fix ProcessVertices.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 460f71dcf839ea406831d246b367260e6057a4ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=460f71dcf839ea406831d246b…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Apr 22 18:06:07 2007 +0200 d3d: Fix ProcessVertices. IDirect3DDevice9::ProcessVertices takes a vertex declaration, not a vertex buffer. The source for ProcessVertices is taken from the stateblock, not the vertex declaration. --- dlls/d3d9/device.c | 3 +- dlls/ddraw/vertexbuffer.c | 13 +++++- dlls/wined3d/device.c | 83 +++++++++++++++++--------------------- include/wine/wined3d_interface.h | 2 +- 4 files changed, 51 insertions(+), 50 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=460f71dcf839ea406831d…
1
0
0
0
Stefan Dösinger : ddraw: Get rid of FVFs.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 0386eed91f5eec57b7cf424c9c35bbf3655cb868 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0386eed91f5eec57b7cf424c9…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Apr 22 17:55:30 2007 +0200 ddraw: Get rid of FVFs. Remove all IWineD3DDevice::SetFVF calls and instead create converted vertex declarations and use them. The idea is to remove the FVF paths from wined3d to simplify the code, and optimize the vertex declaration codepath. --- dlls/ddraw/ddraw.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/ddraw_private.h | 14 +++++++ dlls/ddraw/device.c | 16 +++++---- dlls/ddraw/direct3d.c | 11 ++++++ dlls/ddraw/main.c | 8 ++++ dlls/ddraw/vertexbuffer.c | 2 +- 6 files changed, 126 insertions(+), 8 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0386eed91f5eec57b7cf4…
1
0
0
0
Stefan Dösinger : wined3d: Implement CreateVertexDeclarationFromFVF.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: 32cfbd127c737deb0748c002279d4cf2c932101a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32cfbd127c737deb0748c0022…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Apr 25 17:04:46 2007 +0200 wined3d: Implement CreateVertexDeclarationFromFVF. --- dlls/wined3d/device.c | 139 +++++++++++++++++++++++++++++++++++++++++- include/wine/wined3d_types.h | 2 + 2 files changed, 140 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dccb7bf..226b3a6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1577,8 +1577,145 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* return hr; } +static size_t ConvertFvfToDeclaration(DWORD fvf, WINED3DVERTEXELEMENT** ppVertexElements) { + + unsigned int idx, idx2; + unsigned int offset; + BOOL has_pos = (fvf & WINED3DFVF_POSITION_MASK) != 0; + BOOL has_blend = (fvf & WINED3DFVF_XYZB5) > WINED3DFVF_XYZRHW; + BOOL has_blend_idx = has_blend && + (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB5) || + (fvf & WINED3DFVF_LASTBETA_D3DCOLOR) || + (fvf & WINED3DFVF_LASTBETA_UBYTE4)); + BOOL has_normal = (fvf & WINED3DFVF_NORMAL) != 0; + BOOL has_psize = (fvf & WINED3DFVF_PSIZE) != 0; + BOOL has_diffuse = (fvf & WINED3DFVF_DIFFUSE) != 0; + BOOL has_specular = (fvf & WINED3DFVF_SPECULAR) !=0; + + DWORD num_textures = (fvf & WINED3DFVF_TEXCOUNT_MASK) >> WINED3DFVF_TEXCOUNT_SHIFT; + DWORD texcoords = (fvf & 0x00FF0000) >> 16; + + WINED3DVERTEXELEMENT end_element = WINED3DDECL_END(); + WINED3DVERTEXELEMENT *elements = NULL; + + unsigned int size; + DWORD num_blends = 1 + (((fvf & WINED3DFVF_XYZB5) - WINED3DFVF_XYZB1) >> 1); + if (has_blend_idx) num_blends--; + + /* Compute declaration size */ + size = has_pos + (has_blend && num_blends > 0) + has_blend_idx + has_normal + + has_psize + has_diffuse + has_specular + num_textures + 1; + + /* convert the declaration */ + elements = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WINED3DVERTEXELEMENT)); + if (!elements) + return 0; + + memcpy(&elements[size-1], &end_element, sizeof(WINED3DVERTEXELEMENT)); + idx = 0; + if (has_pos) { + if (!has_blend && (fvf & WINED3DFVF_XYZRHW)) { + elements[idx].Type = WINED3DDECLTYPE_FLOAT4; + elements[idx].Usage = WINED3DDECLUSAGE_POSITIONT; + } + else { + elements[idx].Type = WINED3DDECLTYPE_FLOAT3; + elements[idx].Usage = WINED3DDECLUSAGE_POSITION; + } + elements[idx].UsageIndex = 0; + idx++; + } + if (has_blend && (num_blends > 0)) { + if (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)) + elements[idx].Type = WINED3DDECLTYPE_D3DCOLOR; + else + elements[idx].Type = WINED3DDECLTYPE_FLOAT1 + num_blends - 1; + elements[idx].Usage = WINED3DDECLUSAGE_BLENDWEIGHT; + elements[idx].UsageIndex = 0; + idx++; + } + if (has_blend_idx) { + if (fvf & WINED3DFVF_LASTBETA_UBYTE4 || + (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))) + elements[idx].Type = WINED3DDECLTYPE_UBYTE4; + else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR) + elements[idx].Type = WINED3DDECLTYPE_D3DCOLOR; + else + elements[idx].Type = WINED3DDECLTYPE_FLOAT1; + elements[idx].Usage = WINED3DDECLUSAGE_BLENDINDICES; + elements[idx].UsageIndex = 0; + idx++; + } + if (has_normal) { + elements[idx].Type = WINED3DDECLTYPE_FLOAT3; + elements[idx].Usage = WINED3DDECLUSAGE_NORMAL; + elements[idx].UsageIndex = 0; + idx++; + } + if (has_psize) { + elements[idx].Type = WINED3DDECLTYPE_FLOAT1; + elements[idx].Usage = WINED3DDECLUSAGE_PSIZE; + elements[idx].UsageIndex = 0; + idx++; + } + if (has_diffuse) { + elements[idx].Type = WINED3DDECLTYPE_D3DCOLOR; + elements[idx].Usage = WINED3DDECLUSAGE_COLOR; + elements[idx].UsageIndex = 0; + idx++; + } + if (has_specular) { + elements[idx].Type = WINED3DDECLTYPE_D3DCOLOR; + elements[idx].Usage = WINED3DDECLUSAGE_COLOR; + elements[idx].UsageIndex = 1; + idx++; + } + for (idx2 = 0; idx2 < num_textures; idx2++) { + unsigned int numcoords = (texcoords >> (idx2*2)) & 0x03; + switch (numcoords) { + case WINED3DFVF_TEXTUREFORMAT1: + elements[idx].Type = WINED3DDECLTYPE_FLOAT1; + break; + case WINED3DFVF_TEXTUREFORMAT2: + elements[idx].Type = WINED3DDECLTYPE_FLOAT2; + break; + case WINED3DFVF_TEXTUREFORMAT3: + elements[idx].Type = WINED3DDECLTYPE_FLOAT3; + break; + case WINED3DFVF_TEXTUREFORMAT4: + elements[idx].Type = WINED3DDECLTYPE_FLOAT4; + break; + } + elements[idx].Usage = WINED3DDECLUSAGE_TEXCOORD; + elements[idx].UsageIndex = idx2; + idx++; + } + + /* Now compute offsets, and initialize the rest of the fields */ + for (idx = 0, offset = 0; idx < size-1; idx++) { + elements[idx].Stream = 0; + elements[idx].Method = WINED3DDECLMETHOD_DEFAULT; + elements[idx].Offset = offset; + offset += WINED3D_ATR_SIZE(elements[idx].Type) * WINED3D_ATR_TYPESIZE(elements[idx].Type); + } + + *ppVertexElements = elements; + return size; +} + static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration, IUnknown *Parent, DWORD Fvf) { - return E_NOTIMPL; + WINED3DVERTEXELEMENT* elements = NULL; + size_t size; + DWORD hr; + + size = ConvertFvfToDeclaration(Fvf, &elements); + if (size == 0) return WINED3DERR_OUTOFVIDEOMEMORY; + + hr = IWineD3DDevice_CreateVertexDeclaration(iface, ppVertexDeclaration, Parent, elements, size); + HeapFree(GetProcessHeap(), 0, elements); + if (hr != S_OK) return hr; + + return WINED3D_OK; } /*
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c…
*/ diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 0bd094b..1cccd6d 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -1255,6 +1255,8 @@ typedef enum _WINED3DDECLTYPE { WINED3DDECLTYPE_UNUSED = 17, } WINED3DDECLTYPE; +#define WINED3DDECL_END() {0xFF,0,WINED3DDECLTYPE_UNUSED,0,0,0,-1} + typedef struct WineDirect3DStridedData { BYTE *lpData; /* Pointer to start of data */ DWORD dwStride; /* Stride between occurances of this data */
1
0
0
0
Stefan Dösinger : wined3d: Add a method to create a declaration from a fvf.
by Alexandre Julliard
26 Apr '07
26 Apr '07
Module: wine Branch: master Commit: aec1553e50edad126cc30b2248f38331701807ad URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aec1553e50edad126cc30b224…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Apr 22 11:52:11 2007 +0200 wined3d: Add a method to create a declaration from a fvf. --- dlls/wined3d/device.c | 5 +++++ include/wine/wined3d_interface.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b6fae75..dccb7bf 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1577,6 +1577,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* return hr; } +static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3DDevice* iface, IWineD3DVertexDeclaration** ppVertexDeclaration, IUnknown *Parent, DWORD Fvf) { + return E_NOTIMPL; +} + /*
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c…
*/ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *iface, IWineD3DVertexDeclaration *vertex_declaration, CONST DWORD *pFunction, IWineD3DVertexShader **ppVertexShader, IUnknown *parent) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; @@ -6109,6 +6113,7 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl = IWineD3DDeviceImpl_CreateQuery, IWineD3DDeviceImpl_CreateAdditionalSwapChain, IWineD3DDeviceImpl_CreateVertexDeclaration, + IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF, IWineD3DDeviceImpl_CreateVertexShader, IWineD3DDeviceImpl_CreatePixelShader, IWineD3DDeviceImpl_CreatePalette, diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index cf4a1de..3181bc7 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -357,6 +357,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) STDMETHOD(CreateQuery)(THIS_ WINED3DQUERYTYPE Type, struct IWineD3DQuery **ppQuery, IUnknown *pParent); STDMETHOD(CreateAdditionalSwapChain)(THIS_ WINED3DPRESENT_PARAMETERS *pPresentationParameters, struct IWineD3DSwapChain **pSwapChain, IUnknown *pParent, D3DCB_CREATERENDERTARGETFN pFn, D3DCB_CREATEDEPTHSTENCILSURFACEFN pFn2); STDMETHOD(CreateVertexDeclaration)(THIS_ struct IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent, const WINED3DVERTEXELEMENT *elements, size_t element_count) PURE; + STDMETHOD(CreateVertexDeclarationFromFVF)(THIS_ struct IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent, DWORD Fvf) PURE; STDMETHOD(CreateVertexShader)(THIS_ struct IWineD3DVertexDeclaration *vertex_declaration, CONST DWORD* pFunction, struct IWineD3DVertexShader** ppShader, IUnknown *pParent) PURE; STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, struct IWineD3DPixelShader** ppShader, IUnknown *pParent) PURE; STDMETHOD_(HRESULT,CreatePalette)(THIS_ DWORD Flags, PALETTEENTRY *PalEnt, struct IWineD3DPalette **Palette, IUnknown *Parent); @@ -494,6 +495,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) #define IWineD3DDevice_CreateQuery(p,a,b,c) (p)->lpVtbl->CreateQuery(p,a,b,c) #define IWineD3DDevice_CreateAdditionalSwapChain(p,a,b,c,d,e) (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b,c,d,e) #define IWineD3DDevice_CreateVertexDeclaration(p,a,b,c,d) (p)->lpVtbl->CreateVertexDeclaration(p,a,b,c,d) +#define IWineD3DDevice_CreateVertexDeclarationFromFVF(p,a,b,c) (p)->lpVtbl->CreateVertexDeclarationFromFVF(p,a,b,c) #define IWineD3DDevice_CreateVertexShader(p,a,b,c,d) (p)->lpVtbl->CreateVertexShader(p,a,b,c,d) #define IWineD3DDevice_CreatePixelShader(p,a,b,c) (p)->lpVtbl->CreatePixelShader(p,a,b,c) #define IWineD3DDevice_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d)
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
69
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Results per page:
10
25
50
100
200