internal static uint MsiGetFeatureCost(int hInstall, string szFeature, int iCostTree, int iState, out int iCost)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiGetFeatureCost(hInstall, szFeature, iCostTree, iState, out iCost));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_ISII_I(
                    RemoteMsiFunctionId.MsiGetFeatureCost,
                    RemotableNativeMethods.GetRemoteHandle(hInstall),
                    szFeature,
                    iCostTree,
                    iState,
                    out iCost));
     }
 }
 internal static uint MsiDatabaseOpenView(int hDatabase, string szQuery, out int hView)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hDatabase))
     {
         return(NativeMethods.MsiDatabaseOpenView(hDatabase, szQuery, out hView));
     }
     else
     {
         uint err = RemotableNativeMethods.MsiFunc_ISII_I(
             RemoteMsiFunctionId.MsiDatabaseOpenView,
             RemotableNativeMethods.GetRemoteHandle(hDatabase),
             szQuery,
             0,
             0,
             out hView);
         hView = RemotableNativeMethods.MakeRemoteHandle(hView);
         return(err);
     }
 }
 internal static uint MsiDatabaseGetPrimaryKeys(int hDatabase, string szTableName, out int hRecord)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hDatabase))
     {
         return(NativeMethods.MsiDatabaseGetPrimaryKeys(hDatabase, szTableName, out hRecord));
     }
     else
     {
         uint err = RemotableNativeMethods.MsiFunc_ISII_I(
             RemoteMsiFunctionId.MsiDatabaseGetPrimaryKeys,
             RemotableNativeMethods.GetRemoteHandle(hDatabase),
             szTableName,
             0,
             0,
             out hRecord);
         hRecord = RemotableNativeMethods.MakeRemoteHandle(hRecord);
         return(err);
     }
 }
 internal static uint MsiGetSummaryInformation(int hDatabase, string szDatabasePath, uint uiUpdateCount, out int hSummaryInfo)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hDatabase))
     {
         return(NativeMethods.MsiGetSummaryInformation(hDatabase, szDatabasePath, uiUpdateCount, out hSummaryInfo));
     }
     else
     {
         uint err = RemotableNativeMethods.MsiFunc_ISII_I(
             RemoteMsiFunctionId.MsiGetSummaryInformation,
             RemotableNativeMethods.GetRemoteHandle(hDatabase),
             szDatabasePath,
             (int)uiUpdateCount,
             0,
             out hSummaryInfo);
         hSummaryInfo = RemotableNativeMethods.MakeRemoteHandle(hSummaryInfo);
         return(err);
     }
 }
 internal static uint MsiGetFeatureValidStates(int hInstall, string szFeature, out uint dwInstalledState)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiGetFeatureValidStates(hInstall, szFeature, out dwInstalledState));
     }
     else
     {
         int  iTemp;
         uint ret = RemotableNativeMethods.MsiFunc_ISII_I(
             RemoteMsiFunctionId.MsiGetFeatureValidStates,
             RemotableNativeMethods.GetRemoteHandle(hInstall),
             szFeature,
             0,
             0,
             out iTemp);
         dwInstalledState = (uint)iTemp;
         return(ret);
     }
 }