Skip to content

Commit 31b6d48

Browse files
author
Jan Wilmans
committed
renamed kernelMessageBufferSize and replaced c-style cast with reinterpret_cast
1 parent 815b830 commit 31b6d48

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

application/DebugViewppLib/KernelReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void KernelReader::StartListening()
4545
return;
4646
}
4747
m_handle = std::move(handle);
48-
m_pBuf = (PLOG_ITEM)malloc(dwBufLen);
48+
m_pBuf = reinterpret_cast<PLOG_ITEM>(malloc(kernelMessageBufferSize));
4949
}
5050

5151
void KernelReader::StopListening()
@@ -89,9 +89,9 @@ bool KernelReader::AtEnd() const
8989

9090
void KernelReader::Poll()
9191
{
92-
memset(m_pBuf, 0, dwBufLen);
92+
memset(m_pBuf, 0, kernelMessageBufferSize);
9393
DWORD dwOut = 0;
94-
::DeviceIoControl(m_handle.get(), DBGV_READ_LOG, NULL, 0, m_pBuf, dwBufLen, &dwOut, NULL);
94+
::DeviceIoControl(m_handle.get(), DBGV_READ_LOG, NULL, 0, m_pBuf, kernelMessageBufferSize, &dwOut, NULL);
9595
if (dwOut == 0) return; // no messages to be read
9696

9797
PLOG_ITEM pNextItem = m_pBuf;

application/include/DebugViewppLib/Debugview_kernel_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ typedef struct
4646
#pragma pack()
4747

4848
constexpr const wchar_t * strDbgviewKernelDriverDeviceName = L"\\\\.\\dbgv";
49-
constexpr const DWORD dwBufLen = 0x10000;
49+
constexpr const DWORD kernelMessageBufferSize = 0x10000;
5050

0 commit comments

Comments
 (0)