次の方法で共有


MAPHEADER (Windows Embedded CE 6.0)

1/6/2010

This structures stores header information on a shared memory buffer.

Syntax

typedef struct _MAPHEADER {
    //
    // VERSION 1 DATA
    DWORD  dwBufSize;
    LPBYTE pWrite;
    LPBYTE pRead;
    BOOL   fSetEvent;
    BYTE   bReserved;
    DWORD  dwLostBytes;
    //
    // VERSION 2 DATA
    DWORD  dwVersion;
    DWORD  dwBufferStart;
    DWORD  dwWriteOffset;
    DWORD  dwReadOffset;
} MAPHEADER, *PMAPHEADER;

Members

  • dwBufSize
    Size of the data buffer. This does not include the size of the header.
  • pWrite
    Pointer to the next location to be written in the buffer.

    Valid for Version 1 of this structure. This pointer will be NULL for version 2 and later.

  • pRead
    Pointer to the next location to read from.

    Valid for Version 1 of this structure. This pointer will be NULL for version 2 and later.

  • fSetEvent
    Flag indicating whether the fill event can be set.

    The writer sets this value to FALSE; the reader sets this value to TRUE.

  • bReserved
    Unused padding for DWORD alignment.
  • dwLostBytes
    Total number of lost bytes.

    This value is set by the writer and only read by the reader.

  • dwVersion
    Indicates the version of this structure.

    This value is 2 for Windows Embedded CE and later.

  • dwBufferStart
    Offset of buffer start from the beginning of the map.

    Valid for Version 2 of this structure.

  • dwWriteOffset
    Offset of write pointer from the beginning of the map. The writer moves this pointer.

    Valid for Version 2 of this structure.

  • dwReadOffset
    Offset of read pointer from the beginning of the map. The reader moves this pointer, followed by the data buffer. The data buffer starts at dwBufferStart and ends dwBufSize bytes beyond that.

    Valid for Version 2 of this structure.

Remarks

This structure specifies different members for different versions of Windows Embedded CE. Version 1 data applies to all versions of Windows Embedded CE.

** Windows Embedded CE 6.0 and later versions support version 2 data of the structure. Programming and diagnostic tools included with CE 6.0 and later are backward compatible; that is, tools that ship with CE 6.0 and later can be used to debug any published version of the operating system.

However, customized tools may need to incorporate appropriate modifications when used under CE 6.0 and later. Operating systems created using CE 6.0 and later use only version 2 of the MAPHEADER structure, and tools created for previous releases may not work as expected.

  • If you have an existing, customized, event-tracking DLL that is a replacement for celog.dll, then your DLL must expose version 2 of the MAPHEADER structure in order for tools like celogflush.exe and kernel tracker to read your data. Your DLL must set the pWrite and pRead members of the structure to NULL, and initialize the version 2 data members.
  • If you have an existing, customized, flushing tool that is a replacement for celogflush.exe, then your tool must be able to read version 2 of the MAPHEADER structure in order to get data from celog.dll. In version 2 of the structure, the pWrite and pRead members will be NULL.

If desired, you can write a tool that works with multiple OS versions by having the tool check pWrite, pRead, and dwVersion, then adapt accordingly.

Requirements

Header celog.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

CeLog Event Tracking Structures

Other Resources

CeLog Buffering Scheme