I thought to attach the correct code. Sorry.
The code is the follow:
struct VertexType
{
D3DXVECTOR3 Pos;
D3DXVECTOR4 Col;
};
...
...
VertexType *pData = NULL;
HRESULT hr = vertexBuffer->Map(D3D10_MAP_READ , 0,
reinterpret_cast< void** >(&pData));
The error is in the HRESULT that is not S_OK but E_INVALIDARG.