internal void SaveErrorRecord() { // TODO: pass an affinity handle here? int recordHandle = RemotableNativeMethods.MsiGetLastErrorRecord(0); if (recordHandle != 0) { using (Record errorRec = new Record((IntPtr)recordHandle, true, null)) { this.errorData = new object[errorRec.FieldCount]; for (int i = 0; i < this.errorData.Length; i++) { this.errorData[i] = errorRec[i + 1]; } } } else { this.errorData = null; } }