Difference between revisions of "Truxton event get end"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This retrieves the end of the event. This corresponds to the <code>[End]</code> column of the <code><nowiki>[</nowiki>Event<nowiki>]</nowiki></code> table. =S...")
 
 
Line 16: Line 16:
 
=Sample=
 
=Sample=
 
<source lang="C" highlight="20">
 
<source lang="C" highlight="20">
void dump_event(uint64_t event_handle)
+
void dump_event( uint64_t event_handle )
 
{
 
{
 
   char guid_string[ 40 ];
 
   char guid_string[ 40 ];
Line 39: Line 39:
 
}
 
}
 
</source>
 
</source>
 
  
 
Note, the <code>PRIu64</code> in the sample code above is the new standard way of [https://en.wikipedia.org/wiki/C_data_types#Printf_and_scanf_format_specifiers formatting] a 64-bit integer in C.
 
Note, the <code>PRIu64</code> in the sample code above is the new standard way of [https://en.wikipedia.org/wiki/C_data_types#Printf_and_scanf_format_specifiers formatting] a 64-bit integer in C.
 
Over the years, different compilers on different operating systems used different format specifiers for things, these <code>PRI</code> macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic.
 
Over the years, different compilers on different operating systems used different format specifiers for things, these <code>PRI</code> macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic.

Latest revision as of 07:17, 6 February 2021

This retrieves the end of the event. This corresponds to the [End] column of the [Event] table.

Syntax

uint64_t truxton_event_get_end( uint64_t event_handle );

Parameters

event_handle

The handle created by the truxton_event_create call.

Return value

The date and time in FILETIME ticks.

Sample

void dump_event( uint64_t event_handle )
{
   char guid_string[ 40 ];

   truxton_event_get_file_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "File ID is %s\n", guid_string );

   truxton_event_get_media_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Media ID is %s\n", guid_string );

   truxton_event_get_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Event ID is %s\n", guid_string );

   uint64_t value = truxton_event_get_type( event_handle );
   printf( "Type is %" PRIu64 "\n", value );

   value = truxton_event_get_start( event_handle );
   printf( "Start is %" PRIu64 "\n", value );

   value = truxton_event_get_end( event_handle );
   printf( "End is %" PRIu64 "\n", value );
}

Note, the PRIu64 in the sample code above is the new standard way of formatting a 64-bit integer in C. Over the years, different compilers on different operating systems used different format specifiers for things, these PRI macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic.