Anhang A
A.1 Skript "GetTimeFromPC"
DWORD dwFlags,
LPCSTR lpMultiByteStr, // string to map
int cbMultiByte,
LPWSTR lpWideCharStr,
int cchWideChar
);
#pragma code()
memset(wszUncName, 0, sizeof(wszUncName));
MultiByteToWideChar(0, 0, pszComputerName, -1, wszUncName, MAX_COMPUTERNAME_LENGTH + 1);
dwResult = NetRemoteTOD(wszUncName, (LPBYTE*)&ptodInfo);
if(0 == dwResult)
sprintf(szResult, "%02d.%02d.%04d
>tod_month, ptodInfo->tod_year, ptodInfo->tod_hours, ptodInfo->tod_mins, ptodInfo-
>tod_secs, ptodInfo->tod_hunds * 10);
else
sprintf(szResult, "<error: %d>", dwResult);
if(nResultBufferSize > strlen(szResult))
strcpy(pszResultBuffer, szResult);
else
dwResult = 1; // buffer to small
if(ptodInfo != NULL)
NetApiBufferFree(ptodInfo);
return (dwResult == 0);
}
112
// character-type options
// number of bytes in string
// wide-character buffer
// size of buffer
%02d:%02d:%02d.%03d", ptodInfo->tod_day, ptodInfo-
PCS 7 Uhrzeitsynchronisation
Funktionshandbuch, 01/2008, A5E01216577-01