On 08/02/13 20:08, Daniel Lehman wrote: > + if(!MSVCRT_CHECK_PMT(wcDest)) > + { > + *MSVCRT__errno() = MSVCRT_EINVAL; > return MSVCRT_EINVAL; > + } The MSVCRT_CHECK_PMT macro sets the errno value. There's also MSVCRT_CHECK_PMT_ERR macro if you need to set different error.