Absolutely excellent piece of code! I was ramming my head into the wall searching for reasons why
USB_CDC reception did not work, until I stumbled over your fine replacement for usbd_cdc_if.h/c
However, CubeSTM replaces these files everytime I reconfigure the project with the bad, original ones!
=> How can I incorporate your code "permanently" in a project of mine?
=> Even better: how can I trick CubeIDE to use your files for every upcoming project where I need usb_cdc ?