MCPcopy Create free account
hub / github.com/ariccio/altWinDirStat / OpenForReading

Method OpenForReading

Reference code/osImageTool/LocalSdCard.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 return true;
42}
43bool LocalSdCard::OpenForReading()
44{
45 m_h= CreateFile(m_di->physical.c_str(), GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
46 if (m_h==INVALID_HANDLE_VALUE)
47 {
48 g_err.Set(stringformat("error opening device %s for reading: %s", m_di->physical.c_str(), LastError().c_str()));
49 return false;
50 }
51
52 m_bWriting= false;
53 m_bReading= true;
54
55 return true;
56}
57bool LocalSdCard::Close()
58{
59 if (!m_bReading&&!m_bWriting)

Callers 1

OpenMethod · 0.45

Calls 3

stringformatFunction · 0.85
LastErrorFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected