https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5cad040726bdf83e87475…
commit 5cad040726bdf83e87475ead7f15f2a6c0614cb5
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Fri Nov 19 02:12:23 2021 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Nov 19 02:22:15 2021 +0100
[FDEBUG] Switch to ZeroMemory() from memset().
---
boot/freeldr/fdebug/fdebug.c | 12 ++++++------
boot/freeldr/fdebug/rs232.c | 9 +++++----
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/boot/freeldr/fdebug/fdebug.c b/boot/freeldr/fdebug/fdebug.c
index 25ecd406e0d..a64581e78de 100644
--- a/boot/freeldr/fdebug/fdebug.c
+++ b/boot/freeldr/fdebug/fdebug.c
@@ -98,7 +98,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
- wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.cbSize = sizeof(wcex);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
@@ -170,9 +170,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam)
hEditWnd = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"),
TEXT(""), WS_CHILD|WS_VISIBLE|WS_VSCROLL|ES_AUTOHSCROLL|ES_LEFT|ES_MULTILINE, 0,
0, 0, 0, hWnd, NULL, hInst, NULL);
hDisplayWnd = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"),
TEXT(""), WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|ES_MULTILINE, 0, 0, 0, 0,
hWnd, NULL, hInst, NULL);
- memset(&ncm, 0, sizeof(NONCLIENTMETRICS));
- ncm.cbSize = sizeof(NONCLIENTMETRICS);
- SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm,
0);
+ ZeroMemory(&ncm, sizeof(ncm));
+ ncm.cbSize = sizeof(ncm);
+ SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
hFont = CreateFontIndirect(&ncm.lfMessageFont);
@@ -382,8 +382,8 @@ INT_PTR CALLBACK CaptureDialogProc(HWND hDlg, UINT message, WPARAM
wParam, LPARA
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE)
{
- memset(&ofn, 0, sizeof(OPENFILENAME));
- ofn.lStructSize = sizeof(OPENFILENAME);
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hDlg;
ofn.hInstance = hInst;
ofn.lpstrFilter = NULL;
diff --git a/boot/freeldr/fdebug/rs232.c b/boot/freeldr/fdebug/rs232.c
index 8c627415391..095d871bd5d 100644
--- a/boot/freeldr/fdebug/rs232.c
+++ b/boot/freeldr/fdebug/rs232.c
@@ -98,7 +98,8 @@ BOOL Rs232ConfigurePortWin32(TCHAR* DeviceControlString)
DCB dcb;
DWORD ErrorCode;
- /*if (!GetCommState(hPortHandle, &dcb))
+#if 0
+ if (!GetCommState(hPortHandle, &dcb))
{
ErrorCode = GetLastError();
@@ -124,10 +125,10 @@ BOOL Rs232ConfigurePortWin32(TCHAR* DeviceControlString)
dcb.fDsrSensitivity = FALSE;
dcb.fRtsControl = RTS_CONTROL_DISABLE;
dcb.fOutxCtsFlow = FALSE;
- dcb.fOutxCtsFlow = FALSE;*/
-
+ dcb.fOutxCtsFlow = FALSE;
+#endif
- memset(&dcb, 0, sizeof(DCB));
+ ZeroMemory(&dcb, sizeof(dcb));
dcb.DCBlength = sizeof(dcb);
if (!BuildCommDCB(DeviceControlString, &dcb))
{