ID3DXFileData::Lock

Accesses the .x file data.

HRESULT Lock(
  SIZE_T * pSize,
  CONST VOID ** ppData
);

Parameters

pSize
[in] Pointer to the size of the .x file data.
ppData
[in] Address of a pointer to receive the ID3DXFileData file data object's interface pointer. See Remarks.

Return Values

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

Header: Declared in D3dx9xof.h.