Commit Graph

761 Commits

Author SHA1 Message Date
Rob Shearman c8a802eea8 include: Make RpcRaiseException DECLSPEC_NORETURN, like it is in the PSDK. 2007-12-14 12:28:03 +01:00
Rob Shearman ba280fb1b0 rpcrt4: Fix a typo in rpcrt4_conn_tcp_read. 2007-12-14 12:27:09 +01:00
Rob Shearman 25bf0a409a rpcrt4: Update TODO list.
Out-of-memory check is performed by NdrAllocate and so isn't required to 
be done in the unmarshalling functions.
2007-12-14 12:24:34 +01:00
Rob Shearman 4a028589eb rpcrt4: Document NdrAllocate. 2007-12-14 12:24:24 +01:00
Rob Shearman c7261b732b rpcrt4: Partially revert commit 18faf3184b2ea263d77c2a7ad92eef27bc4ba08f.
Tests show that NdrPointerFree (and hence NdrFree) don't check whether 
the memory was allocated with NdrAllocate before freeing it. This makes 
sense as servers don't need to use NdrAllocate to allocate memory being 
returned and so this commit caused that memory to be leaked.

NdrAllocate hasn't been changed as the tests show it is correct and it 
appears that the memory list is used to implement the RpcSs memory model.
2007-12-14 12:24:21 +01:00
Rob Shearman ce220e2b5f rpcrt4: Free the base pointer in PointerFree when freeing a pointer with RPC_FC_P_DEREF. 2007-12-14 12:24:03 +01:00
Rob Shearman d5ff3467bc rpcrt4: Fix the check in NdrPointerFree.
Add comments to justify why this is the only check that is needed.
2007-12-14 12:23:55 +01:00
Rob Shearman 9d8ebc1a24 rpcrt4: NdrStubGetBuffer shouldn't set BufferStart and BufferEnd.
These are supposed to point to the original buffer when the types were 
unmarshalled.
2007-12-14 12:23:46 +01:00
Rob Shearman ded4b86625 Revert "rpcrt4: Try to free every non-stack pointer in PointerFree now that NdrFree does the sanity checking for us.".
This reverts commit 6db648302ce43f625a073426a35a6f40b7869d8b.

