Question: State should include at least the following:

* All settings set via
SetStreamResource()
* Indices

I have a class whose Draw() function will call SetStreamResource, set Indices and eventually call DrawIndexedPrimitive(). I would like to restore the device state before Draw() returns.

I am looking for something along the lines of GDI's SaveDC()/RestoreDC().

Answer: 
State blocks are the mechanism provided by the API to save and restore chunks of device state. I cover the details of state blocks in Chapter 3. Direct3D Devices from my book [The Direct3D Graphics Pipeline](http://www.xmission.com/~legalize/book/download/). You can download the PDF for that chapter from the link above.
Looks like these will do it:

```
Microsoft::DirectX::Direct3D::Device::BeginStateBlock
Microsoft::DirectX::Direct3D::Device::EndStateBlock

```