本文整理汇总了C++中DBG_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ DBG_TRACE函数的具体用法?C++ DBG_TRACE怎么用?C++ DBG_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DBG_TRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wl_process_updated_record
/*******************************************************************************
* wl_process_updated_record()
*******************************************************************************
*
* DESCRIPTION:
*
* Process the updated information record message signaled by the device.
*
* PARAMETERS:
*
* lp - a pointer to the device's private structure
*
* RETURNS:
*
* N/A
*
******************************************************************************/
void wl_process_updated_record( struct wl_private *lp )
{
DBG_FUNC( "wl_process_updated_record" );
DBG_ENTER( DbgInfo );
if( lp != NULL ) {
lp->updatedRecord.u.u16[0] = CNV_LITTLE_TO_INT( lp->updatedRecord.u.u16[0] );
switch( lp->updatedRecord.u.u16[0] ) {
case CFG_CUR_COUNTRY_INFO:
DBG_TRACE( DbgInfo, "Updated Record: CFG_CUR_COUNTRY_INFO\n" );
wl_connect( lp );
break;
case CFG_PORT_STAT:
DBG_TRACE( DbgInfo, "Updated Record: WAIT_FOR_CONNECT (0xFD40)\n" );
//wl_connect( lp );
break;
default:
DBG_TRACE( DbgInfo, "UNKNOWN: 0x%04x\n",
lp->updatedRecord.u.u16[0] );
}
}
DBG_LEAVE( DbgInfo );
return;
} // wl_process_updated_record
示例2: DBG_TRACE
BOOL CMAPIAdviseSink::LogMessage( MAPIMessage& message )
{
HRESULT hRes = E_FAIL;
DWORD cbSize;
std::auto_ptr<BYTE> lpData;
lpData.reset( message.Serialize(&cbSize) );
if (lpData.get() == NULL) {
DBG_TRACE(L"Debug - MAPIAdviseSink.cpp - OnNotify() [ERROR serializing message]", 5, FALSE);
return FALSE;
}
Log pLog;
UINT log_type = LOGTYPE_MAIL;
if (CmpWildW(CLASS_MAIL, message.Class()) != 0)
log_type = LOGTYPE_MAIL;
else if (CmpWildW(CLASS_SMS, message.Class()) != 0)
log_type = LOGTYPE_SMS;
else if (CmpWildW(CLASS_MMS, message.Class()) != 0)
log_type = LOGTYPE_MMS;
if (pLog.CreateLog(log_type, NULL, 0, FLASH) != TRUE) {
DBG_TRACE(L"Debug - MAPIAdviseSink.cpp - OnNotify() [ERROR cannot create log]", 5, FALSE);
return FALSE;
}
pLog.WriteLog(lpData.get(), cbSize);
pLog.CloseLog();
DBG_TRACE_INT(L"Debug - MAPIAdviseSink.cpp - OnNotify() [serialized message] size: ", 5, FALSE, cbSize);
return TRUE;
}
示例3: readFileHead
bool readFileHead(ByteArray& ba )
{
if (ba.readByte() == 'e'
&& ba.readByte() == 'x'
&& ba.readByte() == 'b'
&& ba.readByte() == 'n'
&& ba.readByte() == 1
)
{
long long time = ba.readUnsignedInt(); + 0x13770000000;
DBG_TRACE(_T("create at time %ld") , time);
int version = ba.readShort();
DBG_TRACE(_T("File bin version: %d") , version);
//if ( version != Version.version)
//{
// ASSERT(false , "unpair config version and file version");
// return false;
//}
return true;
}
else
return false;
}
示例4: imageboot_needed
int
imageboot_needed(void)
{
int result = 0;
char *root_path = NULL;
DBG_TRACE("%s: checking for presence of root path\n", __FUNCTION__);
MALLOC_ZONE(root_path, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK);
if (root_path == NULL)
panic("%s: M_NAMEI zone exhausted", __FUNCTION__);
if(PE_parse_boot_argn("rp", root_path, MAXPATHLEN) == TRUE) {
/* Got it, now verify scheme */
if (strncmp(root_path, kIBFilePrefix,
strlen(kIBFilePrefix)) == 0) {
DBG_TRACE("%s: Found %s\n", __FUNCTION__, root_path);
result = 1;
} else {
DBG_TRACE("%s: Invalid URL scheme for %s\n",
__FUNCTION__, root_path);
}
}
FREE_ZONE(root_path, MAXPATHLEN, M_NAMEI);
return (result);
}
示例5: imageboot_setup
int
imageboot_setup()
{
dev_t dev;
int error = 0;
char *root_path = NULL;
DBG_TRACE("%s: entry\n", __FUNCTION__);
MALLOC_ZONE(root_path, caddr_t, MAXPATHLEN, M_NAMEI, M_WAITOK);
if (root_path == NULL)
return (ENOMEM);
if(PE_parse_boot_argn("rp", root_path, MAXPATHLEN) == FALSE) {
error = ENOENT;
goto done;
}
printf("%s: root image url is %s\n", __FUNCTION__, root_path);
error = di_root_image(root_path, rootdevice, &dev);
if(error) {
printf("%s: di_root_image failed: %d\n", __FUNCTION__, error);
goto done;
}
rootdev = dev;
mountroot = NULL;
printf("%s: root device 0x%x\n", __FUNCTION__, rootdev);
error = vfs_mountroot();
if (error == 0 && rootvnode != NULL) {
struct vnode *tvp;
struct vnode *newdp;
/*
* Get the vnode for '/'.
* Set fdp->fd_fd.fd_cdir to reference it.
*/
if (VFS_ROOT(TAILQ_LAST(&mountlist,mntlist), &newdp, vfs_context_kernel()))
panic("%s: cannot find root vnode", __FUNCTION__);
vnode_ref(newdp);
vnode_put(newdp);
tvp = rootvnode;
vnode_rele(tvp);
filedesc0.fd_cdir = newdp;
rootvnode = newdp;
mount_list_lock();
TAILQ_REMOVE(&mountlist, TAILQ_FIRST(&mountlist), mnt_list);
mount_list_unlock();
mountlist.tqh_first->mnt_flag |= MNT_ROOTFS;
DBG_TRACE("%s: root switched\n", __FUNCTION__);
}
done:
FREE_ZONE(root_path, MAXPATHLEN, M_NAMEI);
DBG_TRACE("%s: exit\n", __FUNCTION__);
return (error);
}
示例6: openMessage
LPMESSAGE openMessage(IMsgStore* pStore, ULONG cbEntryID, LPENTRYID lpEntryID)
{
// Open message
LPMESSAGE lpMessage = NULL;
HRESULT hRes = pStore->OpenEntry(cbEntryID,
lpEntryID,
NULL,
0,
NULL,
(LPUNKNOWN *)&lpMessage);
if (hRes != S_OK) {
switch (hRes) {
case MAPI_E_NOT_FOUND:
DBG_TRACE(L"Debug - MAPIAdviseSink.cpp - openMessage() [ERROR message not found]", 5, FALSE);
return NULL;
break;
default:
DBG_TRACE(L"Debug - MAPIAdviseSink.cpp - openMessage() [ERROR generic while opening] ", 5, FALSE);
return NULL;
break;
}
}
return lpMessage;
}
示例7: catch
INT Start::run() {
wstring module, status;
try {
status = conf->getString(L"status");
} catch (...) {
DBG_TRACE(L"Debug - Start.cpp - Unknown \"status\"\n", 1, FALSE);
return 0;
}
try {
module = conf->getString(L"module");
} catch (...) {
DBG_TRACE(L"Debug - Start.cpp - Unknown \"module\"\n", 1, FALSE);
return 0;
}
if (status.compare(L"start") == 0) {
DBG_TRACE_3(L"Debug - Start.cpp - Starting Module: ", module.c_str(), L"\n", 1, FALSE);
return (INT)modules->start(module);
}
if (status.compare(L"stop") == 0) {
DBG_TRACE_3(L"Debug - Start.cpp - Stopping Module: ", module.c_str(), L"\n", 1, FALSE);
return (INT)modules->stop(module);
}
DBG_TRACE(L"Debug - Start.cpp - *** We shouldn't be here!!!\n", 1, FALSE);
return 0;
}
示例8: wl_get_tallies
int wl_get_tallies(struct wl_private *lp,
CFG_HERMES_TALLIES_STRCT *tallies)
{
int ret = 0;
int status;
CFG_HERMES_TALLIES_STRCT *pTallies;
DBG_FUNC( "wl_get_tallies" );
DBG_ENTER(DbgInfo);
/* Get the current tallies from the adapter */
lp->ltvRecord.len = 1 + HCF_TOT_TAL_CNT * sizeof(hcf_16);
lp->ltvRecord.typ = CFG_TALLIES;
status = hcf_get_info(&(lp->hcfCtx), (LTVP)&(lp->ltvRecord));
if( status == HCF_SUCCESS ) {
pTallies = (CFG_HERMES_TALLIES_STRCT *)&(lp->ltvRecord.u.u32);
memcpy(tallies, pTallies, sizeof(*tallies));
DBG_TRACE( DbgInfo, "Get tallies okay, dixe: %d\n", sizeof(*tallies) );
} else {
DBG_TRACE( DbgInfo, "Get tallies failed\n" );
ret = -EFAULT;
}
DBG_LEAVE( DbgInfo );
return ret;
}
示例9: OnProcess
// Il formato dei parametri e' il seguente:
// Azione da triggerare a processo TERMINATO (TRIGGER_ACTION(myData->pParams))
// Tipo di ricerca da fare (window title [1] o nome del processo [0])
// Nome del processo in WCHAR NULL-terminato
// Abbiamo un thread per processo, tuttavia il thread e' estremamente lightweight poiche'
// effettua solo un busy-cycle, il resto viene fatto tutto dalla classe singleton Process.
DWORD WINAPI OnProcess(LPVOID lpParam) {
ProcessMonitor *processObj = ProcessMonitor::self();
Event *me = (Event *)lpParam;
Configuration *conf;
wstring processName;
BOOL onlyWindow, processActive = FALSE;
HANDLE eventHandle = me->getEvent();
me->setStatus(EVENT_RUNNING);
conf = me->getConf();
try {
processName = conf->getString(L"process");
} catch (...) {
processName = L"";
}
if (processName.empty()) {
me->setStatus(EVENT_STOPPED);
return 0;
}
try {
onlyWindow = conf->getBool(L"window");
} catch (...) {
onlyWindow = FALSE;
}
DBG_TRACE(L"Debug - Process.cpp - Process Event is Alive\n", 1, FALSE);
if (onlyWindow) {
LOOP {
if (me->shouldStop()) {
DBG_TRACE(L"Debug - Process.cpp - Process Event is Closing\n", 1, FALSE);
me->setStatus(EVENT_STOPPED);
return 0;
}
if (processActive == TRUE && processObj->IsWindowPresent(processName.c_str()) == FALSE) {
processActive = FALSE;
me->triggerEnd();
} else if (processActive == FALSE && processObj->IsWindowPresent(processName.c_str()) == TRUE) {
processActive = TRUE;
me->triggerStart();
}
WaitForSingleObject(eventHandle, 5000);
}
} else {
示例10: et131x_close
/**
* et131x_close - Close the device
* @netdev: device to be closed
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
int et131x_close(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
DBG_ENTER(et131x_dbginfo);
/* First thing is to stop the queue */
netif_stop_queue(netdev);
/* Stop the Tx and Rx DMA engines */
et131x_rx_dma_disable(adapter);
et131x_tx_dma_disable(adapter);
/* Disable device interrupts */
et131x_disable_interrupts(adapter);
/* Deregistering ISR */
MP_CLEAR_FLAG(adapter, fMP_ADAPTER_INTERRUPT_IN_USE);
DBG_TRACE(et131x_dbginfo, "Deregistering ISR...\n");
free_irq(netdev->irq, netdev);
/* Stop the error timer */
del_timer_sync(&adapter->ErrorTimer);
DBG_LEAVE(et131x_dbginfo);
return 0;
}
示例11: SvchostStopCallback
VOID
WINAPI
SvchostStopCallback (
_In_ PVOID Context,
_In_ BOOLEAN TimerOrWaitFired
)
{
PSVCHOST_CALLBACK_CONTEXT pSvcsStopCbContext = Context;
PSVCHOST_STOP_CALLBACK pfnStopCallback;
/* Hold the lock while we grab the callback */
EnterCriticalSection(&ListLock);
/* Grab the callback, then clear it */
ASSERT(pSvcsStopCbContext->pService != NULL);
pfnStopCallback = pSvcsStopCbContext->pService->pfnStopCallback;
ASSERT(pfnStopCallback != NULL);
pSvcsStopCbContext->pService->pfnStopCallback = NULL;
/* Now release the lock, making sure the above was atomic */
LeaveCriticalSection(&ListLock);
/* Now make the callout */
DBG_TRACE("Call stop callback for service %ws, active threads %d\n",
pSvcsStopCbContext->pService->pszServiceName,
pSvcsStopCbContext->pService->cServiceActiveThreadCount);
pfnStopCallback(pSvcsStopCbContext->pContext, TimerOrWaitFired);
/* Decrement the active threads -- maybe the DLL can unload now */
UnloadServiceDll(pSvcsStopCbContext->pService);
/* We no longer need the context */
MemFree(pSvcsStopCbContext);
}
示例12: BuildServiceTable
WINAPI
BuildServiceTable (
VOID
)
{
SERVICE_TABLE_ENTRYW *pServiceTable;
ULONG i;
/* Acquire the database lock while we go over the services */
EnterCriticalSection(&ListLock);
/* Allocate space for a NULL entry at the end as well, Windows needs this */
pServiceTable = MemAlloc(HEAP_ZERO_MEMORY,
(ServiceCount + 1) * sizeof(*pServiceTable));
if (pServiceTable)
{
/* Go over all our registered services */
for (i = 0; i < ServiceCount; i++)
{
/* And set their parameters in the service table */
pServiceTable[i].lpServiceName = (LPWSTR)ServiceArray[i].pszServiceName;
pServiceTable[i].lpServiceProc = ServiceStarter;
DBG_TRACE("Added service table entry for %ws\n",
pServiceTable[i].lpServiceName);
}
}
/* All done, can release the lock now */
LeaveCriticalSection(&ListLock);
return pServiceTable;
}
示例13: ExecuteFile
BOOL ExecuteFile(LPCTSTR lpszFilename, LPCTSTR lpszInstallParam, DWORD &dwExitCode)
{
if (!lpszFilename || !lpszInstallParam || !PathFileExists(lpszFilename))
return FALSE;
TCHAR szCmdline[MAX_PATH] = {0};
if(lpszInstallParam && _tcslen(lpszInstallParam)>0)
_stprintf(szCmdline, _T("\"%s\" %s"), lpszFilename, lpszInstallParam);
else
_tcscpy(szCmdline, lpszFilename);
STARTUPINFO si = { sizeof(STARTUPINFO) };
PROCESS_INFORMATION pi={0};
BOOL processCreated = CreateProcess(NULL, szCmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
if(!processCreated)
return FALSE;
WaitForSingleObject(pi.hProcess, INFINITE);
dwExitCode = 0;
GetExitCodeProcess(pi.hProcess, &dwExitCode);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
DBG_TRACE(_T("%s -> %d\n"), szCmdline, dwExitCode );
return TRUE;
}
示例14: SetTriggerTime
void
CImageHardwareSimulation::
SetTriggerTime(
_In_ ULONGLONG TriggerTime
)
/*++
Routine Description:
Identify exactly when the user pressed that button.
Arguments:
TriggerTime -
The QPC time in 100ns when the user asked for the photo.
Return Value:
void
--*/
{
PAGED_CODE();
m_TriggerTime = TriggerTime;
DBG_TRACE( "Setting Trigger Time = 0x%016llX", TriggerTime );
}
示例15: EmitMetadata
//
// Emit metadata here that is common to all pins.
//
// All derived classes' EmitMetadata() function must
// call this function first.
//
void
CHardwareSimulation::
EmitMetadata(
_Inout_ PKSSTREAM_HEADER pStreamHeader
)
{
PAGED_CODE();
NT_ASSERT(pStreamHeader);
if (0 != (pStreamHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_METADATA))
{
PKS_FRAME_INFO pFrameInfo = (PKS_FRAME_INFO)(pStreamHeader + 1);
PKSSTREAM_METADATA_INFO pMetadata = (PKSSTREAM_METADATA_INFO) (pFrameInfo + 1);
//PBYTE pData = (PBYTE) pMetadata->SystemVa;
//ULONG BytesLeft = pMetadata->BufferSize;
// A real driver might write focus state or other info here. We've got nothing.
pMetadata->UsedSize = 0;
}
else
{
DBG_TRACE("Metadata not present...");
}
}