FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName, uint32_t dwMode) { if (m_hFile) { return FALSE; } uint32_t dwAccess, dwShare, dwCreation; FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation); m_hFile = ::CreateFileW((LPCWSTR)fileName.c_str(), dwAccess, dwShare, nullptr, dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr); if (m_hFile == INVALID_HANDLE_VALUE) m_hFile = nullptr; return !!m_hFile; }
FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) { if (m_hFile) { return FALSE; } FX_DWORD dwAccess, dwShare, dwCreation; FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation); m_hFile = ::CreateFileW((LPCWSTR)fileName.GetPtr(), dwAccess, dwShare, NULL, dwCreation, FILE_ATTRIBUTE_NORMAL, NULL); if (m_hFile == INVALID_HANDLE_VALUE) { m_hFile = NULL; } return m_hFile != NULL; }