long _cdecl vdf_initall(int numdisks, const char* cdid, long* cddrives, long* disksfound) { Timer Measure; Measure.Start(); if(hDLL = LoadLibrary(TEXT("Vdfs32org.dll"))) { vdf_fopen_ptr = (vdf_fopen_func)GetProcAddress(hDLL, "vdf_fopen"); vdf_fclose_ptr = (vdf_fclose_func)GetProcAddress(hDLL, "vdf_fclose"); vdf_fread_ptr = (vdf_fread_func)GetProcAddress(hDLL, "vdf_fread"); vdf_fseek_ptr = (vdf_fseek_func)GetProcAddress(hDLL, "vdf_fseek"); vdf_ftell_ptr = (vdf_ftell_func)GetProcAddress(hDLL, "vdf_ftell"); vdf_fexists_ptr = (vdf_fexists_func)GetProcAddress(hDLL, "vdf_fexists"); vdf_getdir_ptr = (vdf_getdir_func)GetProcAddress(hDLL, "vdf_getdir"); vdf_findopen_ptr = (vdf_findopen_func)GetProcAddress(hDLL, "vdf_findopen"); vdf_findnext_ptr = (vdf_findnext_func)GetProcAddress(hDLL, "vdf_findnext"); vdf_findclose_ptr = (vdf_findclose_func)GetProcAddress(hDLL, "vdf_findclose"); vdf_searchfile_ptr = (vdf_searchfile_func)GetProcAddress(hDLL, "vdf_searchfile"); vdf_getlasterror_ptr = (vdf_getlasterror_func)GetProcAddress(hDLL, "vdf_getlasterror"); vdf_initall_ptr = (vdf_initall_func)GetProcAddress(hDLL, "vdf_initall"); vdf_exitall_ptr = (vdf_exitall_func)GetProcAddress(hDLL, "vdf_exitall"); vdf_ffilesize_ptr = (vdf_ffilesize_func)GetProcAddress(hDLL, "vdf_ffilesize"); fopen_s(&Log, "VDFS.log", "w"); long res = vdf_initall_ptr(numdisks, cdid, cddrives, disksfound); fprintf(Log, "%d vdf_initall(%d, %s, %d, %d)\n", res, numdisks, cdid, *cddrives, *disksfound); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; } return -1; }
void main(void) { Vdfs Test; Timer Measure; Measure.Start(); Test.Init(); printf("%f\n", Measure.GetElapsedTimeSeconds()); _getch(); }
long _cdecl vdf_fclose(long fp) { Timer Measure; Measure.Start(); long res = vdf_fclose_ptr(fp); fprintf(Log, "%d vdf_fclose(%d)\n", res, fp); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; }
long _cdecl vdf_fopen(const char* filename, long flags) { Timer Measure; Measure.Start(); long res = vdf_fopen_ptr(filename, flags); fprintf(Log, "%d vdf_fopen(%s, %d)\n", res, filename, flags); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; }
long _cdecl vdf_findnext(long find, TVDFFINDDATA* finddata) { Timer Measure; Measure.Start(); long res = vdf_findnext_ptr(find, finddata); fprintf(Log, "%d vdf_findnext(%d, %s)\n", res, find, finddata->name); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; }
long _cdecl vdf_getdir(char* dirname) { Timer Measure; Measure.Start(); long res = vdf_getdir_ptr(dirname); fprintf(Log, "%d vdf_getdir_ptr(%s)\n", res, dirname); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; }
long _cdecl vdf_getlasterror(char* text) { Timer Measure; Measure.Start(); long res = vdf_getlasterror_ptr(text); fprintf(Log, "%d vdf_getlasterror(%s)\n", res, text); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; }
long _cdecl vdf_searchfile(const char* filename, char* fullname) { Timer Measure; Measure.Start(); long res = vdf_searchfile_ptr(filename, fullname); fprintf(Log, "%d vdf_searchfile(%s, %s)\n", res, filename, fullname); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); return res; };
long _cdecl vdf_exitall(void) { Timer Measure; Measure.Start(); if(hDLL) { long res = vdf_exitall_ptr(); fprintf(Log, "%d vdf_exitall()\n", res); fprintf(Log, "\t%f sec\n", Measure.GetElapsedTimeSeconds()); fflush(Log); vdf_fopen_ptr = NULL; vdf_fclose_ptr = NULL; vdf_fread_ptr = NULL; vdf_fseek_ptr = NULL; vdf_ftell_ptr = NULL; vdf_fexists_ptr = NULL; vdf_getdir_ptr = NULL; vdf_findopen_ptr = NULL; vdf_findnext_ptr = NULL; vdf_findclose_ptr = NULL; vdf_searchfile_ptr = NULL; vdf_getlasterror_ptr = NULL; vdf_initall_ptr = NULL; vdf_exitall_ptr = NULL; vdf_ffilesize_ptr = NULL; FreeLibrary(hDLL); hDLL = NULL; fclose(Log); Log = NULL; return res; } return 0; }