A little progress...
In direct X, to access the format of the stencil buffer and its abilitys - you need to look at the z buffer (hence the EnumZBufferFormats). Now to figure out what the clsid,d3dpfcallbank and void varibles should be!
Local hResult=PrimaryDevice.d3d.EnumZBufferFormats(clsid,d3dpfcallback,void)
In direct X, to access the format of the stencil buffer and its abilitys - you need to look at the z buffer (hence the EnumZBufferFormats). Now to figure out what the clsid,d3dpfcallbank and void varibles should be!