Commit Graph

1552 Commits

Author SHA1 Message Date
Nikolay Sivov 54f9b33476 rpcrt4/tests: Always run tests that don't require special permissions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-13 11:33:47 +02:00
Alexandre Julliard 5d82baf974 winecrt0: Add a default implementation DllRegisterServer()/DllUnregisterServer().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-30 22:59:50 +02:00
Zebediah Figura be101103db rpcrt4: Avoid gai_strerror().
It's not thread-safe.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 18:55:24 +02:00
Alexandre Julliard 621c06a082 rpcrt4: Make inline asm compatible with Thumb-2.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-19 13:25:18 +01:00
Jacek Caban fcf545f449 winapi: Use __alignof__ on clang.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 15:30:07 +01:00
Alexandre Julliard b61cfa8823 rpcrt4/tests: Avoid a printf format warning.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-02 15:38:25 +01:00
Michael Stefaniuc d452c7574f rpcrt4: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 19:01:55 +01:00
Kevin Puetz e4e7be6bd9 rpcrt4: Fix ARM64 stack corruption in call_server_func.
calls with stack_size > 16 pop argument values into x3, overwriting
the number of 16-byte stack octwords. This breaks the checks for popping
x4..x7 and potentially unbalances sp (based on the vaue of args[16..23]).

Use a scratch register (x9) for this count so its lifetime does not
conflict with preparing the parameter/result registers.

Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-18 11:25:36 +02:00
Serge Gautherie 743ed29af5 winapi_test: Update generated.c files.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-14 22:04:03 +02:00
Serge Gautherie 99c0ab2ea1 winapi_test: Restore horizontal alignment of macro defines.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-10 21:26:15 +02:00
Serge Gautherie 151af8c042 winapi_test: Remove MIDL_STUB_MESSAGE field exclusions.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Dmitry Timoshkov 59c0dbb642 rpcrt4/tests: Add some tests for marshalling embedded conformant arrays.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-08 21:01:32 +02:00
Dmitry Timoshkov bd995ea871 rpcrt4/tests: Fix compilation with MS VC.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-08 21:01:32 +02:00
Zhiyi Zhang d3a934be36 rpcrt4: Implement RpcIfInqId().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49257
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-01 22:10:28 +02:00
Serge Gautherie 98eaef3ad9 rpcrt4: Remove inexistent CreateServerInterfaceFromStub().
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:51:17 +02:00
Jacek Caban 7b0830c98d rpcrt4: Don't use GetExceptionCode outside __except block.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-27 12:51:09 +02:00
Zebediah Figura 352a64cbbc rpcrt4: Bump the maximum accepted NDR version.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 10:45:47 +02:00
Zebediah Figura 36c5adca37 rpcrt4: Implement Ndr64AsyncClientCall().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 10:45:44 +02:00
Zebediah Figura 9369aea260 rpcrt4: Implement NdrClientCall3().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 10:45:41 +02:00
Zebediah Figura ff7f92c0b0 rpcrt4: Handle FC_NON_ENCAPSULATED_UNION in calc_arg_size().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45699
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 10:45:38 +02:00
Jacek Caban bfab009e67 rpcrt4: Fix use after free in get_iface_info.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-26 21:20:11 +01:00
Zebediah Figura 15e91ac2ce rpcrt4: Handle bare coclasses as top-level parameters.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 13:04:41 +01:00
Zebediah Figura f4ee83c0eb rpcrt4: Handle bare interfaces as top-level parameters.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-19 13:04:38 +01:00
Francois Gouget a909baeb4e tests: Report all errors when failing to wait for a child process.
Report the line number where the test failed to wait for the child so
one can identify which child process did not behave as expected.
Also wait_child_process() is meant for the general case so report
all non-crash error cases as test failures so they are accounted for.
Omit the "winetest_" prefix to match the other Wine test functions and
so the underlying winetest_wait_child_process() function can be wrapped
with the usual line-capturing macros.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48651
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:51:44 +01:00
Serge Gautherie 57f08ba525 rpcrt4/tests: Remove now useless forced 0x0500 API versions.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-17 10:27:16 +01:00
Serge Gautherie aa384d3642 tools: Remove 0x0501 API versions forced by winapi_test.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:10:44 +01:00
Jacek Caban c041605b00 guiddef.h: Remove GUID_NULL declaration.
It's declared in cguid.h with proper extern "C".

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-04 21:30:27 +01:00
Jacek Caban 1980fcafe1 rpcrt4: Use MustFree for all non-base types in get_param_pointer_info.
Fixes a leak for VT_VARIANT.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-30 22:34:12 +01:00
Zebediah Figura 76238898fc rpcrt4: Use a critical section for the context handle lock.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 19:30:00 +01:00
Kevin Puetz a09c08f17a rpcrt4: Fix ITypeInfo leak in get_iface_info.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-27 16:32:03 +01:00
Zebediah Figura c2b4d98f23 rpcrt4/tests: Pass the default maximum call limit to RpcServerListen().
The tests intermittently crash on 2008 with RPC_S_SERVER_TOO_BUSY.  I suspect
this is due to the server spawned in run_server having a call limit of 20 but
being expected to service 32 threads.  Use the default parameter in an attempt
to prevent this failure.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-15 22:03:36 +01:00
Jacek Caban f64832fe6a rpcrt4: Support VT_BSTR in get_param_pointer_info.
Fixes a leak in typelib marshaller.
Based on patch by Kevin Puetz.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-19 18:38:22 +01:00
Jacek Caban 1aaf870039 rpcrt4: Fix implicit in attribute handling in write_param_fs.
Fixes regression caused by typelib marshaling rewrite.
Spotted by Kevin Puetz.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-18 21:13:16 +01:00
Zebediah Figura 53efccdb65 rpcrt4: Fix ITypeInfo ref count handling.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-17 16:55:15 +01:00
André Hentschel 6127c688ea rpcrt4: Fix RpcNetworkIsProtseqValid[AW] spec file entries.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-16 18:44:57 +01:00
Alexandre Julliard 822e2773d4 rpcrt4/tests: Increase some timeouts.
These are too short when running under QEMU.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 00:33:46 +01:00
Alexandre Julliard d9adc902f8 rpcrt4: Add stubless proxy support for ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-27 13:26:52 +02:00
Dmitry Timoshkov a6fe4f6e65 rpcrt4: Reimplement rpcrt4_conn_np_wait_for_incoming_data() using asynchronous read with zero sized buffer.
The problem with NtFsControlFile(FSCTL_PIPE_PEEK) is that it happily returns
STATUS_SUCCESS with 0 bytes of data available. That makes the client think
that the server already sent a reply and try to read the reply data, which
hangs. A solution to this is call NtReadFile() with zero sized buffer, which
has correct behaviour: just waits for incoming data to appear without mangling
the data in the pipe.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-25 20:09:14 +02:00
Dmitry Timoshkov 306e14b956 rpcrt4: Perform the INITOUT phase in NdrAsyncServerCall instead of RpcAsyncCompleteCall.
This is required to correctly support out reference parameters,
otherwise server method receives not initialized pointers during
the CALLSERVER phase and crashes.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 12:56:59 +02:00
Dmitry Timoshkov 07ee2a7d82 rpcrt4: Remove FIXME about RPC_CONTEXT_HANDLE_FLAGS from NDRSContextMarshall2 and NDRSContextUnmarshall2.
RPC_CONTEXT_HANDLE_FLAGS contain the values RPC_CONTEXT_HANDLE_SERIALIZE
or RPC_CONTEXT_HANDLE_DONT_SERIALIZE, however all the calls to underlying
binding->Assoc are guarded by a critical section, so it's redundant to
take any action about passed in Flags parameter.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-19 12:23:42 +02:00
Dmitry Timoshkov ccbfad5ea7 rpcrt4: Implement RpcAsyncCompleteCall for server side.
Based on NdrStubCall2 implementation.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Dmitry Timoshkov 29fa835687 rpcrt4: Implement NdrAsyncServerCall.
Based on NdrStubCall2 and NdrAsyncClientCall implementations.

