Skip to content

Commit

Permalink
restored IsDBWinViewerActive
Browse files Browse the repository at this point in the history
  • Loading branch information
janwilmans committed Sep 9, 2019
1 parent 283f28e commit e45ec83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DebugView++Lib/DBWinBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ bool IsWindowsVistaOrGreater()
return (osvi.dwMajorVersion > 5);
}

bool IsDBWinViewerActive()
{
Win32::Handle hMap(::OpenFileMapping(FILE_MAP_READ, 0, L"DBWIN_BUFFER"));
return hMap != nullptr;
}

bool HasGlobalDBWinReaderRights()
{
Win32::Handle hMap(::CreateFileMapping(nullptr, nullptr, PAGE_READWRITE, 0, sizeof(DbWinBuffer), L"Global\\DBWIN_BUFFER"));
Expand Down
1 change: 1 addition & 0 deletions include/DebugView++Lib/DBWinBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct DbWinBuffer
static_assert(sizeof(DbWinBuffer) == 4096, "DBWIN_BUFFER size must be 4096");

bool IsWindowsVistaOrGreater();
bool IsDBWinViewerActive();
bool HasGlobalDBWinReaderRights();

} // namespace debugviewpp
Expand Down

0 comments on commit e45ec83

Please sign in to comment.