日期:2014-05-17 浏览次数:20960 次
public override int GetServerNTP(IntPtr hDev, ref string NTPUrl, ref int timezone, ref bool enable, ref int reserve) { DVSNETClient.DVSNET_NTP_PARAM ntp = new DVSNETClient.DVSNET_NTP_PARAM(); IntPtr pntp = Marshal.AllocHGlobal(Marshal.SizeOf(ntp)); //Marshal.StructureToPtr(ntp, pntp, true); //IntPtr pntp = IntPtr.Zero; uint len = (uint)Marshal.SizeOf(new DVSNETClient.DVSNET_NTP_PARAM()); int r = GetServerParam(hDev, (uint)(0x10000 + 224), 0,ref pntp, len); DVSNETClient.DVSNET_NTP_PARAM ntp = (DVSNETClient.DVSNET_NTP_PARAM)Marshal.PtrToStructure(pntp, typeof(DVSNETClient.DVSNET_NTP_PARAM)); NTPUrl = new string(ntp.strNTPUrl); timezone = (int)ntp.nTimeZone; enable = ntp.bEnabled == 1 ? true : false; reserve = (int)ntp.dwReserve; return r; }