The stop event should already be signaled by the time we get to that
point since we wait until the child processes terminate in the server
process and the stop event is signaled in the context of one of the
child processes.
Don't call RpcMgmtWaitServerListening if the call to
WaitForSingleObject failed since it is likely that s_stop() hasn't
been called and therefore the call to RpcMgmtWaitServerListening won't
ever return.
Handle failure to use one or more protocol sequences more gracefully, as
ncacn_np servers aren't support on Win9x and ncacn_ip_tcp fails on some
machines.
This makes the code check that the buffer is big enough to read from
before copying the data from it. The safe_buffer_increment call is still
needed for the case where we point the memory to the buffer, so move the
call there.
Reimplement NdrSimpleTypeUnmarshall using similar macros to
NdrBaseTypeUnmarshalling without buffer checks, due to
NdrSimpleTypeUnmarshall not doing any safety checks.
This is needed because a context binding handle could be released on
unmarshall, but it still needs to stay valid until the binding handle is
no longer being used.
Re-use the previously unused RPCRT4_ExportBinding function as
RPCRT4_AddRefBinding and rename RPCRT4_DestroyBinding to
RPCRT4_ReleaseBinding to show that it's purpose is to release a
reference count and destroy if necessary, not always destroy.
Structures containing enum fields without the v1_enum attribute must be
treated as complex because of the range check and memory/wire size
differences. This includes a test which didn't pass before and now
passes on Wine and Windows.
count is the total count passed into rpcrt4_conn_np_write. If WriteFile
does a partial write it would end up writing too much subsequent times
through the loop. All tests pass as before.
NdrBaseTypeUnmarshall expects a pointer to a pointer to a base type.
pRetVal contains a pointer to a base type, so we need to pass the
address of pRetVal into call_unmarshaller here.
Don't call memory sizing rountines to compute the size of a type, since
memory sizing routines have side effects like checking there is enough
space in the buffer for the type and incrementing the buffer pointer.
Instead, create a function which returns the necessary size of the
limited set of types we can encounter and remove call_memory_sizer which
is no longer needed.