In Win32 layer, we often meet ERROR_PATH_NOT_FOUND, ERROR_NAME_NOT_FOUND.
When does WinAPI(eg CreateFileW, RemoveDirectoryW) return these values?
And What’s the difference?
If I write a file system driver, when do I set STATUS_OBJECT_PATH_NOT_FOUND or STATUS_OBJECT_NAME_NOT_FOUND?
How do you determine?
I’m so confused.
Is there anyone who can explain clearly?
Or are there any documents explain this? I couldn’t find them.
Thanks in advance.
ERROR_NAME_NOT_FOUNDis not a standard Win32 API error code. Typical errors returned by file related APIs that take a file name areERROR_FILE_NOT_FOUNDandERROR_PATH_NOT_FOUND. The best way to figure out what error code to return is use a WDK sample as a guide. The cdfs sample’screate.csource code file for example. It returnsSTATUS_OBJECT_PATH_NOT_FOUNDif it cannot locate a directory,STATUS_OBJECT_NAME_NOT_FOUNDif it cannot locate a file.