Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to previous keepalive mechanism during failure #804

Closed
Liryna opened this issue Jun 12, 2019 · 1 comment
Closed

Fallback to previous keepalive mechanism during failure #804

Liryna opened this issue Jun 12, 2019 · 1 comment

Comments

@Liryna
Copy link
Member

Liryna commented Jun 12, 2019

Here in case of failure

dokany/dokan/dokan.c

Lines 282 to 299 in f32e1f0

wchar_t keepalive_path[128];
StringCbPrintfW(keepalive_path, sizeof(keepalive_path), L"\\\\?%s%s",
instance->DeviceName, DOKAN_KEEPALIVE_FILE_NAME);
HANDLE keepalive_handle =
CreateFile(keepalive_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (keepalive_handle == INVALID_HANDLE_VALUE) {
// We don't consider this a fatal error because the keepalive handle is only
// needed for abnormal termination cases anyway.
DbgPrintW(L"Failed to open keepalive file: %s\n", keepalive_path);
}
DWORD keepalive_bytes_returned = 0;
BOOL keepalive_active =
DeviceIoControl(keepalive_handle, FSCTL_ACTIVATE_KEEPALIVE, NULL, 0, NULL,
0, &keepalive_bytes_returned, NULL);
if (!keepalive_active) {
DbgPrintW(L"Failed to activate keepalive handle.\n");
}

we should fallback to previous keepalive mechanism. It is possible the failure happened when an older kernel without the keepalive file feature is used.

The commit that need to be partially revert:

1fdf9fb

@Liryna Liryna added this to the 1.3.0 milestone Jun 12, 2019
@Liryna
Copy link
Member Author

Liryna commented Jun 22, 2019

Done 6e68efb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant