I would initialize byte_returned to 0 as it is passed as an out parameter to DeviceIoControl. It is not necessary as it is not used and not written to by DeviceIoControl, but if it is not set it contains garbage and one might wonder during debugging what the value means DeviceIoControl returns here.