Converted from bytes to characters, as this is what windows is expecting.
This commit is contained in:
parent
e152db2cce
commit
5ab8dc0275
|
@ -41,7 +41,7 @@ void deinit_dirmonitor(struct dirmonitor_internal* monitor) {
|
||||||
int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int buffer_size, int (*change_callback)(int, const char*, void*), void* data) {
|
int translate_changes_dirmonitor(struct dirmonitor_internal* monitor, char* buffer, int buffer_size, int (*change_callback)(int, const char*, void*), void* data) {
|
||||||
for (FILE_NOTIFY_INFORMATION* info = (FILE_NOTIFY_INFORMATION*)buffer; (char*)info < buffer + buffer_size; info = (FILE_NOTIFY_INFORMATION*)(((char*)info) + info->NextEntryOffset)) {
|
for (FILE_NOTIFY_INFORMATION* info = (FILE_NOTIFY_INFORMATION*)buffer; (char*)info < buffer + buffer_size; info = (FILE_NOTIFY_INFORMATION*)(((char*)info) + info->NextEntryOffset)) {
|
||||||
char transform_buffer[MAX_PATH*4];
|
char transform_buffer[MAX_PATH*4];
|
||||||
int count = WideCharToMultiByte(CP_UTF8, 0, (WCHAR*)info->FileName, info->FileNameLength, transform_buffer, MAX_PATH*4 - 1, NULL, NULL);
|
int count = WideCharToMultiByte(CP_UTF8, 0, (WCHAR*)info->FileName, info->FileNameLength / 2, transform_buffer, MAX_PATH*4 - 1, NULL, NULL);
|
||||||
change_callback(count, transform_buffer, data);
|
change_callback(count, transform_buffer, data);
|
||||||
if (!info->NextEntryOffset)
|
if (!info->NextEntryOffset)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue