开发者

What's the difference between PATH_NOT_FOUND and NAME_NOT_FOUND

开发者 https://www.devze.com 2022-12-29 15:52 出处:网络
In Win32 layer, we often meet ERROR_PATH_NOT_FOUND, ERROR_NAME_NOT_FOUND. When does WinAPI(eg CreateFileW, RemoveDirectoryW) return these values?

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 diffe开发者_运维技巧rence?

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_FOUND is not a standard Win32 API error code. Typical errors returned by file related APIs that take a file name are ERROR_FILE_NOT_FOUND and ERROR_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's create.c source code file for example. It returns STATUS_OBJECT_PATH_NOT_FOUND if it cannot locate a directory, STATUS_OBJECT_NAME_NOT_FOUND if it cannot locate a file.

0

精彩评论

暂无评论...
验证码 换一张
取 消