Michael Stefaniuc : rpcrt4: Use CONTAINING_RECORD instead of an extra macro.

Alexandre Julliard julliard at winehq.org
Tue May 7 17:32:47 CDT 2019


Module: wine
Branch: master
Commit: fb4a77d5c68120fe743ed2c750d714e124e3e775
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fb4a77d5c68120fe743ed2c750d714e124e3e775

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue May  7 20:16:21 2019 +0200

rpcrt4: Use CONTAINING_RECORD instead of an extra macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/rpcrt4/ndr_marshall.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index dbf4074..70e7879 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -132,8 +132,6 @@ static inline void align_pointer_offset_clear( unsigned char **ptr, unsigned cha
 #define NDR_TABLE_SIZE 128
 #define NDR_TABLE_MASK 127
 
-#define NDRSContextFromValue(user_context) (NDR_SCONTEXT)((char *)(user_context) - (char *)NDRSContextValue((NDR_SCONTEXT)NULL))
-
 static unsigned char *WINAPI NdrBaseTypeMarshall(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING);
 static unsigned char *WINAPI NdrBaseTypeUnmarshall(PMIDL_STUB_MESSAGE, unsigned char **, PFORMAT_STRING, unsigned char);
 static void WINAPI NdrBaseTypeBufferSize(PMIDL_STUB_MESSAGE, unsigned char *, PFORMAT_STRING);
@@ -7002,7 +7000,7 @@ static unsigned char *WINAPI NdrContextHandleMarshall(
     }
     else
     {
-        NDR_SCONTEXT ctxt = NDRSContextFromValue(pMemory);
+        NDR_SCONTEXT ctxt = CONTAINING_RECORD(pMemory, struct _NDR_SCONTEXT, userContext);
         NDR_RUNDOWN rundown = pStubMsg->StubDesc->apfnNdrRundownRoutines[pFormat[2]];
         NdrServerContextNewMarshall(pStubMsg, ctxt, rundown, pFormat);
     }




More information about the wine-cvs mailing list