Jump to content

iulica76

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

iulica76's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks @PsaltyDS, but function _Date_Time_SetSystemTimeAdjustment is already doing this. ; #FUNCTION# ==================================================================================================================== ; Name...........: _Date_Time_SetSystemTimeAdjustment ; Description ...: Enables or disables periodic time adjustments to the system's time of day clock ; Syntax.........: _Date_Time_SetSystemTimeAdjustment($iAdjustment, $fDisabled) ; Parameters ....: $iAdjustment - The number of 100 nanosecond units added to the time of day clock at each clock interrupt if ; +periodic time adjustment is enabled. ; $fDisabled - 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 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 iAdjustment to the time of day at each clock interrupt. ; Return values .: Success - True ; Failure - False ; Author ........: Paul Campbell (PaulIA) ; Modified.......: Gary Frost (gafrost) ; Remarks .......: ; Related .......: _Date_Time_GetSystemTimeAdjustment ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _Date_Time_SetSystemTimeAdjustment($iAdjustment, $fDisabled) ; Enable system time privileged mode Local $hToken = _Security__OpenThreadTokenEx(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) If @error Then Return SetError(@error, @extended, False) _Security__SetPrivilege($hToken, "SeSystemtimePrivilege", True) Local $iError = @error Local $iLastError = @extended Local $iRet = False If Not @error Then ; Set system time Local $aResult = DllCall("kernel32.dll", "bool", "SetSystemTimeAdjustment", "dword", $iAdjustment, "bool", $fDisabled) If @error Then $iError = @error $iLastError = @extended ElseIf $aResult[0] Then $iRet = True Else $iError = 1 $iLastError = _WinAPI_GetLastError() EndIf ; Disable system time privileged mode _Security__SetPrivilege($hToken, "SeSystemtimePrivilege", False) If @error Then $iError = 2 EndIf _WinAPI_CloseHandle($hToken) Return SetError($iError, $iLastError, $iRet) EndFunc ;==>_Date_Time_SetSystemTimeAdjustment I think there's other reason for getting this error
  2. Hello, I have tested the following script on few operating systems: #include <Date.au3> #include <WinAPI.au3> ; Under Vista the Windows API "SetSystemTimeAdjustment" may be rejected due to system security _Main() Func _Main() Local $aInfo ; Open the clock so we can watch the fun Run("RunDll32.exe shell32.dll,Control_RunDLL timedate.cpl") WinWaitActive("[CLASS:#32770]") ; Get current time adjustments $aInfo = _Date_Time_GetSystemTimeAdjustment() ; Slow down clock If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1] / 10, False) Then MsgBox(4096, "Error", "System clock cannot be DOWN" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage()) Exit EndIf MsgBox(4096, "Information", "Slowing down system clock", 2) Sleep(5000) ; Speed up clock If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1] * 10, False) Then MsgBox(4096, "Error", "System clock cannot be UP" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage()) EndIf MsgBox(4096, "Information", "Speeding up system clock", 2) Sleep(5000) ; Reset time adjustment If Not _Date_Time_SetSystemTimeAdjustment($aInfo[1], True) Then MsgBox(4096, "Error", "System clock cannot be RESET" & @CRLF & @CRLF & _WinAPI_GetLastErrorMessage()) Else MsgBox(4096, "Information", "System clock restored") EndIf EndFunc ;==>_Main and I get the following error: "Not all privileges or groups referenced are assigned to the caller." This is an example of Helpfile and I tested on : Windows 2000, Windows XP x86 and X64. and Windows Vista x64 logged as user or administrator. Can anyone help me solve this problem? Thanks in advance.
  3. Hello. Did you managed to reproduce that "Error:-1"? I noticed that it stops every 2 hours and 25 minutes. But only at 25 minutes. I analyzed packets sent and received by Yahoo Messenger 9 with "Colasoft Capsa" and I noticed that every minute is sent a packet to yahoo server and the server responds. I'm not an expert and I don't know if this is the cause of error but maybe my notices can help you with something.
  4. This is the message I get in console before error: >>> IN 1 byte sig[4] 0 YMSG 2 byte ver[2] 1 16 3 byte vid[2] 2 0 4 byte len[2] 3 8 5 byte typ[2] 4 0054 6 byte sta[4] 5 -1 7 byte sid[4] 6 004EA3A9 8 Packet Data 7 66À€52À€ Error: -1
  5. If I don't send or receive any message in 2 hours timeframe, I get same "Error -1". I don't know the reason but I got it many times. Untill now I tried lastest versions from Y_PM_Example and YChatClient_Example. YMSGLib version is 2.6c.
×
×
  • Create New...