Why not use use `wcsdup` then you don't need to pass the string length to the constructor.