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