Partager via


PDDInit (Accelerometer) (Compact 7)

3/12/2014

This function initializes a device.

Syntax

DWORD PDDInit(
  DWORD dwMDDContext,
  __in_z WCHAR *pszPDDRegistryKey,
  __inout PDD_INTERFACE *pPDDInterface,
  __in MDD_CALLBACK_INFO* pMDDCallbackInfo
);

Parameters

  • dwMDDContext
    [in] Model device driver (MDD) context.
  • pszPDDRegistryKey
    [in] Pointer to the platform-dependent driver (PDD) registry key. The device manager calls the MDD ACC_Init function with a registry key string pointer. The ACC_Init function then passes this pointer to PDDInit. PDDInit can then read the registry values under that key if they are needed.
  • pPDDInterface
    [inout] Pointer to a PDD_INTERFACE structure that contains function pointers to routines in the PDD. The MDD uses this structure to call back into the PDD.
  • pMDDCallbackInfo
    [in] Pointer to an ACCELEROMETER_CALLBACK_INFO structure that contains pointers to callback functions in the PDD. This information is used by the PDD to asynchronously call back into the MDD.

Return Value

Returns the PDD device context. If NULL is returned, the call was unsuccessful.

Remarks

The pddInterface parameter contains a pointer to a PDD_INTERFACE structure your driver supplies that exposes all of the available functions in your PDD. The structure takes the following form:

typedef struct _PDD_INTERFACE

{

DWORD cbSize; // sizeof(PDD_INTERFACE)

// Function pointer table for the PDD interface follows.

. . .

} PDD_INTERFACE;

The cbSize member is mandatory. All other members are driver specific, and point to the available functions in your PDD.

The pMDDCallbackInto parameter contains a pointer to an ACCELEROMETER_CALLBACK_INFO structure your driver supplies that contains pointers to the callback functions in the MDD. The structure takes the following form:

typedef struct _ACCELEROMETER_CALLBACK_INFO

{

DWORD cbSize; // sizeof(ACCELEROMETER_CALLBACK_INFO)

// Function pointer table for the MDD callback interface follows.

. . .

} ACCELEROMETER_CALLBACK_INFO;

The cbSize member is mandatory. All other members are driver specific, and point to the callback functions in the MDD.

Requirements

Library

accmdd.lib

See Also

Reference

Accelerometer PDD Functions