Package isi.pasco2

Examples of isi.pasco2.TestFileTime


    try {
      CDLL dll = CDLL.LoadLibrary("kernel32.dll");
      CFunction getSystemTimeAsFileTime = dll
          .loadFunction("GetSystemTimeAsFileTime");

      FILETIME ft = new FILETIME();
      Object[] ary = { ft };
      Object o = getSystemTimeAsFileTime.call(null, ary,
          CFunction.FUNCFLAG_STDCALL);
      long lowValue = ft.dwLowDateTime.getValue();
      long highValue = ft.dwHighDateTime.getValue();
View Full Code Here


          .loadFunction("GetSystemTimeAsFileTime");

      int lowValue = 926944912;
      int highValue = 29767328;

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue(lowValue);
      ft.dwHighDateTime.setValue(highValue);

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
View Full Code Here

          .loadFunction("GetSystemTimeAsFileTime");

      String hex = "40B3B13FED2AC001";
      FileTime f = FileTime.parseLittleEndianHex(hex);

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue((int) f.getLow());
      ft.dwHighDateTime.setValue((int) f.getHigh());

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
View Full Code Here

 
  public void testZeroFiletime() {
    try {
      CDLL dll = CDLL.LoadLibrary("kernel32.dll");

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue((int) 0);
      ft.dwHighDateTime.setValue((int) 0);

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      CFunction getFileTimeAsSystemTime = dll.loadFunction("SystemTimeToFileTime");
     
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };

      //Sat, 30 September 2000 14:46:43
      Object o = fileTimeToSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
      assertEquals(1601, st.wYear.getValue());
      assertEquals(1, st.wMonth.getValue());
      assertEquals(1, st.wDay.getValue());
      assertEquals(0, st.wHour.getValue());
      assertEquals(0, st.wMinute.getValue());
      assertEquals(0, st.wSecond.getValue());
      assertEquals(0, st.wMilliseconds.getValue());

      FILETIME zeroFileTime = new FILETIME();
      Object[] a = { st, zeroFileTime };
      Object o1 = getFileTimeAsSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
     
      assertEquals(0, zeroFileTime.dwHighDateTime.getValue());
View Full Code Here

      UNIXepochTime.wHour.setValue((short)0);
      UNIXepochTime.wMinute.setValue((short)0);
      UNIXepochTime.wSecond.setValue((short)0);
      UNIXepochTime.wMilliseconds.setValue((short)0);
     
      FILETIME zeroFileTime = new FILETIME();
      FILETIME UNIXepochFileTime = new FILETIME();

      Object[] ary1 = { zeroTime, zeroFileTime };
      CInt o = (CInt) systemTimeToFileTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
      assertTrue(o.getValue() != 0);
View Full Code Here

       * BOOL FileTimeToSystemTime( const FILETIME* lpFileTime, LPSYSTEMTIME
       * lpSystemTime );
       */

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };
      o = fileTimeToSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
      int year = st.wYear.getValue();
      assertTrue(year >= 2006);
View Full Code Here

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue(lowValue);
      ft.dwHighDateTime.setValue(highValue);

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };

      Object o = fileTimeToSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
      assertEquals(2006, st.wYear.getValue());
View Full Code Here

      FILETIME ft = new FILETIME();
      ft.dwLowDateTime.setValue((int) f.getLow());
      ft.dwHighDateTime.setValue((int) f.getHigh());

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };

      //Sat, 30 September 2000 14:46:43
      Object o = fileTimeToSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
View Full Code Here

      ft.dwHighDateTime.setValue((int) 0);

      CFunction fileTimeToSystemTime = dll.loadFunction("FileTimeToSystemTime");
      CFunction getFileTimeAsSystemTime = dll.loadFunction("SystemTimeToFileTime");
     
      SYSTEMTIME st = new SYSTEMTIME();
      Object[] ary1 = { ft, st };

      //Sat, 30 September 2000 14:46:43
      Object o = fileTimeToSystemTime.call(CInt.class, ary1,
          CFunction.FUNCFLAG_STDCALL);
View Full Code Here

      CDLL dll = CDLL.LoadLibrary("kernel32.dll");

      CFunction systemTimeToFileTime = dll
      .loadFunction("SystemTimeToFileTime");
     
      SYSTEMTIME zeroTime = new SYSTEMTIME();
      zeroTime.wDay.setValue((short)1);
      zeroTime.wMonth.setValue((short)1);
      zeroTime.wYear.setValue((short)1601);
      zeroTime.wHour.setValue((short)0);
      zeroTime.wMinute.setValue((short)0);
      zeroTime.wSecond.setValue((short)0);
      zeroTime.wMilliseconds.setValue((short)0);
     
      SYSTEMTIME UNIXepochTime = new SYSTEMTIME();
      UNIXepochTime.wDay.setValue((short)1);
      UNIXepochTime.wMonth.setValue((short)1);
      UNIXepochTime.wYear.setValue((short)1970);
      UNIXepochTime.wHour.setValue((short)0);
      UNIXepochTime.wMinute.setValue((short)0);
View Full Code Here

TOP

Related Classes of isi.pasco2.TestFileTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.