Share via


IWMSDataContainerVersion::GetLastModifiedTime

banner art

Previous Next

IWMSDataContainerVersion::GetLastModifiedTime

The GetLastModifiedTime method retrieves the time at which the content was last modified.

Syntax

  HRESULT GetLastModifiedTime(
  DATE*  pdateLastModifiedTime
);

Parameters

pdateLastModifiedTime

[out] Pointer to a DATE containing the date and time the container was last modified. The DATE type is implemented using an 8-byte floating point number. Days are represented by whole number increments starting with midnight on 30 December 1899 as time zero. Hour values are expressed as the absolute value of the fractional part of a day. This is illustrated in the following table.

Date Value
30 December 1899, midnight 0.00
30 December 1899, noon 0.50
1 January 1900, midnight 2.00
4 January 1900, midnight 5.00
4 January 1900, 6 A.M. 5.25
4 January 1900, noon 5.50
4 January 1900, 9 P.M. 5.875

Return Values

If the method succeeds, the plug-in must return S_OK. To report an error, the plug-in can return any HRESULT other than S_OK. If the plug-in uses the IWMSEventLog interface to log error information directly to the Windows Event Viewer, it is recommended that it return NS_E_PLUGIN_ERROR_REPORTED. Typically, the server attempts to make plug-in error information available to the server object model, the Windows Event Viewer, and the troubleshooting list in the details pane of the Windows Media Services MMC. However, if the plug-in uses the IWMSEventLog interface to send custom error information to the Windows Event Viewer, returning NS_E_PLUGIN_ERROR_REPORTED stops the server from also logging to the event viewer. For more information about retrieving plug-in error information, see Identifying Plug-in Errors.

Remarks

If the SetLastModifiedTime method has never been called, the GetLastModifiedTime method returns zero. Any data containers based on standard file systems (for example, NTFS) must have a last modified time. But it is possible for a custom-defined data container to not have one.

Example Code

// Declare variables.
HRESULT hr;
DATE  dateLMT;

// Use a pointer to a cache content information context
// to retrieve a pointer to the IWMSDataContainerVersion
// interface stored in the context.
hr = pContentInfo->GetAndQueryIUnknownValue( 
          WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION,
          WMS_CACHE_CONTENT_INFORMATION_DATA_CONTAINER_VERSION_ID,
          IID_IWMSDataContainerVersion,
          (IUnknown **) &pContentVersion, 0 )
if (FAILED(hr)) goto EXIT;

// Retrieve the time at which the content was last changed.
hr = pContentVersion->GetLastModifiedTime( &dateLMT );
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: datacontainerversion.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next