public void GetCameraType() { System.Diagnostics.Debug.Assert(m_pHandle != IntPtr.Zero); IntPtr buffer = new IntPtr(); int size = sizeof(HVTYPE); StringBuilder str = new StringBuilder(); buffer = Marshal.AllocHGlobal(size); HVSTATUS status = USBCameraAPI.HVGetDeviceInfo(m_pHandle, HV_DEVICE_INFO.DESC_DEVICE_TYPE, buffer, ref size); USBCameraAPI.HV_VERIFY(status); int[] type = new int[size / 4]; Marshal.Copy(buffer, type, 0, size / 4); for (int i = 0; i < size / 4; i++) { str.Append(((HVTYPE)type[i]).ToString().Substring(0, 8)); } m_strCameraType = str.ToString(); str.Remove(0, str.Length); Marshal.FreeHGlobal(buffer); }