88#include < MsRdpEx/NameResolver.h>
99#include < MsRdpEx/RdpInstance.h>
1010#include < MsRdpEx/Environment.h>
11+ #include < MsRdpEx/Stopwatch.h>
1112
1213#include < MsRdpEx/OutputMirror.h>
1314
@@ -113,7 +114,6 @@ Func_LoadLibraryExW Real_LoadLibraryExW = NULL;
113114HMODULE WINAPI Hook_LoadLibraryExA (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
114115{
115116 HMODULE hModule = NULL ;
116- const char * filename = MsRdpEx_FileBase (lpLibFileName);
117117
118118 // LoadLibraryExA calls LoadLibraryExW under the hood, don't log here
119119 // MsRdpEx_LogPrint(DEBUG, "LoadLibraryExA: %s", lpLibFileName);
@@ -435,7 +435,8 @@ bool WINAPI MsRdpEx_CaptureBlt(
435435
436436 instance->GetOutputMirrorObject ((LPVOID*) &outputMirror);
437437
438- if (!outputMirror) {
438+ if (!outputMirror)
439+ {
439440 outputMirror = MsRdpEx_OutputMirror_New ();
440441 MsRdpEx_OutputMirror_SetDumpBitmapUpdates (outputMirror, dumpBitmapUpdates);
441442 MsRdpEx_OutputMirror_SetVideoRecordingEnabled (outputMirror, videoRecordingEnabled);
@@ -456,7 +457,6 @@ bool WINAPI MsRdpEx_CaptureBlt(
456457 HDC hShadowDC = MsRdpEx_OutputMirror_GetShadowDC (outputMirror);
457458 BitBlt (hShadowDC, dstX, dstY, width, height, hdcSrc, srcX, srcY, SRCCOPY);
458459 MsRdpEx_OutputMirror_Unlock (outputMirror);
459-
460460 MsRdpEx_OutputMirror_DumpFrame (outputMirror);
461461
462462 captured = true ;
@@ -469,13 +469,16 @@ BOOL WINAPI Hook_BitBlt(
469469 HDC hdcSrc, int srcX, int srcY, DWORD rop)
470470{
471471 BOOL status;
472+ MsRdpEx_Stopwatch stopwatch;
472473
473474 status = Real_BitBlt (hdcDst, dstX, dstY, width, height, hdcSrc, srcX, srcY, rop);
474475
476+ MsRdpEx_Stopwatch_Init (&stopwatch, MSRDPEX_PROF_TRACE, true );
475477 bool captured = MsRdpEx_CaptureBlt (hdcDst, dstX, dstY, width, height, hdcSrc, srcX, srcY);
476-
477- if (captured) {
478- MsRdpEx_LogPrint (TRACE, " BitBlt: %d,%d %dx%d %d,%d" , dstX, dstY, width, height, srcX, srcY);
478+
479+ if (captured)
480+ {
481+ MsRdpEx_LogPrint (TRACE, " BitBlt: %d,%d %dx%d %d,%d [%.3fms]" , dstX, dstY, width, height, srcX, srcY, MsRdpEx_Stopwatch_GetTime (&stopwatch));
479482 }
480483
481484 return status;
@@ -491,13 +494,16 @@ BOOL WINAPI Hook_StretchBlt(
491494 HDC hdcSrc, int srcX, int srcY, int srcW, int srcH, DWORD rop)
492495{
493496 BOOL status;
497+ MsRdpEx_Stopwatch stopwatch;
494498
495499 status = Real_StretchBlt (hdcDst, dstX, dstY, dstW, dstH, hdcSrc, srcX, srcY, srcW, srcH, rop);
496500
501+ MsRdpEx_Stopwatch_Init (&stopwatch, MSRDPEX_PROF_TRACE, true );
497502 bool captured = MsRdpEx_CaptureBlt (hdcDst, srcX, srcY, srcW, srcH, hdcSrc, srcX, srcY);
498503
499- if (captured) {
500- MsRdpEx_LogPrint (TRACE, " StretchBlt: %d,%d %dx%d %d,%d %dx%d" , dstX, dstY, dstW, dstH, srcX, srcY, srcW, srcH);
504+ if (captured)
505+ {
506+ MsRdpEx_LogPrint (TRACE, " StretchBlt: %d,%d %dx%d %d,%d %dx%d [%.3fms])" , dstX, dstY, dstW, dstH, srcX, srcY, srcW, srcH, MsRdpEx_Stopwatch_GetTime (&stopwatch));
501507 }
502508
503509end:
@@ -697,7 +703,7 @@ LRESULT CALLBACK Hook_IHWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
697703 IMsRdpExInstance* instance = NULL ;
698704 CMsRdpExtendedSettings* pExtendedSettings = NULL ;
699705
700- MsRdpEx_LogPrint (DEBUG, " IHWndProc: %s (%d)" , MsRdpEx_GetWindowMessageName (uMsg), uMsg);
706+ // MsRdpEx_LogPrint(DEBUG, "IHWndProc: %s (%d)", MsRdpEx_GetWindowMessageName(uMsg), uMsg);
701707
702708 if (uMsg == WM_NCCREATE)
703709 {
0 commit comments