| 1574 | } |
| 1575 | |
| 1576 | static NTSTATUS DOKAN_CALLBACK CryptUnlockFile(LPCWSTR FileName, |
| 1577 | LONGLONG ByteOffset, |
| 1578 | LONGLONG Length, |
| 1579 | PDOKAN_FILE_INFO DokanFileInfo) { |
| 1580 | FileNameEnc filePath(DokanFileInfo, FileName); |
| 1581 | HANDLE handle; |
| 1582 | |
| 1583 | DbgPrint(L"UnlockFile %s\n", FileName); |
| 1584 | |
| 1585 | handle = (HANDLE)DokanFileInfo->Context; |
| 1586 | if (!handle || handle == INVALID_HANDLE_VALUE) { |
| 1587 | DbgPrint(L"\tinvalid handle\n\n"); |
| 1588 | return STATUS_INVALID_HANDLE; |
| 1589 | } |
| 1590 | |
| 1591 | CryptFile *file = CryptFile::NewInstance(GetContext()); |
| 1592 | |
| 1593 | if (file->Associate(GetContext(), handle, FileName, false)) { |
| 1594 | |
| 1595 | if (!file->UnlockFile(ByteOffset, Length)) { |
| 1596 | DWORD error = GetLastError(); |
| 1597 | DbgPrint(L"\terror code = %d\n\n", error); |
| 1598 | delete file; |
| 1599 | return ToNtStatus(error); |
| 1600 | } |
| 1601 | } else { |
| 1602 | delete file; |
| 1603 | return STATUS_ACCESS_DENIED; |
| 1604 | } |
| 1605 | delete file; |
| 1606 | DbgPrint(L"\tsuccess\n\n"); |
| 1607 | return STATUS_SUCCESS; |
| 1608 | } |
| 1609 | |
| 1610 | static NTSTATUS DOKAN_CALLBACK CryptGetFileSecurity( |
| 1611 | LPCWSTR FileName, PSECURITY_INFORMATION SecurityInformation, |
nothing calls this directly
no test coverage detected