// // warning -- this function is implemented twice for ansi applications // linking to the unicode library // void WINAPI DbgLogInfo(DWORD Type,DWORD Level,const TCHAR *pFormat,...) { /* Check the current level for this type combination */ BOOL bAccept = DbgCheckModuleLevel(Type,Level); if (bAccept == FALSE) { return; } TCHAR szInfo[2000]; /* Format the variable length parameter list */ va_list va; va_start(va, pFormat); lstrcpy(szInfo,m_ModuleName); wsprintf(szInfo + lstrlen(szInfo), TEXT("(tid %x) %8d : "), GetCurrentThreadId(), timeGetTime() - dwTimeOffset); _vstprintf(szInfo + lstrlen(szInfo), pFormat, va); lstrcat(szInfo, TEXT("\r\n")); DbgOutString(szInfo); va_end(va); }
// // warning -- this function is implemented twice for ansi applications // linking to the unicode library // void WINAPI DbgLogInfo(DWORD Type,DWORD Level,const CHAR *pFormat,...) { /* Check the current level for this type combination */ BOOL bAccept = DbgCheckModuleLevel(Type,Level); if (bAccept == FALSE) { return; } TCHAR szInfo[2000]; /* Format the variable length parameter list */ va_list va; va_start(va, pFormat); lstrcpy(szInfo,m_ModuleName); wsprintf(szInfo + lstrlen(szInfo), TEXT("(tid %x) %8d : "), GetCurrentThreadId(), timeGetTime() - dwTimeOffset); CHAR szInfoA[2000]; WideCharToMultiByte(CP_ACP, 0, szInfo, -1, szInfoA, NUMELMS(szInfoA), 0, 0); wvsprintfA(szInfoA + lstrlenA(szInfoA), pFormat, va); lstrcatA(szInfoA, "\r\n"); WCHAR wszOutString[2000]; MultiByteToWideChar(CP_ACP, 0, szInfoA, -1, wszOutString, NUMELMS(wszOutString)); DbgOutString(wszOutString); va_end(va); }
// // warning -- this function is implemented twice for ansi applications // linking to the unicode library // void WINAPI DbgLogInfo(DWORD Type,DWORD Level,LPCTSTR pFormat,...) { /* Check the current level for this type combination */ BOOL bAccept = DbgCheckModuleLevel(Type,Level); if (bAccept == FALSE) { return; } TCHAR szInfo[2000]; /* Format the variable length parameter list */ va_list va; va_start(va, pFormat); (void)StringCchPrintf(szInfo, NUMELMS(szInfo), TEXT("%s(tid %x) %8d : "), m_ModuleName, GetCurrentThreadId(), timeGetTime() - dwTimeOffset); (void)StringCchVPrintf(szInfo + lstrlen(szInfo), NUMELMS(szInfo) - lstrlen(szInfo), pFormat, va); (void)StringCchCat(szInfo, NUMELMS(szInfo), TEXT("\r\n")); DbgOutString(szInfo); va_end(va); }
void CBasePin::DisplayPinInfo(IPin *pReceivePin) { if (DbgCheckModuleLevel(LOG_TRACE, CONNECT_TRACE_LEVEL)) { PIN_INFO ConnectPinInfo; PIN_INFO ReceivePinInfo; if (FAILED(QueryPinInfo(&ConnectPinInfo))) { lstrcpyW(ConnectPinInfo.achName, L"Bad Pin"); } else { QueryPinInfoReleaseFilter(ConnectPinInfo); } if (FAILED(pReceivePin->QueryPinInfo(&ReceivePinInfo))) { lstrcpyW(ReceivePinInfo.achName, L"Bad Pin"); } else { QueryPinInfoReleaseFilter(ReceivePinInfo); } DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT("Trying to connect Pins :"))); DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT(" <%ls>"), ConnectPinInfo.achName)); DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT(" <%ls>"), ReceivePinInfo.achName)); } }
void CBasePin::DisplayTypeInfo(IPin *pPin, const CMediaType *pmt) { UNREFERENCED_PARAMETER(pPin); if (DbgCheckModuleLevel(LOG_TRACE, CONNECT_TRACE_LEVEL)) { DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT("Trying media type:"))); DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT(" major type: %hs"), GuidNames[*pmt->Type()])); DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT(" sub type : %hs"), GuidNames[*pmt->Subtype()])); } }
REFERENCE_TIME CAMSchedule::Advise( const REFERENCE_TIME & rtTime ) { REFERENCE_TIME rtNextTime; CAdvisePacket * pAdvise; DbgLog((LOG_TIMING, 2, TEXT("CAMSchedule::Advise( %lu ms )"), ULONG(rtTime / (UNITS / MILLISECONDS)))); CAutoLock lck(&m_Serialize); #ifdef DEBUG if (DbgCheckModuleLevel(LOG_TIMING, 4)) DumpLinkedList(); #endif // Note - DON'T cache the difference, it might overflow while ( rtTime >= (rtNextTime = (pAdvise=head.m_next)->m_rtEventTime) && !pAdvise->IsZ() ) { ASSERT(pAdvise->m_dwAdviseCookie); // If this is zero, its the head or the tail!! ASSERT(pAdvise->m_hNotify != INVALID_HANDLE_VALUE); if (pAdvise->m_bPeriodic == TRUE) { ReleaseSemaphore(pAdvise->m_hNotify,1,NULL); pAdvise->m_rtEventTime += pAdvise->m_rtPeriod; ShuntHead(); } else { ASSERT( pAdvise->m_bPeriodic == FALSE ); EXECUTE_ASSERT(SetEvent(pAdvise->m_hNotify)); --m_dwAdviseCount; Delete( head.RemoveNext() ); } } DbgLog((LOG_TIMING, 3, TEXT("CAMSchedule::Advise() Next time stamp: %lu ms, for advise %lu."), DWORD(rtNextTime / (UNITS / MILLISECONDS)), pAdvise->m_dwAdviseCookie )); return rtNextTime; }