What is the difference between PATH_NOT_FOUND and NAME_NOT_FOUND

In the Win32 layer, we often see ERROR_PATH_NOT_FOUND , ERROR_NAME_NOT_FOUND .

When WinAPI(eg CreateFileW, RemoveDirectoryW) return these values? And what is 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 define?

I'm so confused. Is there anyone who can clearly explain?
Or are there any documents explaining this? I could not find them.

Thanks in advance.

+4
source share
1 answer

ERROR_NAME_NOT_FOUND not a standard Win32 API error code. Typical errors returned by the APIs associated with files that take a file name are ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND . The best way to find out which error code to return is to use the WDK sample as a guide. For example, the cdfs create.c source code create.c . It returns STATUS_OBJECT_PATH_NOT_FOUND if it cannot find the directory, STATUS_OBJECT_NAME_NOT_FOUND if it cannot find the file.

+4
source

Source: https://habr.com/ru/post/1309004/


All Articles