TypeLib importer imports enum as LongWord instead of Integer
The TypeLib importer imports enum as LongWord instead of Integer. On 16 bit machines, enum is 16 bit ushort. On 32 bit machines, enum should be declared as 32 bit signed integer by using the [v1_enum] attribute. The TypeLib importer ignores the [v1_enum] attribute.
From https://docs.microsoft.com/en-us/windows/win32/midl/enum
In the MIDL compiler's default mode, you can assign integer values to enumerators. Objects of type enum are int types, and their size is system-dependent. By default, objects of enum types are treated as 16-bit objects of type unsigned short when transmitted over a network. To transmit objects as 32-bit entities, apply the [v1_enum] attribute to the enum typedef.
https://docs.microsoft.com/en-us/windows/win32/midl/v1-enum
The [v1_enum] attribute directs that the specified enumerated type be transmitted as a 32-bit entity, rather than the 16-bit default. For improved performance, we recommend applying the [v1_enum] attribute to enumerators in 32-bit applications. 16-bit client applications need to convert enum types to long for remote transmission.