Share via


NameProfile (Windows Embedded CE 6.0)

1/5/2010

This function assigns a name to a specified process or thread.

int NameProfile(
    LPCSTR pszName,
    int nLevel,
    DWORD dwID
);

Parameters

  • pszName
    A pointer to a string that contains the name of the profiling element.

    The length of the string cannot exceed 32 characters, including the terminating null character.

    A name cannot contain spaces.

  • nLevel
    Level of execution of the identifier specified in the dwID parameter.

    The following table shows possible values for the nLevel parameter.

    Value Description

    PROFILE_GLOBALLEVEL

    Assigns a name to the entire profiling run.

    A profile name applied at the global level appears in the Properties window in the Scenario Name.

    PROFILE_PROCESSLEVEL

    Assigns a name to the process specified by the dwId parameter.

    PROFILE_THREADLEVEL

    Assigns a name to the thread specified by the dwId parameter.

  • dwID
    Element to which the NameProfile function applies.

    To specify the current process or thread, use PROFILE_CURRENTID.

    To specify a process or thread other than the current process or thread, use the process or thread identifier that the system generates.

Return Values

The following table shows the values that this function returns.

Value Description

NAME_OK

The name was registered successfully.

NAME_ERROR_TEXTTRUNCATED

The string containing the name exceeded 32 characters and was truncated.

NAME_ERROR_REDEFINITION

A name was already assigned to the profile element.

Remote Call Profiler ignored the name in this function.

NAME_ERROR_INVALID_NAME

The name is invalid.

NAME_ERROR_LEVEL_NOEXIST

The profile level specified in the nLevel parameter does not exist.

PROFILE_ERROR_ID_NO_EXIST

The profiling element specified by the dwId parameter does not exist.

Remarks

In the Remote Call Profiler Collection Control window, the identifier assigned to an element by the NameProfile function is displayed in place of the default name for the process or thread.

You can only assign one name to each process or thread. After you name a profiling element, subsequent calls to the NameProfile function for that element are ignored.

If you specify a process or thread other than the current process or thread, be sure it initializes and runs before you name it. Otherwise, the NameProfile function fails.

Requirements

Header cecap.h
Library cecap.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Concepts

Call Profiler Data Collection Functions
Call Profiler Collection Control Window