IIRC, the listctrl sorting is stable. To get the desired result as ken suggested, all you have to do is use the same approach as radix-sorting, sorting the fields in reverse order. IE, first by desired column, then by "has file" column. This of course does require that the sorting is stable.
In this example, the second field is the "has file" field, the first being some arbitrary data field.
Original: 9-0 2-0 1-1 9-0 2-1 3-0
Sorted by first: 1-1 2-0 2-1 3-0 9-0 9-0
Sorted by second: 2-0 3-0 9-0 9-0 1-1 2-1
The actual order of the fields is of course only relevant when choosing the first column to sort by.