Closed Fulgen301 closed 2 weeks ago
The underlying type of _EXPCMDSTATE is int
sadly. We might be able to use the associated enum attribute here, haven't looked yet. Will leave this open for others to chime in.
enum _EXPCMDSTATE
{
ECS_ENABLED = 0,
ECS_DISABLED = 0x1,
ECS_HIDDEN = 0x2,
ECS_CHECKBOX = 0x4,
ECS_CHECKED = 0x8,
ECS_RADIOCHECK = 0x10
} ;
IExplorerCommand::GetState
returnsEXPCMDSTATE
in C, which is a typedef toDWORD
, while all the values are part of the_EXPCMDSTATE
enum, necessitating extra casts when used in Rust. As all the valid values are part of that enum, the function could return that type directly, similar to #1674. The same applies toIExplorerCommand::GetFlags
andEXPCMDSTATE
/_EXPCMDSTATE
.Additionally,
_EXPCMDSTATE
/_EXPCMDFLAGS
aren't marked as flags, so combining them via bitwise operations is impossible without casts inwindows-rs
.