NetworkCaptureLogger: Allow PCAP shared read access on Windows

This commit is contained in:
Sepalani
2022-09-24 20:25:23 +04:00
parent 69ad2cc4d0
commit 481ddd1308
3 changed files with 26 additions and 8 deletions

View File

@ -20,6 +20,12 @@ enum class SeekOrigin
End,
};
enum class SharedAccess
{
Default,
Read,
};
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
// and make forgetting an fclose() harder
@ -28,7 +34,8 @@ class IOFile
public:
IOFile();
IOFile(std::FILE* file);
IOFile(const std::string& filename, const char openmode[]);
IOFile(const std::string& filename, const char openmode[],
SharedAccess sh = SharedAccess::Default);
~IOFile();
@ -40,7 +47,8 @@ public:
void Swap(IOFile& other) noexcept;
bool Open(const std::string& filename, const char openmode[]);
bool Open(const std::string& filename, const char openmode[],
SharedAccess sh = SharedAccess::Default);
bool Close();
template <typename T>