| 199 | } |
| 200 | |
| 201 | sys_file_t* sys_file_open_r(const String& file_name, sys_file_cache_type_t cache_type) |
| 202 | { |
| 203 | auto* ret = new sys_file_t; |
| 204 | |
| 205 | HANDLE h_file = nullptr; |
| 206 | h_file = CreateFileW(reinterpret_cast<LPCWSTR>(file_name.utf16_str().GetData()), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, |
| 207 | get_cache_access_type(cache_type), nullptr); |
| 208 | |
| 209 | if (h_file == KYTY_INVALID_HANDLE_VALUE()) |
| 210 | { |
| 211 | ret->type = SYS_FILE_ERROR; |
| 212 | } else |
| 213 | { |
| 214 | ret->type = SYS_FILE_FILE; |
| 215 | } |
| 216 | |
| 217 | ret->handle = h_file; |
| 218 | |
| 219 | return ret; |
| 220 | } |
| 221 | |
| 222 | sys_file_t* sys_file_open(uint8_t* buf, uint32_t buf_size) |
| 223 | { |
no test coverage detected