ReactOS 0.4.16-dev-1151-g3842b59
evtdetctl.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Event Log Viewer
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Event Details Control.
5 * COPYRIGHT: Copyright 2007 Marc Piulachs <marc.piulachs@codexchange.net>
6 * Copyright 2008-2016 Eric Kohl <eric.kohl@reactos.org>
7 * Copyright 2016-2025 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10#include "eventvwr.h"
11#include "evtdetctl.h"
12
13#include <shellapi.h>
14
24#define COPY_EVTTEXT_SPACE_PADDING_MODE
25
26// FIXME:
27#define EVENT_MESSAGE_EVENTTEXT_BUFFER (1024*10)
28extern WCHAR szTitle[];
29extern HWND hwndListView;
30
31extern BOOL
36 _Out_writes_z_(cchText) PWSTR EventText,
38
39
40typedef struct _DETAILDATA
41{
42 /* The event record being displayed */
44
45 /* Data initialized from EVENTDETAIL_INFO */
48
51
56
57
58static
59VOID
61 _In_ HWND hDlg,
62 _In_ PDETAILDATA pDetailData);
63
64static
65VOID
67 _In_ HWND hDlg,
68 _In_ PDETAILDATA pDetailData)
69{
70 /* Mapping of ListView column index to corresponding dialog control ID */
71 static const WORD lvColsToDlgItemIDs[] =
72 {
76 };
77
78 PEVENTLOGRECORD pevlr;
79 PEVENTLOGFILTER EventLogFilter = pDetailData->EventLogFilter;
80 INT iItem = pDetailData->iEventItem;
81 USHORT i;
82 BOOL bEventData;
83
84 WCHAR szSource[MAX_PATH];
86
87 /* Retrieve and cache the pointer to the selected event item */
88 LVITEMW li;
89 li.mask = LVIF_PARAM;
90 li.iItem = iItem;
91 li.iSubItem = 0;
93 pevlr = pDetailData->pevlr = (PEVENTLOGRECORD)li.lParam;
94
95 for (i = 0; i < _countof(lvColsToDlgItemIDs); ++i)
96 {
97 PWSTR pszBuffer = szEventText;
98 if (lvColsToDlgItemIDs[i] == IDC_EVENTSOURCESTATIC)
99 {
100 /* Use a separate buffer to store the source; used below */
101 pszBuffer = szSource;
103 szSource, _countof(szSource));
104 }
105 else
106 {
108 szEventText, _countof(szEventText));
109 }
110 SetDlgItemTextW(hDlg, lvColsToDlgItemIDs[i], pszBuffer);
111 }
112
113 bEventData = (pevlr->DataLength > 0);
114 EnableDlgItem(hDlg, IDC_BYTESRADIO, bEventData);
115 EnableDlgItem(hDlg, IDC_WORDSRADIO, bEventData);
116
117 // FIXME: At the moment we support only one event log in the filter
118 GetEventMessage(EventLogFilter->EventLogs[0]->LogName, szSource, pevlr,
119 szEventText, _countof(szEventText));
120 SetDlgItemTextW(hDlg, IDC_EVENTTEXTEDIT, szEventText);
121
122 DisplayEventData(hDlg, pDetailData);
123}
124
125static
126UINT
128{
129 PWCHAR p = pBuffer;
130 UINT n, i, r = 0;
131
132 if (uOffset != 0)
133 {
134 n = swprintf(p, L"\r\n");
135 p += n;
136 r += n;
137 }
138
139 n = swprintf(p, L"%04lx:", uOffset);
140 p += n;
141 r += n;
142
143 for (i = 0; i < uLength; i++)
144 {
145 n = swprintf(p, L" %02x", pData[i]);
146 p += n;
147 r += n;
148 }
149
150 for (i = 0; i < 9 - uLength; i++)
151 {
152 n = swprintf(p, L" ");
153 p += n;
154 r += n;
155 }
156
157 for (i = 0; i < uLength; i++)
158 {
159 // NOTE: Normally iswprint should return FALSE for tabs...
160 n = swprintf(p, L"%c", (iswprint(pData[i]) && (pData[i] != L'\t')) ? pData[i] : L'.');
161 p += n;
162 r += n;
163 }
164
165 return r;
166}
167
168static
169UINT
171{
172 PWCHAR p = pBuffer;
173 UINT n, i, r = 0;
174
175 if (uOffset != 0)
176 {
177 n = swprintf(p, L"\r\n");
178 p += n;
179 r += n;
180 }
181
182 n = swprintf(p, L"%04lx:", uOffset);
183 p += n;
184 r += n;
185
186 for (i = 0; i < uLength / sizeof(ULONG); i++)
187 {
188 n = swprintf(p, L" %08lx", pData[i]);
189 p += n;
190 r += n;
191 }
192
193 /* Display the remaining bytes if uLength was not a multiple of sizeof(ULONG) */
194 for (i = (uLength / sizeof(ULONG)) * sizeof(ULONG); i < uLength; i++)
195 {
196 n = swprintf(p, L" %02x", ((PBYTE)pData)[i]);
197 p += n;
198 r += n;
199 }
200
201 return r;
202}
203
204static
205VOID
207 _In_ HWND hDlg,
208 _In_ PDETAILDATA pDetailData)
209{
210 PEVENTLOGRECORD pevlr = pDetailData->pevlr;
211 BOOL bDisplayWords = pDetailData->bDisplayWords;
212
214 UINT i, uOffset;
215 UINT uBufferSize, uLineLength;
216 PWCHAR pTextBuffer, pLine;
217
218 if (!pevlr)
219 return;
220
221 if (pevlr->DataLength == 0)
222 {
224 return;
225 }
226
227 if (bDisplayWords)
228 uBufferSize = ((pevlr->DataLength / 8) + 1) * 26 * sizeof(WCHAR);
229 else
230 uBufferSize = ((pevlr->DataLength / 8) + 1) * 43 * sizeof(WCHAR);
231
232 pTextBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, uBufferSize);
233 if (!pTextBuffer)
234 return;
235
236 pLine = pTextBuffer;
237 uOffset = 0;
238
239 for (i = 0; i < pevlr->DataLength / 8; i++)
240 {
241 pData = (LPBYTE)((LPBYTE)pevlr + pevlr->DataOffset + uOffset);
242
243 if (bDisplayWords)
244 uLineLength = PrintWordDataLine(pLine, uOffset, (PULONG)pData, 8);
245 else
246 uLineLength = PrintByteDataLine(pLine, uOffset, pData, 8);
247 pLine = pLine + uLineLength;
248
249 uOffset += 8;
250 }
251
252 if (pevlr->DataLength % 8 != 0)
253 {
254 pData = (LPBYTE)((LPBYTE)pevlr + pevlr->DataOffset + uOffset);
255
256 if (bDisplayWords)
257 PrintWordDataLine(pLine, uOffset, (PULONG)pData, pevlr->DataLength % 8);
258 else
259 PrintByteDataLine(pLine, uOffset, pData, pevlr->DataLength % 8);
260 }
261
262 SetDlgItemTextW(hDlg, IDC_EVENTDATAEDIT, pTextBuffer);
263
264 HeapFree(GetProcessHeap(), 0, pTextBuffer);
265}
266
267#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
268
269static inline
270int my_cType3ToWidth(WORD wType, wchar_t ucs)
271{
272 if (wType & C3_HALFWIDTH)
273 return 1;
274 else if (wType & (C3_FULLWIDTH | C3_KATAKANA | C3_HIRAGANA | C3_IDEOGRAPH))
275 return 2;
276 /*
277 * HACK for Wide Hangul characters not recognized by GetStringTypeW(CT_CTYPE3)
278 * See:
279 * https://unicode.org/reports/tr11/
280 * https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
281 * https://www.unicode.org/Public/UCD/latest/ucd/extracted/DerivedEastAsianWidth.txt
282 * (or the /Public/UNIDATA/ files)
283 */
284 else if ((ucs >= 0x1100 && ucs <= 0x115F) || (ucs >= 0x302E && ucs <= 0x302F) ||
285 (ucs >= 0x3131 && ucs <= 0x318E) || (ucs >= 0x3260 && ucs <= 0x327F) ||
286 (ucs >= 0xA960 && ucs <= 0xA97C) || (ucs >= 0xAC00 && ucs <= 0xD7A3))
287 return 2;
288 else if (wType & (C3_SYMBOL | C3_KASHIDA | C3_LEXICAL | C3_ALPHA))
289 return 1;
290 else // if (wType & (C3_NONSPACING | C3_DIACRITIC | C3_VOWELMARK | C3_HIGHSURROGATE | C3_LOWSURROGATE | C3_NOTAPPLICABLE))
291 return 0;
292}
293
294int my_wcwidth(wchar_t ucs)
295{
296 WORD wType = 0;
297 GetStringTypeW(CT_CTYPE3, &ucs, sizeof(ucs)/sizeof(WCHAR), &wType);
298 return my_cType3ToWidth(wType, ucs);
299}
300
301int my_wcswidth(const wchar_t *pwcs, size_t n)
302{
303 int width = 0;
304 PWORD pwType, pwt;
305
306 pwType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, n * sizeof(WORD));
307 if (!pwType)
308 return 0;
309 if (!GetStringTypeW(CT_CTYPE3, pwcs, n, pwType))
310 goto Quit;
311
312 for (pwt = pwType; n-- > 0; ++pwt, ++pwcs)
313 {
314 width += my_cType3ToWidth(*pwt, *pwcs);
315 }
316Quit:
317 HeapFree(GetProcessHeap(), 0, pwType);
318 return width;
319}
320
321#endif // COPY_EVTTEXT_SPACE_PADDING_MODE
322
354static
355VOID
357 _In_ HWND hWnd)
358{
359#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
360 static const LONG nTabWidth = 4;
361#endif
362 static const WCHAR szCRLF[] = L"\r\n";
363 struct
364 {
365 WORD uHdrID; // Header string resource ID.
366 WORD nDlgItemID; // Dialog control ID containing the corresponding info.
367 WORD bSameLine : 1; // Info follows header on same line (TRUE) or not (FALSE).
368 WORD bOptional : 1; // Omit if info is empty (TRUE) or keep it (FALSE).
369 PCWCH pchHdrText; // Pointer to header string resource.
370 SIZE_T cchHdrLen; // Header string length (number of characters).
371 SIZE_T cchInfoLen; // Info string length (number of characters).
372#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
373 UINT nHdrWidth; // Display width of the header string.
374 UINT nSpacesPad; // Padding after header in number of spaces.
375#endif
376 } CopyData[] =
377 {
388 };
389 USHORT i;
390#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
391 BOOL bUsePad; // Use space padding (TRUE) or not (FALSE, default).
392 UINT nMaxHdrWidth = 0;
393#endif
394 SIZE_T size = 0;
395 PWSTR output;
396 PWSTR pszDestEnd;
397 size_t cchRemaining;
398 HGLOBAL hMem;
399
400 /* Try to open the clipboard */
401 if (!OpenClipboard(hWnd))
402 return;
403
404#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
405 /* Use space padding only if the user presses SHIFT */
406 bUsePad = !!(GetKeyState(VK_SHIFT) & 0x8000);
407#endif
408
409 /*
410 * Grab all the information and get it ready for the clipboard.
411 */
412
413 /* Calculate the necessary string buffer size */
414 for (i = 0; i < _countof(CopyData); ++i)
415 {
416 /* Retrieve the event info string length (without NUL terminator) */
417 CopyData[i].cchInfoLen = GetWindowTextLengthW(GetDlgItem(hWnd, CopyData[i].nDlgItemID));
418
419 /* If no data is present and is optional, ignore it */
420 if ((CopyData[i].cchInfoLen == 0) && CopyData[i].bOptional)
421 continue;
422
423 /* Load the header string from resources */
424 CopyData[i].cchHdrLen = LoadStringW(hInst, CopyData[i].uHdrID, (PWSTR)&CopyData[i].pchHdrText, 0);
425 size += CopyData[i].cchHdrLen;
426
427 if (CopyData[i].bSameLine)
428 {
429 /* The header and info are on the same line */
430#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
431 if (bUsePad)
432 {
433 /* Retrieve the maximum header string displayed
434 * width for computing space padding later */
435 CopyData[i].nHdrWidth = my_wcswidth(CopyData[i].pchHdrText, CopyData[i].cchHdrLen);
436 nMaxHdrWidth = max(nMaxHdrWidth, CopyData[i].nHdrWidth);
437 }
438 else
439#endif
440 {
441 /* Count a TAB separator */
442 size++;
443 }
444 }
445 else
446 {
447 /* The data is on a separate line, count a newline */
448 size += _countof(szCRLF)-1;
449 }
450
451 /* Count the event info string and the newline that follows it */
452 size += CopyData[i].cchInfoLen;
453 size += _countof(szCRLF)-1;
454 }
455#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
456 if (bUsePad)
457 {
458 /* Round nMaxHdrWidth to the next TAB width, and
459 * compute the space padding for each field */
460 UINT nSpaceWidth = 1; // my_wcwidth(L' ');
461 nMaxHdrWidth = ((nMaxHdrWidth / nTabWidth) + 1) * nTabWidth;
462 for (i = 0; i < _countof(CopyData); ++i)
463 {
464 /* If no data is present and is optional, ignore it */
465 if ((CopyData[i].cchInfoLen == 0) && CopyData[i].bOptional)
466 continue;
467
468 /* If the data is on a separate line, ignore padding */
469 if (!CopyData[i].bSameLine)
470 continue;
471
472 /* Compute the padding */
473 CopyData[i].nSpacesPad = (nMaxHdrWidth - CopyData[i].nHdrWidth) / nSpaceWidth;
474 size += CopyData[i].nSpacesPad;
475 }
476 }
477#endif // COPY_EVTTEXT_SPACE_PADDING_MODE
478 /* Add NUL-termination */
479 size++;
480
481 /*
482 * Consolidate the information into a single buffer to copy in the clipboard.
483 */
484 hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, size * sizeof(WCHAR));
485 if (!hMem)
486 goto Quit;
487
488 output = GlobalLock(hMem);
489 if (!output)
490 {
491 GlobalFree(hMem);
492 goto Quit;
493 }
494
495 /* Build the string */
496 pszDestEnd = output;
497 cchRemaining = size;
498 for (i = 0; i < _countof(CopyData); ++i)
499 {
500 SIZE_T sizeDataStr;
501
502 /* If no data is present and is optional, ignore it */
503 if ((CopyData[i].cchInfoLen == 0) && CopyData[i].bOptional)
504 continue;
505
506 /* Copy the header string */
507 StringCchCopyNExW(pszDestEnd, cchRemaining,
508 CopyData[i].pchHdrText, CopyData[i].cchHdrLen,
509 &pszDestEnd, &cchRemaining, 0);
510
511 if (CopyData[i].bSameLine)
512 {
513 /* The header and info are on the same line, add
514 * either the space padding or the TAB separator */
515#ifdef COPY_EVTTEXT_SPACE_PADDING_MODE
516 if (bUsePad)
517 {
518 UINT j = CopyData[i].nSpacesPad;
519 while (j--)
520 {
521 *pszDestEnd++ = L' ';
522 cchRemaining--;
523 }
524 }
525 else
526#endif
527 {
528 *pszDestEnd++ = L'\t';
529 cchRemaining--;
530 }
531 }
532 else
533 {
534 /* The data is on a separate line, add a newline */
535 StringCchCopyExW(pszDestEnd, cchRemaining, szCRLF,
536 &pszDestEnd, &cchRemaining, 0);
537 }
538
539 /* Copy the event info */
540 sizeDataStr = min(cchRemaining, CopyData[i].cchInfoLen + 1);
541 sizeDataStr = GetDlgItemTextW(hWnd, CopyData[i].nDlgItemID, pszDestEnd, sizeDataStr);
542 pszDestEnd += sizeDataStr;
543 cchRemaining -= sizeDataStr;
544
545 /* A newline follows the data */
546 StringCchCopyExW(pszDestEnd, cchRemaining, szCRLF,
547 &pszDestEnd, &cchRemaining, 0);
548 }
549 /* NUL-terminate the buffer */
550 *pszDestEnd++ = UNICODE_NULL;
551 cchRemaining--;
552
553 GlobalUnlock(hMem);
554
555 /* We succeeded, empty the clipboard and write the data in it */
558
559Quit:
560 /* Close the clipboard once we are done with it */
562}
563
564static
565VOID
566OnLink(HWND hDlg, ENLINK* penLink)
567{
568 LPWSTR pLink;
569 TEXTRANGE txtRange;
570
572
573 /* Only act on left button up events */
574 if (penLink->msg != WM_LBUTTONUP)
575 return;
576
577 /* If the range is empty, do nothing */
578 if (penLink->chrg.cpMin == penLink->chrg.cpMax)
579 return;
580
581 /* Allocate memory for the text link */
583 (max(penLink->chrg.cpMin, penLink->chrg.cpMax) -
584 min(penLink->chrg.cpMin, penLink->chrg.cpMax) + 1) * sizeof(WCHAR));
585 if (!pLink)
586 {
587 /* Not enough memory, bail out */
588 return;
589 }
590
591 txtRange.chrg = penLink->chrg;
592 txtRange.lpstrText = pLink;
594
595 /* Open the link */
596 ShellExecuteW(hDlg, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
597
598 /* Free the buffer */
599 HeapFree(GetProcessHeap(), 0, pLink);
600}
601
602static
603VOID
604OnScroll(HWND hDlg, PDETAILDATA pData, INT nBar, WORD sbCode)
605{
606 RECT rect;
607
608 SCROLLINFO sInfo;
609 INT oldPos, Maximum;
610 PLONG pOriginXY;
611
612 ASSERT(nBar == SB_HORZ || nBar == SB_VERT);
613
614 GetClientRect(hDlg, &rect);
615
616 if (nBar == SB_HORZ)
617 {
618 Maximum = pData->cxMin - (rect.right-rect.left) /* pData->cxOld */;
619 pOriginXY = &pData->scPos.x;
620 }
621 else // if (nBar == SB_VERT)
622 {
623 Maximum = pData->cyMin - (rect.bottom-rect.top) /* pData->cyOld */;
624 pOriginXY = &pData->scPos.y;
625 }
626
627 /* Set scrollbar sizes */
628 sInfo.cbSize = sizeof(sInfo);
630
631 if (!GetScrollInfo(hDlg, nBar, &sInfo))
632 return;
633
634 oldPos = sInfo.nPos;
635
636 switch (sbCode)
637 {
638 case SB_LINEUP: // SB_LINELEFT:
639 sInfo.nPos--;
640 break;
641
642 case SB_LINEDOWN: // SB_LINERIGHT:
643 sInfo.nPos++;
644 break;
645
646 case SB_PAGEUP: // SB_PAGELEFT:
647 sInfo.nPos -= sInfo.nPage;
648 break;
649
650 case SB_PAGEDOWN: // SB_PAGERIGHT:
651 sInfo.nPos += sInfo.nPage;
652 break;
653
654 case SB_THUMBTRACK:
655 sInfo.nPos = sInfo.nTrackPos;
656 break;
657
658 case SB_THUMBPOSITION:
659 sInfo.nPos = sInfo.nTrackPos;
660 break;
661
662 case SB_TOP: // SB_LEFT:
663 sInfo.nPos = sInfo.nMin;
664 break;
665
666 case SB_BOTTOM: // SB_RIGHT:
667 sInfo.nPos = sInfo.nMax;
668 break;
669
670 default:
671 break;
672 }
673
674 sInfo.nPos = min(max(sInfo.nPos, 0), Maximum);
675
676 if (oldPos != sInfo.nPos)
677 {
678 POINT scOldPos = pData->scPos;
679
680 /* We now modify pData->scPos */
681 *pOriginXY = sInfo.nPos;
682
683 ScrollWindowEx(hDlg,
684 (scOldPos.x - pData->scPos.x),
685 (scOldPos.y - pData->scPos.y),
686 NULL,
687 NULL,
688 NULL,
689 NULL,
691
692 sInfo.fMask = SIF_POS;
693 SetScrollInfo(hDlg, nBar, &sInfo, TRUE);
694
695 // UpdateWindow(hDlg);
696 }
697}
698
699static
700VOID
702{
703 LONG_PTR dwStyle;
704 INT sbVXSize, sbHYSize;
705 SCROLLINFO sInfo;
706 POINT scOldPos;
707 HDWP hdwp;
708 HWND hItemWnd;
709 RECT rect;
710 INT y = 0;
711
712 if (!pData)
713 return;
714
715 dwStyle = GetWindowLongPtrW(hDlg, GWL_STYLE);
716 sbVXSize = GetSystemMetrics(SM_CXVSCROLL);
717 sbHYSize = GetSystemMetrics(SM_CYHSCROLL);
718
719 /* Compensate for existing scroll bars (because lParam values do not accommodate scroll bar) */
720 if (dwStyle & WS_HSCROLL) cy += sbHYSize; // Window currently has a horizontal scrollbar
721 if (dwStyle & WS_VSCROLL) cx += sbVXSize; // Window currently has a vertical scrollbar
722
723 /* Compensate for added scroll bars in window */
724 if (cx < pData->cxMin) cy -= sbHYSize; // Window will have a horizontal scroll bar
725 if (cy < pData->cyMin) cx -= sbVXSize; // Window will have a vertical scroll bar
726
727 /* Set scrollbar sizes */
728 sInfo.cbSize = sizeof(sInfo);
729
730 sInfo.fMask = SIF_POS;
731 if (GetScrollInfo(hDlg, SB_VERT, &sInfo))
732 scOldPos.y = sInfo.nPos;
733 else
734 scOldPos.y = pData->scPos.y;
735
736 sInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
737 sInfo.nMin = 0;
738 if (pData->cyMin > cy)
739 {
740 sInfo.nMax = pData->cyMin - 1;
741 sInfo.nPage = cy;
742 sInfo.nPos = pData->scPos.y;
743 SetScrollInfo(hDlg, SB_VERT, &sInfo, TRUE);
744
745 /* Display the scrollbar if needed */
746 if (!(dwStyle & WS_VSCROLL))
747 ShowScrollBar(hDlg, SB_VERT, TRUE);
748 }
749 else
750 {
751 scOldPos.y = 0;
752
753 sInfo.nMax = pData->cyMin - 1;
754 sInfo.nPage = cy;
755 sInfo.nPos = pData->scPos.y;
756 sInfo.nPos = scOldPos.y;
757 SetScrollInfo(hDlg, SB_VERT, &sInfo, TRUE);
758
760
761 rect.left = cx - sbVXSize;
762 rect.right = cx;
763 rect.top = 0;
764 rect.bottom = cy;
765 InvalidateRect(hDlg, &rect, TRUE);
766 }
767
768 sInfo.fMask = SIF_POS;
769 if (GetScrollInfo(hDlg, SB_HORZ, &sInfo))
770 scOldPos.x = sInfo.nPos;
771 else
772 scOldPos.x = pData->scPos.x;
773
774 sInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
775 sInfo.nMin = 0;
776 if (pData->cxMin > cx)
777 {
778 sInfo.nMax = pData->cxMin - 1;
779 sInfo.nPage = cx;
780 sInfo.nPos = pData->scPos.x;
781 SetScrollInfo(hDlg, SB_HORZ, &sInfo, TRUE);
782
783 /* Display the scrollbar if needed */
784 if (!(dwStyle & WS_HSCROLL))
785 ShowScrollBar(hDlg, SB_HORZ, TRUE);
786 }
787 else
788 {
789 scOldPos.x = 0;
790
791 sInfo.nMax = pData->cxMin - 1;
792 sInfo.nPage = cx;
793 sInfo.nPos = pData->scPos.x;
794 sInfo.nPos = scOldPos.x;
795 SetScrollInfo(hDlg, SB_HORZ, &sInfo, TRUE);
796
798
799 rect.left = 0;
800 rect.right = cx;
801 rect.top = cy - sbHYSize;
802 rect.bottom = cy;
803 InvalidateRect(hDlg, &rect, TRUE);
804 }
805
806 if ((scOldPos.x != pData->scPos.x) || (scOldPos.y != pData->scPos.y))
807 {
808 ScrollWindowEx(hDlg,
809 // (scOldPos.x - pData->scPos.x),
810 (pData->scPos.x - scOldPos.x),
811 // (scOldPos.y - pData->scPos.y),
812 (pData->scPos.y - scOldPos.y),
813 NULL,
814 NULL,
815 NULL,
816 NULL,
818
819 pData->scPos = scOldPos;
820 }
821
822 // /* Adjust the start of the visible area if we are attempting to show nonexistent areas */
823 // if ((pData->cxMin - pData->scPos.x) < cx) pData->scPos.x = pData->cxMin - cx;
824 // if ((pData->cyMin - pData->scPos.y) < cy) pData->scPos.y = pData->cyMin - cy;
825 // // InvalidateRect(GuiData->hWindow, NULL, TRUE);
826
827 /* Forbid resizing the control smaller than its minimal size */
828 if (cx < pData->cxMin) cx = pData->cxMin;
829 if (cy < pData->cyMin) cy = pData->cyMin;
830
831 if ((cx != pData->cxOld) || (cy != pData->cyOld))
832 {
833 hdwp = BeginDeferWindowPos(8);
834
835 /* Move the edit boxes */
836
837 GetWindowRect(hDlg, &rect);
838
839 hItemWnd = GetDlgItem(hDlg, IDC_EVENTTEXTEDIT);
840 GetWindowRect(hItemWnd, &rect);
841 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
842 // OffsetRect(&rect, 0, y);
843 // y += (cy - pData->cyOld) / 2 ; // + (cy - pData->cyOld) % 2;
845 if (cy >= pData->cyOld)
846 y += (cy - pData->cyOld) / 2 + (cy - pData->cyOld) % 2;
847 else
848 y -= (pData->cyOld - cy) / 2 + (pData->cyOld - cy) % 2;
849
850 if (hdwp)
851 hdwp = DeferWindowPos(hdwp,
852 hItemWnd,
853 0,
854 rect.left, rect.top,
855 (rect.right - rect.left) + (cx - pData->cxOld),
856 (rect.bottom - rect.top) + y, SWP_NOZORDER | SWP_NOACTIVATE);
858
859 hItemWnd = GetDlgItem(hDlg, IDC_DETAILS_STATIC);
860 GetWindowRect(hItemWnd, &rect);
861 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
862 // OffsetRect(&rect, 0, y);
863
864 if (hdwp)
865 hdwp = DeferWindowPos(hdwp,
866 hItemWnd,
867 0,
868 rect.left, rect.top + y,
869 0, 0,
871
872 hItemWnd = GetDlgItem(hDlg, IDC_BYTESRADIO);
873 GetWindowRect(hItemWnd, &rect);
874 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
875 // OffsetRect(&rect, 0, y);
876
877 if (hdwp)
878 hdwp = DeferWindowPos(hdwp,
879 hItemWnd,
880 0,
881 rect.left, rect.top + y,
882 0, 0,
884
885 hItemWnd = GetDlgItem(hDlg, IDC_WORDSRADIO);
886 GetWindowRect(hItemWnd, &rect);
887 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
888 // OffsetRect(&rect, 0, y);
889
890 if (hdwp)
891 hdwp = DeferWindowPos(hdwp,
892 hItemWnd,
893 0,
894 rect.left, rect.top + y,
895 0, 0,
897
898 hItemWnd = GetDlgItem(hDlg, IDC_EVENTDATAEDIT);
899 GetWindowRect(hItemWnd, &rect);
900 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
901 // OffsetRect(&rect, 0, y);
902 // // y -= (cy - pData->cyOld) % 2;
903
904 if (hdwp)
905 hdwp = DeferWindowPos(hdwp,
906 hItemWnd,
907 0,
908 rect.left, rect.top + y,
909 (rect.right - rect.left) + (cx - pData->cxOld),
910 (rect.bottom - rect.top) + y,
912
913 /* Move the buttons */
914
915 hItemWnd = GetDlgItem(hDlg, IDC_PREVIOUS);
916 GetWindowRect(hItemWnd, &rect);
917 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
918
919 if (hdwp)
920 hdwp = DeferWindowPos(hdwp,
921 hItemWnd,
922 0,
923 rect.left + (cx - pData->cxOld),
924 rect.top,
925 0, 0,
927
928 hItemWnd = GetDlgItem(hDlg, IDC_NEXT);
929 GetWindowRect(hItemWnd, &rect);
930 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
931
932 if (hdwp)
933 hdwp = DeferWindowPos(hdwp,
934 hItemWnd,
935 0,
936 rect.left + (cx - pData->cxOld),
937 rect.top,
938 0, 0,
940
941 hItemWnd = GetDlgItem(hDlg, IDC_COPY);
942 GetWindowRect(hItemWnd, &rect);
943 MapWindowPoints(HWND_DESKTOP /*NULL*/, hDlg, (LPPOINT)&rect, sizeof(RECT)/sizeof(POINT));
944
945 if (hdwp)
946 hdwp = DeferWindowPos(hdwp,
947 hItemWnd,
948 0,
949 rect.left + (cx - pData->cxOld),
950 rect.top,
951 0, 0,
953
954 if (hdwp)
955 EndDeferWindowPos(hdwp);
956
957 pData->cxOld = cx;
958 pData->cyOld = cy;
959 }
960}
961
962static
963VOID
965 _In_ HWND hDlg,
967{
968 /* Enable Previous/Next only if there is more than one item in the list */
969 if (bEnable)
973}
974
975static
976VOID
978 _In_ HWND hDlg)
979{
980 /* Disable the Previous/Next and Copy buttons */
983
984 /* Disable the Bytes/Words mode buttons */
987
988 /* Clear the data fields */
997
1000}
1001
1002static
1003HFONT
1005{
1006 LOGFONTW tmpFont = {0};
1007 HFONT hFont;
1008 HDC hDC;
1009
1010 hDC = GetDC(NULL);
1011
1012 tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDC, LOGPIXELSY), 72);
1013 tmpFont.lfWeight = FW_NORMAL;
1014 wcscpy(tmpFont.lfFaceName, L"Courier New");
1015
1016 hFont = CreateFontIndirectW(&tmpFont);
1017
1018 ReleaseDC(NULL, hDC);
1019
1020 return hFont;
1021}
1022
1023static
1024VOID
1026{
1027 DWORD dwMask;
1028
1032
1036
1037 /* Set the default read-only RichEdit color */
1039
1040 /* Enable RichEdit coloured and underlined links */
1043
1044 /*
1045 * Activate automatic URL recognition by the RichEdit control. For more information, see:
1046 * https://learn.microsoft.com/en-us/archive/blogs/murrays/automatic-richedit-hyperlinks
1047 * https://learn.microsoft.com/en-us/archive/blogs/murrays/richedit-friendly-name-hyperlinks
1048 * https://learn.microsoft.com/en-us/windows/win32/controls/em-autourldetect
1049 */
1050 SendDlgItemMessageW(hDlg, IDC_EVENTTEXTEDIT, EM_AUTOURLDETECT, AURL_ENABLEURL /* | AURL_ENABLEEAURLS */, 0);
1051
1052 /* Note that the RichEdit control never gets themed under WinXP+; one would have to write code to simulate Edit-control theming */
1053
1056
1057 //ClearContents(hDlg);
1058 if (pData->iEventItem != -1)
1059 {
1061 EnableDlgItem(hDlg, IDC_COPY, TRUE);
1062 }
1063 else
1064 {
1067 }
1070}
1071
1072/* Message handler for Event Details control */
1073static
1076{
1078
1080
1081 switch (uMsg)
1082 {
1083 case WM_INITDIALOG:
1084 {
1085 RECT rect;
1086
1088 if (!pData)
1089 {
1090 EndDialog(hDlg, 0);
1091 return (INT_PTR)TRUE;
1092 }
1094
1095 if (lParam != 0)
1096 {
1098 pData->EventLogFilter = DetailInfo->EventLogFilter;
1099 pData->iEventItem = DetailInfo->iEventItem;
1100 }
1101 else
1102 {
1103 pData->iEventItem = -1;
1104 }
1105
1106 pData->bDisplayWords = FALSE;
1107 pData->hMonospaceFont = CreateMonospaceFont();
1108
1109 GetClientRect(hDlg, &rect);
1110 pData->cxOld = pData->cxMin = rect.right - rect.left;
1111 pData->cyOld = pData->cyMin = rect.bottom - rect.top;
1112 pData->scPos.x = pData->scPos.y = 0;
1113
1115 /* NOTE: Showing the event (if any) is currently delayed to later */
1116 // SendMessageW(hDlg, EVT_DISPLAY, TRUE, (LPARAM)pData->iEventItem);
1117
1118 // OnSize(hDlg, pData, pData->cxOld, pData->cyOld);
1119 return (INT_PTR)TRUE;
1120 }
1121
1122 case WM_DESTROY:
1123 if (pData)
1124 {
1125 if (pData->hMonospaceFont)
1126 DeleteObject(pData->hMonospaceFont);
1128 }
1129 return (INT_PTR)TRUE;
1130
1131 case EVT_SETFILTER:
1132 {
1133 /* Disable the display first, before changing the current filter */
1134 pData->pevlr = NULL;
1135 pData->iEventItem = -1;
1136 ClearContents(hDlg);
1137 pData->EventLogFilter = (PEVENTLOGFILTER)lParam;
1138 return (INT_PTR)TRUE;
1139 }
1140
1141 case EVT_DISPLAY:
1142 {
1143 if (wParam)
1144 {
1145 INT iEventItem = (INT)lParam;
1146
1147 /* If no filter is set, don't change anything */
1148 if (!pData->EventLogFilter)
1149 return (INT_PTR)TRUE;
1150
1151 /* If we re-enable display from previously disabled state, re-enable the buttons */
1152 if ((pData->iEventItem == -1) && (iEventItem != -1))
1153 {
1155 EnableDlgItem(hDlg, IDC_COPY, TRUE);
1156 }
1157 else
1158 /* If we disable display from previously enabled state, clear and disable it */
1159 if ((pData->iEventItem != -1) && (iEventItem == -1))
1160 {
1161 ClearContents(hDlg);
1162 }
1163
1164 /* Set the new item */
1165 pData->pevlr = NULL;
1166 pData->iEventItem = iEventItem;
1167
1168 /* Display the event info, if there is one */
1169 if (pData->iEventItem != -1)
1170 DisplayEvent(hDlg, pData);
1171 }
1172 else
1173 {
1174 /* Enable or disable the Previous/Next buttons,
1175 * but keep the existing contents, if any */
1176 EnableNavigationArrows(hDlg, (lParam != -1));
1177
1178 // HACK: Disable the Bytes/Words mode buttons
1179 // because we won't have access anymore to the
1180 // event data. (This will be fixed in the future.)
1181 pData->pevlr = NULL; // Invalidate also the cache.
1184 }
1185 return (INT_PTR)TRUE;
1186 }
1187
1188 case WM_COMMAND:
1189 switch (LOWORD(wParam))
1190 {
1191 case IDC_PREVIOUS:
1192 case IDC_NEXT:
1193 {
1194 BOOL bPrev = (LOWORD(wParam) == IDC_PREVIOUS);
1196 INT iItem, iSel;
1197
1198 if (nItems <= 0) /* No items? */
1199 break;
1200
1201 /* Get the index of the first selected item */
1203
1204 /* Select the previous/next item from our current one */
1205 iItem = ListView_GetNextItem(hwndListView, iSel,
1206 (bPrev ? LVNI_ABOVE : LVNI_BELOW));
1207 if (iItem < 0 || iItem >= nItems)
1208 {
1209 /* Confirm selection restart only if an item was previously
1210 * selected. If not, just proceed with default selection. */
1211 if (iSel != -1)
1212 {
1213 WCHAR szText[200];
1216 szText, _countof(szText));
1217 if (MessageBoxW(hDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) != IDYES)
1218 break;
1219 }
1220
1221 /* Determine where to restart from */
1222 iItem = (bPrev ? (nItems - 1) : 0);
1223 }
1224
1225 /*
1226 * Deselect the currently selected items in the list view.
1227 * (They may be different from our current one, if multiple
1228 * event details are being displayed concurrently!)
1229 */
1230 iSel = -1;
1231 while ((iSel = ListView_GetNextItem(hwndListView, iSel, LVNI_SELECTED)) != -1)
1232 {
1235 }
1236
1237 /* Select the new item */
1242
1243 pData->pevlr = NULL;
1244 pData->iEventItem = iItem;
1245
1246 /* Display the event info */
1247 if (pData->EventLogFilter)
1248 DisplayEvent(hDlg, pData);
1249 return (INT_PTR)TRUE;
1250 }
1251
1252 case IDC_COPY:
1253 if (pData->EventLogFilter)
1254 CopyEventEntry(hDlg);
1255 return (INT_PTR)TRUE;
1256
1257 case IDC_BYTESRADIO:
1258 case IDC_WORDSRADIO:
1259 pData->bDisplayWords = (LOWORD(wParam) == IDC_WORDSRADIO);
1260 if (pData->EventLogFilter)
1261 DisplayEventData(hDlg, pData);
1262 return (INT_PTR)TRUE;
1263
1264 default:
1265 break;
1266 }
1267 break;
1268
1269 case WM_NOTIFY:
1270 {
1272
1273 if (hdr->idFrom == IDC_EVENTTEXTEDIT)
1274 {
1275 switch (hdr->code)
1276 {
1277 case EN_LINK:
1278 OnLink(hDlg, (ENLINK*)lParam);
1279 break;
1280 }
1281 }
1282 break;
1283 }
1284
1285 case WM_HSCROLL:
1286 case WM_VSCROLL:
1287 {
1288 OnScroll(hDlg, pData,
1289 (uMsg == WM_HSCROLL) ? SB_HORZ : SB_VERT,
1290 LOWORD(wParam));
1292 return (INT_PTR)TRUE;
1293 }
1294
1295 case WM_SIZE:
1298 return (INT_PTR)TRUE;
1299 }
1300
1301 return (INT_PTR)FALSE;
1302}
1303
1304HWND
1306 HWND hParentWnd,
1307 LPARAM lParam)
1308{
1311 hParentWnd, EventDetailsCtrl, lParam);
1312}
static HDC hDC
Definition: 3dtext.c:33
int nItems
Definition: appswitch.c:56
WCHAR SourceName[256]
Definition: arping.c:28
#define IDC_COPY
Definition: resource.h:17
HWND hWnd
Definition: settings.c:17
#define IDS_COPY_EVTUSER
Definition: resource.h:139
#define IDC_EVENTCOMPUTERSTATIC
Definition: resource.h:46
#define IDD_EVENTDETAILS_CTRL
Definition: resource.h:33
#define IDS_COPY_EVTTEXT
Definition: resource.h:141
#define IDC_EVENTDATESTATIC
Definition: resource.h:39
#define IDS_COPY_EVTCOMP
Definition: resource.h:140
#define IDC_WORDSRADIO
Definition: resource.h:53
#define IDC_EVENTUSERSTATIC
Definition: resource.h:45
#define IDI_PREV
Definition: resource.h:23
#define IDS_COPY_EVTSRC
Definition: resource.h:134
#define IDS_CONTFROMBEGINNING
Definition: resource.h:108
#define IDC_EVENTTYPESTATIC
Definition: resource.h:43
#define IDS_COPY_EVTCAT
Definition: resource.h:135
#define IDS_COPY_EVTTIME
Definition: resource.h:138
#define IDS_COPY_EVTTYPE
Definition: resource.h:133
#define IDC_BYTESRADIO
Definition: resource.h:52
#define IDC_EVENTTIMESTATIC
Definition: resource.h:41
#define IDC_EVENTDATAEDIT
Definition: resource.h:54
#define IDS_CONTFROMEND
Definition: resource.h:109
#define IDC_EVENTSOURCESTATIC
Definition: resource.h:40
#define IDC_PREVIOUS
Definition: resource.h:47
#define IDI_NEXT
Definition: resource.h:22
#define IDC_EVENTCATEGORYSTATIC
Definition: resource.h:42
#define IDS_COPY_EVTDATE
Definition: resource.h:137
#define IDC_EVENTTEXTEDIT
Definition: resource.h:50
#define IDC_DETAILS_STATIC
Definition: resource.h:51
#define IDI_COPY
Definition: resource.h:24
#define IDC_EVENTIDSTATIC
Definition: resource.h:44
#define IDS_COPY_EVTDATA
Definition: resource.h:142
#define IDS_COPY_EVTID
Definition: resource.h:136
#define CF_UNICODETEXT
Definition: constants.h:408
HFONT hFont
Definition: main.c:53
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
wcscpy
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: locale.c:3095
#define szCRLF
Definition: ftp.c:108
#define swprintf
Definition: precomp.h:40
HINSTANCE hInst
Definition: dxdiag.c:13
static INT cxMin
Definition: eventvwr.c:4340
static INT cyMin
Definition: eventvwr.c:4340
#define AURL_ENABLEURL
Definition: eventvwr.h:44
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
struct _EVENTLOGFILTER * PEVENTLOGFILTER
static int my_cType3ToWidth(WORD wType, wchar_t ucs)
Definition: evtdetctl.c:270
static VOID CopyEventEntry(_In_ HWND hWnd)
Retrieves the already-gathered event information, structure it in text format and copy it into the cl...
Definition: evtdetctl.c:356
BOOL GetEventMessage(_In_ PCWSTR KeyName, _In_ PCWSTR SourceName, _In_ PEVENTLOGRECORD pevlr, _Out_writes_z_(cchText) PWSTR EventText, _In_ SIZE_T cchText)
Definition: eventvwr.c:1658
static VOID OnScroll(HWND hDlg, PDETAILDATA pData, INT nBar, WORD sbCode)
Definition: evtdetctl.c:604
static VOID InitDetailsDlgCtrl(HWND hDlg, PDETAILDATA pData)
Definition: evtdetctl.c:1025
static INT_PTR CALLBACK EventDetailsCtrl(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: evtdetctl.c:1075
static HFONT CreateMonospaceFont(VOID)
Definition: evtdetctl.c:1004
int my_wcwidth(wchar_t ucs)
Definition: evtdetctl.c:294
int my_wcswidth(const wchar_t *pwcs, size_t n)
Definition: evtdetctl.c:301
#define EVENT_MESSAGE_EVENTTEXT_BUFFER
Definition: evtdetctl.c:27
struct _DETAILDATA * PDETAILDATA
static VOID DisplayEventData(_In_ HWND hDlg, _In_ PDETAILDATA pDetailData)
Definition: evtdetctl.c:206
static VOID EnableNavigationArrows(_In_ HWND hDlg, _In_ BOOL bEnable)
Definition: evtdetctl.c:964
static VOID OnLink(HWND hDlg, ENLINK *penLink)
Definition: evtdetctl.c:566
static UINT PrintByteDataLine(PWCHAR pBuffer, UINT uOffset, PBYTE pData, UINT uLength)
Definition: evtdetctl.c:127
static UINT PrintWordDataLine(PWCHAR pBuffer, UINT uOffset, PULONG pData, UINT uLength)
Definition: evtdetctl.c:170
static VOID ClearContents(_In_ HWND hDlg)
Definition: evtdetctl.c:977
static VOID DisplayEvent(_In_ HWND hDlg, _In_ PDETAILDATA pDetailData)
Definition: evtdetctl.c:66
WCHAR szTitle[]
Definition: magnifier.c:35
struct _DETAILDATA DETAILDATA
HWND CreateEventDetailsCtrl(HINSTANCE hInstance, HWND hParentWnd, LPARAM lParam)
Definition: evtdetctl.c:1305
HWND hwndListView
Definition: eventvwr.c:66
static VOID OnSize(HWND hDlg, PDETAILDATA pData, INT cx, INT cy)
Definition: evtdetctl.c:701
struct _EVENTDETAIL_INFO * PEVENTDETAIL_INFO
#define EVT_DISPLAY
Definition: evtdetctl.h:21
#define EVT_SETFILTER
Definition: evtdetctl.h:20
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define IDC_NEXT
Definition: fontview.h:17
pKey DeleteObject()
LARGE_INTEGER li
Definition: fxtimerapi.cpp:235
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLdouble n
Definition: glext.h:7729
GLsizeiptr size
Definition: glext.h:5919
GLfloat GLfloat p
Definition: glext.h:8902
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define iswprint(_c)
Definition: ctype.h:672
char hdr[14]
Definition: iptest.cpp:33
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
#define for
Definition: utility.h:88
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define min(a, b)
Definition: monoChain.cc:55
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
unsigned int UINT
Definition: ndis.h:50
#define _Out_writes_z_(s)
Definition: no_sal2.h:180
#define _In_
Definition: no_sal2.h:158
CONST WCHAR * PCWCH
Definition: ntbasedef.h:419
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
WORD * PWORD
Definition: pedump.c:67
BYTE * PBYTE
Definition: pedump.c:66
#define WS_VSCROLL
Definition: pedump.c:627
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define WS_HSCROLL
Definition: pedump.c:628
#define INT
Definition: polytest.cpp:20
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2678
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2689
#define LVNI_BELOW
Definition: commctrl.h:2434
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2439
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2312
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVIF_PARAM
Definition: commctrl.h:2316
#define LVNI_ABOVE
Definition: commctrl.h:2433
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2399
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2524
PVOID pBuffer
#define EM_GETEVENTMASK
Definition: richedit.h:92
#define EM_AUTOURLDETECT
Definition: richedit.h:125
#define ENM_LINK
Definition: richedit.h:485
#define EM_SETEVENTMASK
Definition: richedit.h:102
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define EM_GETTEXTRANGE
Definition: richedit.h:108
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
#define ENM_MOUSEEVENTS
Definition: richedit.h:476
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2529
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:184
STRSAFEAPI StringCchCopyNExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
Definition: strsafe.h:275
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
PEVENTLOGFILTER EventLogFilter
Definition: evtdetctl.c:46
INT iEventItem
Definition: evtdetctl.c:47
PEVENTLOGRECORD pevlr
Definition: evtdetctl.c:43
POINT scPos
Definition: evtdetctl.c:54
BOOL bDisplayWords
Definition: evtdetctl.c:49
HFONT hMonospaceFont
Definition: evtdetctl.c:50
PEVENTLOGFILTER EventLogFilter
Definition: evtdetctl.h:16
PEVENTLOG EventLogs[ANYSIZE_ARRAY]
Definition: eventvwr.h:138
PWSTR LogName
Definition: eventvwr.h:93
LONG cpMax
Definition: richedit.h:501
LONG cpMin
Definition: richedit.h:500
UINT_PTR idFrom
Definition: winuser.h:3169
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define max(a, b)
Definition: svc.c:63
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
int32_t * PLONG
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
_In_z_ const wchar_t * pwcs
Definition: wcstombs.cpp:85
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define GMEM_MOVEABLE
Definition: winbase.h:320
#define GMEM_SHARE
Definition: winbase.h:331
_In_ BOOL bEnable
Definition: winddi.h:3426
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define FW_NORMAL
Definition: wingdi.h:373
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define C3_FULLWIDTH
Definition: winnls.h:271
#define C3_ALPHA
Definition: winnls.h:275
#define C3_IDEOGRAPH
Definition: winnls.h:272
#define CT_CTYPE3
Definition: winnls.h:241
#define C3_HALFWIDTH
Definition: winnls.h:270
#define C3_SYMBOL
Definition: winnls.h:267
#define C3_LEXICAL
Definition: winnls.h:274
#define C3_KATAKANA
Definition: winnls.h:268
#define C3_KASHIDA
Definition: winnls.h:273
#define C3_HIRAGANA
Definition: winnls.h:269
struct _EVENTLOGRECORD * PEVENTLOGRECORD
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SB_THUMBTRACK
Definition: winuser.h:573
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4840
#define SB_LINEUP
Definition: winuser.h:564
#define WM_HSCROLL
Definition: winuser.h:1754
#define IMAGE_ICON
Definition: winuser.h:212
#define WM_VSCROLL
Definition: winuser.h:1755
#define SW_SCROLLCHILDREN
Definition: winuser.h:2589
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define SIF_RANGE
Definition: winuser.h:1246
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SM_CXVSCROLL
Definition: winuser.h:972
#define WM_SIZE
Definition: winuser.h:1622
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define SB_VERT
Definition: winuser.h:553
#define SB_BOTTOM
Definition: winuser.h:577
#define WM_COMMAND
Definition: winuser.h:1751
#define SW_INVALIDATE
Definition: winuser.h:2590
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2540
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define SW_SHOWNOACTIVATE
Definition: winuser.h:785
#define SIF_PAGE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1256
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1750
#define MB_YESNO
Definition: winuser.h:828
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define SIF_TRACKPOS
Definition: winuser.h:1248
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define SM_CYHSCROLL
Definition: winuser.h:973
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BM_SETCHECK
Definition: winuser.h:1932
#define HWND_DESKTOP
Definition: winuser.h:1220
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BM_SETIMAGE
Definition: winuser.h:1933
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_SETFONT
Definition: winuser.h:1661
_In_ int cchText
Definition: winuser.h:4476
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
#define SB_PAGEDOWN
Definition: winuser.h:569
struct tagNMHDR * LPNMHDR
HDC WINAPI GetDC(_In_opt_ HWND)
#define SB_LINEDOWN
Definition: winuser.h:565
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define WM_LBUTTONUP
Definition: winuser.h:1788
#define SB_TOP
Definition: winuser.h:578
#define MB_ICONQUESTION
Definition: winuser.h:800
#define SIF_POS
Definition: winuser.h:1245
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define SW_ERASE
Definition: winuser.h:2591
#define LR_DEFAULTCOLOR
Definition: winuser.h:1098
#define VK_SHIFT
Definition: winuser.h:2213
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1620
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
#define SWP_NOZORDER
Definition: winuser.h:1258
#define SetWindowLongPtrW
Definition: winuser.h:5366
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
int WINAPI GetSystemMetrics(_In_ int)
#define SB_PAGEUP
Definition: winuser.h:568
#define BST_CHECKED
Definition: winuser.h:197
#define SB_HORZ
Definition: winuser.h:552
SHORT WINAPI GetKeyState(_In_ int)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define COLOR_3DFACE
Definition: winuser.h:940
#define SB_THUMBPOSITION
Definition: winuser.h:572
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184