Hobart Liu

http://msdn2.microsoft.com/en-us/library/ms928547.aspx, It says "The accuracy 
may be retrieved by IOCTL_KLIB_GETALARMRESOLUTION", my question is how 


Re: Smart Devices Native C++ Development How to get real-time clock accuracy on windows mobile 5.0

Michael Koster

The following sample show how:

Code Snippet

#ifdef __cplusplus

extern "C" {

#endif

// KernelLibIoControl definitions

#define KMOD_CORE 1

#define IOCTL_KLIB_GETALARMRESOLUTION 5

BOOL KernelLibIoControl (HANDLE hLib, DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned);

#ifdef __cplusplus

}

#endif

DWORD dwTimer = 0;

DWORD dwRet = 0;

KernelLibIoControl((HANDLE)KMOD_CORE, IOCTL_KLIB_GETALARMRESOLUTION, NULL, 0, &dwTimer, sizeof(dwTimer), &dwRet);

HTH

Michael