This is very unusual. Why not just use lstrlenW(...)?
I just followed these examples[1][2], but I can change it if necessary.
You should also look at calculating the string length within
WCMD_keyword_ws_found(), instead of passing the length as an argument.
But do this as a separate patch.