网站首页  词典首页

请输入您要查询的函数:

 

术语 setsystemtimeadjustment
释义 SetSystemTimeAdjustment
语法:
C++
BOOL WINAPI SetSystemTimeAdjustment(
__in DWORD dwTimeAdjustment,
__in BOOL bTimeAdjustmentDisabled
);
SetSystemTimeAdjustment功能
启用或禁用定期时间调整系统时间的一天24小时。这种调整的时间用于同步的一天时间,一些其他信息来源的时间。当周期时间调整的启用,将它们应用于在每个时钟中断。
参数
dwTimeAdjustment [in]
数的100纳秒单位加入时间天的时钟在每个时钟周期中断时间调整,如果启用。
bTimeAdjustmentDisabled [in]
时间调整模式,该系统是使用。定期调整系统时间可以禁用或启用。
true值指定周期时间的调整是为了被禁用。该系统可自由调整一天的时间使用它自己的内部机制。在dwTimeAdjustment值会被忽略。该系统的内部调整机制可能导致的时间每天24小时明显跳时作出调整。
FALSE值的规定,定期调整的时间要启用,并且将用于调整的时间天24小时。该系统将不会干扰时间调整计划,将不尝试同步自己一天中的时间。该系统将在每个时钟增加了dwTimeAdjustment价值一天的时间中断。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。该函数的方法之一是可能会失败,如果调用方不具备SE_SYSTEMTIME_NAME特权。
备注
在GetSystemTimeAdjustment和SetSystemTimeAdjustment功能的支持算法,同步的一天24小时通过GetSystemTime和GetLocalTime报道,另有一次使用一周期时间调整的来源,时间。
该SetSystemTimeAdjustment功能支持两种模式的时间同步:时间调整-残疾人士和时间调节器-启用。
在第一种模式,bTimeAdjustmentDisabled设置为FALSE。在每一个时钟中断,系统内加入了dwTimeAdjustment价值一天的时间。时钟中断率会决定调用GetSystemTimeAdjustment,并在返回的值来指向lpTimeIncrement。
在第二个模式,bTimeAdjustmentDisabled设置为TRUE。在每一个时钟中断,系统增加了时钟中断之间的时间间隔一天中的时间。该时间间隔不作调整。该系统是免费的定期刷新的时间,一天24小时使用其他技术。这样的其他技术可能会导致的时间每天24小时明显跳时作出调整。
应用程序必须有系统时间权限(特权的SE_SYSTEMTIME_NAME此功能)才能成功。该SE_SYSTEMTIME_NAME权限默认情况下禁用。使用AdjustTokenPrivileges函数调用SetSystemTimeAdjustment之前启用的特权,然后禁用后SetSystemTimeAdjustment调用特权。有关更多信息,请运行特权。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
AdjustTokenPrivileges
GetLocalTime
GetSystemTime
GetSystemTimeAdjustment
系统时间
时间函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetSystemTimeAdjustment Function
Enables or disables periodic time adjustments to the system's time-of-day clock. Such time adjustments are used to synchronize the time of day with some other source of time information. When periodic time adjustments are enabled, they are applied at each clock interrupt.
Syntax
C++
BOOL WINAPI SetSystemTimeAdjustment(
__in DWORD dwTimeAdjustment,
__in BOOL bTimeAdjustmentDisabled
);
Parameters
dwTimeAdjustment [in]
The number of 100-nanosecond units added to the time-of-day clock at each clock interrupt if periodic time adjustment is enabled.
bTimeAdjustmentDisabled [in]
The time adjustment mode that the system is to use. Periodic system time adjustments can be disabled or enabled.
A value of TRUE specifies that periodic time adjustment is to be disabled. The system is free to adjust time of day using its own internal mechanisms. The value of dwTimeAdjustment is ignored. The system's internal adjustment mechanisms may cause the time-of-day clock to jump noticeably when adjustments are made.
A value of FALSE specifies that periodic time adjustment is to be enabled, and will be used to adjust the time-of-day clock. The system will not interfere with the time adjustment scheme, and will not attempt to synchronize time of day on its own. The system will add the value of dwTimeAdjustment to the time of day at each clock interrupt.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError . One way the function can fail is if the caller does not possess the SE_SYSTEMTIME_NAME privilege.
Remarks
The GetSystemTimeAdjustment and SetSystemTimeAdjustment functions support algorithms that synchronize the time-of-day clock, reported via GetSystemTime and GetLocalTime , with another time source using a periodic time adjustment.
The SetSystemTimeAdjustment function supports two modes of time synchronization: time-adjustment – disabled and time-adjustment – enabled.
In the first mode, bTimeAdjustmentDisabled is set to FALSE. At each clock interrupt, the system adds the value of dwTimeAdjustment to the time of day. The clock interrupt rate may be determined by calling GetSystemTimeAdjustment, and looking at the returned value pointed to by lpTimeIncrement.
In the second mode, bTimeAdjustmentDisabled is set to TRUE. At each clock interrupt, the system adds the interval between clock interrupts to the time of day. No adjustment to that interval is made. The system is free to periodically refresh the time-of-day clock using other techniques. Such other techniques may cause the time-of-day clock to jump noticeably when adjustments are made.
An application must have system-time privilege (the SE_SYSTEMTIME_NAME privilege) for this function to succeed. The SE_SYSTEMTIME_NAME privilege is disabled by default. Use the AdjustTokenPrivileges function to enable the privilege before calling SetSystemTimeAdjustment, and then to disable the privilege after the SetSystemTimeAdjustment call. For more information, see Running with Special Privileges .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
AdjustTokenPrivileges
GetLocalTime
GetSystemTime
GetSystemTimeAdjustment
System Time
Time Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724943(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:15:32