1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

feat(fsdrv) fix issues for win32 backends (#3284)

This commit is contained in:
Kenji Mouri 2022-04-26 22:55:40 +08:00 committed by GitHub
parent 4094a37a5f
commit 3c0a3d05cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -219,14 +219,14 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
return handle;
#else
handle->dir_p = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA fdata;
WIN32_FIND_DATAA fdata;
/*Make the path relative to the current directory (the projects root folder)*/
char buf[MAX_PATH_LEN];
lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s\\*", path);
strcpy(handle->next_fn, "");
handle->dir_p = FindFirstFile(buf, &fdata);
handle->dir_p = FindFirstFileA(buf, &fdata);
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
@ -278,9 +278,9 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
strcpy(fn, handle->next_fn);
strcpy(handle->next_fn, "");
WIN32_FIND_DATA fdata;
WIN32_FIND_DATAA fdata;
if(FindNextFile(handle->dir_p, &fdata) == false) return LV_FS_RES_OK;
if(FindNextFileA(handle->dir_p, &fdata) == false) return LV_FS_RES_OK;
do {
if(strcmp(fdata.cFileName, ".") == 0 || strcmp(fdata.cFileName, "..") == 0) {
continue;
@ -294,7 +294,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
}
break;
}
} while(FindNextFile(handle->dir_p, &fdata));
} while(FindNextFileA(handle->dir_p, &fdata));
#endif
return LV_FS_RES_OK;

View File

@ -1,4 +1,4 @@
/**
/**
* @file lv_fs_win32.c
*
*/
@ -362,7 +362,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
dir_handle_t * handle = (dir_handle_t *)lv_mem_alloc(sizeof(dir_handle_t));
handle->dir_p = INVALID_HANDLE_VALUE;
handle->next_error = LV_FS_RES_OK;
WIN32_FIND_DATA fdata;
WIN32_FIND_DATAA fdata;
/*Make the path relative to the current directory (the projects root folder)*/
char buf[MAX_PATH_LEN];
@ -373,7 +373,7 @@ static void * fs_dir_open(lv_fs_drv_t * drv, const char * path)
#endif
strcpy(handle->next_fn, "");
handle->dir_p = FindFirstFile(buf, &fdata);
handle->dir_p = FindFirstFileA(buf, &fdata);
do {
if(is_dots_name(fdata.cFileName)) {
continue;
@ -416,7 +416,7 @@ static lv_fs_res_t fs_dir_read(lv_fs_drv_t * drv, void * dir_p, char * fn)
lv_fs_res_t current_error = handle->next_error;
strcpy(handle->next_fn, "");
WIN32_FIND_DATA fdata;
WIN32_FIND_DATAA fdata;
while(FindNextFileA(handle->dir_p, &fdata)) {
if(is_dots_name(fdata.cFileName)) {