ITabletContextP::UseSharedMemoryCommunications method

Provides access to memory shared between tablet threads.

Syntax

HRESULT UseSharedMemoryCommunications(
  [in]  DWORD pid,
  [out] DWORD *phEventMoreData,
  [out] DWORD *phEventClientReady,
  [out] DWORD *phMutexAccess,
  [out] DWORD *phFileMapping
);

Parameters

pid [in]

Process id.

phEventMoreData [out]

Event handle that signals when new data is available to be processed.

phEventClientReady [out]

Returned event handle used to signal that the client is ready to receive data. Signaled after processing new data.

phMutexAccess [out]

The mutex granting access to shared memory.

phFileMapping [out]

Pointer to the shared memory block.

Return value

This method can return one of these values.

Return code Description
S_OK
Success.
E_FAIL
An unspecified error occurred.

Remarks

The UseSharedMemoryCommunications method is used as part of the Tablet PC shared memory protocol. Since the Wisptis service has a high integrity level (IL), it can store and access data stored in shared memory without needing to elevate its privileges.

The SHAREDMEMORY_HEADER structure is cast from the data referenced by the file mapping and the raw packet data follows the SHAREDMEMORY_HEADER. Raw packet data can be read off of the shared memory when the event referenced by pdwEventClientReady is raised.

The following list describes the sequence of events for accessing and using shared memory.

  • The client sets the clientReady event.
  • The client waits for the moreData event.
  • The client acquires the mutex.
  • The client reads packet data from the section of shared memory after the header and serial numbers after the packets.
  • The client handles data depending on the value of dwEvent.
  • The client writes -1 (0xFFFFFFFF) into dwEvent.
  • The client releases the mutex.
  • The client sets the clientReady event.

Requirements

Requirement Value
Minimum supported client
Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server
None supported
Library
Wisptis.exe

See also

ITabletContextP Interface

UseNamedSharedMemoryCommunications