I am trying to convert a C++ struct to C but keep getting "undeclared identifier"? Does C++ have a different syntax for referring to structs?
struc
In C, the name of the type is struct KEY_STATE
.
So you have to declare the second struct as
typedef struct _DEVICE_EXTENSION
{
WDFDEVICE WdfDevice;
struct KEY_STATE kState;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
If you do not want to write struct
all the time, you can use a typedef declare KEY_STATE
similar to DEVICE_EXTENSION
:
typedef struct _KEY_STATE
{
/* ... */
} KEY_STATE;