| 1021 | } |
| 1022 | |
| 1023 | bool |
| 1024 | get_file_directory(LPCWSTR filepath, wstring& dirpath) |
| 1025 | { |
| 1026 | size_t len = wcslen(filepath); |
| 1027 | |
| 1028 | if (len < 1) |
| 1029 | return false; |
| 1030 | |
| 1031 | const WCHAR *lastslash = wcsrchr(filepath, '\\'); |
| 1032 | |
| 1033 | if (!lastslash) |
| 1034 | return false; |
| 1035 | |
| 1036 | if (lastslash == filepath) { |
| 1037 | dirpath = L"\\"; |
| 1038 | return true; |
| 1039 | } |
| 1040 | |
| 1041 | dirpath = filepath; |
| 1042 | |
| 1043 | dirpath = dirpath.substr(0, lastslash - filepath); |
| 1044 | |
| 1045 | return true; |
| 1046 | } |
| 1047 | |
| 1048 | const WCHAR * // returns base64-encoded, encrypted stream name. input stream name is expected to start with colon |
| 1049 | encrypt_stream_name(const CryptContext *con, const unsigned char *dir_iv, const WCHAR *stream, wstring& storage) |
no outgoing calls
no test coverage detected