Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behaviour of IOConnectMethodStructureIStructureO



On Thursday, December 12, 2002, at 08:19 PM, Amanda Walker wrote:

On 12/12/02 6:51 PM, Robert Penland <email@hidden> wrote:
If you make an IOConnectMethodStructureIStructureO call from user
land, does the system not update the StructureO in user land if the call
returns with an error?

I don't believe so, though I don't recall seeing any docs one way or the
other. In the stuff I've written, I've been assuming that the data does not
get copied out if I return an error, which seems to be the case.

You are correct. The IOKit interfaces are defined with MIG. MIG's standard operating procedure is to not copy out any "out" parameters if the result is not "KERN_SUCCESS" (i.e. zero, many other subsystems have their own defines for this value).

Of course, if you MUST return both data and a non-zero return code, you can wrap the MIG-generated function, declare an out parameter for the "real result of the function" and pass that out in addition to the out data. Your wrapper routine can pull that return value out and override the "KERN_SUCCESS" actually returned to MIG.

--Jim
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Behaviour of IOConnectMethodStructureIStructureO (From: Amanda Walker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.