Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
979 B

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "tsupp.hxx"
void _CRTAPI1 main(int argc, char *argv[])
{
IStorage *pstg;
HRESULT hr;
FILETIME ftm;
time_t ctm;
StartTest("settime");
CmdArgs(argc, argv);
ctm = time(NULL);
printf("Create time is %s", ctime(&ctm));
hr = StgCreateDocfile(TEXT("TEST.DFL"), ROOTP(STGM_RW) |
STGM_CREATE, 0, &pstg);
Result("Create root docfile", hr);
pstg->Release();
#ifdef FLAT
Sleep(5000);
#endif
ctm = time(NULL);
printf("Set time is %s", ctime(&ctm));
#ifdef FLAT
SYSTEMTIME stm;
GetSystemTime(&stm);
SystemTimeToFileTime(&stm, &ftm);
Sleep(5000);
#else
ftm.dwLowDateTime = 0x7fffffff;
ftm.dwHighDateTime = 0x100;
#endif
ctm = time(NULL);
printf("Current time is %s", ctime(&ctm));
hr = StgSetTimes(TEXT("TEST.DFL"), &ftm, &ftm, &ftm);
Result("StgSetTimes", hr);
EndTest(0);
}