mscom needs the ability to (de)serialize structs

RESOLVED FIXED in Firefox 54

Status

()

Core
IPC
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: aklotz, Assigned: aklotz)

Tracking

Trunk
mozilla54
Unspecified
Windows
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
COM easily serializes interfaces via CoMarshalInterface, but we need to do it with structs. Microsoft RPC provides a way to do this provided that the struct is declared properly in the idl.

I've written a pair of classes that allow us to read and write to/from IStream objects, which then can be read from/written to a buffer.

This is required to be able to send payloads along with a COM interface during marshaling.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 4

a year ago
I keep forgetting to point out that the function pointers that are accepted by this code are generated by midl. There is a bunch of info in the remarks section of https://msdn.microsoft.com/en-us/library/windows/desktop/aa366812(v=vs.85).aspx that goes into more detail.

Comment 5

a year ago
mozreview-review
Comment on attachment 8836194 [details]
Bug 1338609: Add the ability to serialize and deserialize structs using Microsoft RPC to mscom;

https://reviewboard.mozilla.org/r/111648/#review116138

::: ipc/mscom/StructStream.h:104
(Diff revision 3)
> +    return mStatus == RPC_S_OK && !mEncodedLen;
> +  }
> +
> +  unsigned long GetSize() const
> +  {
> +    return sizeof(mEncodedLen) + mEncodedLen;

why add sizeof(mEncodedLen) here?
Attachment #8836194 - Flags: review?(jmathies) → review+
(Assignee)

Comment 6

a year ago
(In reply to Jim Mathies [:jimm] from comment #5)
> why add sizeof(mEncodedLen) here?

When writing to the buffer we write out mEncodedLen before we write the buffer contents.

Comment 7

a year ago
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6c4184cc1e21
Add the ability to serialize and deserialize structs using Microsoft RPC to mscom; r=jimm

Comment 8

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6c4184cc1e21
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox54: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.