fn fill_utf16_buf<F1, F2, T>(f1: F1, f2: F2) -> Result<T>where F1: FnMut(*mut u16, c_ulong) -> c_ulong, F2: FnOnce(&[u16]) -> T,