+ if (hr == S_OK) + hr = write_source(iface, source, rc, format, 8, FALSE, This->width, This->height);
I think needs_palette should probably be something like !This->colors.
+ if (state->user_write_data(state->user_ptr, &byte, 1) != 1) + return 0;
Why do we use this kind of abstraction for an internal function? Was this imported from another project?
If possible, I would prefer not to maintain an implementation of LZW compression.