From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,9a36fee7fc1f6cfd,start X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-09-22 19:05:54 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!elroy.jpl.nasa.gov!swrinde!menudo.uh.edu!uuneo!sugar!jabberwock!daniels From: daniels@jabberwock.NeoSoft.com (Brad Daniels) Subject: DCE RPC: [out] conformant arrays? Organization: Biles and Associates Date: Wed, 22 Sep 1993 14:39:15 GMT Message-ID: We want to send an array of names to a remote server and get back an array of values and an array of status. Each value is of a discriminated union type, and we want a conformant array of them. We can't seem to declare an [out] parameter of the conformant type, though. E.g., we want to say something like: typedef enum { INT_TYPE, FLOAT_TYPE, DOUBLE_TYPE } valType; typedef struct { union switch (valType t) { case INT_TYPE: int i; case FLOAT_TYPE: float f; case DOUBLE_TYPE: double d; } valUnion; } value; typedef struct { int count; [size_is(count)] value vals[]; } valList; [idempotent] void getValues([out] valList *vals); ... But we get errors. Do we need to do something like: [idempotent] void getValues([in] int count, [out,length_is(count)] value vals[]); In either case, how are we actually supposed to handle memory allocation? I think we're supposed to just allocate the memory at the client end, and pass it in to be filled up by the stub. On the server end, we're expecting the server stub to have allocated appropriate memory. Is this the right way to handle the memory part? There weren't any examples we could find in the docs to show how we should be doing this, and the descriptions are a wee bit confusing. Examples or explanations much appreciated. Thanks, - Brad --