예제 #1
0
        private static eLeapRS SaveConfigWithRefType(IntPtr hConnection, string key, LEAP_VARIANT_REF_TYPE valueStruct, out UInt32 requestId)
        {
            IntPtr  configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct));
            eLeapRS callResult  = eLeapRS.eLeapRS_UnknownError;

            try {
                Marshal.StructureToPtr(valueStruct, configValue, false);
                callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
            } finally {
                Marshal.FreeHGlobal(configValue);
            }
            return(callResult);
        }
예제 #2
0
파일: LeapC.cs 프로젝트: microdee/leappack
 private static eLeapRS SaveConfigWithRefType(IntPtr hConnection, string key, LEAP_VARIANT_REF_TYPE valueStruct, out UInt32 requestId)
 {
     IntPtr configValue = Marshal.AllocHGlobal(Marshal.SizeOf(valueStruct));
       eLeapRS callResult = eLeapRS.eLeapRS_UnknownError;
       try
       {
     Marshal.StructureToPtr(valueStruct, configValue, false);
     callResult = SaveConfigValue(hConnection, key, configValue, out requestId);
       }
       finally
       {
     Marshal.FreeHGlobal(configValue);
       }
       return callResult;
 }