Fix (*file_list) pointer syntax in Windows code, remove repeated variable, windows code now returns event types
This commit is contained in:
+4
-5
@@ -175,7 +175,6 @@ stk_file_event_t *platform_directory_watch_check(void *handle,
|
|||||||
DWORD bytes_returned;
|
DWORD bytes_returned;
|
||||||
FILE_NOTIFY_INFORMATION *info;
|
FILE_NOTIFY_INFORMATION *info;
|
||||||
BYTE *event_ptr;
|
BYTE *event_ptr;
|
||||||
char **file_list;
|
|
||||||
size_t file_count, index;
|
size_t file_count, index;
|
||||||
int char_count;
|
int char_count;
|
||||||
BOOL result;
|
BOOL result;
|
||||||
@@ -242,14 +241,14 @@ stk_file_event_t *platform_directory_watch_check(void *handle,
|
|||||||
info->FileNameLength / sizeof(WCHAR), NULL, 0, NULL, NULL);
|
info->FileNameLength / sizeof(WCHAR), NULL, 0, NULL, NULL);
|
||||||
|
|
||||||
if (char_count > 0) {
|
if (char_count > 0) {
|
||||||
(file_list *)[index] = malloc(char_count + 1);
|
(*file_list)[index] = malloc(char_count + 1);
|
||||||
if ((*file_list)[index]) {
|
if ((*file_list)[index]) {
|
||||||
WideCharToMultiByte(CP_UTF8, 0, info->FileName,
|
WideCharToMultiByte(CP_UTF8, 0, info->FileName,
|
||||||
info->FileNameLength /
|
info->FileNameLength /
|
||||||
sizeof(WCHAR),
|
sizeof(WCHAR),
|
||||||
(file_list *)[index],
|
(*file_list)[index],
|
||||||
char_count, NULL, NULL);
|
char_count, NULL, NULL);
|
||||||
(file_list *)[index][char_count] = '\0';
|
(*file_list)[index][char_count] = '\0';
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,7 +260,7 @@ stk_file_event_t *platform_directory_watch_check(void *handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*out_count = index;
|
*out_count = index;
|
||||||
return file_list;
|
return events;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user