MCPcopy Create free account
hub / github.com/InoriRus/Kyty / sys_file_open_r

Function sys_file_open_r

source/lib/Sys/src/SysWindowsFileIO.cpp:201–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201sys_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
222sys_file_t* sys_file_open(uint8_t* buf, uint32_t buf_size)
223{

Calls 4

get_cache_access_typeFunction · 0.85
utf16_strMethod · 0.80
GetDataMethod · 0.45

Tested by

no test coverage detected