I am able to get a buffer using aaApi_SQueryCriDataBufferAddCriterion but can't do anything with it.
So I decided to give PWSearchWrapperX64.dll a go and tried using the SearchForDocumentsMinMemoryX64 function but it's not working.
The error returned is Search execution has failed.
I'm trying to search filenames for .nwd files. Does anyone know how to use the SearchForDocuments functions?
I figured it out eventually