36 #define WIN32_LEAN_AND_MEAN
45 struct cfs_win32_dir {
55 struct cfs_win32_dir *dir = (
struct cfs_win32_dir *)p;
57 char dirname[MAX_PATH];
60 GetModuleFileName(
NULL, dirname,
sizeof(dirname));
61 strcpy(strrchr(dirname,
'\\'),
"/*");
63 sprintf(dirname,
"%s/*", n);
66 dir->handle = FindFirstFile(dirname, &data);
67 if(dir->handle == INVALID_HANDLE_VALUE) {
71 dir->name = strdup(data.cFileName);
72 dir->size = ((data.nFileSizeLow + 511) / 512) % 1000;
79 struct cfs_win32_dir *dir = (
struct cfs_win32_dir *)p;
82 if(dir->name ==
NULL) {
86 strncpy(e->name, dir->name,
sizeof(e->name));
90 if(FindNextFile(dir->handle, &data) == 0) {
94 dir->name = strdup(data.cFileName);
95 dir->size = ((data.nFileSizeLow + 511) / 512) % 1000;
102 struct cfs_win32_dir *dir = (
struct cfs_win32_dir *)p;
105 FindClose(dir->handle);