none
[WP8.1] MIDL Error for Native Service with RPC RRS feed

  • Question

  • Hi

    I want develop communication Driver and Application.

    So i use the native service with RPC Server and Client.

    But I don't know MIDL format.

    I want use void * as out parameter but can't use that.

    If you know solve this problem, please let me know.

    ps. refer my idl code as below

    import "wtypes.idl";

    [uuid(DCD98A63-8DCB-48c6-A664-14E86872E781)]
    interface DMDSvcApi
    {
        // these functions allow tracking any client side unexpected disconnects
        // client apps don't need to call them
        typedef [context_handle] void * PCONTEXT_HANDLE_TYPE;
        typedef [ref] PCONTEXT_HANDLE_TYPE * PPCONTEXT_HANDLE_TYPE;
        HRESULT CreateContext([in] handle_t hBinding, [out] PPCONTEXT_HANDLE_TYPE pphContext);
        HRESULT CloseContext([in, out] PPCONTEXT_HANDLE_TYPE pphContext);

        // a sample API, clients will call this
        HRESULT Add(
            [in] PCONTEXT_HANDLE_TYPE hBinding,
            [in] DWORD Operand1,
            [in] DWORD Operand2,
            [out] DWORD* Sum
        );

    HRESULT DeviceApiInit(
    [in] PCONTEXT_HANDLE_TYPE hBinding
    );

    HRESULT DeviceApiDeinit(
    [in] PCONTEXT_HANDLE_TYPE hBinding
    );

    HRESULT DeviceApiSet(
    [in] PCONTEXT_HANDLE_TYPE hBinding,
    [in] DWORD i,
    [in] void * p, // this error
    [in] DWORD size,
    [in] DWORD n
    );

    HRESULT DeviceApiGet(
    [in] PCONTEXT_HANDLE_TYPE hBinding,
    [in] DWORD i,
    [out] void * p, // this error
    [in] DWORD size,
    [in] DWORD n,
    [out] DWORD *pn
    );
    }

    // functions the clientside lib provides to initiate a connection to the server
    cpp_quote("HRESULT DMDSvcInit(__inout PPCONTEXT_HANDLE_TYPE);")
    cpp_quote("HRESULT DMDSvcDeinit(__inout PPCONTEXT_HANDLE_TYPE);")

    Jack.

    Tuesday, May 3, 2016 4:35 AM

Answers

  • I resolved this problem.

    change to parameter's attribute.

    [out] void * p -> [in, out, size_is(size)] UCHAR [ *]

    Jack

    • Marked as answer by jack.hong Wednesday, May 4, 2016 9:30 AM
    Wednesday, May 4, 2016 9:30 AM