Поделиться через


CeLog Table Interfaces (Windows Embedded CE 6.0)

1/5/2010

Two table structures define the primary interface between the kernel and an event tracking library: CeLogImportTable, and CeLogExportTable.

Your library may only call functions that are provided by the CeLogImportTable structure. Because your event tracking library loads into the kernel, it cannot link against coredll.dll, or use the system APIs and services that coredll provides.

When the kernel loads your library, it calls the DLL entry point for your library with a pointer to the KernelLibIoControl function. The DLL for your custom library can use this function to get the CeLogImportTable from the kernel, and to register its CeLogExportTable with the kernel. For more information, see Registering an Event Tracking Library.

CeLogImportTable Cautions

The kernel often calls CeLogData from within parts of the kernel where it is unsafe to make system calls, and unsafe to interact with the kernel debugger, such as to set a breakpoint or step through code. As a result, you must be careful about such actions when you are implementing or debugging your CeLogData function. Failing to do so can cause an unrecoverable system crash.

The following table shows CeLogImportTable functions that are safe to call from within a CeLogData implementation. Do not call any other functions from the CeLogImportTable inside your CeLogData implementation.

CeLogImportTable function Description

pEventModify

Pointer to the DLL version of PEventModify. EventModify is used to implement the SetEvent, ResetEvent, and PulseEvent functions. See CeLogImportTable for more information.

pQueryPerformanceCounter

Pointer to the DLL's version of QueryPerformanceCounter.

pQueryPerformanceFrequency

Pointer to the DLL's version of QueryPerformanceFrequency.

pGetLastError

Pointer to the DLL's version of GetLastError.

pSetLastError

Pointer to the DLL's version of SetLastError.

pInSysCall

Pointer to InSysCall wrapper function.

Use the pInSysCall function to determine whether it is safe to use the debugger. For example, while you are debugging your CeLogData implementation, you can add some temporary code that is safe to put a debug break on:

    if (imports.pInSysCall() == FALSE) {
        int I = 0; // Add a debugger breakpoint on this line to stop safely
    }

Note

Libraries that load into the kernel follow special rules when they are built into the run-time image. The library must be in the FILES Section, or it must be in the MODULES Section with the kernel flag, K, set for kernel-style fixups.

Note

Fixups are functionality of Romimage that allow you to initialize the load address of a module at MAKEIMG time.

See Also

Reference

Registering an Event Tracking Library

Concepts

Implementing an Event Tracking Library
CeLog IOCTL Interface