23 #define _PH_GRAPH_PRIVATE
27 #define COLORREF_TO_BITS(Color) (_byteswap_ulong(Color) >> 8)
29 typedef struct _PHP_GRAPH_CONTEXT
40 HBITMAP BufferedOldBitmap;
41 HBITMAP BufferedBitmap;
43 RECT BufferedContextRect;
46 HBITMAP FadeOutOldBitmap;
47 HBITMAP FadeOutBitmap;
49 RECT FadeOutContextRect;
52 WNDPROC TooltipOldWndProc;
53 POINT LastCursorLocation;
70 WNDCLASSEX c = {
sizeof(c) };
72 c.style = CS_GLOBALCLASS | CS_DBLCLKS;
75 c.cbWndExtra =
sizeof(PVOID);
78 c.hCursor = LoadCursor(NULL, IDC_ARROW);
79 c.hbrBackground = NULL;
80 c.lpszMenuName = NULL;
84 if (!RegisterClassEx(&c))
117 width = DrawInfo->Width;
118 height = DrawInfo->Height;
119 height1 = DrawInfo->Height - 1;
120 flags = DrawInfo->Flags;
121 step = DrawInfo->Step;
123 nullPen = GetStockObject(NULL_PEN);
124 dcPen = GetStockObject(DC_PEN);
125 dcBrush = GetStockObject(DC_BRUSH);
131 rect.bottom = height;
132 SetDCBrushColor(hdc, DrawInfo->BackColor);
133 FillRect(hdc, &rect, dcBrush);
137 if (DrawInfo->LineData1 && DrawInfo->LineDataCount >= 2)
139 LONG x = width - step;
141 BOOLEAN willBreak =
FALSE;
143 SelectObject(hdc, dcBrush);
144 SelectObject(hdc, nullPen);
148 if (DrawInfo->LineData2)
151 while (index < DrawInfo->LineDataCount - 1)
158 if (x < 0 || index == DrawInfo->LineDataCount - 2)
163 f0 = DrawInfo->LineData1[index];
164 f1 = DrawInfo->LineData1[index + 1];
165 h0 = (ULONG)((1 - f0) * height);
166 h1 = (ULONG)((1 - f1) * height);
171 points[1].x = x + step;
173 points[2].x = x + step;
174 points[2].y = height;
176 points[3].y = height;
179 SetDCBrushColor(hdc, DrawInfo->LineBackColor1);
180 Polygon(hdc, points, 4);
183 if (h0 > height1) h0 = height1;
184 if (h1 > height1) h1 = height1;
193 f0 = DrawInfo->LineData2[index];
194 f1 = DrawInfo->LineData2[index + 1];
198 f0 += DrawInfo->LineData2[index];
199 f1 += DrawInfo->LineData2[index + 1];
205 h0 = (ULONG)((1 - f0) * height);
206 h1 = (ULONG)((1 - f1) * height);
208 if (flags & PH_GRAPH_OVERLAY_LINE_2)
216 points[2].y = points[1].y;
217 points[3].y = points[0].y;
222 SetDCBrushColor(hdc, DrawInfo->LineBackColor2);
223 Polygon(hdc, points, 4);
225 if (h0 > height1) h0 = height1;
226 if (h1 > height1) h1 = height1;
242 ULONG x = width / DrawInfo->GridWidth;
243 ULONG y = height / DrawInfo->GridHeight;
248 SetDCPenColor(hdc, DrawInfo->GridColor);
249 SelectObject(hdc, dcPen);
254 points[1].y = height;
255 gridStart = (DrawInfo->GridStart * DrawInfo->Step) % DrawInfo->GridWidth;
257 for (i = 0; i <= x; i++)
259 pos = width - (i * DrawInfo->GridWidth + gridStart) - 1;
262 Polyline(hdc, points, 2);
270 for (i = 0; i <= y; i++)
272 pos = i * DrawInfo->GridHeight - 1;
275 Polyline(hdc, points, 2);
283 LONG x = width - step;
285 ULONG previousHeight1;
286 ULONG previousHeight2;
288 previousHeight1 = (ULONG)lineList1->
Items[0];
292 previousHeight2 = (ULONG)lineList2->
Items[0];
294 while (index < lineList1->Count)
297 points[1].x = x + step;
302 points[0].y = (ULONG)lineList2->
Items[index];
303 points[1].y = previousHeight2;
305 SelectObject(hdc, dcPen);
306 SetDCPenColor(hdc, DrawInfo->LineColor2);
307 Polyline(hdc, points, 2);
309 previousHeight2 = points[0].y;
311 points[0].y = (ULONG)lineList1->
Items[index];
312 points[1].y = previousHeight1;
314 SelectObject(hdc, dcPen);
315 SetDCPenColor(hdc, DrawInfo->LineColor1);
316 Polyline(hdc, points, 2);
318 previousHeight1 = points[0].y;
323 points[0].y = (ULONG)lineList1->
Items[index];
324 points[1].x = x + step;
325 points[1].y = previousHeight1;
327 SelectObject(hdc, dcPen);
328 SetDCPenColor(hdc, DrawInfo->LineColor1);
329 Polyline(hdc, points, 2);
331 previousHeight1 = points[0].y;
346 if (DrawInfo->Text.Buffer)
349 SetDCBrushColor(hdc, DrawInfo->TextBoxColor);
350 FillRect(hdc, &DrawInfo->TextBoxRect, GetStockObject(DC_BRUSH));
353 SetTextColor(hdc, DrawInfo->TextColor);
354 SetBkMode(hdc, TRANSPARENT);
355 DrawText(hdc, DrawInfo->Text.Buffer, (ULONG)DrawInfo->Text.Length / 2, &DrawInfo->TextRect, DT_NOCLIP);
366 if (Index < DrawInfo->LineDataCount)
371 f1 = DrawInfo->LineData1[Index];
378 *H1 = (ULONG)(f1 * (DrawInfo->Height - 1));
382 f2 = f1 + DrawInfo->LineData2[Index];
389 *H2 = (ULONG)(f2 * (DrawInfo->Height - 1));
427 BOOLEAN intermediate;
451 ULONG lineBackColor1;
453 ULONG lineBackColor2;
455 ULONG gridXIncrement;
459 width = DrawInfo->Width;
460 height = DrawInfo->Height;
461 numberOfPixels = width * height;
462 flags = DrawInfo->Flags;
468 if (DrawInfo->BackColor == 0)
470 memset(bits, 0, numberOfPixels * 4);
478 intermediate =
FALSE;
489 gridYCounter = DrawInfo->GridWidth - (DrawInfo->GridStart * DrawInfo->Step) % DrawInfo->GridWidth - 1;
490 gridXIncrement = width * DrawInfo->GridHeight;
508 h1_left = (h1_i + h1_o) / 2;
510 h2_left = (h2_i + h2_o) / 2;
558 mid = ((h1_left + h1) / 2) * width;
560 old_high2 = h1_high2;
564 h1_low2 = h1_left * width;
566 h1_low1 = mid + width;
567 h1_high1 = h1 * width;
571 h1_high2 = h1_left * width;
572 h1_low2 = mid + width;
574 h1_low1 = h1 * width;
578 if (h1_low1 > old_low2)
580 if (h1_high1 < old_high2)
581 h1_high1 = old_high2;
589 mid = ((h2_left + h2) / 2) * width;
591 old_high2 = h2_high2;
595 h2_low2 = h2_left * width;
597 h2_low1 = mid + width;
598 h2_high1 = h2 * width;
602 h2_high2 = h2_left * width;
603 h2_low2 = mid + width;
605 h2_low1 = h2 * width;
609 if (h2_low1 > old_low2)
611 if (h2_high1 < old_high2)
612 h2_high1 = old_high2;
621 if (flags & PH_GRAPH_USE_LINE_2)
623 for (i = h1_high1 + width; i < h2_low1; i += width)
625 bits[i] = lineBackColor2;
629 for (i = x; i < h1_low1; i += width)
631 bits[i] = lineBackColor1;
636 if (flags & PH_GRAPH_USE_GRID)
639 if (gridYCounter == 0)
641 for (i = x; i < numberOfPixels; i += width)
649 if (gridYCounter == DrawInfo->GridWidth)
653 for (i = x + gridXIncrement; i < numberOfPixels; i += gridXIncrement)
661 if (flags & PH_GRAPH_USE_LINE_2)
663 for (i = h2_low1; i <= h2_high1; i += width)
665 bits[i] = lineColor2;
669 for (i = h1_low1; i <= h1_high1; i += width)
671 bits[i] = lineColor1;
674 intermediate = !intermediate;
678 if (DrawInfo->Text.Buffer)
681 SetDCBrushColor(hdc, DrawInfo->TextBoxColor);
682 FillRect(hdc, &DrawInfo->TextBoxRect, GetStockObject(DC_BRUSH));
685 SetTextColor(hdc, DrawInfo->TextColor);
686 SetBkMode(hdc, TRANSPARENT);
687 DrawText(hdc, DrawInfo->Text.Buffer, (ULONG)DrawInfo->Text.Length / 2, &DrawInfo->TextRect, DT_NOCLIP);
716 DrawInfo->Text = *Text;
717 GetTextExtentPoint32(hdc, Text->Buffer, (ULONG)Text->Length / 2, &textSize);
721 boxRectangle.
Width = textSize.cx + Padding->left + Padding->right;
722 boxRectangle.
Height = textSize.cy + Padding->top + Padding->bottom;
725 boxRectangle.
Left = Margin->left;
727 boxRectangle.
Left = DrawInfo->Width - boxRectangle.
Width - Margin->right;
729 boxRectangle.
Left = (DrawInfo->Width - boxRectangle.
Width) / 2;
732 boxRectangle.
Top = Margin->top;
734 boxRectangle.
Top = DrawInfo->Height - boxRectangle.
Height - Margin->bottom;
736 boxRectangle.
Top = (DrawInfo->Height - boxRectangle.
Height) / 2;
740 textRectangle.
Left = boxRectangle.
Left + Padding->left;
741 textRectangle.
Top = boxRectangle.
Top + Padding->top;
742 textRectangle.
Width = textSize.cx;
743 textRectangle.
Height = textSize.cy;
759 context->DrawInfo.Width = 3;
760 context->DrawInfo.Height = 3;
762 context->DrawInfo.Step = 2;
763 context->DrawInfo.BackColor = RGB(0xef, 0xef, 0xef);
764 context->DrawInfo.LineDataCount = 0;
765 context->DrawInfo.LineData1 = NULL;
766 context->DrawInfo.LineData2 = NULL;
767 context->DrawInfo.LineColor1 = RGB(0x00, 0xff, 0x00);
768 context->DrawInfo.LineColor2 = RGB(0xff, 0x00, 0x00);
769 context->DrawInfo.LineBackColor1 = RGB(0x00, 0x77, 0x00);
770 context->DrawInfo.LineBackColor2 = RGB(0x77, 0x00, 0x00);
771 context->DrawInfo.GridColor = RGB(0xc7, 0xc7, 0xc7);
772 context->DrawInfo.GridWidth = 20;
773 context->DrawInfo.GridHeight = 40;
774 context->DrawInfo.GridStart = 0;
775 context->DrawInfo.TextColor = RGB(0x00, 0xff, 0x00);
776 context->DrawInfo.TextBoxColor = RGB(0x00, 0x22, 0x00);
778 context->Options.FadeOutBackColor = RGB(0xef, 0xef, 0xef);
779 context->Options.FadeOutWidth = 100;
791 static PWSTR PhpMakeGraphTooltipContextAtom(
798 static VOID PhpDeleteBufferedContext(
802 if (Context->BufferedContext)
806 SelectObject(Context->BufferedContext, Context->BufferedOldBitmap);
807 DeleteObject(Context->BufferedBitmap);
808 DeleteDC(Context->BufferedContext);
810 Context->BufferedContext = NULL;
811 Context->BufferedBitmap = NULL;
812 Context->BufferedBits = NULL;
816 static VOID PhpCreateBufferedContext(
821 BITMAPINFOHEADER header;
823 PhpDeleteBufferedContext(Context);
825 GetClientRect(Context->Handle, &Context->BufferedContextRect);
827 hdc = GetDC(Context->Handle);
828 Context->BufferedContext = CreateCompatibleDC(hdc);
830 memset(&header, 0,
sizeof(BITMAPINFOHEADER));
831 header.biSize =
sizeof(BITMAPINFOHEADER);
832 header.biWidth = Context->BufferedContextRect.right;
833 header.biHeight = Context->BufferedContextRect.bottom;
835 header.biBitCount = 32;
837 Context->BufferedBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&header, DIB_RGB_COLORS, &Context->BufferedBits, NULL, 0);
839 ReleaseDC(Context->Handle, hdc);
840 Context->BufferedOldBitmap = SelectObject(Context->BufferedContext, Context->BufferedBitmap);
843 static VOID PhpDeleteFadeOutContext(
847 if (Context->FadeOutContext)
849 SelectObject(Context->FadeOutContext, Context->FadeOutOldBitmap);
850 DeleteObject(Context->FadeOutBitmap);
851 DeleteDC(Context->FadeOutContext);
853 Context->FadeOutContext = NULL;
854 Context->FadeOutBitmap = NULL;
855 Context->FadeOutBits = NULL;
859 static VOID PhpCreateFadeOutContext(
864 BITMAPINFOHEADER header;
870 FLOAT fadeOutWidthSquared;
874 PhpDeleteFadeOutContext(Context);
876 GetClientRect(Context->Handle, &Context->FadeOutContextRect);
877 Context->FadeOutContextRect.right = Context->Options.FadeOutWidth;
879 hdc = GetDC(Context->Handle);
880 Context->FadeOutContext = CreateCompatibleDC(hdc);
882 memset(&header, 0,
sizeof(BITMAPINFOHEADER));
883 header.biSize =
sizeof(BITMAPINFOHEADER);
884 header.biWidth = Context->FadeOutContextRect.right;
885 header.biHeight = Context->FadeOutContextRect.bottom;
887 header.biBitCount = 32;
889 Context->FadeOutBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&header, DIB_RGB_COLORS, &Context->FadeOutBits, NULL, 0);
891 ReleaseDC(Context->Handle, hdc);
892 Context->FadeOutOldBitmap = SelectObject(Context->FadeOutContext, Context->FadeOutBitmap);
894 if (!Context->FadeOutBits)
897 height = Context->FadeOutContextRect.bottom;
898 backColor = Context->Options.FadeOutBackColor;
899 fadeOutWidth = Context->Options.FadeOutWidth;
900 fadeOutWidthSquared = (FLOAT)fadeOutWidth * fadeOutWidth;
902 for (i = 0; i < fadeOutWidth; i++)
904 currentAlpha = 255 - (ULONG)((FLOAT)(i * i) / fadeOutWidthSquared * 255);
906 ((backColor & 0xff) * currentAlpha / 255) +
907 ((((backColor >> 8) & 0xff) * currentAlpha / 255) << 8) +
908 ((((backColor >> 16) & 0xff) * currentAlpha / 255) << 16) +
909 (currentAlpha << 24);
911 for (j = i; j < height * fadeOutWidth; j += fadeOutWidth)
913 ((PULONG)Context->FadeOutBits)[j] = currentColor;
925 Context->
DrawInfo.
Width = Context->BufferedContextRect.right;
926 Context->DrawInfo.Height = Context->BufferedContextRect.bottom;
928 getDrawInfo.
Header.hwndFrom = hwnd;
929 getDrawInfo.
Header.idFrom = Context->Id;
931 getDrawInfo.
DrawInfo = &Context->DrawInfo;
933 SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&getDrawInfo);
941 if (Context->BufferedBits)
942 PhDrawGraphDirect(Context->BufferedContext, Context->BufferedBits, &Context->DrawInfo);
946 BLENDFUNCTION blendFunction;
948 if (!Context->FadeOutContext)
949 PhpCreateFadeOutContext(Context);
951 blendFunction.BlendOp = AC_SRC_OVER;
952 blendFunction.BlendFlags = 0;
953 blendFunction.SourceConstantAlpha = 255;
954 blendFunction.AlphaFormat = AC_SRC_ALPHA;
956 Context->BufferedContext,
959 Context->Options.FadeOutWidth,
960 Context->FadeOutContextRect.bottom,
961 Context->FadeOutContext,
964 Context->Options.FadeOutWidth,
965 Context->FadeOutContextRect.bottom,
974 drawPanel.
Header.hwndFrom = hwnd;
975 drawPanel.
Header.idFrom = Context->Id;
977 drawPanel.
hdc = Context->BufferedContext;
978 drawPanel.
Rect = Context->BufferedContextRect;
980 SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&drawPanel);
995 if (uMsg == WM_CREATE)
998 SetWindowLongPtr(hwnd, 0, (LONG_PTR)context);
1002 return DefWindowProc(hwnd, uMsg, wParam, lParam);
1007 case WM_LBUTTONDOWN:
1009 case WM_RBUTTONDOWN:
1011 case WM_MBUTTONDOWN:
1014 if (context->TooltipHandle)
1018 message.hwnd = hwnd;
1019 message.message = uMsg;
1020 message.wParam = wParam;
1021 message.lParam = lParam;
1022 SendMessage(context->TooltipHandle, TTM_RELAYEVENT, 0, (LPARAM)&message);
1032 CREATESTRUCT *createStruct = (CREATESTRUCT *)lParam;
1034 context->Handle = hwnd;
1035 context->Style = createStruct->style;
1036 context->Id = (ULONG_PTR)createStruct->hMenu;
1041 if (context->TooltipHandle)
1042 DestroyWindow(context->TooltipHandle);
1044 PhpDeleteFadeOutContext(context);
1045 PhpDeleteBufferedContext(context);
1047 SetWindowLongPtr(hwnd, 0, (LONG_PTR)NULL);
1050 case WM_STYLECHANGED:
1052 STYLESTRUCT *styleStruct = (STYLESTRUCT *)lParam;
1054 if (wParam == GWL_STYLE)
1056 context->Style = styleStruct->styleNew;
1057 context->NeedsDraw =
TRUE;
1064 PhpCreateBufferedContext(context);
1065 PhpDeleteFadeOutContext(context);
1068 context->NeedsDraw =
TRUE;
1069 InvalidateRect(hwnd, NULL,
FALSE);
1071 if (context->TooltipHandle)
1075 memset(&toolInfo, 0,
sizeof(TOOLINFO));
1076 toolInfo.cbSize =
sizeof(TOOLINFO);
1077 toolInfo.hwnd = hwnd;
1079 GetClientRect(hwnd, &toolInfo.rect);
1080 SendMessage(context->TooltipHandle, TTM_NEWTOOLRECT, 0, (LPARAM)&toolInfo);
1086 PAINTSTRUCT paintStruct;
1089 if (hdc = BeginPaint(hwnd, &paintStruct))
1091 if (!context->BufferedContext)
1092 PhpCreateBufferedContext(context);
1094 if (context->NeedsUpdate)
1097 context->NeedsUpdate =
FALSE;
1100 if (context->NeedsDraw)
1103 context->NeedsDraw =
FALSE;
1108 paintStruct.rcPaint.left,
1109 paintStruct.rcPaint.top,
1110 paintStruct.rcPaint.right - paintStruct.rcPaint.left,
1111 paintStruct.rcPaint.bottom - paintStruct.rcPaint.top,
1112 context->BufferedContext,
1113 paintStruct.rcPaint.left,
1114 paintStruct.rcPaint.top,
1118 EndPaint(hwnd, &paintStruct);
1128 updateRegion = (HRGN)wParam;
1130 if (updateRegion == (HRGN)1)
1131 updateRegion = NULL;
1134 if (context->Style & WS_BORDER)
1142 flags = DCX_WINDOW | DCX_LOCKWINDOWUPDATE | 0x10000;
1145 flags |= DCX_INTERSECTRGN | 0x40000;
1147 if (hdc = GetDCEx(hwnd, updateRegion, flags))
1149 GetClientRect(hwnd, &rect);
1152 SetDCBrushColor(hdc, RGB(0x8f, 0x8f, 0x8f));
1153 FrameRect(hdc, &rect, GetStockObject(DC_BRUSH));
1155 ReleaseDC(hwnd, hdc);
1163 LPNMHDR header = (LPNMHDR)lParam;
1165 if (header->hwndFrom == context->TooltipHandle)
1167 switch (header->code)
1169 case TTN_GETDISPINFO:
1171 LPNMTTDISPINFO dispInfo = (LPNMTTDISPINFO)header;
1176 GetCursorPos(&point);
1177 ScreenToClient(hwnd, &point);
1178 GetClientRect(hwnd, &clientRect);
1180 getTooltipText.
Header.hwndFrom = hwnd;
1181 getTooltipText.
Header.idFrom = context->Id;
1183 getTooltipText.
Index = (clientRect.right - point.x - 1) / context->DrawInfo.Step;
1184 getTooltipText.
TotalCount = context->DrawInfo.LineDataCount;
1188 SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&getTooltipText);
1192 dispInfo->lpszText = getTooltipText.
Text.
Buffer;
1202 if (context->Options.DefaultCursor)
1204 SetCursor(context->Options.DefaultCursor);
1211 if (context->TooltipHandle)
1215 GetCursorPos(&point);
1216 ScreenToClient(hwnd, &point);
1218 if (context->LastCursorLocation.x != point.x || context->LastCursorLocation.y != point.y)
1220 SendMessage(context->TooltipHandle, TTM_UPDATE, 0, 0);
1221 context->LastCursorLocation = point;
1226 case WM_LBUTTONDOWN:
1228 case WM_LBUTTONDBLCLK:
1229 case WM_RBUTTONDOWN:
1231 case WM_RBUTTONDBLCLK:
1236 GetClientRect(hwnd, &clientRect);
1238 mouseEvent.
Header.hwndFrom = hwnd;
1239 mouseEvent.
Header.idFrom = context->Id;
1242 mouseEvent.
Keys = (ULONG)wParam;
1243 mouseEvent.
Point.x = LOWORD(lParam);
1244 mouseEvent.
Point.y = HIWORD(lParam);
1246 mouseEvent.
Index = (clientRect.right - mouseEvent.
Point.x - 1) / context->DrawInfo.Step;
1247 mouseEvent.
TotalCount = context->DrawInfo.LineDataCount;
1249 SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&mouseEvent);
1265 width = context->DrawInfo.
Width;
1266 height = context->DrawInfo.Height;
1268 context->DrawInfo.Width = width;
1269 context->DrawInfo.Height = height;
1275 context->NeedsDraw =
TRUE;
1282 context->DrawInfo.GridStart += increment;
1286 return (LRESULT)context->BufferedContext;
1291 TOOLINFO toolInfo = {
sizeof(toolInfo) };
1293 context->TooltipHandle = CreateWindow(
1296 WS_POPUP | WS_EX_TRANSPARENT | TTS_NOPREFIX,
1307 SetWindowPos(context->TooltipHandle, HWND_TOPMOST, 0, 0, 0, 0,
1308 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
1310 toolInfo.uFlags = 0;
1311 toolInfo.hwnd = hwnd;
1313 toolInfo.lpszText = LPSTR_TEXTCALLBACK;
1314 GetClientRect(hwnd, &toolInfo.rect);
1315 SendMessage(context->TooltipHandle, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);
1317 SendMessage(context->TooltipHandle, TTM_SETDELAYTIME, TTDT_INITIAL, 0);
1318 SendMessage(context->TooltipHandle, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAXSHORT);
1320 SendMessage(context->TooltipHandle, TTM_SETMAXTIPWIDTH, 0, MAXSHORT);
1324 DestroyWindow(context->TooltipHandle);
1325 context->TooltipHandle = NULL;
1331 if (!context->TooltipHandle)
1334 SendMessage(context->TooltipHandle, TTM_UPDATE, 0, 0);
1342 PhpDeleteFadeOutContext(context);
1346 return DefWindowProc(hwnd, uMsg, wParam, lParam);
1358 Buffers->AllocatedCount = 0;
1359 Buffers->Data1 = NULL;
1360 Buffers->Data2 = NULL;
1361 Buffers->Valid =
FALSE;
1373 if (Buffers->Data1)
PhFree(Buffers->Data1);
1374 if (Buffers->Data2)
PhFree(Buffers->Data2);
1389 _In_ ULONG DataCount
1392 DrawInfo->LineDataCount = min(DataCount,
PH_GRAPH_DATA_COUNT(DrawInfo->Width, DrawInfo->Step));
1395 if (Buffers->AllocatedCount < DrawInfo->LineDataCount)
1402 Buffers->AllocatedCount *= 2;
1404 if (Buffers->AllocatedCount < DrawInfo->LineDataCount)
1405 Buffers->AllocatedCount = DrawInfo->LineDataCount;
1407 Buffers->Data1 = PhAllocate(Buffers->AllocatedCount *
sizeof(FLOAT));
1411 Buffers->Data2 = PhAllocate(Buffers->AllocatedCount *
sizeof(FLOAT));
1414 Buffers->Valid =
FALSE;
1417 DrawInfo->LineData1 = Buffers->Data1;
1418 DrawInfo->LineData2 = Buffers->Data2;
1427 State->TooltipText = NULL;
1428 State->TooltipIndex = -1;
1443 _In_ ULONG DataCount