ID3DXFileData::Lock method

Accesses the .x file data.

Syntax

HRESULT Lock(
  [in]       SIZE_T *pSize,
  [in] const VOID   **ppData
);

Parameters

pSize [in]

Type: SIZE_T*

Pointer to the size of the .x file data.

ppData [in]

Type: const VOID**

Address of a pointer to receive the ID3DXFileData file data object's interface pointer. See Remarks.

Return value

Type: HRESULT

If the method succeeds, the return value is S_OK. If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

Remarks

The ppData pointer is only valid during a ID3DXFileData::Lock ... ID3DXFileData::Unlock sequence. You can make multiple lock calls. However, you must ensure that the number of lock calls matches the number of unlock calls.

Because file data is not guaranteed to be aligned properly with byte boundaries, you should access ppData with UNALIGNED pointers.

Returned parameter values are not guaranteed to be valid due to possible file corruption; therefore, your code should verify the returned parameter values.

Requirements

Requirement Value
Header
D3DX9Xof.h
Library
D3dx9.lib

See also

ID3DXFileData