54 return ! m_hhFile.
IsNull();
63 bool Lock(LPCTSTR lpszName)
66 DWORD dwDesiredAccess = GENERIC_READ;
67 DWORD dwShareMode = (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE);
68 DWORD dwCreationDisp = OPEN_EXISTING;
69 m_hhFile = ::CreateFile(lpszName, dwDesiredAccess, dwShareMode, NULL, dwCreationDisp, 0, NULL);
70 _GetLastError(
"CreateFile");
71 if ( ! m_hhFile.
IsNull() && ::LockFile(m_hhFile, 0, 0, DWORD_MAX, DWORD_MAX) )
87 ::UnlockFile(m_hhFile, 0, 0, DWORD_MAX, DWORD_MAX);
void Unlock(void)
[排他] アンロック
bool IsLock(void) const
[確認] ロック状態
bool Lock(LPCTSTR lpszName)
[排他] ロック
bool IsNull(void) const
[確認] NULLチェック