Пример #1
0
bool CRemoteCacheLink::ReleaseLockForPath(const CTGitPath& path)
{
	EnsureCommandPipeOpen();
	if (m_hCommandPipe)
	{
		DWORD cbWritten;
		TGITCacheCommand cmd;
		SecureZeroMemory(&cmd, sizeof(TGITCacheCommand));
		cmd.command = TGITCACHECOMMAND_RELEASE;
		wcsncpy_s(cmd.path, path.GetDirectory().GetWinPath(), MAX_PATH);
		BOOL fSuccess = WriteFile(
			m_hCommandPipe, // handle to pipe
			&cmd,           // buffer to write from
			sizeof(cmd),    // number of bytes to write
			&cbWritten,     // number of bytes written
			NULL);          // not overlapped I/O
		if (! fSuccess || sizeof(cmd) != cbWritten)
		{
			CloseCommandPipe();
			return false;
		}
		return true;
	}
	return false;
}
Пример #2
0
CRemoteCacheLink::~CRemoteCacheLink(void)
{
	ClosePipe();
	CloseCommandPipe();
	m_critSec.Term();
}