internal static int MsiGetLastErrorRecord(int hAny) { // When remoting is enabled, we might need to create either a local or // remote record, depending on the handle it is to have an affinity with. // If no affinity handle is specified, create a remote record (the 99% case). if (!RemotingEnabled || (hAny != 0 && !RemotableNativeMethods.IsRemoteHandle(hAny))) { return(NativeMethods.MsiGetLastErrorRecord()); } else { int hRecord = unchecked ((int)RemotableNativeMethods.MsiFunc_III( RemoteMsiFunctionId.MsiGetLastErrorRecord, 0, 0, 0)); return(RemotableNativeMethods.MakeRemoteHandle(hRecord)); } }