Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function IsAppLicensed(ByVal appName As String) As <MarshalAs(UnmanagedType.U1)> Boolean
- Dim num2 As Integer = CInt(stackalloc Byte[<Module>.__CxxQueryExceptionSize])
- Monitor.Enter(Me.dotNetSession_)
- Dim numPtr As SByte ModOpt(IsSignUnspecifiedByte)* = Nothing
- Try
- If (appName = Nothing) Then
- Throw New FMEOException(0, "IsAppLicensed")
- End If
- numPtr = Me.dotNetSession_.CreateCharPtrFromString(appName)
- Dim managerPtr As IFMELicenseManager* = Me.fmeLicenseManager_
- Dim flag As Boolean = (*DirectCast(managerPtr, Integer*)(60)(managerPtr, numPtr) = 1)
- Dim flag2 As Boolean = flag
- If (Not numPtr Is Nothing) Then
- Dim hglobal As New IntPtr(numPtr)
- Marshal.FreeHGlobal(hglobal)
- End If
- Monitor.Exit(Me.dotNetSession_)
- Dim num3 As Byte = CByte(flag)
- Return CBool(num3)
- Catch exception1 As FMEOException
- If (Not numPtr Is Nothing) Then
- Dim ptr2 As New IntPtr(numPtr)
- Marshal.FreeHGlobal(ptr2)
- End If
- Monitor.Exit(Me.dotNetSession_)
- Throw exception1
- Catch obj1 As Object When (?)
- Dim num As UInt32 = 0
- <Module>.__CxxRegisterExceptionObject(DirectCast(Marshal.GetExceptionPointers, Void*), DirectCast(num2, Void*))
- Try
- Try
- If (Not numPtr Is Nothing) Then
- Dim ptr As New IntPtr(numPtr)
- Marshal.FreeHGlobal(ptr)
- End If
- Monitor.Exit(Me.dotNetSession_)
- Throw New FMEOException(0, "Unhandled exception")
- Catch obj2 As Object When (?)
- End Try
- If (num <> 0) Then
- Throw
- End If
- Finally
- <Module>.__CxxUnregisterExceptionObject(DirectCast(num2, Void*), CInt(num))
- End Try
- End Try
- Return False
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement