CursorKind sometimes expects default value.
Handle some nulls gracefully.
Add PInvokeGenerator sample.