private void TestData() { int hr; const int SIZE = 100; int i; IntPtr ip = Marshal.AllocCoTaskMem(SIZE); IntPtr ip2 = Marshal.AllocCoTaskMem(SIZE); Marshal.WriteInt64(ip, 123456789); hr = m_pVideoGroupObj.SetUserData(ip, SIZE); DESError.ThrowExceptionForHR(hr); hr = m_pVideoGroupObj.GetUserData(ip2, out i); DESError.ThrowExceptionForHR(hr); long j = Marshal.ReadInt64(ip2); Debug.Assert(i == SIZE && j == 123456789, "UserData"); Marshal.FreeCoTaskMem(ip); Marshal.FreeCoTaskMem(ip2); }