In order to test asynchronous RPC I used dlls/rpcrt4/tests/server.c as a base,
converted int_return() and sum() to use asynchronous RPC on both client and
server sides (server.idl doesn't need any changes), and added server.acf:
interface IServer
{
    [async] int_return();
    [async] sum();
}
With this implementation these tests pass under Wine. Since widl doesn't
support asynchronous RPC it's impossible to add appropriate Wine tests.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Dmitry Timoshkov bb7c119190 rpcrt4: Implement wait_for_incoming_data() for named pipes transport.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-17 16:50:44 +02:00
Dmitry Timoshkov 0c2f5f8b15 rpcrt4: Return an exception code from NdrAsyncClientCall.
Otherwise the caller may decide to wait for the call termination which
will never happen.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-02 20:47:31 +02:00
Dmitry Timoshkov 1df0091dac rpcrt4: Add an exception handler to NdrAsyncClientCall.
NdrClientCall already uses TRY/EXCEPT block if the procedure has
Oi_HAS_COMM_OR_FAULT in its Oi_flags, I've added similar block
to NdrAsyncClientCall but without mapping the fault code using
CommFaultOffsets because NdrAsyncClientCall doesn't have this
implemented.

An installer that I have here calls NdrAsyncClientCall in order
to query status of a not yet installed service, and that leads
to a crash due to RaiseException from inside of NdrAsyncClientCall.
With this patch it no longer crashes on an unhandled exception,
and then installs the service.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-28 18:18:56 +02:00
Alexandre Julliard 7592b406d2 rpcrt4: Add .seh annotations for x86_64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 11:56:13 +02:00
Alexandre Julliard eadb037ba1 rpcrt4: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-19 11:22:47 +02:00
André Hentschel 660ee356e9 rpcrt4: Fix NdrServerContextMarshall spec file entry.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 12:23:50 +02:00
Zebediah Figura 9271efc0c7 rpcrt4: Use a FINALLY block to clean up in do_ndr_client_call().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00
Zebediah Figura ae5f2a8f84 rpcrt4: Handle exceptions in a larger portion of NdrClientCall().
Most notably in NdrProxyInitialize().

This patch and the next bring the scope of exception handling roughly in line
with -Os stubs.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36981
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00