示例#1
0
 internal static uint MsiRecordReadStream(int hRecord, uint iField, byte[] szDataBuf, ref uint cbDataBuf)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hRecord))
     {
         return(NativeMethods.MsiRecordReadStream(hRecord, iField, szDataBuf, ref cbDataBuf));
     }
     else
     {
         lock (RemotableNativeMethods.remotingDelegate)
         {
             ClearData(requestBuf);
             unchecked
             {
                 WriteInt(requestBuf, 0, RemotableNativeMethods.GetRemoteHandle(hRecord));
                 WriteInt(requestBuf, 1, (int)iField);
                 WriteInt(requestBuf, 2, (int)cbDataBuf);
                 IntPtr resp;
                 remotingDelegate(RemoteMsiFunctionId.MsiRecordReadStream, requestBuf, out resp);
                 uint ret = (uint)ReadInt(resp, 0);
                 if (ret == 0)
                 {
                     cbDataBuf = (uint)ReadInt(resp, 2);
                     if (cbDataBuf > 0)
                     {
                         RemotableNativeMethods.ReadStream(resp, 1, szDataBuf, (int)cbDataBuf);
                     }
                 }
                 return(ret);
             }
         }
     }
 }
示例#2
0
        internal static uint MsiSummaryInfoGetProperty(int hSummaryInfo, uint uiProperty, out uint uiDataType, out int iValue, ref long ftValue, StringBuilder szValueBuf, ref uint cchValueBuf)
        {
            if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hSummaryInfo))
            {
                return(NativeMethods.MsiSummaryInfoGetProperty(hSummaryInfo, uiProperty, out uiDataType, out iValue, ref ftValue, szValueBuf, ref cchValueBuf));
            }
            else
            {
                lock (RemotableNativeMethods.remotingDelegate)
                {
                    ClearData(requestBuf);
                    WriteInt(requestBuf, 0, RemotableNativeMethods.GetRemoteHandle(hSummaryInfo));
                    WriteInt(requestBuf, 1, (int)uiProperty);
                    IntPtr resp;
                    remotingDelegate(RemoteMsiFunctionId.MsiSummaryInfoGetProperty, requestBuf, out resp);
                    unchecked
                    {
                        uint ret = (uint)ReadInt(resp, 0);
                        if (ret == 0)
                        {
                            uiDataType = (uint)ReadInt(resp, 1);
                            switch ((VarEnum)uiDataType)
                            {
                            case VarEnum.VT_I2:
                            case VarEnum.VT_I4:
                                iValue = ReadInt(resp, 2);
                                break;

                            case VarEnum.VT_FILETIME:
                                uint ftHigh = (uint)ReadInt(resp, 2);
                                uint ftLow  = (uint)ReadInt(resp, 3);
                                ftValue = ((long)ftHigh) << 32 | ((long)ftLow);
                                iValue  = 0;
                                break;

                            case VarEnum.VT_LPSTR:
                                ReadString(resp, 2, szValueBuf, ref cchValueBuf);
                                iValue = 0;
                                break;

                            default:
                                iValue = 0;
                                break;
                            }
                        }
                        else
                        {
                            uiDataType = 0;
                            iValue     = 0;
                        }
                        return(ret);
                    }
                }
            }
        }
示例#3
0
 internal static uint MsiSetFeatureState(int hInstall, string szFeature, int iState)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiSetFeatureState(hInstall, szFeature, iState));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_ISI(
                    RemoteMsiFunctionId.MsiSetFeatureState,
                    RemotableNativeMethods.GetRemoteHandle(hInstall), szFeature, iState));
     }
 }
示例#4
0
 internal static uint MsiRecordDataSize(int hRecord, uint iField)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hRecord))
     {
         return(NativeMethods.MsiRecordDataSize(hRecord, iField));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_III(
                    RemoteMsiFunctionId.MsiRecordDataSize,
                    RemotableNativeMethods.GetRemoteHandle(hRecord),
                    (int)iField, 0));
     }
 }
示例#5
0
 internal static uint MsiVerifyDiskSpace(int hInstall)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiVerifyDiskSpace(hInstall));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_III(
                    RemoteMsiFunctionId.MsiVerifyDiskSpace,
                    RemotableNativeMethods.GetRemoteHandle(hInstall),
                    0,
                    0));
     }
 }
示例#6
0
 internal static uint MsiSetTargetPath(int hInstall, string szFolder, string szFolderPath)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiSetTargetPath(hInstall, szFolder, szFolderPath));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_ISS(
                    RemoteMsiFunctionId.MsiSetTargetPath,
                    RemotableNativeMethods.GetRemoteHandle(hInstall),
                    szFolder,
                    szFolderPath));
     }
 }
示例#7
0
 internal static uint MsiSetInstallLevel(int hInstall, int iInstallLevel)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiSetInstallLevel(hInstall, iInstallLevel));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_III(
                    RemoteMsiFunctionId.MsiSetInstallLevel,
                    RemotableNativeMethods.GetRemoteHandle(hInstall),
                    iInstallLevel,
                    0));
     }
 }
示例#8
0
 internal static uint MsiSetFeatureAttributes(int hInstall, string szFeature, uint dwAttributes)
 {
     if (!RemotingEnabled || !RemotableNativeMethods.IsRemoteHandle(hInstall))
     {
         return(NativeMethods.MsiSetFeatureAttributes(hInstall, szFeature, dwAttributes));
     }
     else
     {
         return(RemotableNativeMethods.MsiFunc_ISI(
                    RemoteMsiFunctionId.MsiSetFeatureAttributes,
                    RemotableNativeMethods.GetRemoteHandle(hInstall),
                    szFeature,
                    (int)dwAttributes));
     }
 }