Merge branch 'nfs' of https://github.com/panxiao2014/fio
[fio.git] / os / windows / dlls.c
index 774b1c612f99356a8fe1b4658be8268ed513057b..ffedfa1e8f4663d694723c184b35892e00fcbd37 100644 (file)
@@ -11,12 +11,18 @@ void os_clk_tck(long *clk_tck)
         */
        unsigned long minRes, maxRes, curRes;
        HMODULE lib;
-       FARPROC queryTimer;
-       FARPROC setTimer;
+       NTSTATUS NTAPI (*queryTimer)
+               (OUT PULONG              MinimumResolution,
+                OUT PULONG              MaximumResolution,
+                OUT PULONG              CurrentResolution);
+       NTSTATUS NTAPI (*setTimer)
+               (IN ULONG                DesiredResolution,
+                IN BOOLEAN              SetResolution,
+                OUT PULONG              CurrentResolution);
 
        if (!(lib = LoadLibrary(TEXT("ntdll.dll"))) ||
-               !(queryTimer = GetProcAddress(lib, "NtQueryTimerResolution")) ||
-               !(setTimer = GetProcAddress(lib, "NtSetTimerResolution"))) {
+               !(queryTimer = (void *)GetProcAddress(lib, "NtQueryTimerResolution")) ||
+               !(setTimer = (void *)GetProcAddress(lib, "NtSetTimerResolution"))) {
                dprint(FD_HELPERTHREAD, 
                        "Failed to load ntdll library, set to lower bound 64 Hz\n");
                *clk_tck = 64;
@@ -30,4 +36,4 @@ void os_clk_tck(long *clk_tck)
                setTimer(maxRes, 1, &curRes);
                *clk_tck = (long) (10000000L / maxRes);
        }
-}
\ No newline at end of file
+}