Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.09.30;
Скачать: CL | DM;

Вниз

Как получить текущую дату в обход стандартных функций Date & Now   Найти похожие ветки 

 
гончий   (2002-09-18 14:23) [0]

Например из даты создания файла реестра...Но тут непонятно, а будет ли работать это на разных операционках, как реализовать?


 
REA   (2002-09-18 14:25) [1]

Чем функции то не угодили?


 
Алексей Ким ©   (2002-09-18 14:26) [2]

из win32.hlp
---
The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).

VOID GetSystemTime(

LPSYSTEMTIME lpSystemTime // address of system time structure
);
Parameters

lpSystemTime

Points to a SYSTEMTIME structure to receive the current system date and time.

Return Value

This function does not return a value.

Remarks

Windows 95: Early beta implementations of this function return local time rather than UTC.

See Also

GetLocalTime, GetSystemTimeAdjustment, SetSystemTime, SYSTEMTIME


 
McSimm ©   (2002-09-18 14:27) [3]

Попытаюсь угадать - обманываем хакеров? :)


 
Слесарь Матерящийся   (2002-09-18 14:29) [4]

Прочитать из RTC.


 
Алексей Ким ©   (2002-09-18 14:30) [5]

не... не то нажал...
---
The GetSystemTimeAsFileTime function obtains the current system date and time. The information is in Coordinated Universal Time (UTC) format.

VOID GetSystemTimeAsFileTime(

LPFILETIME lpSystemTimeAsFileTime // pointer to a file time structure
);
Parameters

lpSystemTimeAsFileTime

Pointer to a FILETIME structure to receive the current system date and time in UTC format.

Return Value

This function does not return a value.

Remarks

The GetSystemTimeAsFileTime function is equivalent to the following code sequence:

FILETIME ft;
SYSTEMTIME st;

GetSystemTime(&st);
SystemTimeToFileTime(&st,&ft);


Windows 95: The GetSystemTimeAsFileTime function is not available on the Windows 95 platform. If you need its functionality, use the preceding code sequence.

See Also

FILETIME, GetSystemTime, SYSTEMTIME, SystemTimeToFileTime


 
REA   (2002-09-18 14:31) [6]

Как прочитать из RTC? :) Я уже спрашивал


 
Алексей Ким ©   (2002-09-18 14:33) [7]

опять не то...
---
The GetFileTime function retrieves the date and time that a file was created, last accessed, and last modified.

BOOL GetFileTime(

HANDLE hFile, // identifies the file
LPFILETIME lpCreationTime, // address of creation time
LPFILETIME lpLastAccessTime, // address of last access time
LPFILETIME lpLastWriteTime // address of last write time
);
Parameters

hFile

Identifies the files for which to get dates and times. The file handle must have been created with GENERIC_READ access to the file.

lpCreationTime

Points to a FILETIME structure to receive the date and time the file was created. This parameter can be NULL if the application does not require this information.


lpLastAccessTime

Points to a FILETIME structure to receive the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or, in the case of executable files, run. This parameter can be NULL if the application does not require this information.

lpLastWriteTime

Points to a FILETIME structure to receive the date and time the file was last written to. This parameter can be NULL if the application does not require this information.

Return Value

If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

Remarks

The FAT, NTFS, and HPFS file systems all support the file creation, last access, and last write time values.
Windows 95: The precision of the time for a file in a FAT file system is 2 seconds. The time precision for files in other file systems, such as those connected through a network depends on the file system but may also be limited by the remote device.

See Also

FILETIME, GetFileSize, GetFileType, SetFileTime

прошу прощения за загрузку топика :(


 
гончий   (2002-09-18 14:33) [8]

2 McSimm - угадал!


 
REA   (2002-09-18 14:33) [9]

Кстати есть драйвер "CMOS и часы" VMM32.vxd (CONFIGMG.vxd) - никто не в курсе как им пользоваться?


 
гончий   (2002-09-18 14:35) [10]

2 Алексей Ким - спасибо, но как добраться до файла, и у какого файла его надежнее всего брать? Вдруг его в других ОС не будет?


 
Алексей Ким ©   (2002-09-18 14:36) [11]

2гончий бери какой нибудь покрупнее типа io.sys или бери несколько сразу... думаю так


 
гончий   (2002-09-18 14:37) [12]

io.sys - показывает неактуальную дату!


 
Алексей Ким ©   (2002-09-18 14:43) [13]

хм... не понимаю... какую дату ты хочешь?


 
REA   (2002-09-18 14:43) [14]

своп файл :)


 
Алексей Ким ©   (2002-09-18 14:47) [15]

2гончий если сегодняшнюю тогда бери lastaccessed папки виндавс


 
гончий   (2002-09-18 14:50) [16]

2Алексей Ким пасиб, это больше подходит!


 
гончий   (2002-09-18 14:53) [17]

а как у папки получить этот lastaccessed ?


 
Алексей Ким ©   (2002-09-18 14:57) [18]

18.09.02 14:33


 
гончий   (2002-09-18 15:01) [19]

а конкретнее?


 
REA   (2002-09-18 15:02) [20]

Во чего нашел: IOCTL_MSJDRVR_READ_CMOS - можно часы читать из CMOS


 
гончий   (2002-09-18 15:05) [21]

2 REA поясни как :)


 
REA   (2002-09-18 15:12) [22]

Ну по логике нужно открыть файл с именем драйвера, который за CMOS отвечает и DeviceIOControl, но на Microsoft я примера не нашел в явном виде - они на макросы DDK ссылаются, а у меня его нет под рукой. Не уверен что на всех осях оно одинаково будет работать.


 
Алексей Ким ©   (2002-09-18 15:12) [23]

2REA> а виндавс откуда берет свои часы и сует куда? даже я
смогу поменять байосное время на своем компе


 
гончий   (2002-09-18 15:14) [24]

да тут хакеров надо слегка подзапутать и выковырять время до того как он сможет поменять его в windows


 
Алексей Ким ©   (2002-09-18 15:16) [25]

2гончий> если меняешь время то до следующего запуска у тебя есть
время для считывания


 
REA   (2002-09-18 15:28) [26]

2Алексей Ким:
Оно его несомненно оттуда берет, только вот недостаточно часто для меня. По крайней мере W98 синхронизируется с биосом очень нечасто, если не сказать очень редко. Возникает расхождение, а мне нужно точное время (до 100мс). Может в XP ситуация и лучше, но не узнать - прерывания и порты закрыты.


 
Алексей Ким ©   (2002-09-18 15:33) [27]

2REA>понятно


 
гончий   (2002-09-19 11:57) [28]

Lastaccessed папки Windows - показывает неактуальную дату!
System.dat - отлично подходит для снятия даты, но!
Во всех ли ВинОС он есть и везде ли он находится в папке Windows?
A User.dat ?



Страницы: 1 вся ветка

Текущий архив: 2002.09.30;
Скачать: CL | DM;

Наверх




Память: 0.53 MB
Время: 0.018 c
1-98179
AndreyS
2002-09-17 18:31
2002.09.30
Упаковщики exe


1-98116
askall
2002-09-18 20:02
2002.09.30
Передача классов в Dll


14-98340
*****
2002-09-03 10:23
2002.09.30
HelpScrible


14-98288
lipskiy
2002-09-04 00:05
2002.09.30
Загадка природы, поясните, кто знает


1-98212
Wolverin
2002-09-18 18:06
2002.09.30
Иконка в TrayBar