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