I had the same problem today.
m_VertexBuffer->Lock(m_nNextVertexData, Size, &pData, VertexLockFlags) failed
at Src\D3D9DrawPrimitiveUPWrapper.cpp:293
with error D3DERR_DEVICELOST
....and it's very annoying and it happens time by time.
Please find a solution to fix this issue because this makes the game completely unplayable.