Rename 'WINDOW' to 'STREAM'; use result type

Signed-off-by: David Scott <dave.scott@citrix.com>