Now, online there is a handy set of docs in MSDN about the layout of the DDS file.
In these files is the line;
For simple uncompressed textures, a .dds file should contain DDSD_PITCH and a DDPF_RGB pixel format surface. The pitch value should be DWORD-aligned. In this case, the main image should be (dwPitchOrLinearSize-by-dwHeight) bytes total.
"Excellent", thinks I, "I can use that to detect uncompressed DDS files and work out their size".
So, I go ahead and code it and all is good with the world.
Today I get my attension drawn to uncompressed DDS files and I figure I should test my code with them, so firstly I try to use the compressonator from ATI to produce an compressed mipmap'd DDS, however it doesnt let me.
So I ask on #graphicsdev and get pointed at MS's own DX Texture Tool, which yes does allow me to build a mipmap chain and save the image.
So I do so, make the adjustments needed, hit run and promptly get dumpped out with an assert on the ptr to the image data being null.
Much investing later and it turns out that MS's own texture tool doesnt correctly write the headers! The flags section of the header doesnt have the DDSPITCH flag set!
Time to work out another way to detect it...