| 267 | } |
| 268 | |
| 269 | sys_file_t* sys_file_open_rw(const String& file_name, sys_file_cache_type_t cache_type) |
| 270 | { |
| 271 | auto* ret = new sys_file_t; |
| 272 | |
| 273 | HANDLE h_file = nullptr; |
| 274 | h_file = CreateFileW(reinterpret_cast<LPCWSTR>(file_name.utf16_str().GetData()), |
| 275 | static_cast<DWORD>(GENERIC_READ) | static_cast<DWORD>(GENERIC_WRITE), 0, nullptr, OPEN_EXISTING, |
| 276 | get_cache_access_type(cache_type), nullptr); |
| 277 | |
| 278 | if (h_file == KYTY_INVALID_HANDLE_VALUE()) |
| 279 | { |
| 280 | ret->type = SYS_FILE_ERROR; |
| 281 | } else |
| 282 | { |
| 283 | ret->type = SYS_FILE_FILE; |
| 284 | } |
| 285 | |
| 286 | ret->handle = h_file; |
| 287 | |
| 288 | return ret; |
| 289 | } |
| 290 | |
| 291 | void sys_file_close(sys_file_t* f) |
| 292 | { |
no test coverage detected