According to the Microsoft documentation, the return value to FindNextFile
is not the same as for FindFirstFile
. FindNextFile
returns a boolean value:
...
BOOL found = TRUE;
printf("shader files found \n");
while (found)
{
printf("Filename=%s\n",FindFileData.cFileName);
found = FindNextFile(hFind, &FindFileData);
shader_counter++;
}
printf("Exit loop\n");
FindClose(hFind);
...
(It has to be an independent value, otherwise you would pass an invalid handle to FindClose
.)