This one was quite strange - the PPJoy installer would work when using the debug build of the DLL that registers the driver; when I used the release build the installer would fail to register the driver. Oh joy.
So then out comes windbg. Man's best friend for sure. As it turns out, there is one function in my DLL that requires a MULTI_SZ format string. Basically this means the string must end with two zero bytes; and the code was initialising it with only one zero, hence it failed. So why did the debug version work? I am speculating that the debug version includes extra variables that changes the packing in memory and the empty spots are probably filled with zeros... These zeros would make up for the one I forgot to add at the end of the string.
I really, really hope I don't other similar bugs lurking in there somewhere!!! The scary thing is that these bugs can lie dormant for years, just waiting for an innocent code change.