Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following code example shows how to configure the SNTP service for Windows CE using Services.exe:
int WINAPI
WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
#ifdef UNDER_NT
LPSTR lpCmdLine,
#else
LPWSTR lpCmdLine,
#endif
int nCmdShow)
{
HANDLE hFile=CreateFile(L"NTP0:",GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
if(INVALID_HANDLE_VALUE==hFile)
return 0;
WCHAR szControlString[]=L"sync";
DWORD dwLenIn=sizeof(szControlString);
DWORD dwBytesReturned;
DeviceIoControl(hFile, IOCTL_SERVICE_CONTROL, szControlString, dwLenIn, NULL, 0, &dwBytesReturned, NULL);
return 0;
}
Send Feedback on this topic to the authors
Please sign in to use this experience.
Sign in