private static unsafe int DoCreateRecordSchedule(IntPtr aPtr, uint aVersion, char *aElements, char **aRecordScheduleID, char **aResult, uint *aUpdateID) { GCHandle gch = GCHandle.FromIntPtr(aPtr); DvServiceUpnpOrgScheduledRecording1 self = (DvServiceUpnpOrgScheduledRecording1)gch.Target; string elements = Marshal.PtrToStringAnsi((IntPtr)aElements); string recordScheduleID; string result; uint updateID; self.CreateRecordSchedule(aVersion, elements, out recordScheduleID, out result, out updateID); *aRecordScheduleID = (char *)Marshal.StringToHGlobalAnsi(recordScheduleID).ToPointer(); *aResult = (char *)Marshal.StringToHGlobalAnsi(result).ToPointer(); *aUpdateID = updateID; return(0); }