Tests show the assumptions in a commit that this commit depends on are 
not valid.
2007-12-14 12:23:38 +01:00
Rob Shearman 9642714d06 rpcrt4: Add tests for freeing non-NdrAllocate allocated memory blocks. 2007-12-13 14:30:40 +01:00
Rob Shearman e12b487e26 rpcrt4: Try to free every non-stack pointer in PointerFree now that NdrFree does the sanity checking for us. 2007-12-12 16:02:53 +01:00
Rob Shearman 9c8c74f388 rpcrt4: Store allocated memory in a singly-linked list to keep track of what we should and shouldn't free in NdrFree. 2007-12-12 16:02:43 +01:00
Rob Shearman 33c4c25dad rpcrt4: Make the NdrAllocate tests pass on XP SP2 and greater. 2007-12-12 16:01:33 +01:00
Rob Shearman d458a599eb widl: Add support for non-basetype return types. 2007-12-11 18:07:05 +01:00
Rob Shearman 766d8a17af rpcrt4: Pass the USER_MARSHAL_CB structure into user marshal routines. 2007-12-10 12:04:28 +01:00
Rob Shearman 80b8743aa2 rpcrt4: NdrRangeUnmarshall is implemented so add it to the spec file. 2007-12-10 12:04:19 +01:00
Rob Shearman a07afe7e06 rpcrt4: Implement NdrConformantArrayMemorySize. 2007-12-10 12:04:15 +01:00
Rob Shearman 41937c5756 rpcrt4: Add a missing break in DllMain. 2007-12-08 19:58:24 +01:00
Rob Shearman 417b9d80f2 rpcrt4: Save the buffer in EmbeddedPointerMemorySize, like EmbeddedPointerUnmarshall does. 2007-12-08 19:58:11 +01:00
Rob Shearman d7a0de303e rpcrt4: Fix the return value from NdrSimpleStructMemorySize. 2007-12-08 19:58:07 +01:00
Rob Shearman 3a13de3115 rpcrt4: Add a trace to NdrBaseTypeMemorySize. 2007-12-08 19:58:03 +01:00
Rob Shearman 7ae1d44816 rpcrt4: Implement PointerMemorySize. 2007-12-08 19:57:55 +01:00
Rob Shearman 8348f0413d rpcrt4: Fix NdrConformantStructUnmarshall to use buffer memory if applicable and to reuse memory for embedded pointers. 2007-12-08 19:57:46 +01:00
Rob Shearman a5f9ed81e3 rpcrt4: Fix NdrFixedArrayUnmarshall to use buffer memory if applicable and to reuse memory for embedded pointers. 2007-12-08 19:57:39 +01:00
Rob Shearman abbceb137a rpcrt4: Fix NdrConformantArrayUnmarshall to use buffer memory if applicable and to reuse memory for embedded pointers. 2007-12-08 19:57:32 +01:00
Alexandre Julliard c0b12351e0 Avoid size_t types in traces. 2007-12-07 18:49:18 +01:00
Rob Shearman 7092590c90 rpcrt4: Use an alertable wait in rpcrt4_protseq_np_wait_for_new_connection to fix a small memory leak flagged by Valgrind.
This is called only by the RPCRT4_server_thread so we don't have to 
worry about application user APCs being run at improper times.
2007-12-07 17:06:33 +01:00
Rob Shearman ba6aec70ca rpcrt4: Implement NdrConformantStructFree. 2007-12-07 17:06:05 +01:00
Rob Shearman 2ebee18198 rpcrt4: Improve PointerFree to not free buffer memory. 2007-12-07 16:34:17 +01:00
Rob Shearman 1b79da8be0 rpcrt4: Fix a memory leak caused by NdrFullPointerXlatFree not freeing the entries in the full pointer translation table. 2007-12-06 12:08:10 +01:00
Rob Shearman 867cc3c05f rpcrt4: Fix a memory leak when freeing an association by deleting the critical section. 2007-12-06 12:08:05 +01:00
Rob Shearman 5fb5fccac0 rpcrt4: Fix a memory leak in RpcAssoc_BindConnection. 2007-12-06 12:08:00 +01:00
Rob Shearman 13e47d762a rpcrt4: Set the memory pointer in NdrBaseTypeUnmarshall to the buffer if we're unmarshalling on a server without memory being passed in. 2007-12-05 13:49:08 +01:00
Rob Shearman 17132f7e1f rpcrt4: Set fMustAlloc to TRUE when unmarshalling an object pointer. 2007-12-05 13:48:59 +01:00
Rob Shearman c866b06806 rpcrt4: Add tests for a pointer to a conformant strings. 2007-12-04 18:18:03 +01:00
Rob Shearman 2a9fae7565 rpcrt4: Set the destination pointer in PointerUnmarshall before calling the referenced type's unmarshalling routine.
When a pointer that is dereferenced is encountered then this can result 
in a stale pointer (i.e. the one that is marshalled into the buffer for 
the embedded pointer unmarshalling case) being used instead of the one 
that was intended.
2007-12-04 18:18:01 +01:00
Rob Shearman a016d7b335 rpcrt4: Handle all non-continuable exceptions in CStdStubBuffer_Invoke. 2007-12-04 13:33:10 +01:00
Rob Shearman 6dcc3fe62e rpcrt4: Put the delegating stub thunks in an executable memory page, rather than on the heap. 2007-12-04 13:32:41 +01:00
Rob Shearman 341208bf1b rpcrt4: Call IRpcChannelBuffer_GetDestCtx in NdrStubInitialize, just like we do in NdrProxyInitialize. 2007-12-04 13:32:29 +01:00
Rob Shearman f191f59ee4 rpcrt4: Flesh out more of the IRpcChannelBuffer vtable to make the test_delegating_Invoke test succeed on Windows. 2007-12-04 13:31:59 +01:00
Rob Shearman 620fca405d rpcrt4: Test that the string retrieved from get_name was actually unmarshalled correctly. 2007-12-03 13:10:21 +01:00
Rob Shearman d8e467b0fd rpcrt4: Reverse the conditions for which *pPointer is assigned base_ptr_val in PointerUnmarshall.
In one condition (fMustAlloc == TRUE), base_ptr_val may be uninitialised
and so cause a valgrind warning. Reversing the check is harmless and
doesn't result in a performance decrease.
2007-12-03 13:10:21 +01:00
Rob Shearman eef207e3f1 rpcrt4: Initialise the memory in test_simple_struct_marshal before passing it to NdrSimpleStructUnmarshall.
Otherwise, the unmarshalling code will read from unintialised memory
when trying to reuse the embedded pointers in the memory block.

Also fix a couple of memory leaks.
2007-12-03 13:10:21 +01:00
Rob Shearman c735a14788 rpcrt4: Fix NdrSimpleStructUnmarshall to cope with [in, out] embedded pointers. 2007-11-30 11:56:30 +01:00
Rob Shearman b676309db3 rpcrt4: Improve PointerUnmarshall to cope with keeping the non-NULL source pointer of a client unmarshall.
This will enable various types with embedded pointers to handle [in,out] 
parameters correctly by keeping the existing memory.
2007-11-30 11:56:21 +01:00
Rob Shearman 4e8f69ac2d rpcrt4: Move forcing of fMustAlloc to NULL to the callers of EmbeddedPointerUnmarshall.
This will enable them to be individually fixed up to use memory if it 
was provided by the caller.
2007-11-30 11:56:11 +01:00
Rob Shearman 43e0c67fe2 rpcrt4: EmbeddedPointerUnmarshall doesn't need to change the address of the allocated memory, so reduce the level of indirection of the memory parameter by one. 2007-11-30 11:56:04 +01:00
Rob Shearman 34522de870 rpcrt4: Errors in sending or receiving packets should result in RPC_S_CALL_FAILED being returned, not RPC_S_PROTOCOL_ERROR. 2007-11-30 11:55:50 +01:00
Rob Shearman 8668369b4f rpcrt4: Fix an integer overflow in NdrConformantStructMarshall and NdrConformantStructUnmarshall. 2007-11-29 13:31:05 +01:00
Rob Shearman 074898ba2b rpcrt4: Fix some more potential buffer overflows. 2007-11-29 13:30:58 +01:00