Menu
  • HOME
  • TAGS

EnumDisplayDevices - passing null causes error

c#,winapi,pinvoke,null-string

Original definition from MSDN: typedef struct _DISPLAY_DEVICE { DWORD cb; TCHAR DeviceName[32]; TCHAR DeviceString[128]; DWORD StateFlags; TCHAR DeviceID[128]; TCHAR DeviceKey[128]; } DISPLAY_DEVICE, *PDISPLAY_DEVICE; All string fields are defined as fixed-size arrays. Your DISPLAY_DEVICE structure definition contains multiple string values without instructions how to marshal them, so they will be passed...