ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ftime.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   LGPL, See LGPL.txt in the top level directory
00003  * PROJECT:     ReactOS CRT library
00004  * FILE:        lib/sdk/crt/time/ftime.c
00005  * PURPOSE:     Deprecated BSD library call
00006  * PROGRAMERS:  Timo Kreuzer
00007  */
00008 #include <precomp.h>
00009 #include <sys/timeb.h>
00010 #include "bitsfixup.h"
00011 
00012 /******************************************************************************
00013  * \name _ftime_s
00014  * \brief Get the current time.
00015  * \param [out] ptimeb Pointer to a structure of type struct _timeb that
00016  *        recieves the current time.
00017  * \sa http://msdn.microsoft.com/en-us/library/95e68951.aspx
00018  */
00019 errno_t
00020 CDECL
00021 _ftime_s(struct _timeb *ptimeb)
00022 {
00023     DWORD ret;
00024     TIME_ZONE_INFORMATION TimeZoneInformation;
00025     FILETIME SystemTime;
00026 
00027     /* Validate parameters */
00028     if (!MSVCRT_CHECK_PMT( ptimeb != NULL ))
00029     {
00030         *_errno() = EINVAL;
00031         return EINVAL;
00032     }
00033 
00034     ret = GetTimeZoneInformation(&TimeZoneInformation);
00035     ptimeb->dstflag = (ret == TIME_ZONE_ID_DAYLIGHT) ? 1 : 0;
00036     ptimeb->timezone = (short)TimeZoneInformation.Bias;
00037 
00038     GetSystemTimeAsFileTime(&SystemTime);
00039     ptimeb->time = (time_t)FileTimeToUnixTime(&SystemTime, &ptimeb->millitm);
00040 
00041     return 0;
00042 }
00043 
00044 /******************************************************************************
00045  * \name _ftime
00046  * \brief Get the current time.
00047  * \param [out] ptimeb Pointer to a structure of type struct _timeb that
00048  *        recieves the current time.
00049  * \note This function is for compatability and simply calls the secure
00050  *       version _ftime_s().
00051  * \sa http://msdn.microsoft.com/en-us/library/z54t9z5f.aspx
00052  */
00053 void
00054 CDECL
00055 _ftime(struct _timeb *ptimeb)
00056 {
00057     _ftime_s(ptimeb);
00058 }

Generated on Sun May 27 2012 04:36:46 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.