[RPCRT4] Sync with Wine Staging 4.0. CORE-15682
[reactos.git] / dll / win32 / rpcrt4 / cstub.c
index dc279b7..e33d499 100644 (file)
@@ -50,13 +50,6 @@ static LONG WINAPI stub_filter(EXCEPTION_POINTERS *eptr)
     return EXCEPTION_EXECUTE_HANDLER;
 }
 
-typedef struct
-{
-    IUnknownVtbl *base_obj;
-    IRpcStubBuffer *base_stub;
-    CStdStubBuffer stub_buffer;
-} cstdstubbuffer_delegating_t;
-
 static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface )
 {
     return CONTAINING_RECORD((void *)iface, cstdstubbuffer_delegating_t, stub_buffer);
@@ -175,11 +168,23 @@ typedef struct
 static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01,
                                   0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 };
 #elif defined(__arm__)
+
+static const DWORD opcodes[] =
+{
+    0xe52d4004,    /* push {r4} */
+    0xe5900010,    /* ldr r0, [r0, #16] */
+    0xe5904000,    /* ldr r4, [r0] */
+    0xe59fc008,    /* ldr ip, [pc, #8] */
+    0xe08cc004,    /* add ip, ip, r4 */
+    0xe49d4004,    /* pop {r4} */
+    0xe59cf000     /* ldr pc, [ip] */
+};
+
 typedef struct
 {
+    DWORD opcodes[ARRAY_SIZE(opcodes)];
     DWORD offset;
 } vtbl_method_t;
-static const BYTE opcodes[1];
 
 #else
 
@@ -267,7 +272,7 @@ BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num)
     return TRUE;
 }
 
-static IUnknownVtbl *get_delegating_vtbl(DWORD num_methods)
+IUnknownVtbl *get_delegating_vtbl(DWORD num_methods)
 {
     IUnknownVtbl *ret;
 
@@ -303,7 +308,7 @@ static IUnknownVtbl *get_delegating_vtbl(DWORD num_methods)
     return ret;
 }
 
-static void release_delegating_vtbl(IUnknownVtbl *vtbl)
+void release_delegating_vtbl(IUnknownVtbl *vtbl)
 {
     ref_counted_vtbl *table = (ref_counted_vtbl*)((DWORD *)vtbl - 1);