简体   繁体   中英

What's the difference between PATH_NOT_FOUND and NAME_NOT_FOUND

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_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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM