Hi,
+ char * nstr1 = HeapAlloc(GetProcessHeap(), 0, count + 1); + char * nstr2 = HeapAlloc(GetProcessHeap(), 0, count + 1); + + memcpy(nstr1, str1, count + 1); strncoll is used to compare at most count characters (you can't access data after nullbyte). You're not null terminating nstr1 and nstr2 strings.
This function should be implemented without memory allocations.
Cheers, Piotr