public CcmErrorCode GetApplicationInfo(int applicationId, out IcaApplication application) { var ptr = IntPtr.Zero; var result = Environment.Is64BitProcess ? CcmSdk64.CCMGetApplicationInfo(applicationId, ref ptr) : CcmSdk32.CCMGetApplicationInfo(applicationId, ref ptr); var appStruct = Marshal.PtrToStructure <CcmIcaApplication>(ptr); application = new IcaApplication() { ApplicationID = appStruct.ApplicationID, SessionID = appStruct.SessionID, FriendlyName = appStruct.FriendlyName, Title = appStruct.Title, ClassName = appStruct.ClassName, IconByteArray = PinvokeHelper.GetIconBytesFromIntPtr(appStruct.hIcon) }; _ = Environment.Is64BitProcess ? CcmSdk64.CCMFreeICAApplication(1U, ptr) : CcmSdk32.CCMFreeICAApplication(1U, ptr); return((CcmErrorCode)result); }