[Bug 49162] New: widl generates incorrect marshaller for pointer sized output parameter for 32-bit client and 64-bit server

WineHQ Bugzilla wine-bugs at winehq.org
Fri May 15 00:59:21 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=49162

            Bug ID: 49162
           Summary: widl generates incorrect marshaller for pointer sized
                    output parameter for 32-bit client and 64-bit server
           Product: Wine
           Version: 5.8
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: rpc
          Assignee: wine-bugs at winehq.org
          Reporter: dmitry at baikal.ru
      Distribution: ---

Consider the following .idl:

import "objidl.idl";

cpp_quote("#if 0")
typedef ULONG_PTR HDATA;
cpp_quote("#endif")

[
    uuid(00000000-1111-2222-3333-444444444444),
    implicit_handle(handle_t rpc_handle),
    version(1.0)
]
interface IServer
{
    DWORD rpc_GetData([out] HDATA *data);
}

Makefile snippet:

server_s.c: Makefile server.idl $(WIDL)
    $(WIDL) -s -h -o $@ server.idl -m64 -I. -I$(WINEINCLUDE)

server_c.c: Makefile server.idl $(WIDL)
    $(WIDL) -c -h -o $@ server.idl -m32 -I. -I$(WINEINCLUDE)

generated server_s.c snippet:
void __RPC_STUB IServer_rpc_GetData( PRPC_MESSAGE _pRpcMessage )
{
...
        *(HDATA *)__frame->_StubMsg.Buffer = *__frame->data;
...
        *(DWORD *)__frame->_StubMsg.Buffer = __frame->_RetVal;
}

generated server_c.c snippet:
DWORD __cdecl rpc_GetData(
    HDATA *data)
{
...
        *data = *(HDATA *)__frame->_StubMsg.Buffer;
...
        _RetVal = *(DWORD *)__frame->_StubMsg.Buffer;
}

As a result a being marshalled buffer looks like this:
[8 bytes HDATA][4 bytes _RetVal]
and on the client side _Retval gets value of upper 32-bits of the 64-bit HDATA.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list