C++ (Cpp) TRACE Examples

C++ (Cpp) TRACE - 30 examples found. These are the top rated real world C++ (Cpp) examples of TRACE extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
static DWORD WINAPI MessageLoop(LPVOID lpParameter)
{
    VideoRendererImpl* This = lpParameter;
    MSG msg;
    BOOL fGotMessage;

    TRACE("Starting message loop\n");

    if (FAILED(BaseWindowImpl_PrepareWindow(&This->baseControlWindow.baseWindow)))
    {
        This->ThreadResult = FALSE;
        SetEvent(This->hEvent);
        return 0;
    }

    This->ThreadResult = TRUE;
    SetEvent(This->hEvent);

    while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
    {
        TranslateMessage(&msg);
        DispatchMessageW(&msg);
    }

    TRACE("End of message loop\n");

    return msg.wParam;
}
Example #2
0
void insertCommandAfter(COMMAND_LIST list, COMMAND_LIST_ITERATOR iterator, const COMMAND command)
{
    if (list == null)
    {
        TRACE(TRACE_ERROR, "Illegal attempt to access null list");
        return;
    }
    if (iterator == null)
    {
        TRACE(TRACE_ERROR, "Illegal attempt to access null iterator");
        return;
    }
    COMMAND_LIST_ENTRY command_list_entry = createCommandListEntry();
    if (command_list_entry == null)
    {
        return;
    }
    command_list_entry->command=command;
    command_list_entry->next=iterator->next;
    iterator->next=command_list_entry;
    if (list->last == iterator)
    {
        list->last == command_list_entry;
    }
}
Example #3
0
File: stub.c Project: OPSF/uClinux
static void *
get_func_addr(const char *name) {
#ifdef RTLD_NEXT
    void *addr = shared_obj_findsym(RTLD_NEXT, name);

    if (addr != NULL) {
        TRACE(("stub: %s found in the subsequent objects\n", name));
        return (addr);
    }
#else
    int i;

    for (i = 0; shobj[i].name != NULL; i++) {
        if (shobj[i].handle == NULL) {
            TRACE(("stub: loading %s\n", shobj[i].name));
            shobj[i].handle = shared_obj_open(shobj[i].name);
        }
        if (shobj[i].handle != NULL) {
            void *addr = shared_obj_findsym(shobj[i].handle, name);
            if (addr != NULL) {
                TRACE(("stub: %s found in %s\n",
                       name, shobj[i].name));
                return (addr);
            }
        }
    }
#endif
    TRACE(("stub: %s not found\n", name));
    return (NULL);
}
Example #4
0
COMMAND createCommand(const LABEL_TYPE label, const COMMAND_TYPE type, const PARAMETER parameter)
{
    COMMAND result;
    TRACE(TRACE_DEBUG, "Creating command %s", getCommandTypeString(type));
    result = (COMMAND)malloc(sizeof(T_COMMAND));
    if (result == null)
    {
        TRACE(TRACE_ERROR, "Memory allocation failed");
        return null;
    }
    if (label == null)
    {
        result->label = null;
    }
    else
    {
        result->label = label;
        if (result->label == null)
        {
            free(result);
            return null;
        }
    }
    result->type = type;
    result->parameter = parameter;
    return result;
}
Example #5
0
void addCommand(COMMAND_LIST list, const COMMAND command)
{
    if (list == null)
    {
        TRACE(TRACE_ERROR, "Illegal attempt to access null list");
        return;
    }
    TRACE(TRACE_DEBUG, "Adding new entry to the list");
    COMMAND_LIST_ENTRY command_list_entry = createCommandListEntry();
    if (command_list_entry == null)
    {
        return;
    }
    command_list_entry->command=command;
    command_list_entry->next=null;
    if (list->first == null)
    {
        list->first=command_list_entry;
    }
    else
    {
        setNextEntry(list->last, command_list_entry);
    }
    list->last=command_list_entry;
    TRACE(TRACE_DEBUG, "New entry added");
}
Example #6
0
static HRESULT WINAPI IDirectSoundCaptureBufferImpl_GetFormat(IDirectSoundCaptureBuffer8 *iface,
        WAVEFORMATEX *lpwfxFormat, DWORD dwSizeAllocated, DWORD *lpdwSizeWritten)
{
    IDirectSoundCaptureBufferImpl *This = impl_from_IDirectSoundCaptureBuffer8(iface);
    HRESULT hres = DS_OK;

    TRACE("(%p,%p,0x%08x,%p)\n", This, lpwfxFormat, dwSizeAllocated, lpdwSizeWritten);

    if (This->device == NULL) {
        WARN("invalid parameter: This->device == NULL\n");
        return DSERR_INVALIDPARAM;
    }

    if (dwSizeAllocated > (sizeof(WAVEFORMATEX) + This->device->pwfx->cbSize))
        dwSizeAllocated = sizeof(WAVEFORMATEX) + This->device->pwfx->cbSize;

    if (lpwfxFormat) { /* NULL is valid (just want size) */
        CopyMemory(lpwfxFormat, This->device->pwfx, dwSizeAllocated);
        if (lpdwSizeWritten)
            *lpdwSizeWritten = dwSizeAllocated;
    } else {
        if (lpdwSizeWritten)
            *lpdwSizeWritten = sizeof(WAVEFORMATEX) + This->device->pwfx->cbSize;
        else {
            TRACE("invalid parameter: lpdwSizeWritten = NULL\n");
            hres = DSERR_INVALIDPARAM;
        }
    }

    TRACE("returning %08x\n", hres);
    return hres;
}