On 11 February 2014 06:54, Erich E. Hoover erich.e.hoover@gmail.com wrote:
- memset(&adapter_id, 0x0, sizeof(adapter_id));
- adapter_id.driver = DriverName;
- adapter_id.driver_size = sizeof(DriverName);
- adapter_id.description = DriverDescription;
- adapter_id.description_size = sizeof(DriverDescription);
I think you can just write that as: + adapter_id.driver = DDDI->szDriver; + adapter_id.driver_size = sizeof(DDDI->szDriver); + adapter_id.description = DDDI->szDescription; + adapter_id.description_size = sizeof(DDDI->szDescription); + adapter_id.device_name_size = 0;
/* check how strings are copied into the structure */
ok(pdddi2->szDriver[MAX_DDDEVICEID_STRING - 1]==0, "szDriver not cleared\n");
ok(pdddi2->szDescription[MAX_DDDEVICEID_STRING - 1]==0, "szDescription not cleared\n");
I don't think there anything in the code that guarantees this.