Sometimes, In our network redirector, ZwCreateFile fails with 0xC00000BE (STATUS_BAD_NETWORK_PATH)
But I couldn’t find any problem(The function’s inputs, and Device status etc.)
This is the code snippet.
InitializeObjectAttributes(
&ObjectAttributes,
ConnectionName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
NULL,
NULL);
Status = ZwCreateFile(
pHandle,
SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL, // Allocation size
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_OPEN_IF,
FILE_CREATE_TREE_CONNECTION | FILE_SYNCHRONOUS_IO_NONALERT,
NULL, // Ptr to EA Buffer
0); // Length of EA buffer
When does ZwCreateFile return STATUS_BAD_NETWORK_PATH?
The error occurs very rarely. But once it occurs, only rebooting can resolve the problem.
Is there anybody know this?
Thanks in advance.