예제 #1
0
        public static AmClusterPropListDisposable CreatePropListString(string name, string value, out int bufferSize)
        {
            int num  = 4 + AmClusPropListMaker.ClusPropValueSize(name) + AmClusPropListMaker.ClusPropValueSize(value) + 4;
            int num2 = AmClusPropListMaker.PaddingSize(num, 4);

            bufferSize = num + num2;
            IntPtr intPtr = Marshal.AllocHGlobal(bufferSize);

            string.Format("buffer is alloc'ed 0x{0:x} at 0x{1:x}", bufferSize, intPtr.ToInt64());
            int num3 = 0;

            num3 += AmClusPropListMaker.WriteHeader(intPtr, num3, 1);
            num3 += AmClusPropListMaker.WriteStringValue(intPtr, num3, 262147, name);
            num3 += AmClusPropListMaker.WriteStringValue(intPtr, num3, 65539, value);
            num3 += AmClusPropListMaker.WriteTerminator(intPtr, num3);
            ClusapiMethods.ResUtilVerifyPrivatePropertyList(intPtr, bufferSize);
            return(new AmClusterPropListDisposable(new SafeHGlobalHandle(intPtr), (uint)bufferSize));
        }
예제 #2
0
        public static AmClusterPropListDisposable CreatePropListMultiString(string name, string[] value, out int bufferSize)
        {
            int num  = 4 + AmClusPropListMaker.ClusPropValueSize(name) + AmClusPropListMaker.ClusPropValueSize(value) + 4;
            int num2 = AmClusPropListMaker.PaddingSize(num, 4);

            bufferSize = num + num2;
            IntPtr intPtr = Marshal.AllocHGlobal(bufferSize);

            string.Format("buffer is alloc'ed 0x{0:x} at 0x{1:x}", bufferSize, intPtr.ToInt64());
            int num3 = 0;

            num3 += AmClusPropListMaker.WriteHeader(intPtr, num3, 1);
            num3 += AmClusPropListMaker.WriteStringValue(intPtr, num3, 262147, name);
            num3 += AmClusPropListMaker.WriteMultiStringValue(intPtr, num3, 65541, value);
            num3 += AmClusPropListMaker.WriteTerminator(intPtr, num3);
            ClusapiMethods.ResUtilVerifyPrivatePropertyList(intPtr, bufferSize);
            throw new NotImplementedException("CreatePropListMultiString entire function may work, but has not been tested properly.");
        }