Gerald Pfeifer gerald@pfeifer.com writes:
dwBufLen already indictes that this variable is of type DWORD and thus always positive. I also looked at the implementation of ImmGetCompositionStringW() and we do not seem to return a negative value (such as -1).
Maybe the implementation doesn't, but the function returns a LONG, and can (and probably should) return negative values on error.