Difference between revisions of "Truxton media set expires"
Jump to navigation
Jump to search
(Created page with "This sets the creation date of the media. This corresponds to the <code>Expires</code> column of the <code>Media</code> table. =Syntax= <syntaxhighlight lang="C"> void truxto...") |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This sets the creation date of the media. | This sets the creation date of the media. | ||
| − | This corresponds to the <code>Expires</code> column of the <code>Media</code> table. | + | This corresponds to the <code>[Expires]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table. |
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
void truxton_media_set_expires( uint64_t media_handle, uint64_t ticks ); | void truxton_media_set_expires( uint64_t media_handle, uint64_t ticks ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 15: | Line 15: | ||
=Sample= | =Sample= | ||
| − | < | + | <source lang="C" highlight="18"> |
| − | void set_expires(uint64_t media) | + | void set_expires( uint64_t media ) |
{ | { | ||
SYSTEMTIME now; | SYSTEMTIME now; | ||
| Line 26: | Line 26: | ||
FILETIME expiration_date; | FILETIME expiration_date; | ||
| − | SystemTimeToFileTime(&now, &expiration_date); | + | SystemTimeToFileTime( &now, &expiration_date ); |
ULARGE_INTEGER ticks; | ULARGE_INTEGER ticks; | ||
| Line 33: | Line 33: | ||
ticks.HighPart = expiration_date.dwHighDateTime; | ticks.HighPart = expiration_date.dwHighDateTime; | ||
| − | truxton_media_set_expires(media, ticks.QuadPart); | + | truxton_media_set_expires( media, ticks.QuadPart ); |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 07:43, 3 February 2024
This sets the creation date of the media.
This corresponds to the [Expires] column of the [Media] table.
Syntax
void truxton_media_set_expires( uint64_t media_handle, uint64_t ticks );
Parameters
media_handle
The handle created by the truxton_media_open_id or truxton_media_create call.
ticks
The expiration date in FILETIME ticks.
Sample
void set_expires( uint64_t media )
{
SYSTEMTIME now;
GetSystemTime( &now );
now.wYear += 99;
FILETIME expiration_date;
SystemTimeToFileTime( &now, &expiration_date );
ULARGE_INTEGER ticks;
ticks.LowPart = expiration_date.dwLowDateTime;
ticks.HighPart = expiration_date.dwHighDateTime;
truxton_media_set_expires( media, ticks.QuadPart );
}